@epam/ai-dial-skills 1.2.0-dev.201 → 1.2.0-dev.207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,75 +1,98 @@
1
1
  import { DeploymentIcon as e, buildCssVars as t, isSkillSelectionUnsupported as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as i, Button as a, ButtonAppearance as o, ButtonVariant as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, Dropdown as u, FileDropzone as d, GhostButton as f, Highlight as p, Input as m, InteractiveTooltip as h, Popup as g, PopupSize as _, Search as v, ToggleIconButton as y, TooltipPlacement as b } from "@epam/ai-dial-ui-kit";
3
- import { Suspense as x, useCallback as S, useEffect as C, useId as ee, useLayoutEffect as w, useMemo as T, useRef as E, useState as D } from "react";
4
- import { IconBlocks as O, IconChevronDown as k, IconEye as te, IconStarFilled as A, IconX as j } from "@tabler/icons-react";
5
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
6
- import { DialFileNodeType as F, DialFoldersTree as I } from "@epam/ai-dial-react-file-manager";
7
- import { CatalogContentNodeType as L, DetailsPanel as R } from "@epam/ai-dial-catalog";
2
+ import { BASE_ICON_SIZE as i, Button as a, ButtonAppearance as o, ButtonVariant as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, Dropdown as u, FileDropzone as d, GhostButton as f, Highlight as p, Input as m, InteractiveTooltip as h, Popup as g, PopupSize as _, Search as v, Spinner as y, ToggleIconButton as b, TooltipPlacement as x } from "@epam/ai-dial-ui-kit";
3
+ import { Suspense as S, useCallback as C, useEffect as w, useId as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
4
+ import { IconBlocks as ee, IconChevronDown as te, IconEye as A, IconLock as j, IconStarFilled as ne, IconTrash as M, IconX as N } from "@tabler/icons-react";
5
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
6
+ import { DialFileNodeType as L, DialFoldersTree as R } from "@epam/ai-dial-react-file-manager";
7
+ import { CatalogContentNodeType as z, DetailsPanel as B } from "@epam/ai-dial-catalog";
8
8
  //#region src/constants/public-class-names.ts
9
- var z = {
9
+ var V = {
10
10
  selectorField: "dial-skills-selector-field",
11
11
  favoritesPanel: "dial-skills-favorites-panel",
12
12
  chip: "dial-skills-chip"
13
- }, B = ({ description: e, unsupportedMessage: t, viewDetailsLabel: n = "View details", onViewDetails: r, viewDetailsTabIndex: i }) => t == null ? /* @__PURE__ */ P("div", {
14
- className: "flex flex-col gap-3",
15
- children: [e != null && e !== "" && /* @__PURE__ */ N("p", {
13
+ }, H = /* @__PURE__ */ function(e) {
14
+ return e.Deleted = "deleted", e.NotShared = "not-shared", e;
15
+ }({}), U = ({ description: e, unsupportedMessage: t, unresolvedReason: n, deletedMessage: r, notSharedMessage: i, viewDetailsLabel: u = "View details", onViewDetails: d, viewDetailsTabIndex: f }) => {
16
+ if (n != null) {
17
+ let e = n === H.Deleted, t = e ? M : j, a = e ? r : i;
18
+ return /* @__PURE__ */ I("div", {
19
+ className: "flex flex-row items-center gap-2",
20
+ children: [/* @__PURE__ */ F(t, {
21
+ size: c.MD,
22
+ stroke: l,
23
+ "aria-hidden": !0,
24
+ className: "shrink-0 text-secondary"
25
+ }), /* @__PURE__ */ F("p", {
26
+ className: "dial-tiny-text text-start text-primary",
27
+ children: a
28
+ })]
29
+ });
30
+ }
31
+ return t == null ? /* @__PURE__ */ I("div", {
32
+ className: "flex flex-col gap-3",
33
+ children: [e != null && e !== "" && /* @__PURE__ */ F("p", {
34
+ className: "text-start",
35
+ children: e
36
+ }), /* @__PURE__ */ F(a, {
37
+ variant: s.Primary,
38
+ appearance: o.Link,
39
+ className: "h-[24px] self-start",
40
+ label: u,
41
+ iconBefore: /* @__PURE__ */ F(A, {
42
+ size: c.SM,
43
+ stroke: l,
44
+ "aria-hidden": !0
45
+ }),
46
+ onClick: d,
47
+ tabIndex: f
48
+ })]
49
+ }) : /* @__PURE__ */ F("p", {
16
50
  className: "text-start",
17
- children: e
18
- }), /* @__PURE__ */ N(a, {
19
- variant: s.Primary,
20
- appearance: o.Link,
21
- className: "h-[24px] self-start",
22
- label: n,
23
- iconBefore: /* @__PURE__ */ N(te, {
24
- size: c.SM,
25
- stroke: l,
26
- "aria-hidden": !0
27
- }),
28
- onClick: r,
29
- tabIndex: i
30
- })]
31
- }) : /* @__PURE__ */ N("p", {
32
- className: "text-start",
33
- children: t
34
- }), V = ({ name: e, path: t, description: n, isUnsupported: i = !1, labelClassName: a = "dial-body-paragraph-text text-accent", unsupportedLabelClassName: o = "text-error", unsupportedClassName: s = "bg-error", detailsTrigger: c = "hover", onViewDetails: l, labels: u = {} }) => {
35
- let { viewDetailsLabel: d = "View details", unsupportedTooltipLabel: f = "Selected model does not support skills. Remove the skill or select different model to proceed." } = u, [p, m] = D(0), [g, _] = D(!1), v = c === "click", y = () => {
36
- _(!1), m((e) => e + 1), l(t);
37
- }, x = (e) => {
38
- !v || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), _(!0));
39
- }, S = E(null), [C, ee] = D(null);
40
- return w(() => {
41
- ee(S.current?.getBoundingClientRect().width ?? null);
42
- }, [a]), /* @__PURE__ */ N(h, {
51
+ children: t
52
+ });
53
+ }, W = ({ name: e, path: t, description: n, isUnsupported: i = !1, unresolvedReason: a, labelClassName: o = "dial-body-paragraph-text text-accent", unsupportedLabelClassName: s = "text-error", unsupportedClassName: c = "bg-error", detailsTrigger: l = "hover", onViewDetails: u, labels: d = {} }) => {
54
+ let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: p = "Selected model does not support skills. Remove the skill or select different model to proceed.", deletedTooltipLabel: m = "This skill has been deleted. Its details are no longer available.", notSharedTooltipLabel: g = "You don't have access to this skill, so its details aren't shown. Ask the chat owner to share it with you." } = d, [_, v] = k(0), [y, b] = k(!1), S = l === "click", C = () => {
55
+ b(!1), v((e) => e + 1), u(t);
56
+ }, w = (e) => {
57
+ !S || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), b(!0));
58
+ }, T = O(null), [D, ee] = k(null);
59
+ return E(() => {
60
+ ee(T.current?.getBoundingClientRect().width ?? null);
61
+ }, [o]), /* @__PURE__ */ F(h, {
43
62
  asChild: !0,
44
- placement: b.Top,
45
- open: v ? g : void 0,
46
- onOpenChange: v ? _ : void 0,
63
+ placement: x.Top,
64
+ open: S ? y : void 0,
65
+ onOpenChange: S ? b : void 0,
47
66
  contentClassName: "max-w-[550px]",
48
- content: i ? /* @__PURE__ */ N(B, { unsupportedMessage: f }) : /* @__PURE__ */ N(B, {
67
+ content: a == null ? i ? /* @__PURE__ */ F(U, { unsupportedMessage: p }) : /* @__PURE__ */ F(U, {
49
68
  description: n,
50
- viewDetailsLabel: d,
51
- onViewDetails: y
69
+ viewDetailsLabel: f,
70
+ onViewDetails: C
71
+ }) : /* @__PURE__ */ F(U, {
72
+ unresolvedReason: a,
73
+ deletedMessage: m,
74
+ notSharedMessage: g
52
75
  }),
53
- children: /* @__PURE__ */ P("span", {
76
+ children: /* @__PURE__ */ I("span", {
54
77
  tabIndex: 0,
55
- className: r("relative -me-1 -ms-1 inline-block cursor-pointer select-text rounded-full pe-1 ps-1", i ? s : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(a, o) : a, z.chip),
78
+ className: r("relative -me-1 -ms-1 inline-block cursor-pointer select-text rounded-full pe-1 ps-1", i ? c : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(o, s) : o, V.chip),
56
79
  "aria-label": `/${e}`,
57
- onClick: v ? () => _(!0) : void 0,
58
- onKeyDown: x,
59
- children: [/* @__PURE__ */ N("span", {
60
- ref: S,
80
+ onClick: S ? () => b(!0) : void 0,
81
+ onKeyDown: w,
82
+ children: [/* @__PURE__ */ F("span", {
83
+ ref: T,
61
84
  "aria-hidden": !0,
62
85
  className: "inset-inline-start-0 pointer-events-none absolute top-0 select-none",
63
86
  children: "/"
64
- }), /* @__PURE__ */ N("span", {
87
+ }), /* @__PURE__ */ F("span", {
65
88
  "aria-hidden": !0,
66
89
  className: "select-none",
67
- style: { paddingInlineStart: C ?? void 0 },
90
+ style: { paddingInlineStart: D ?? void 0 },
68
91
  children: e
69
92
  })]
70
93
  })
71
- }, p);
72
- }, H = {
94
+ }, _);
95
+ }, G = {
73
96
  row: "_row_1v431_1",
74
97
  header: "_header_1v431_8",
75
98
  emptyHint: "_emptyHint_1v431_12",
@@ -80,105 +103,105 @@ var z = {
80
103
  rowLeaving: "_rowLeaving_1v431_32",
81
104
  rowFadeOut: "_rowFadeOut_1v431_1",
82
105
  listContent: "_listContent_1v431_60"
83
- }, U = "px-3 pb-0.5 pt-2", W = 180, G = 288, K = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, className: l, rowClassName: u, searchQuery: d, listboxId: m, activeOptionId: g, isMenu: _ = !1, labels: v = {}, colors: b, nameClassName: x = "dial-small-text", headerClassName: S = "dial-tiny-lead-semi-text", emptyHintClassName: T = "dial-small-text" }) => {
84
- let { myCollectionLabel: O = "My Collection", emptyHintLabel: k = "Star a skill to pin it here", browseLabel: te = "Browse", removeFromFavoritesLabel: j = "Remove from favorites", viewDetailsLabel: M = "View details", noMatchingSkillsLabel: F = "No matching skills" } = v, I = t({
85
- "--fs-row-hover-bg": b?.rowHoverBackground,
86
- "--fs-header-text": b?.headerText,
87
- "--fs-empty-hint-text": b?.emptyHintText,
88
- "--fs-star-color": b?.starColor,
89
- "--fs-footer-border": b?.footerBorder
90
- }), [L, R] = D(/* @__PURE__ */ new Set()), V = E(/* @__PURE__ */ new Map());
91
- C(() => {
92
- let e = V.current;
106
+ }, K = "px-3 pb-0.5 pt-2", re = 180, q = 288, J = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, className: l, rowClassName: u, searchQuery: d, listboxId: m, activeOptionId: g, isMenu: _ = !1, labels: v = {}, colors: y, nameClassName: x = "dial-small-text", headerClassName: S = "dial-tiny-lead-semi-text", emptyHintClassName: C = "dial-small-text" }) => {
107
+ let { myCollectionLabel: D = "My Collection", emptyHintLabel: ee = "Star a skill to pin it here", browseLabel: te = "Browse", removeFromFavoritesLabel: A = "Remove from favorites", viewDetailsLabel: j = "View details", noMatchingSkillsLabel: M = "No matching skills" } = v, N = t({
108
+ "--fs-row-hover-bg": y?.rowHoverBackground,
109
+ "--fs-header-text": y?.headerText,
110
+ "--fs-empty-hint-text": y?.emptyHintText,
111
+ "--fs-star-color": y?.starColor,
112
+ "--fs-footer-border": y?.footerBorder
113
+ }), [P, L] = k(/* @__PURE__ */ new Set()), R = O(/* @__PURE__ */ new Map());
114
+ w(() => {
115
+ let e = R.current;
93
116
  return () => {
94
117
  e.forEach((e) => clearTimeout(e)), e.clear();
95
118
  };
96
119
  }, []);
97
- let K = m != null, q = _ && !K, J = K || q ? "none" : void 0, Y = "button";
98
- K ? Y = "option" : q && (Y = "menuitem");
99
- let X = ee(), Z = d != null, Q = d?.toLowerCase() ?? "", ne = Z ? n.filter((e) => e.name.toLowerCase().includes(Q)) : n, $ = E(null), [re, ie] = D();
100
- w(() => {
101
- $.current && ie(Math.min($.current.scrollHeight, G));
120
+ let z = m != null, B = _ && !z, H = z || B ? "none" : void 0, W = "button";
121
+ z ? W = "option" : B && (W = "menuitem");
122
+ let J = T(), Y = d != null, X = d?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q = O(null), [ie, ae] = k();
123
+ E(() => {
124
+ Q.current && ae(Math.min(Q.current.scrollHeight, q));
102
125
  }, [n, d]);
103
- let ae = (e, t) => {
126
+ let oe = (e, t) => {
104
127
  e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
105
- }, oe = (e) => {
106
- R((t) => new Set(t).add(e));
128
+ }, se = (e) => {
129
+ L((t) => new Set(t).add(e));
107
130
  let t = setTimeout(() => {
108
- a?.(e), R((t) => {
131
+ a?.(e), L((t) => {
109
132
  let n = new Set(t);
110
133
  return n.delete(e), n;
111
- }), V.current.delete(e);
112
- }, W);
113
- V.current.set(e, t);
134
+ }), R.current.delete(e);
135
+ }, re);
136
+ R.current.set(e, t);
114
137
  };
115
- return /* @__PURE__ */ P("div", {
116
- className: r("flex w-full flex-col desktop:w-[280px]", l, z.favoritesPanel),
117
- style: I,
138
+ return /* @__PURE__ */ I("div", {
139
+ className: r("flex w-full flex-col desktop:w-[280px]", l, V.favoritesPanel),
140
+ style: N,
118
141
  children: [
119
- /* @__PURE__ */ N("p", {
120
- id: X,
121
- className: r(S, U, H.header),
122
- children: O
142
+ /* @__PURE__ */ F("p", {
143
+ id: J,
144
+ className: r(S, K, G.header),
145
+ children: D
123
146
  }),
124
- /* @__PURE__ */ N("div", {
125
- className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", H.listContent),
126
- style: { maxHeight: re },
127
- children: /* @__PURE__ */ N("div", {
128
- ref: $,
129
- children: ne.length > 0 ? /* @__PURE__ */ N("ul", {
147
+ /* @__PURE__ */ F("div", {
148
+ className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", G.listContent),
149
+ style: { maxHeight: ie },
150
+ children: /* @__PURE__ */ F("div", {
151
+ ref: Q,
152
+ children: Z.length > 0 ? /* @__PURE__ */ F("ul", {
130
153
  id: m,
131
- role: K ? "listbox" : J,
132
- "aria-labelledby": K ? X : void 0,
154
+ role: z ? "listbox" : H,
155
+ "aria-labelledby": z ? J : void 0,
133
156
  className: "flex flex-col gap-1 px-1 pb-1",
134
- children: ne.map((t) => {
135
- let n = K ? `${m}-${encodeURIComponent(t.id)}` : void 0, o = K ? -1 : void 0, l = /* @__PURE__ */ P("div", {
136
- role: Y,
157
+ children: Z.map((t) => {
158
+ let n = z ? `${m}-${encodeURIComponent(t.id)}` : void 0, o = z ? -1 : void 0, l = /* @__PURE__ */ I("div", {
159
+ role: W,
137
160
  id: n,
138
- "aria-selected": K ? n === g : void 0,
161
+ "aria-selected": z ? n === g : void 0,
139
162
  "aria-label": t.name,
140
163
  tabIndex: 0,
141
- className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", H.row, u),
164
+ className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", G.row, u),
142
165
  onClick: () => i(t),
143
- onKeyDown: (e) => ae(e, t),
166
+ onKeyDown: (e) => oe(e, t),
144
167
  children: [
145
- /* @__PURE__ */ N(e, {
168
+ /* @__PURE__ */ F(e, {
146
169
  size: c.MD,
147
170
  initialsName: t.name
148
171
  }),
149
- d == null ? /* @__PURE__ */ N("span", {
172
+ d == null ? /* @__PURE__ */ F("span", {
150
173
  className: r(x, "min-w-0 flex-1 truncate text-start"),
151
174
  children: t.name
152
- }) : /* @__PURE__ */ N(p, {
175
+ }) : /* @__PURE__ */ F(p, {
153
176
  text: t.name,
154
177
  query: d,
155
178
  maxLines: 1,
156
179
  className: r(x, "min-w-0 flex-1 text-start")
157
180
  }),
158
- a && /* @__PURE__ */ N(y, {
159
- icon: /* @__PURE__ */ N(A, {
181
+ a && /* @__PURE__ */ F(b, {
182
+ icon: /* @__PURE__ */ F(ne, {
160
183
  size: c.SM,
161
- className: H.star,
184
+ className: G.star,
162
185
  "aria-hidden": !0
163
186
  }),
164
- "aria-label": j,
187
+ "aria-label": A,
165
188
  isSelected: !0,
166
189
  tabIndex: o,
167
190
  onClick: (e) => {
168
- e.stopPropagation(), oe(t.id);
191
+ e.stopPropagation(), se(t.id);
169
192
  }
170
193
  })
171
194
  ]
172
195
  });
173
- return /* @__PURE__ */ N("li", {
174
- role: J,
175
- className: L.has(t.id) ? H.rowLeaving : H.rowEnter,
176
- children: s ? /* @__PURE__ */ N(h, {
196
+ return /* @__PURE__ */ F("li", {
197
+ role: H,
198
+ className: P.has(t.id) ? G.rowLeaving : G.rowEnter,
199
+ children: s ? /* @__PURE__ */ F(h, {
177
200
  asChild: !0,
178
201
  contentClassName: "max-w-[550px]",
179
- content: /* @__PURE__ */ N(B, {
202
+ content: /* @__PURE__ */ F(U, {
180
203
  description: t.description,
181
- viewDetailsLabel: M,
204
+ viewDetailsLabel: j,
182
205
  onViewDetails: () => s(t),
183
206
  viewDetailsTabIndex: o
184
207
  }),
@@ -186,21 +209,21 @@ var z = {
186
209
  }) : l
187
210
  }, t.id);
188
211
  })
189
- }) : Z && Q !== "" ? /* @__PURE__ */ N("p", {
212
+ }) : Y && X !== "" ? /* @__PURE__ */ F("p", {
190
213
  role: "status",
191
214
  "aria-live": "polite",
192
- className: r(T, "px-4 py-4 text-start", H.emptyHint),
193
- children: F
194
- }) : /* @__PURE__ */ N("p", {
195
- className: r(T, "px-4 py-4 text-start", H.emptyHint),
196
- children: k
215
+ className: r(C, "px-4 py-4 text-start", G.emptyHint),
216
+ children: M
217
+ }) : /* @__PURE__ */ F("p", {
218
+ className: r(C, "px-4 py-4 text-start", G.emptyHint),
219
+ children: ee
197
220
  })
198
221
  })
199
222
  }),
200
- /* @__PURE__ */ N("div", {
201
- className: r("border-t px-2 py-3", H.footer),
202
- children: /* @__PURE__ */ N(f, {
203
- role: q ? "menuitem" : void 0,
223
+ /* @__PURE__ */ F("div", {
224
+ className: r("border-t px-2 py-3", G.footer),
225
+ children: /* @__PURE__ */ F(f, {
226
+ role: B ? "menuitem" : void 0,
204
227
  label: te,
205
228
  className: "w-full justify-center",
206
229
  onClick: o
@@ -208,79 +231,80 @@ var z = {
208
231
  })
209
232
  ]
210
233
  });
211
- }, q = ".zip,.md", J = ({ isOpen: e, errorText: t, accept: n = q, labels: r, onClose: i, onFilesSelected: a, onFilesRejected: o }) => {
212
- let { dialogTitle: s = "Upload skill", dropZoneLabel: c = "Drag and drop it or click here to upload", dropZoneMobileLabel: l = "Click here to upload", formatsLabel: u = "File formats .zip and SKILL.md", fileInputAriaLabel: f = "Upload a skill ZIP archive or a SKILL.md file", closeAriaLabel: p = "Close" } = r ?? {};
213
- return /* @__PURE__ */ N(g, {
234
+ }, Y = ".zip,.md", X = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = Y, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
235
+ let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel: u = "Click here to upload", formatsLabel: f = "File formats .zip and SKILL.md", fileInputAriaLabel: p = "Upload a skill ZIP archive or a SKILL.md file", closeAriaLabel: m = "Close", uploadingAriaLabel: h = "Uploading skill" } = i ?? {};
236
+ return /* @__PURE__ */ F(g, {
214
237
  open: e,
215
238
  size: _.Sm,
216
- header: s,
217
- closeAriaLabel: p,
218
- onClose: i,
219
- children: /* @__PURE__ */ N("div", {
220
- className: "px-6 py-4",
221
- children: /* @__PURE__ */ N(d, {
222
- label: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
239
+ header: c,
240
+ closeAriaLabel: m,
241
+ onClose: a,
242
+ children: /* @__PURE__ */ I("div", {
243
+ className: "flex flex-col gap-4 px-6 py-4",
244
+ children: [/* @__PURE__ */ F(d, {
245
+ label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
223
246
  className: "desktop:hidden",
224
- children: l
225
- }), /* @__PURE__ */ N("span", {
247
+ children: u
248
+ }), /* @__PURE__ */ F("span", {
226
249
  className: "hidden desktop:inline",
227
- children: c
250
+ children: l
228
251
  })] }),
229
- description: u,
230
- ariaLabel: f,
231
- accept: n,
232
- errorText: t,
233
- onChange: a,
234
- onReject: o
235
- })
252
+ description: f,
253
+ ariaLabel: p,
254
+ accept: r,
255
+ disabled: n,
256
+ errorText: n ? void 0 : t,
257
+ onChange: o,
258
+ onReject: s
259
+ }), n && /* @__PURE__ */ F(y, { ariaLabel: h })]
236
260
  })
237
261
  });
238
- }, Y = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ N(g, {
262
+ }, Z = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ F(g, {
239
263
  open: e,
240
264
  header: r,
241
265
  size: _.Lg,
242
266
  className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden",
243
267
  onClose: t,
244
- children: /* @__PURE__ */ N("div", {
268
+ children: /* @__PURE__ */ F("div", {
245
269
  className: "h-[min(80vh,840px)] overflow-auto",
246
- children: /* @__PURE__ */ N(x, {
270
+ children: /* @__PURE__ */ F(S, {
247
271
  fallback: null,
248
272
  children: e && i(n, t)
249
273
  })
250
274
  })
251
- }), X = (e, t = null) => e.map((e) => e.type === L.Folder ? {
275
+ }), Q = (e, t = null) => e.map((e) => e.type === z.Folder ? {
252
276
  path: e.id,
253
277
  name: e.name,
254
- nodeType: F.FOLDER,
278
+ nodeType: L.FOLDER,
255
279
  parentPath: t,
256
280
  folderId: e.id,
257
- items: X(e.items, e.id)
281
+ items: Q(e.items, e.id)
258
282
  } : {
259
283
  path: e.id,
260
284
  name: e.name,
261
- nodeType: F.ITEM,
285
+ nodeType: L.ITEM,
262
286
  parentPath: t,
263
287
  folderId: t ?? ""
264
- }), Z = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ N(I, {
265
- items: T(() => X(e), [e]),
288
+ }), ie = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ F(R, {
289
+ items: D(() => Q(e), [e]),
266
290
  showFiles: !0,
267
291
  areHiddenFilesVisible: !0,
268
292
  selectedPath: t,
269
- expandedPaths: T(() => new Set(n), [n]),
293
+ expandedPaths: D(() => new Set(n), [n]),
270
294
  onExpandedPathsChange: (e) => {
271
295
  for (let t of e) n.has(t) || r(t);
272
296
  for (let t of n) e.has(t) || r(t);
273
297
  },
274
298
  onItemClick: (e) => {
275
- e.nodeType === F.ITEM && i(e.path);
299
+ e.nodeType === L.ITEM && i(e.path);
276
300
  },
277
301
  ariaLabel: o,
278
302
  autoFocus: !0,
279
303
  onEscape: a
280
- }), Q = (e) => /* @__PURE__ */ N(R, {
304
+ }), ae = (e) => /* @__PURE__ */ F(B, {
281
305
  ...e,
282
- renderContentFileTree: (e) => /* @__PURE__ */ N(Z, { ...e })
283
- }), ne = (e) => e == null || /[\s/]/.test(e), $ = (e, t, n) => {
306
+ renderContentFileTree: (e) => /* @__PURE__ */ F(ie, { ...e })
307
+ }), oe = (e) => e == null || /[\s/]/.test(e), se = (e, t, n) => {
284
308
  let r = [], i = 0;
285
309
  return t.forEach((t, a) => {
286
310
  let o = `/${n(t.url)}`, s = i;
@@ -288,7 +312,7 @@ var z = {
288
312
  let t = e.indexOf(o, s);
289
313
  if (t === -1) return;
290
314
  let n = t + o.length;
291
- if (ne(e[n])) {
315
+ if (oe(e[n])) {
292
316
  r.push({
293
317
  skillIndex: a,
294
318
  start: t,
@@ -299,7 +323,7 @@ var z = {
299
323
  s = t + 1;
300
324
  }
301
325
  }), r;
302
- }, re = (e, t) => {
326
+ }, ce = (e, t) => {
303
327
  let n = Math.min(e.length, t.length), r = 0;
304
328
  for (; r < n && e[r] === t[r];) r += 1;
305
329
  let i = n - r, a = 0;
@@ -309,13 +333,13 @@ var z = {
309
333
  deletedLength: e.length - r - a,
310
334
  insertedLength: t.length - r - a
311
335
  };
312
- }, ie = (e, t) => {
336
+ }, le = (e, t) => {
313
337
  let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
314
338
  return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
315
339
  ...i,
316
340
  start: i.start + r
317
341
  }), e), []);
318
- }, ae = (e, t, n, r, i) => {
342
+ }, ue = (e, t, n, r, i) => {
319
343
  let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
320
344
  ...e,
321
345
  start: e.start + o
@@ -326,7 +350,7 @@ var z = {
326
350
  length: a
327
351
  };
328
352
  return [...s, c].sort((e, t) => e.start - t.start);
329
- }, oe = (e, t) => e.find((e) => e.start + e.length === t), se = (e, t, n) => {
353
+ }, de = (e, t) => e.find((e) => e.start + e.length === t), fe = (e, t, n) => {
330
354
  let r = t;
331
355
  for (; r > 0 && !/\s/.test(e[r - 1]);) r--;
332
356
  let i = r;
@@ -336,23 +360,23 @@ var z = {
336
360
  start: r,
337
361
  end: i
338
362
  };
339
- }, ce = () => {
340
- let [e, t] = D(""), [n, r] = D([]), i = E(e);
363
+ }, pe = () => {
364
+ let [e, t] = k(""), [n, r] = k([]), i = O(e);
341
365
  i.current = e;
342
- let a = E(n);
366
+ let a = O(n);
343
367
  a.current = n;
344
- let o = S((e) => {
345
- let n = re(i.current, e);
346
- r((e) => ie(e, n)), i.current = e, t(e);
347
- }, []), s = S((e, n, a) => {
368
+ let o = C((e) => {
369
+ let n = ce(i.current, e);
370
+ r((e) => le(e, n)), i.current = e, t(e);
371
+ }, []), s = C((e, n, a) => {
348
372
  let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
349
- return i.current = l, t(l), r((t) => ae(t, a, e, n, s)), s;
350
- }, []), c = S((e) => oe(a.current, e), []), l = T(() => {
373
+ return i.current = l, t(l), r((t) => ue(t, a, e, n, s)), s;
374
+ }, []), c = C((e) => de(a.current, e), []), l = D(() => {
351
375
  if (n.length !== 0) return n.map((e) => ({ url: e.url }));
352
- }, [n]), u = S(() => {
376
+ }, [n]), u = C(() => {
353
377
  t(""), r([]);
354
- }, []), d = S((e, n, i) => {
355
- let a = n ?? [], o = $(e, a, i);
378
+ }, []), d = C((e, n, i) => {
379
+ let a = n ?? [], o = se(e, a, i);
356
380
  t(e), r(o.map((e) => {
357
381
  let t = a[e.skillIndex];
358
382
  return {
@@ -363,7 +387,7 @@ var z = {
363
387
  };
364
388
  }));
365
389
  }, []);
366
- return T(() => ({
390
+ return D(() => ({
367
391
  draft: e,
368
392
  anchors: n,
369
393
  onDraftChange: o,
@@ -382,15 +406,18 @@ var z = {
382
406
  u,
383
407
  d
384
408
  ]);
385
- }, le = (e) => ({
409
+ }, me = (e) => ({
386
410
  id: e.url,
387
411
  name: e.name,
388
412
  description: e.description
389
- }), ue = (e) => {
413
+ }), he = (e) => {
390
414
  let t = e.split("/").filter((e) => e.length > 0);
391
415
  return t[t.length - 1] ?? e;
392
- }, de = "/", fe = ({ isSkillsSupported: e, skills: t, sharedWithMe: n, publicSkills: r, favoriteIds: a, onToggleFavorite: o, labels: s, historyChipLabelClassName: c, activeMentionDetailsTrigger: u, renderCatalogContent: d, detailsPanelComponent: f }) => {
393
- let { addMenuLabel: p = "Skills", backLabel: m = "Back", catalogModalTitleLabel: h = "Use skill", emptyQueryHintLabel: g = "Type to filter", panelLabels: _ } = s ?? {}, [v, y] = D(!1), [b, C] = D(null), [ee, w] = D(0), [E, k] = D(0), [te, A] = D(void 0), j = ce(), M = T(() => [
416
+ }, ge = (e) => {
417
+ let t = e.split("/").filter((e) => e.length > 0);
418
+ return t[0] !== "skills" || t.length < 3 ? null : t[1];
419
+ }, _e = (e, t) => ge(e) === t ? H.Deleted : H.NotShared, ve = "/", ye = ({ isSkillsSupported: e, skills: t, sharedWithMe: n, publicSkills: r, favoriteIds: a, viewerBucket: o, onToggleFavorite: s, labels: c, historyChipLabelClassName: u, activeMentionDetailsTrigger: d, renderCatalogContent: f, detailsPanelComponent: p }) => {
420
+ let { addMenuLabel: m = "Skills", backLabel: h = "Back", catalogModalTitleLabel: g = "Use skill", emptyQueryHintLabel: _ = "Type to filter", deletedTooltipLabel: v, notSharedTooltipLabel: y, panelLabels: b } = c ?? {}, [x, w] = k(!1), [T, E] = k(null), [O, te] = k(0), [A, j] = k(0), [ne, M] = k(void 0), N = pe(), P = D(() => [
394
421
  ...t,
395
422
  ...n ?? [],
396
423
  ...r ?? []
@@ -398,301 +425,317 @@ var z = {
398
425
  t,
399
426
  n,
400
427
  r
401
- ]), P = T(() => new Map(M.map((e) => [e.url, e])), [M]), F = S((e) => P.get(e)?.name ?? ue(e), [P]), I = T(() => M.filter((e) => a.has(e.url)).map((e) => le(e)), [M, a]), L = j.anchors.length > 0 && !e, R = T(() => j.anchors.map((t) => ({
428
+ ]), I = D(() => new Map(P.map((e) => [e.url, e])), [P]), L = C((e) => I.get(e)?.name ?? he(e), [I]), R = D(() => P.filter((e) => a.has(e.url)).map((e) => me(e)), [P, a]), z = N.anchors.length > 0 && !e, B = D(() => N.anchors.map((t) => ({
402
429
  start: t.start,
403
430
  length: t.length,
404
431
  isUnsupported: !e,
405
- render: () => /* @__PURE__ */ N(V, {
432
+ render: () => /* @__PURE__ */ F(W, {
406
433
  name: t.name,
407
434
  path: t.url,
408
- labelClassName: c,
409
- description: P.get(t.url)?.description,
435
+ labelClassName: u,
436
+ description: I.get(t.url)?.description,
410
437
  isUnsupported: !e,
411
- detailsTrigger: u,
412
- onViewDetails: C,
413
- labels: { viewDetailsLabel: _?.viewDetailsLabel }
438
+ detailsTrigger: d,
439
+ onViewDetails: E,
440
+ labels: { viewDetailsLabel: b?.viewDetailsLabel }
414
441
  })
415
442
  })), [
416
- j.anchors,
443
+ N.anchors,
417
444
  e,
418
- P,
419
- c,
445
+ I,
420
446
  u,
421
- _
422
- ]), z = S((e, t, n) => {
423
- let r = j.insertMention(e, t, n);
424
- k((e) => e + 1), A(n + 1 + t.length + +!!r);
425
- }, [j]), B = S((e) => {
426
- let t = se(j.draft, e, de);
427
- return t == null ? e : (j.onDraftChange(j.draft.slice(0, t.start) + j.draft.slice(t.end)), t.start);
428
- }, [j]), H = S(() => {
429
- j.reset(), k((e) => e + 1), A(void 0);
430
- }, [j]), U = S((e, t) => {
431
- j.seedFromMessage(e, t, F), k((e) => e + 1), A(void 0);
432
- }, [j, F]), W = S((e, t) => {
447
+ d,
448
+ b
449
+ ]), V = C((e, t, n) => {
450
+ let r = N.insertMention(e, t, n);
451
+ j((e) => e + 1), M(n + 1 + t.length + +!!r);
452
+ }, [N]), H = C((e) => {
453
+ let t = fe(N.draft, e, ve);
454
+ return t == null ? e : (N.onDraftChange(N.draft.slice(0, t.start) + N.draft.slice(t.end)), t.start);
455
+ }, [N]), U = C(() => {
456
+ N.reset(), j((e) => e + 1), M(void 0);
457
+ }, [N]), G = C((e, t) => {
458
+ N.seedFromMessage(e, t, L), j((e) => e + 1), M(void 0);
459
+ }, [N, L]), K = C((e, t) => {
433
460
  if (t == null || t.length === 0) return null;
434
- let n = $(e, t, F), r = [], i = 0;
461
+ let n = se(e, t, L), r = [], i = 0;
435
462
  return n.forEach((n) => {
436
463
  n.start > i && r.push(e.slice(i, n.start));
437
- let a = t[n.skillIndex], o = P.get(a.url), s = o?.name ?? ue(a.url);
438
- r.push(/* @__PURE__ */ N(V, {
439
- name: s,
464
+ let a = t[n.skillIndex], s = I.get(a.url), c = s?.name ?? he(a.url), l = s == null ? _e(a.url, o) : void 0;
465
+ r.push(/* @__PURE__ */ F(W, {
466
+ name: c,
440
467
  path: a.url,
441
- labelClassName: c,
442
- description: o?.description,
443
- onViewDetails: C,
444
- labels: { viewDetailsLabel: _?.viewDetailsLabel }
468
+ labelClassName: u,
469
+ description: s?.description,
470
+ unresolvedReason: l,
471
+ onViewDetails: E,
472
+ labels: {
473
+ viewDetailsLabel: b?.viewDetailsLabel,
474
+ deletedTooltipLabel: v,
475
+ notSharedTooltipLabel: y
476
+ }
445
477
  }, `${a.url}-${n.start}`)), i = n.start + n.length;
446
478
  }), i < e.length && r.push(e.slice(i)), r;
447
479
  }, [
448
- F,
449
- P,
450
- c,
451
- _
452
- ]), G = S((e) => e == null || e.length === 0 ? null : e.map((e) => {
453
- let t = P.get(e.url);
454
- return /* @__PURE__ */ N(V, {
455
- name: t?.name ?? ue(e.url),
480
+ L,
481
+ I,
482
+ u,
483
+ b,
484
+ o,
485
+ v,
486
+ y
487
+ ]), re = C((e) => e == null || e.length === 0 ? null : e.map((e) => {
488
+ let t = I.get(e.url), n = t?.name ?? he(e.url), r = t == null ? _e(e.url, o) : void 0;
489
+ return /* @__PURE__ */ F(W, {
490
+ name: n,
456
491
  path: e.url,
457
- labelClassName: c,
492
+ labelClassName: u,
458
493
  description: t?.description,
459
- onViewDetails: C,
460
- labels: { viewDetailsLabel: _?.viewDetailsLabel }
494
+ unresolvedReason: r,
495
+ onViewDetails: E,
496
+ labels: {
497
+ viewDetailsLabel: b?.viewDetailsLabel,
498
+ deletedTooltipLabel: v,
499
+ notSharedTooltipLabel: y
500
+ }
461
501
  }, e.url);
462
502
  }), [
463
- P,
464
- c,
465
- _
466
- ]), q = S((e, t) => /* @__PURE__ */ N(K, {
467
- favorites: I,
503
+ I,
504
+ u,
505
+ b,
506
+ o,
507
+ v,
508
+ y
509
+ ]), q = C((e, t) => /* @__PURE__ */ F(J, {
510
+ favorites: R,
468
511
  isMenu: !0,
469
512
  onSelect: (n) => {
470
- z(n.id, n.name, B(t)), e();
513
+ V(n.id, n.name, H(t)), e();
471
514
  },
472
- onToggleFavorite: o,
515
+ onToggleFavorite: s,
473
516
  onBrowse: () => {
474
- w(B(t)), e(), y(!0);
517
+ te(H(t)), e(), w(!0);
475
518
  },
476
519
  onViewDetails: (n) => {
477
- B(t), e(), C(n.id);
520
+ H(t), e(), E(n.id);
478
521
  },
479
- labels: _
522
+ labels: b
480
523
  }), [
481
- I,
482
- z,
483
- B,
484
- o,
485
- _
524
+ R,
525
+ V,
526
+ H,
527
+ s,
528
+ b
486
529
  ]);
487
530
  return {
488
- skillMenuOverlay: T(() => e ? {
531
+ skillMenuOverlay: D(() => e ? {
489
532
  key: "skills",
490
- title: p,
491
- icon: /* @__PURE__ */ N(O, {
533
+ title: m,
534
+ icon: /* @__PURE__ */ F(ee, {
492
535
  size: i,
493
536
  "aria-hidden": !0,
494
537
  stroke: l
495
538
  }),
496
539
  renderOverlay: q,
497
- backLabel: m
540
+ backLabel: h
498
541
  } : void 0, [
499
542
  e,
500
- p,
501
543
  m,
544
+ h,
502
545
  q
503
546
  ]),
504
- commandMenu: T(() => e ? {
505
- triggerPrefix: de,
506
- menuLabel: p,
507
- emptyQueryHint: g,
508
- renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ N(K, {
509
- favorites: I,
547
+ commandMenu: D(() => e ? {
548
+ triggerPrefix: ve,
549
+ menuLabel: m,
550
+ emptyQueryHint: _,
551
+ renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ F(J, {
552
+ favorites: R,
510
553
  searchQuery: e,
511
554
  listboxId: r,
512
555
  activeOptionId: i,
513
556
  onSelect: (e) => {
514
- n({ consumeQuery: !0 }), z(e.id, e.name, t);
557
+ n({ consumeQuery: !0 }), V(e.id, e.name, t);
515
558
  },
516
- onToggleFavorite: o,
559
+ onToggleFavorite: s,
517
560
  onBrowse: () => {
518
- n({ consumeQuery: !0 }), w(t), y(!0);
561
+ n({ consumeQuery: !0 }), te(t), w(!0);
519
562
  },
520
563
  onViewDetails: (e) => {
521
- n({ consumeQuery: !0 }), C(e.id);
564
+ n({ consumeQuery: !0 }), E(e.id);
522
565
  },
523
- labels: _
566
+ labels: b
524
567
  })
525
568
  } : void 0, [
526
569
  e,
527
- p,
528
- g,
529
- I,
530
- z,
531
- o,
532
- _
570
+ m,
571
+ _,
572
+ R,
573
+ V,
574
+ s,
575
+ b
533
576
  ]),
534
- skillCatalogModal: /* @__PURE__ */ N(Y, {
535
- isOpen: v,
536
- onClose: () => y(!1),
577
+ skillCatalogModal: /* @__PURE__ */ F(Z, {
578
+ isOpen: x,
579
+ onClose: () => w(!1),
537
580
  onSelect: (e) => {
538
- z(e, F(e), ee), y(!1);
581
+ V(e, L(e), O), w(!1);
539
582
  },
540
- title: h,
541
- renderContent: d
583
+ title: g,
584
+ renderContent: f
542
585
  }),
543
- skillDetailsPanel: /* @__PURE__ */ N(x, {
586
+ skillDetailsPanel: /* @__PURE__ */ F(S, {
544
587
  fallback: null,
545
- children: /* @__PURE__ */ N(f, {
546
- skillId: b,
547
- onClose: () => C(null)
588
+ children: /* @__PURE__ */ F(p, {
589
+ skillId: T,
590
+ onClose: () => E(null)
548
591
  })
549
592
  }),
550
- message: j.draft,
551
- messageRevision: E,
552
- activeMentions: R,
553
- onDraftChange: j.onDraftChange,
554
- onBackspaceAtCaret: j.onBackspaceAtCaret,
555
- caretPositionOverride: te,
556
- isSkillUnsupported: L,
557
- selectedSkills: j.orderedSkills,
558
- resetSkillMentions: H,
559
- seedSkillMentions: U,
560
- renderHistorySkillSegments: W,
561
- renderHistorySkills: G
593
+ message: N.draft,
594
+ messageRevision: A,
595
+ activeMentions: B,
596
+ onDraftChange: N.onDraftChange,
597
+ onBackspaceAtCaret: N.onBackspaceAtCaret,
598
+ caretPositionOverride: ne,
599
+ isSkillUnsupported: z,
600
+ selectedSkills: N.orderedSkills,
601
+ resetSkillMentions: U,
602
+ seedSkillMentions: G,
603
+ renderHistorySkillSegments: K,
604
+ renderHistorySkills: re
562
605
  };
563
- }, pe = {
606
+ }, $ = {
564
607
  background: "_background_14zdf_1",
565
608
  border: "_border_14zdf_5",
566
609
  value: "_value_14zdf_9",
567
610
  clear: "_clear_14zdf_13",
568
611
  invalid: "_invalid_14zdf_17"
569
- }, me = [], he = ({ value: e, onChange: i, displayName: a, favorites: o = me, onToggleFavorite: s, onViewDetails: c, renderOverlay: d, isSkillsSupported: p, isDisabled: h = !1, isInvalid: g = !1, labelledById: _, describedById: y, labels: b, renderCatalogContent: x, className: S, styles: w }) => {
570
- let [T, O] = D(!1), [te, A] = D(!1), [F, I] = D(""), L = E(null), R = ee(), B = E(null), V = E(!1), H = n(e, p), U = p && !h, W = T && U, G = te && U, q = () => {
571
- B.current && !B.current.disabled ? B.current.focus() : L.current?.querySelector("button:not(:disabled)")?.focus();
612
+ }, be = [], xe = ({ value: e, onChange: i, displayName: a, favorites: o = be, onToggleFavorite: s, onViewDetails: c, renderOverlay: d, isSkillsSupported: p, isDisabled: h = !1, isInvalid: g = !1, labelledById: _, describedById: y, labels: b, renderCatalogContent: x, className: S, styles: C }) => {
613
+ let [E, D] = k(!1), [ee, A] = k(!1), [j, ne] = k(""), M = O(null), L = T(), R = O(null), z = O(!1), B = n(e, p), H = p && !h, U = E && H, W = ee && H, G = () => {
614
+ R.current && !R.current.disabled ? R.current.focus() : M.current?.querySelector("button:not(:disabled)")?.focus();
572
615
  };
573
- C(() => {
574
- V.current && !W && !G && ((document.activeElement === document.body || L.current?.contains(document.activeElement)) && q(), O(!1), A(!1)), V.current = W || G;
575
- }, [W, G]);
576
- let J = (e) => {
577
- e && !U || (I(""), O(e));
578
- }, X = (e) => {
579
- U && i(e), O(!1), A(!1);
580
- }, Z = {
616
+ w(() => {
617
+ z.current && !U && !W && ((document.activeElement === document.body || M.current?.contains(document.activeElement)) && G(), D(!1), A(!1)), z.current = U || W;
618
+ }, [U, W]);
619
+ let K = (e) => {
620
+ e && !H || (ne(""), D(e));
621
+ }, re = (e) => {
622
+ H && i(e), D(!1), A(!1);
623
+ }, q = {
581
624
  ...t({
582
- "--ssf-text": w?.colors?.text,
583
- "--ssf-bg": w?.colors?.background,
584
- "--ssf-border": w?.colors?.border,
585
- "--ssf-error": w?.colors?.error
625
+ "--ssf-text": C?.colors?.text,
626
+ "--ssf-bg": C?.colors?.background,
627
+ "--ssf-border": C?.colors?.border,
628
+ "--ssf-error": C?.colors?.error
586
629
  }),
587
- ...w?.cssVars
588
- }, Q = /* @__PURE__ */ P("div", {
589
- id: R,
630
+ ...C?.cssVars
631
+ }, Y = /* @__PURE__ */ I("div", {
632
+ id: L,
590
633
  className: "w-full min-w-0",
591
- children: [/* @__PURE__ */ N("div", {
634
+ children: [/* @__PURE__ */ F("div", {
592
635
  className: "p-2",
593
- children: /* @__PURE__ */ N(v, {
594
- value: F,
595
- onChange: (e) => I(e ?? ""),
636
+ children: /* @__PURE__ */ F(v, {
637
+ value: j,
638
+ onChange: (e) => ne(e ?? ""),
596
639
  placeholder: b.searchPlaceholder ?? "Search skills",
597
640
  "aria-label": b.searchPlaceholder ?? "Search skills",
598
641
  clearLabel: b.clearSearchLabel ?? "Clear search"
599
642
  })
600
- }), /* @__PURE__ */ N(K, {
643
+ }), /* @__PURE__ */ F(J, {
601
644
  className: "min-w-0 desktop:w-full",
602
645
  rowClassName: "min-h-11",
603
646
  favorites: o,
604
- searchQuery: F,
647
+ searchQuery: j,
605
648
  labels: b.panelLabels,
606
- onSelect: (e) => X(e.id),
649
+ onSelect: (e) => re(e.id),
607
650
  onToggleFavorite: s,
608
651
  onViewDetails: c ? (e) => {
609
- O(!1), c(e);
652
+ D(!1), c(e);
610
653
  } : void 0,
611
654
  onBrowse: () => {
612
- O(!1), A(!0);
655
+ D(!1), A(!0);
613
656
  }
614
657
  })]
615
- }), ne = /* @__PURE__ */ N(m, {
616
- inputRef: B,
658
+ }), X = /* @__PURE__ */ F(m, {
659
+ inputRef: R,
617
660
  readOnly: !0,
618
661
  role: "combobox",
619
662
  "aria-haspopup": "dialog",
620
- "aria-expanded": W,
621
- "aria-controls": W ? R : void 0,
663
+ "aria-expanded": U,
664
+ "aria-controls": U ? L : void 0,
622
665
  "aria-labelledby": _,
623
666
  "aria-describedby": y,
624
- "aria-invalid": g || H,
625
- disabled: !U,
626
- invalid: g || H,
667
+ "aria-invalid": g || B,
668
+ disabled: !H,
669
+ invalid: g || B,
627
670
  value: e ? a || e : "",
628
671
  placeholder: b.placeholder,
629
672
  title: p ? e ? a || e : void 0 : b.unsupportedTooltipLabel,
630
673
  containerClassName: "w-full min-w-0",
631
- wrapperClassName: r("cursor-pointer", "--ssf-bg" in Z && pe.background, "--ssf-border" in Z && pe.border, (g || H) && pe.invalid, w?.triggerClassName),
632
- className: r("min-w-0 cursor-pointer text-ellipsis", "--ssf-text" in Z && pe.value, w?.typography?.fontClassName ?? "dial-small-text"),
674
+ wrapperClassName: r("cursor-pointer", "--ssf-bg" in q && $.background, "--ssf-border" in q && $.border, (g || B) && $.invalid, C?.triggerClassName),
675
+ className: r("min-w-0 cursor-pointer text-ellipsis", "--ssf-text" in q && $.value, C?.typography?.fontClassName ?? "dial-small-text"),
633
676
  onKeyDown: (e) => {
634
677
  [
635
678
  "Enter",
636
679
  " ",
637
680
  "ArrowDown"
638
- ].includes(e.key) ? (e.preventDefault(), e.stopPropagation(), J(e.key === "ArrowDown" || !W)) : e.key === "Escape" && J(!1);
681
+ ].includes(e.key) ? (e.preventDefault(), e.stopPropagation(), K(e.key === "ArrowDown" || !U)) : e.key === "Escape" && K(!1);
639
682
  },
640
- iconAfter: /* @__PURE__ */ P("span", {
683
+ iconAfter: /* @__PURE__ */ I("span", {
641
684
  className: "flex shrink-0 items-center",
642
- children: [e && /* @__PURE__ */ N(f, {
685
+ children: [e && /* @__PURE__ */ F(f, {
643
686
  type: "button",
644
- className: r("size-11 shrink-0", pe.clear),
687
+ className: r("size-11 shrink-0", $.clear),
645
688
  disabled: h,
646
689
  "aria-label": b.removeSkillLabel,
647
690
  onKeyDown: (e) => e.stopPropagation(),
648
691
  onClick: (e) => {
649
- e.stopPropagation(), i(void 0), O(!1), U ? B.current?.focus() : L.current?.focus();
692
+ e.stopPropagation(), i(void 0), D(!1), H ? R.current?.focus() : M.current?.focus();
650
693
  },
651
- iconBefore: /* @__PURE__ */ N(j, {
694
+ iconBefore: /* @__PURE__ */ F(N, {
652
695
  "aria-hidden": !0,
653
696
  size: 18,
654
697
  stroke: l
655
698
  })
656
- }), /* @__PURE__ */ N(k, {
699
+ }), /* @__PURE__ */ F(te, {
657
700
  "aria-hidden": !0,
658
701
  size: 20,
659
702
  stroke: l,
660
- className: r("transition-transform", W && "rotate-180")
703
+ className: r("transition-transform", U && "rotate-180")
661
704
  })]
662
705
  })
663
706
  });
664
- return /* @__PURE__ */ P("div", {
665
- ref: L,
707
+ return /* @__PURE__ */ I("div", {
708
+ ref: M,
666
709
  role: "group",
667
710
  "aria-labelledby": _,
668
711
  tabIndex: -1,
669
- className: r("min-w-0", S, z.selectorField),
670
- style: Z,
671
- children: [d ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("div", {
712
+ className: r("min-w-0", S, V.selectorField),
713
+ style: q,
714
+ children: [d ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
672
715
  className: "w-full min-w-0",
673
- onClick: () => J(!W),
674
- children: ne
675
- }), d(Q, W, () => J(!1))] }) : /* @__PURE__ */ N(u, {
676
- open: W,
677
- onOpenChange: J,
678
- disabled: !U,
716
+ onClick: () => K(!U),
717
+ children: X
718
+ }), d(Y, U, () => K(!1))] }) : /* @__PURE__ */ F(u, {
719
+ open: U,
720
+ onOpenChange: K,
721
+ disabled: !H,
679
722
  className: "w-full min-w-0",
680
723
  listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full",
681
- renderOverlay: () => /* @__PURE__ */ N("div", {
724
+ renderOverlay: () => /* @__PURE__ */ F("div", {
682
725
  role: "dialog",
683
726
  "aria-labelledby": _,
684
- children: Q
727
+ children: Y
685
728
  }),
686
729
  initialFocus: 0,
687
- children: ne
688
- }), G && /* @__PURE__ */ N(Y, {
730
+ children: X
731
+ }), W && /* @__PURE__ */ F(Z, {
689
732
  isOpen: !0,
690
733
  onClose: () => A(!1),
691
734
  title: b.modalTitle,
692
- onSelect: X,
735
+ onSelect: re,
693
736
  renderContent: x
694
737
  })]
695
738
  });
696
739
  };
697
740
  //#endregion
698
- export { V as ChatSkill, K as FavoriteSkillsPanel, z as SKILLS_CLASS, J as SkillArchiveUploadDialog, Y as SkillCatalogModal, Z as SkillContentFileTree, Q as SkillDetailsSidePanel, B as SkillInfoTooltipContent, he as SkillSelectorField, le as buildFavoriteSkillItem, re as diffTextChange, oe as findMentionAtCaret, ue as getSkillFallbackName, ae as insertAnchor, $ as matchSkillMentions, ie as reconcileAnchors, ce as useSkillMentions, fe as useSkillSelectorOverlay };
741
+ export { W as ChatSkill, J as FavoriteSkillsPanel, V as SKILLS_CLASS, X as SkillArchiveUploadDialog, Z as SkillCatalogModal, ie as SkillContentFileTree, ae as SkillDetailsSidePanel, U as SkillInfoTooltipContent, xe as SkillSelectorField, H as SkillUnresolvedReason, me as buildFavoriteSkillItem, ce as diffTextChange, de as findMentionAtCaret, he as getSkillFallbackName, ue as insertAnchor, se as matchSkillMentions, le as reconcileAnchors, pe as useSkillMentions, ye as useSkillSelectorOverlay };