@epam/ai-dial-projects 1.3.0-dev.331 → 1.3.0-dev.342

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,35 +1,35 @@
1
1
  import { ActionMenu as e, DeleteConfirmationDialog as t, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as n, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as r, MarkdownRenderer as i, PROHIBITED_CONVERSATION_NAME_CHARS_RE as a, PanelEmptyState as o, RequestStatus as s, TextRefinementField as c, buildCssVars as l, getAttachmentTypeFromMime as u, inferMimeTypeFromPath as d, mergeClasses as f, useAvailableHeightCap as p, useIsMobile as m, useTextRefinement as h } from "@epam/ai-dial-chat-shared";
2
- import { Button as g, ButtonAppearance as _, ButtonDropdown as v, ButtonVariant as y, CardShell as b, DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, EllipsisTooltip as w, ErrorText as T, FileDropzone as E, FolderPath as D, GhostButton as O, GhostIconButton as k, Highlight as A, Input as j, Label as M, LinkButton as N, LiveRegion as P, LiveRegionElement as F, LiveRegionPoliteness as I, MenuItemMark as L, NeutralButton as R, Popup as ee, PopupSize as te, Search as ne, Spinner as re } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowNarrowLeft as z, IconArrowsSort as ie, IconDotsVertical as B, IconDownload as ae, IconPencilMinus as V, IconPin as oe, IconPinFilled as H, IconPlus as se, IconShare as ce, IconTrashX as le, IconWorldShare as U, createReactComponent as ue } from "@tabler/icons-react";
4
- import { Suspense as de, lazy as fe, memo as W, useCallback as G, useEffect as pe, useId as K, useMemo as q, useRef as J, useState as Y } from "react";
5
- import { Fragment as me, jsx as X, jsxs as Z } from "react/jsx-runtime";
6
- import { AttachmentCard as he, FileDndOverlay as ge } from "@epam/ai-dial-attachment-input";
7
- import { BuilderFormActionsOrder as _e, BuilderFormContainer as ve } from "@epam/ai-dial-builder-form";
8
- import { LazyMarkdownEditor as ye } from "@epam/ai-dial-ui-kit/editors";
2
+ import { Button as g, ButtonAppearance as _, ButtonDropdown as v, ButtonVariant as y, CardShell as b, DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, EllipsisTooltip as w, ErrorText as T, FileDropzone as E, FolderPath as D, GhostButton as O, GhostIconButton as k, Highlight as A, Input as ee, Label as j, LinkButton as te, LiveRegion as M, LiveRegionElement as ne, LiveRegionPoliteness as N, MenuItemMark as P, NeutralButton as F, Popup as re, PopupSize as ie, Search as ae, Spinner as oe } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowNarrowLeft as I, IconArrowsSort as se, IconDotsVertical as L, IconDownload as ce, IconPencilMinus as R, IconPin as z, IconPinFilled as B, IconPlus as le, IconShare as ue, IconTrashX as de, IconWorldShare as fe, createReactComponent as V } from "@tabler/icons-react";
4
+ import { Suspense as pe, lazy as me, memo as H, useCallback as U, useEffect as he, useId as W, useMemo as G, useRef as K, useState as q } from "react";
5
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
6
+ import { AttachmentCard as ge, FileDndOverlay as _e } from "@epam/ai-dial-attachment-input";
7
+ import { BuilderFormActionsOrder as ve, BuilderFormContainer as ye } from "@epam/ai-dial-builder-form";
8
+ import { LazyMarkdownEditor as be } from "@epam/ai-dial-ui-kit/editors";
9
9
  //#region src/types/projects-sort-key.ts
10
- var be = /* @__PURE__ */ function(e) {
10
+ var xe = /* @__PURE__ */ function(e) {
11
11
  return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
12
- }({}), xe = (e, t) => {
12
+ }({}), Se = (e, t) => {
13
13
  let n = t.trim().toLocaleLowerCase();
14
14
  return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
15
- }, Se = (e, t, n) => {
15
+ }, Ce = (e, t, n) => {
16
16
  let r = new Intl.Collator(n, {
17
17
  sensitivity: "base",
18
18
  numeric: !0
19
19
  }), i = (e, t) => r.compare(e.name, t.name), a = (e, t) => Number(t.isPinned ?? !1) - Number(e.isPinned ?? !1);
20
- if (t === be.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
- let o = t === be.Oldest ? 1 : -1;
20
+ if (t === xe.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
+ let o = t === xe.Oldest ? 1 : -1;
22
22
  return [...e].sort((e, t) => {
23
23
  let n = a(e, t);
24
24
  return n === 0 ? e.updatedAt == null && t.updatedAt == null ? i(e, t) : e.updatedAt == null ? 1 : t.updatedAt == null ? -1 : (e.updatedAt - t.updatedAt) * o || i(e, t) : n;
25
25
  });
26
- }, Ce = 60, we = 3600, Te = 24 * we, Ee = [
27
- ["year", 365 * Te],
28
- ["month", 30 * Te],
29
- ["week", 7 * Te],
30
- ["day", Te],
31
- ["hour", we],
32
- ["minute", Ce]
26
+ }, we = 60, Te = 3600, Z = 24 * Te, Ee = [
27
+ ["year", 365 * Z],
28
+ ["month", 30 * Z],
29
+ ["week", 7 * Z],
30
+ ["day", Z],
31
+ ["hour", Te],
32
+ ["minute", we]
33
33
  ], De = (e, t, n) => {
34
34
  let r = (t - e) / 1e3;
35
35
  for (let [e, t] of Ee) {
@@ -49,34 +49,34 @@ var be = /* @__PURE__ */ function(e) {
49
49
  aboveLink: "_aboveLink_1gkfw_55",
50
50
  interactive: "_interactive_1gkfw_60"
51
51
  }, Oe = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], ke = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ae = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: l, locale: u, updatedAtClassName: d, titleClassName: p, pathLabelClassName: m, pathLeafClassName: h }) => {
52
- let g = /* @__PURE__ */ X(A, {
52
+ let g = /* @__PURE__ */ Y(A, {
53
53
  text: e.name,
54
54
  query: t,
55
55
  maxLines: 1,
56
56
  className: f("min-w-0", p, Q.title, s != null && Q.aboveLink)
57
- }), _ = /* @__PURE__ */ X(D, {
57
+ }), _ = /* @__PURE__ */ Y(D, {
58
58
  segments: Oe(n, e.parentPath),
59
59
  ariaLabel: r,
60
60
  labelClassName: f(m, Q.path),
61
61
  leafClassName: f(h, Q.path)
62
- }), v = J(null);
63
- return /* @__PURE__ */ X("li", {
62
+ }), v = K(null);
63
+ return /* @__PURE__ */ Y("li", {
64
64
  className: "flex min-w-0",
65
- children: /* @__PURE__ */ Z(b, {
65
+ children: /* @__PURE__ */ X(b, {
66
66
  "aria-label": e.name,
67
67
  className: f("relative flex w-full min-w-0 flex-col gap-2", Q.card, s != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", s != null && Q.interactive),
68
68
  children: [
69
- e.updatedAt != null && /* @__PURE__ */ X("time", {
69
+ e.updatedAt != null && /* @__PURE__ */ Y("time", {
70
70
  dateTime: new Date(e.updatedAt).toISOString(),
71
71
  className: f(d, Q.updatedAt, (e.isPinned || o != null) && "pe-6"),
72
72
  children: De(e.updatedAt, l, u)
73
73
  }),
74
- /* @__PURE__ */ Z("div", {
74
+ /* @__PURE__ */ X("div", {
75
75
  className: f("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
76
- children: [s == null ? /* @__PURE__ */ X("div", {
76
+ children: [s == null ? /* @__PURE__ */ Y("div", {
77
77
  className: "min-w-0 flex-1",
78
78
  children: g
79
- }) : /* @__PURE__ */ X("a", {
79
+ }) : /* @__PURE__ */ Y("a", {
80
80
  ref: v,
81
81
  href: s,
82
82
  onClick: (t) => {
@@ -84,21 +84,21 @@ var be = /* @__PURE__ */ function(e) {
84
84
  },
85
85
  className: f("min-w-0 flex-1", Q.link),
86
86
  children: g
87
- }), o == null ? e.isPinned && /* @__PURE__ */ Z("span", {
87
+ }), o == null ? e.isPinned && /* @__PURE__ */ X("span", {
88
88
  className: f("absolute inset-e-5 top-5 flex", Q.pin),
89
- children: [/* @__PURE__ */ X(H, {
89
+ children: [/* @__PURE__ */ Y(B, {
90
90
  size: x.SM,
91
91
  "aria-hidden": !0
92
- }), /* @__PURE__ */ X("span", {
92
+ }), /* @__PURE__ */ Y("span", {
93
93
  className: "sr-only",
94
94
  children: i
95
95
  })]
96
- }) : /* @__PURE__ */ X(k, {
96
+ }) : /* @__PURE__ */ Y(k, {
97
97
  size: C.Small,
98
- icon: e.isPinned ? /* @__PURE__ */ X(H, {
98
+ icon: e.isPinned ? /* @__PURE__ */ Y(B, {
99
99
  size: x.SM,
100
100
  "aria-hidden": !0
101
- }) : /* @__PURE__ */ X(oe, {
101
+ }) : /* @__PURE__ */ Y(z, {
102
102
  size: x.SM,
103
103
  "aria-hidden": !0,
104
104
  stroke: S
@@ -109,7 +109,7 @@ var be = /* @__PURE__ */ function(e) {
109
109
  className: f("absolute inset-e-4 top-4", Q.pinToggle, !e.isPinned && Q.pinToggleIdle)
110
110
  })]
111
111
  }),
112
- s == null ? _ : /* @__PURE__ */ X("div", {
112
+ s == null ? _ : /* @__PURE__ */ Y("div", {
113
113
  className: Q.aboveLink,
114
114
  onClick: (e) => {
115
115
  v.current?.dispatchEvent(new window.MouseEvent("click", {
@@ -132,7 +132,7 @@ var be = /* @__PURE__ */ function(e) {
132
132
  subtitle: "_subtitle_4rer8_5",
133
133
  sortButton: "_sortButton_4rer8_9"
134
134
  }, Me = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onTogglePin: s, onOpenProject: c, getProjectHref: u, searchQuery: d, onSearchQueryChange: p, sortKey: h, onSortKeyChange: b, labels: w, locale: T, styles: E }) => {
135
- let { colors: D, typography: k } = E ?? {}, A = k?.titleClassName ?? "dial-h1-text", j = k?.subtitleClassName ?? "dial-body-text", M = k?.cardTitleClassName ?? "dial-body-semi-text", N = k?.pathLabelClassName ?? "dial-tiny-text", I = k?.pathLeafClassName ?? "dial-tiny-semi-text", R = k?.updatedAtClassName ?? "dial-tiny-text", ee = k?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", te = l({
135
+ let { colors: D, typography: k } = E ?? {}, A = k?.titleClassName ?? "dial-h1-text", ee = k?.subtitleClassName ?? "dial-body-text", j = k?.cardTitleClassName ?? "dial-body-semi-text", te = k?.pathLabelClassName ?? "dial-tiny-text", N = k?.pathLeafClassName ?? "dial-tiny-semi-text", F = k?.updatedAtClassName ?? "dial-tiny-text", re = k?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", ie = l({
136
136
  "--pr-bg": D?.background,
137
137
  "--pr-subtitle-text": D?.subtitleText,
138
138
  "--pr-sort-text": D?.sortButtonText,
@@ -141,55 +141,55 @@ var be = /* @__PURE__ */ function(e) {
141
141
  "--pr-updated-at-text": D?.updatedAtText,
142
142
  "--pr-path-text": D?.pathText,
143
143
  "--pr-card-focus-outline": D?.cardFocusOutline
144
- }), z = m(), B = q(() => Date.now(), [e]), ae = d.trim(), V = r.length > 0, oe = V && e.length === 0, H = q(() => Se(xe(e, d), h, T), [
144
+ }), I = m(), L = G(() => Date.now(), [e]), ce = d.trim(), R = r.length > 0, z = R && e.length === 0, B = G(() => Ce(Se(e, d), h, T), [
145
145
  e,
146
146
  d,
147
147
  h,
148
148
  T
149
- ]), ce = w.sortOptions.find((e) => e.value === h)?.label ?? w.sortLabel, le = q(() => w.sortOptions.map((e) => ({
149
+ ]), ue = w.sortOptions.find((e) => e.value === h)?.label ?? w.sortLabel, de = G(() => w.sortOptions.map((e) => ({
150
150
  key: e.value,
151
151
  label: e.label,
152
- mark: L.Check,
152
+ mark: P.Check,
153
153
  checked: e.value === h,
154
154
  onClick: () => b(e.value)
155
155
  })), [
156
156
  w.sortOptions,
157
157
  h,
158
158
  b
159
- ]), U = (e) => {
159
+ ]), fe = (e) => {
160
160
  p(e ?? "");
161
- }, ue = () => {
162
- if (!t) return n ? w.errorLabel : V ? w.incompleteLabel : e.length === 0 ? w.emptyStateLabel : H.length === 0 ? w.noResultsLabel : w.resultCountLabel(H.length);
163
- }, de = (e, t) => a ? /* @__PURE__ */ X(g, {
161
+ }, V = () => {
162
+ if (!t) return n ? w.errorLabel : R ? w.incompleteLabel : e.length === 0 ? w.emptyStateLabel : B.length === 0 ? w.noResultsLabel : w.resultCountLabel(B.length);
163
+ }, pe = (e, t) => a ? /* @__PURE__ */ Y(g, {
164
164
  label: w.createProjectLabel,
165
165
  variant: e,
166
166
  onClick: a,
167
167
  className: f("shrink-0", t)
168
- }) : void 0, fe = () => t ? /* @__PURE__ */ X(re, {}) : n || oe ? /* @__PURE__ */ Z("div", {
168
+ }) : void 0, me = () => t ? /* @__PURE__ */ Y(oe, { ariaLabel: w.loadingAriaLabel ?? "Loading projects" }) : n || z ? /* @__PURE__ */ X("div", {
169
169
  className: "flex flex-col items-center gap-3",
170
- children: [/* @__PURE__ */ X("p", {
171
- className: f(j, je.subtitle),
170
+ children: [/* @__PURE__ */ Y("p", {
171
+ className: f(ee, je.subtitle),
172
172
  children: n ? w.errorLabel : w.incompleteLabel
173
- }), /* @__PURE__ */ X(O, {
173
+ }), /* @__PURE__ */ Y(O, {
174
174
  label: w.retryLabel,
175
175
  onClick: i
176
176
  })]
177
- }) : e.length === 0 ? /* @__PURE__ */ X(o, {
177
+ }) : e.length === 0 ? /* @__PURE__ */ Y(o, {
178
178
  label: w.emptyStateLabel,
179
179
  description: w.emptyStateDescription,
180
- action: de(y.Secondary, "mt-2"),
181
- containerClassName: G,
180
+ action: pe(y.Secondary, "mt-2"),
181
+ containerClassName: U,
182
182
  labelClassName: "mt-3",
183
- descriptionClassName: ee
184
- }) : H.length === 0 ? /* @__PURE__ */ X(o, {
183
+ descriptionClassName: re
184
+ }) : B.length === 0 ? /* @__PURE__ */ Y(o, {
185
185
  label: w.noResultsLabel,
186
- containerClassName: G,
186
+ containerClassName: U,
187
187
  labelClassName: "mt-3"
188
- }) : /* @__PURE__ */ X("ul", {
188
+ }) : /* @__PURE__ */ Y("ul", {
189
189
  className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-4 p-0 desktop:grid-cols-3 desktop:gap-5",
190
- children: H.map((e) => /* @__PURE__ */ X(Ae, {
190
+ children: B.map((e) => /* @__PURE__ */ Y(Ae, {
191
191
  project: e,
192
- searchQuery: ae,
192
+ searchQuery: ce,
193
193
  sourceLabel: w.sourceLabels[e.source],
194
194
  folderPathLabel: w.folderPathLabel,
195
195
  pinnedLabel: w.pinnedLabel ?? "Pinned",
@@ -197,61 +197,61 @@ var be = /* @__PURE__ */ function(e) {
197
197
  onTogglePin: s,
198
198
  href: u?.(e.id),
199
199
  onOpen: c,
200
- now: B,
200
+ now: L,
201
201
  locale: T,
202
- updatedAtClassName: R,
203
- titleClassName: M,
204
- pathLabelClassName: N,
205
- pathLeafClassName: I
202
+ updatedAtClassName: F,
203
+ titleClassName: j,
204
+ pathLabelClassName: te,
205
+ pathLeafClassName: N
206
206
  }, e.id))
207
- }), W = t || n || oe, G = "mt-6 p-3 desktop:mt-0";
208
- return /* @__PURE__ */ Z("div", {
209
- style: te,
207
+ }), H = t || n || z, U = "mt-6 p-3 desktop:mt-0";
208
+ return /* @__PURE__ */ X("div", {
209
+ style: ie,
210
210
  className: f("relative flex size-full min-h-0 min-w-0 flex-1 flex-col", je.container),
211
- children: [/* @__PURE__ */ Z("div", {
211
+ children: [/* @__PURE__ */ X("div", {
212
212
  className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto",
213
213
  children: [
214
- z ? /* @__PURE__ */ X("h1", {
214
+ I ? /* @__PURE__ */ Y("h1", {
215
215
  className: "sr-only",
216
216
  children: w.title
217
- }) : /* @__PURE__ */ Z("div", {
217
+ }) : /* @__PURE__ */ X("div", {
218
218
  className: "flex min-w-0 items-start gap-2 px-8 py-4",
219
- children: [/* @__PURE__ */ Z("div", {
219
+ children: [/* @__PURE__ */ X("div", {
220
220
  className: "flex min-h-10 min-w-0 flex-1 flex-col justify-center gap-0.5",
221
- children: [/* @__PURE__ */ X("h1", {
221
+ children: [/* @__PURE__ */ Y("h1", {
222
222
  className: f("wrap-break-word", A),
223
223
  children: w.title
224
- }), w.subtitle && /* @__PURE__ */ X("p", {
225
- className: f(j, je.subtitle),
224
+ }), w.subtitle && /* @__PURE__ */ Y("p", {
225
+ className: f(ee, je.subtitle),
226
226
  children: w.subtitle
227
227
  })]
228
- }), de(y.Primary)]
228
+ }), pe(y.Primary)]
229
229
  }),
230
- /* @__PURE__ */ Z("div", {
230
+ /* @__PURE__ */ X("div", {
231
231
  className: "flex items-center gap-2 p-4 desktop:gap-3 desktop:px-8 desktop:pt-4 desktop:pb-5",
232
- children: [/* @__PURE__ */ X("div", {
232
+ children: [/* @__PURE__ */ Y("div", {
233
233
  role: "search",
234
234
  className: "min-w-0 flex-1",
235
- children: /* @__PURE__ */ X(ne, {
235
+ children: /* @__PURE__ */ Y(ae, {
236
236
  value: d,
237
- onChange: U,
237
+ onChange: fe,
238
238
  placeholder: w.searchPlaceholder,
239
239
  clearLabel: w.clearSearchLabel,
240
240
  "aria-label": w.searchAriaLabel,
241
- size: z ? C.Standard : C.Large
241
+ size: I ? C.Standard : C.Large
242
242
  })
243
- }), w.sortOptions.length > 0 && /* @__PURE__ */ X("div", {
243
+ }), w.sortOptions.length > 0 && /* @__PURE__ */ Y("div", {
244
244
  role: "group",
245
245
  "aria-label": w.sortLabel,
246
246
  className: "shrink-0",
247
- children: /* @__PURE__ */ X(v, {
248
- items: le,
249
- label: ce,
247
+ children: /* @__PURE__ */ Y(v, {
248
+ items: de,
249
+ label: ue,
250
250
  variant: y.Primary,
251
251
  appearance: _.Ghost,
252
- size: z ? C.Small : C.Standard,
253
- iconBefore: /* @__PURE__ */ X(ie, {
254
- size: z ? x.SM : x.MD,
252
+ size: I ? C.Small : C.Standard,
253
+ iconBefore: /* @__PURE__ */ Y(se, {
254
+ size: I ? x.SM : x.MD,
255
255
  "aria-hidden": !0,
256
256
  stroke: S
257
257
  }),
@@ -259,31 +259,31 @@ var be = /* @__PURE__ */ function(e) {
259
259
  })
260
260
  })]
261
261
  }),
262
- /* @__PURE__ */ X(P, {
262
+ /* @__PURE__ */ Y(M, {
263
263
  visuallyHidden: !0,
264
- as: F.Span,
265
- children: ue()
264
+ as: ne.Span,
265
+ children: V()
266
266
  }),
267
- /* @__PURE__ */ Z("div", {
267
+ /* @__PURE__ */ X("div", {
268
268
  className: "flex w-full min-w-0 flex-1 flex-col items-center gap-4 px-4 pb-20 desktop:gap-5 desktop:px-8 desktop:pt-6 desktop:pb-8",
269
- children: [V && !t && !n && !oe && /* @__PURE__ */ Z("div", {
269
+ children: [R && !t && !n && !z && /* @__PURE__ */ X("div", {
270
270
  className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
271
- children: [/* @__PURE__ */ X("p", {
272
- className: f(j, je.subtitle),
271
+ children: [/* @__PURE__ */ Y("p", {
272
+ className: f(ee, je.subtitle),
273
273
  children: w.incompleteLabel
274
- }), /* @__PURE__ */ X(O, {
274
+ }), /* @__PURE__ */ Y(O, {
275
275
  label: w.retryLabel,
276
276
  onClick: i
277
277
  })]
278
- }), /* @__PURE__ */ X("div", {
279
- className: f("flex w-full max-w-[1116px] min-w-0 flex-col items-center", W && "flex-1 justify-center"),
280
- children: fe()
278
+ }), /* @__PURE__ */ Y("div", {
279
+ className: f("flex w-full max-w-[1116px] min-w-0 flex-col items-center", H && "flex-1 justify-center"),
280
+ children: me()
281
281
  })]
282
282
  })
283
283
  ]
284
- }), z && a && /* @__PURE__ */ X(g, {
284
+ }), I && a && /* @__PURE__ */ Y(g, {
285
285
  variant: y.Primary,
286
- iconBefore: /* @__PURE__ */ X(se, {
286
+ iconBefore: /* @__PURE__ */ Y(le, {
287
287
  size: x.LG,
288
288
  "aria-hidden": !0,
289
289
  stroke: S
@@ -296,20 +296,20 @@ var be = /* @__PURE__ */ function(e) {
296
296
  }, Ne = /* @__PURE__ */ function(e) {
297
297
  return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
298
298
  }({}), Pe = (e) => !!e.dataTransfer?.types.includes("Files"), Fe = (e) => {
299
- let [t, n] = Y(!1), r = J(0);
299
+ let [t, n] = q(!1), r = K(0);
300
300
  return {
301
301
  isDragActive: t,
302
302
  handlers: {
303
- onDragEnter: G((e) => {
303
+ onDragEnter: U((e) => {
304
304
  Pe(e) && (e.preventDefault(), r.current += 1, n(!0));
305
305
  }, []),
306
- onDragLeave: G((e) => {
306
+ onDragLeave: U((e) => {
307
307
  Pe(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
308
308
  }, []),
309
- onDragOver: G((e) => {
309
+ onDragOver: U((e) => {
310
310
  Pe(e) && e.preventDefault();
311
311
  }, []),
312
- onDrop: G((t) => {
312
+ onDrop: U((t) => {
313
313
  if (!Pe(t)) return;
314
314
  t.preventDefault(), r.current = 0, n(!1);
315
315
  let i = Array.from(t.dataTransfer?.files ?? []);
@@ -365,59 +365,59 @@ var be = /* @__PURE__ */ function(e) {
365
365
  dropZone: "_dropZone_ru73x_11",
366
366
  label: "_label_ru73x_20",
367
367
  link: "_link_ru73x_24"
368
- }, tt = fe(async () => ({ default: (await ye()).MarkdownEditor })), nt = (e) => `Preview ${e}`, rt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: s, selectedContextFileId: u, allowedExtensions: d, maxFileBytes: m, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: b, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: O, className: k, styles: A }) => {
369
- let N = K(), L = K(), R = K(), ee = K(), te = J(null), ne = p(), [ie, B] = Y(!1), [ae, V] = Y([]), [oe, H] = Y(""), se = h({
368
+ }, tt = me(async () => ({ default: (await be()).MarkdownEditor })), nt = (e) => `Preview ${e}`, rt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: s, selectedContextFileId: u, allowedExtensions: d, maxFileBytes: m, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: b, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: O, className: k, styles: A }) => {
369
+ let te = W(), P = W(), F = W(), re = W(), ie = W(), ae = K(null), se = p(), [L, ce] = q(!1), [R, z] = q([]), [B, le] = q(""), ue = h({
370
370
  value: e.instructions,
371
371
  onChange: (e) => i("instructions", e),
372
372
  onRefine: v,
373
373
  disabled: w
374
- }), ce = se.isPending, le = Ue(e.name), U = t.name ?? (ie && le != null ? D.nameErrors[le] : void 0), ue = le != null || w || ce;
375
- pe(() => {
376
- t.name && te.current?.focus();
374
+ }), de = ue.isPending, fe = Ue(e.name), V = t.name ?? (L && fe != null ? D.nameErrors[fe] : void 0), me = fe != null || w || de, H;
375
+ t.name ? H = P : V && (H = F), he(() => {
376
+ t.name && ae.current?.focus();
377
377
  }, [t.name]);
378
- let fe = q(() => d.map((e) => `.${e}`).join(","), [d]), W = (e) => {
378
+ let U = G(() => d.map((e) => `.${e}`).join(","), [d]), J = (e) => {
379
379
  if (e.length === 0) return;
380
380
  let { accepted: t, rejected: n } = Qe(e, a, {
381
381
  allowedExtensions: d,
382
382
  maxFileBytes: m,
383
383
  maxTotalBytes: g
384
384
  });
385
- V(n), t.length > 0 && o([...a, ...t]), H([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
386
- }, { isDragActive: G, handlers: me } = Fe(W), ye = D.openFileLabel ?? nt, be = (e) => {
385
+ z(n), t.length > 0 && o([...a, ...t]), le([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
386
+ }, { isDragActive: be, handlers: xe } = Fe(J), Se = D.openFileLabel ?? nt, Ce = (e) => {
387
387
  let t = a.find((t) => t.id === e);
388
- o(a.filter((t) => t.id !== e)), V([]), t && H(D.fileRemovedStatus(t.name));
389
- }, xe = async (e) => {
388
+ o(a.filter((t) => t.id !== e)), z([]), t && le(D.fileRemovedStatus(t.name));
389
+ }, we = async (e) => {
390
390
  if (e.preventDefault(), e.stopPropagation(), _) try {
391
391
  let e = await _();
392
- e && W(e);
392
+ e && J(e);
393
393
  } catch {}
394
- }, Se = () => {
395
- ue || C();
396
- }, { colors: Ce, typography: we } = A ?? {}, Te = we?.titleClassName ?? "dial-h1-text", Ee = f(we?.labelClassName ?? "dial-tiny-semi-text", et.label), De = we?.helperClassName ?? "dial-tiny-text", Q = l({
397
- "--pcf-label-text": Ce?.labelText,
398
- "--pcf-link-text": Ce?.linkText,
399
- "--pcf-dropzone-bg": Ce?.dropZoneBackground
400
- }), Oe = D.refinement, ke = t.context, Ae = [...ae.map(({ name: e, reason: t }) => D.fileRejections[t](e)), ke].filter(Boolean).join("\n"), je = D.dropZoneLabel({
401
- fromDevice: /* @__PURE__ */ X("span", { className: et.link }),
402
- fileManager: _ ? /* @__PURE__ */ X("button", {
394
+ }, Te = () => {
395
+ me || C();
396
+ }, { colors: Z, typography: Ee } = A ?? {}, De = Ee?.titleClassName ?? "dial-h1-text", Q = f(Ee?.labelClassName ?? "dial-tiny-semi-text", et.label), Oe = Ee?.helperClassName ?? "dial-tiny-text", ke = l({
397
+ "--pcf-label-text": Z?.labelText,
398
+ "--pcf-link-text": Z?.linkText,
399
+ "--pcf-dropzone-bg": Z?.dropZoneBackground
400
+ }), Ae = D.refinement, je = t.context, Me = [...R.map(({ name: e, reason: t }) => D.fileRejections[t](e)), je].filter(Boolean).join("\n"), Ne = D.dropZoneLabel({
401
+ fromDevice: /* @__PURE__ */ Y("span", { className: et.link }),
402
+ fileManager: _ ? /* @__PURE__ */ Y("button", {
403
403
  type: "button",
404
404
  className: et.link,
405
405
  disabled: w,
406
- onClick: (e) => void xe(e)
406
+ onClick: (e) => void we(e)
407
407
  }) : void 0
408
408
  });
409
- return /* @__PURE__ */ Z("div", {
409
+ return /* @__PURE__ */ X("div", {
410
410
  className: f("relative flex h-full min-h-0 w-full", k),
411
- ...me,
411
+ ...xe,
412
412
  children: [
413
- /* @__PURE__ */ X(ge, {
414
- isVisible: G,
413
+ /* @__PURE__ */ Y(_e, {
414
+ isVisible: be,
415
415
  labels: {
416
416
  title: D.dropOverlayTitle,
417
417
  subtitle: D.dropOverlaySubtitle
418
418
  }
419
419
  }),
420
- /* @__PURE__ */ X(ve, {
420
+ /* @__PURE__ */ Y(ye, {
421
421
  labels: {
422
422
  title: D.title,
423
423
  backButtonLabel: D.backLabel,
@@ -427,37 +427,37 @@ var be = /* @__PURE__ */ function(e) {
427
427
  },
428
428
  onBack: y,
429
429
  onCancel: b,
430
- onSubmit: Se,
430
+ onSubmit: Te,
431
431
  isCancelDisabled: w,
432
- isSubmitDisabled: ue,
432
+ isSubmitDisabled: me,
433
433
  isSubmitting: w,
434
- footerActionsOrder: _e.SubmitFirst,
435
- backIcon: /* @__PURE__ */ X(z, {
434
+ footerActionsOrder: ve.SubmitFirst,
435
+ backIcon: /* @__PURE__ */ Y(I, {
436
436
  size: x.LG,
437
437
  stroke: S,
438
438
  "aria-hidden": !0,
439
439
  className: "rtl:scale-x-[-1]"
440
440
  }),
441
441
  styles: {
442
- colors: { background: Ce?.background },
442
+ colors: { background: Z?.background },
443
443
  header: {
444
- colors: { borderColor: Ce?.headerBorder },
445
- typography: { fontClassName: Te }
444
+ colors: { borderColor: Z?.headerBorder },
445
+ typography: { fontClassName: De }
446
446
  },
447
- cssVars: Q
447
+ cssVars: ke
448
448
  },
449
- children: /* @__PURE__ */ Z("div", {
449
+ children: /* @__PURE__ */ X("div", {
450
450
  className: f("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6", et.formColumn),
451
451
  children: [
452
- /* @__PURE__ */ Z("div", {
452
+ /* @__PURE__ */ X("div", {
453
453
  className: "flex flex-col gap-1",
454
454
  children: [
455
- /* @__PURE__ */ X(j, {
456
- id: N,
457
- inputRef: te,
455
+ /* @__PURE__ */ Y(ee, {
456
+ id: te,
457
+ inputRef: ae,
458
458
  value: e.name,
459
459
  onChange: (e) => i("name", e ?? ""),
460
- onBlur: () => B(!0),
460
+ onBlur: () => ce(!0),
461
461
  placeholder: D.namePlaceholder,
462
462
  labelProps: {
463
463
  label: D.nameLabel,
@@ -465,47 +465,47 @@ var be = /* @__PURE__ */ function(e) {
465
465
  },
466
466
  required: !0,
467
467
  "aria-required": !0,
468
- invalid: !!U,
469
- "aria-invalid": !!U,
470
- "aria-describedby": U ? L : void 0
468
+ invalid: !!V,
469
+ "aria-invalid": !!V,
470
+ "aria-describedby": H
471
471
  }),
472
- /* @__PURE__ */ X(T, {
473
- announce: I.Assertive,
474
- id: L,
475
- className: De,
472
+ /* @__PURE__ */ Y(T, {
473
+ announce: N.Assertive,
474
+ id: P,
475
+ className: Oe,
476
476
  text: t.name ?? ""
477
477
  }),
478
- U && !t.name && /* @__PURE__ */ X(T, {
479
- id: L,
480
- className: De,
481
- text: U
478
+ V && !t.name && /* @__PURE__ */ Y(T, {
479
+ id: F,
480
+ className: Oe,
481
+ text: V
482
482
  })
483
483
  ]
484
484
  }),
485
- /* @__PURE__ */ X(c, {
485
+ /* @__PURE__ */ Y(c, {
486
486
  isEnabled: !!v,
487
- fieldId: R,
487
+ fieldId: re,
488
488
  label: D.instructionsLabel,
489
- labelClassName: Ee,
490
- labels: Oe,
491
- refinement: se,
492
- disabled: w || ce,
493
- children: /* @__PURE__ */ Z("div", {
489
+ labelClassName: Q,
490
+ labels: Ae,
491
+ refinement: ue,
492
+ disabled: w || de,
493
+ children: /* @__PURE__ */ X("div", {
494
494
  className: "flex flex-1 flex-col gap-2",
495
- children: [!v && /* @__PURE__ */ X(M, {
496
- htmlFor: R,
497
- className: Ee,
495
+ children: [!v && /* @__PURE__ */ Y(j, {
496
+ htmlFor: re,
497
+ className: Q,
498
498
  label: D.instructionsLabel
499
- }), /* @__PURE__ */ X("div", {
500
- ref: ne,
499
+ }), /* @__PURE__ */ Y("div", {
500
+ ref: se,
501
501
  className: f("w-full", n, r),
502
- children: /* @__PURE__ */ X(de, {
503
- fallback: /* @__PURE__ */ X(re, {}),
504
- children: /* @__PURE__ */ X(tt, {
505
- id: R,
502
+ children: /* @__PURE__ */ Y(pe, {
503
+ fallback: /* @__PURE__ */ Y(oe, { ariaLabel: D.editorLoadingAriaLabel ?? "Loading editor" }),
504
+ children: /* @__PURE__ */ Y(tt, {
505
+ id: re,
506
506
  value: e.instructions,
507
507
  onChange: (e) => {
508
- se.reset(), i("instructions", e);
508
+ ue.reset(), i("instructions", e);
509
509
  },
510
510
  height: 176,
511
511
  theme: O,
@@ -515,44 +515,44 @@ var be = /* @__PURE__ */ function(e) {
515
515
  })]
516
516
  })
517
517
  }),
518
- /* @__PURE__ */ Z("section", {
519
- "aria-labelledby": ee,
518
+ /* @__PURE__ */ X("section", {
519
+ "aria-labelledby": ie,
520
520
  className: "flex flex-col gap-2",
521
521
  children: [
522
- /* @__PURE__ */ X("h2", {
523
- id: ee,
524
- className: Ee,
522
+ /* @__PURE__ */ Y("h2", {
523
+ id: ie,
524
+ className: Q,
525
525
  children: D.contextLabel
526
526
  }),
527
- /* @__PURE__ */ X(E, {
528
- label: je,
527
+ /* @__PURE__ */ Y(E, {
528
+ label: Ne,
529
529
  ariaLabel: D.dropZoneAriaLabel,
530
530
  description: D.dropZoneHint,
531
- accept: fe,
531
+ accept: U,
532
532
  multiple: !0,
533
533
  disabled: w,
534
- onChange: W,
535
- onReject: W,
536
- errorText: Ae || void 0,
534
+ onChange: J,
535
+ onReject: J,
536
+ errorText: Me || void 0,
537
537
  className: et.dropZone
538
538
  }),
539
- /* @__PURE__ */ X(P, {
539
+ /* @__PURE__ */ Y(M, {
540
540
  visuallyHidden: !0,
541
- politeness: I.Assertive,
542
- children: ke
541
+ politeness: N.Assertive,
542
+ children: je
543
543
  }),
544
- a.length > 0 && /* @__PURE__ */ X("ul", {
544
+ a.length > 0 && /* @__PURE__ */ Y("ul", {
545
545
  className: "flex min-w-0 flex-wrap gap-2 pt-3",
546
- children: a.map((e) => /* @__PURE__ */ X("li", {
546
+ children: a.map((e) => /* @__PURE__ */ Y("li", {
547
547
  className: "min-w-0",
548
- children: /* @__PURE__ */ X(he, {
548
+ children: /* @__PURE__ */ Y(ge, {
549
549
  attachment: e,
550
550
  onClick: s,
551
551
  isSelected: s == null ? void 0 : e.id === u,
552
- onRemove: be,
552
+ onRemove: Ce,
553
553
  labels: {
554
554
  removeLabel: D.removeFileLabel(e.name),
555
- clickLabel: ye(e.name)
555
+ clickLabel: Se(e.name)
556
556
  }
557
557
  })
558
558
  }, e.id))
@@ -562,14 +562,14 @@ var be = /* @__PURE__ */ function(e) {
562
562
  ]
563
563
  })
564
564
  }),
565
- /* @__PURE__ */ X(P, {
565
+ /* @__PURE__ */ Y(M, {
566
566
  visuallyHidden: !0,
567
- as: F.Span,
568
- children: w ? D.creatingStatus : oe
567
+ as: ne.Span,
568
+ children: w ? D.creatingStatus : B
569
569
  })
570
570
  ]
571
571
  });
572
- }, it = ue("outline", "pin-off", "PinOff", [
572
+ }, it = V("outline", "pin-off", "PinOff", [
573
573
  ["path", {
574
574
  d: "M3 3l18 18",
575
575
  key: "svg-0"
@@ -611,15 +611,15 @@ var be = /* @__PURE__ */ function(e) {
611
611
  contentType: e.contentType,
612
612
  type: u(e.contentType),
613
613
  status: s.Idle
614
- }), ot = W(({ project: t, isLoading: n = !1, hasError: r = !1, isNotFound: a = !1, isPinned: s, isPinPending: c = !1, contextSearchQuery: u, onContextSearchQueryChange: d, onBack: p, onTogglePin: m, onPublish: h, onEdit: g, onShare: _, onDelete: v, onDownload: y, onContextFileClick: b, selectedContextFileId: C, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: D, mainContent: A, mainContentLabel: j = "Project content", labels: M, styles: N }) => {
615
- let { colors: I, typography: L } = N ?? {}, ee = L?.titleClassName ?? "dial-h1-text", te = L?.panelTitleClassName ?? "dial-body-semi-text", ie = L?.sectionTitleClassName ?? "dial-tiny-text", H = L?.bodyClassName ?? "dial-small-text", se = L?.helperClassName ?? "dial-tiny-text", ue = L?.instructionsHeadingClassName ?? "dial-small-semi-text", de = l({
616
- "--pv-bg": I?.background,
617
- "--pv-border": I?.border,
618
- "--pv-heading-text": I?.headingText,
619
- "--pv-body-text": I?.bodyText,
620
- "--pv-secondary-text": I?.secondaryText
621
- }), fe = q(() => t?.contextFiles ?? [], [t]), W = q(() => $e(fe, u), [fe, u]), G = u.trim(), pe = K(), J = q(() => {
622
- let e = f("mb-1 mt-3 first:mt-0", ue);
614
+ }), ot = H(({ project: t, isLoading: n = !1, hasError: r = !1, isNotFound: a = !1, isPinned: s, isPinPending: c = !1, contextSearchQuery: u, onContextSearchQueryChange: d, onBack: p, onTogglePin: m, onPublish: h, onEdit: g, onShare: _, onDelete: v, onDownload: y, onContextFileClick: b, selectedContextFileId: C, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: D, mainContent: A, mainContentLabel: ee = "Project content", labels: j, styles: te }) => {
615
+ let { colors: N, typography: P } = te ?? {}, re = P?.titleClassName ?? "dial-h1-text", ie = P?.panelTitleClassName ?? "dial-body-semi-text", se = P?.sectionTitleClassName ?? "dial-tiny-text", B = P?.bodyClassName ?? "dial-small-text", le = P?.helperClassName ?? "dial-tiny-text", V = P?.instructionsHeadingClassName ?? "dial-small-semi-text", pe = l({
616
+ "--pv-bg": N?.background,
617
+ "--pv-border": N?.border,
618
+ "--pv-heading-text": N?.headingText,
619
+ "--pv-body-text": N?.bodyText,
620
+ "--pv-secondary-text": N?.secondaryText
621
+ }), me = G(() => t?.contextFiles ?? [], [t]), H = G(() => $e(me, u), [me, u]), U = u.trim(), he = W(), K = G(() => {
622
+ let e = f("mb-1 mt-3 first:mt-0", V);
623
623
  return {
624
624
  h1: e,
625
625
  h2: e,
@@ -627,157 +627,157 @@ var be = /* @__PURE__ */ function(e) {
627
627
  h4: e,
628
628
  h5: e,
629
629
  h6: e,
630
- p: H,
631
- ul: H,
632
- ol: H
630
+ p: B,
631
+ ul: B,
632
+ ol: B
633
633
  };
634
- }, [H, ue]), Y = (e) => /* @__PURE__ */ X(e, {
634
+ }, [B, V]), q = (e) => /* @__PURE__ */ Y(e, {
635
635
  size: x.SM,
636
636
  "aria-hidden": !0,
637
637
  stroke: S
638
- }), ge = (e) => {
638
+ }), _e = (e) => {
639
639
  let t = [];
640
640
  return e && h && t.push({
641
641
  key: "publish",
642
- label: M.publishLabel,
643
- icon: Y(U),
642
+ label: j.publishLabel,
643
+ icon: q(fe),
644
644
  onClick: h
645
645
  }), e && g && t.push({
646
646
  key: "edit",
647
- label: M.editLabel,
648
- icon: Y(V),
647
+ label: j.editLabel,
648
+ icon: q(R),
649
649
  onClick: g
650
650
  }), _ && t.push({
651
651
  key: "share",
652
- label: M.shareLabel,
653
- icon: Y(ce),
652
+ label: j.shareLabel,
653
+ icon: q(ue),
654
654
  onClick: _
655
655
  }), t.push({
656
656
  key: "download",
657
- label: M.downloadLabel,
658
- icon: Y(ae),
657
+ label: j.downloadLabel,
658
+ icon: q(ce),
659
659
  onClick: y
660
660
  }), v && t.push({
661
661
  key: "delete",
662
- label: M.deleteLabel,
663
- icon: Y(le),
662
+ label: j.deleteLabel,
663
+ icon: q(de),
664
664
  danger: !0,
665
665
  onClick: v
666
666
  }), t;
667
- }, _e = (t, n) => /* @__PURE__ */ X("div", {
667
+ }, ve = (t, n) => /* @__PURE__ */ Y("div", {
668
668
  className: n,
669
- children: /* @__PURE__ */ X(e, {
670
- items: ge(t),
671
- title: M.moreActionsLabel,
672
- closeLabel: M.closeLabel,
669
+ children: /* @__PURE__ */ Y(e, {
670
+ items: _e(t),
671
+ title: j.moreActionsLabel,
672
+ closeLabel: j.closeLabel,
673
673
  matchReferenceWidth: !1,
674
674
  listClassName: "w-[200px]",
675
- children: /* @__PURE__ */ X(k, {
676
- icon: /* @__PURE__ */ X(B, {
675
+ children: /* @__PURE__ */ Y(k, {
676
+ icon: /* @__PURE__ */ Y(L, {
677
677
  size: x.MD,
678
678
  "aria-hidden": !0,
679
679
  stroke: S
680
680
  }),
681
- "aria-label": M.moreActionsLabel
681
+ "aria-label": j.moreActionsLabel
682
682
  })
683
683
  })
684
- }), ve = () => {
684
+ }), ye = () => {
685
685
  c || m();
686
- }, ye = () => n ? /* @__PURE__ */ X(re, {}) : r ? /* @__PURE__ */ Z("div", {
686
+ }, be = () => n ? /* @__PURE__ */ Y(oe, { ariaLabel: j.loadingAriaLabel ?? "Loading project" }) : r ? /* @__PURE__ */ X("div", {
687
687
  className: "flex flex-col items-center gap-3",
688
- children: [/* @__PURE__ */ X("p", {
688
+ children: [/* @__PURE__ */ Y("p", {
689
689
  "aria-hidden": !0,
690
- className: f(H, $.body),
691
- children: M.errorLabel
692
- }), /* @__PURE__ */ X(O, {
693
- label: M.retryLabel,
690
+ className: f(B, $.body),
691
+ children: j.errorLabel
692
+ }), /* @__PURE__ */ Y(O, {
693
+ label: j.retryLabel,
694
694
  onClick: E
695
695
  })]
696
- }) : /* @__PURE__ */ Z("div", {
696
+ }) : /* @__PURE__ */ X("div", {
697
697
  className: "flex flex-col items-center gap-3",
698
- children: [/* @__PURE__ */ X("p", {
699
- className: f(H, $.body),
700
- children: M.notFoundLabel
701
- }), /* @__PURE__ */ X(O, {
702
- label: M.browseProjectsLabel,
698
+ children: [/* @__PURE__ */ Y("p", {
699
+ className: f(B, $.body),
700
+ children: j.notFoundLabel
701
+ }), /* @__PURE__ */ Y(O, {
702
+ label: j.browseProjectsLabel,
703
703
  onClick: D
704
704
  })]
705
705
  });
706
- if (n || r || a || t == null) return /* @__PURE__ */ Z("div", {
707
- style: de,
706
+ if (n || r || a || t == null) return /* @__PURE__ */ X("div", {
707
+ style: pe,
708
708
  className: f("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
709
- children: [/* @__PURE__ */ X(P, {
709
+ children: [/* @__PURE__ */ Y(M, {
710
710
  visuallyHidden: !0,
711
- children: !n && r && M.errorLabel
712
- }), ye()]
711
+ children: !n && r && j.errorLabel
712
+ }), be()]
713
713
  });
714
- let be = () => fe.length === 0 ? /* @__PURE__ */ X(o, { label: M.emptyContextLabel }) : /* @__PURE__ */ Z(me, { children: [
715
- /* @__PURE__ */ X("div", {
714
+ let xe = () => me.length === 0 ? /* @__PURE__ */ Y(o, { label: j.emptyContextLabel }) : /* @__PURE__ */ X(J, { children: [
715
+ /* @__PURE__ */ Y("div", {
716
716
  role: "search",
717
- children: /* @__PURE__ */ X(ne, {
717
+ children: /* @__PURE__ */ Y(ae, {
718
718
  value: u,
719
719
  onChange: (e) => d(e ?? ""),
720
- placeholder: M.contextSearchPlaceholder,
721
- clearLabel: M.clearSearchLabel,
722
- "aria-label": M.contextSearchAriaLabel
720
+ placeholder: j.contextSearchPlaceholder,
721
+ clearLabel: j.clearSearchLabel,
722
+ "aria-label": j.contextSearchAriaLabel
723
723
  })
724
724
  }),
725
- W.length === 0 ? /* @__PURE__ */ X("p", {
726
- className: f(se, $.secondary),
727
- children: M.noContextMatchesLabel
728
- }) : /* @__PURE__ */ X("ul", {
725
+ H.length === 0 ? /* @__PURE__ */ Y("p", {
726
+ className: f(le, $.secondary),
727
+ children: j.noContextMatchesLabel
728
+ }) : /* @__PURE__ */ Y("ul", {
729
729
  className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
730
- children: W.map((e) => /* @__PURE__ */ X("li", {
730
+ children: H.map((e) => /* @__PURE__ */ Y("li", {
731
731
  className: "min-w-0",
732
- children: /* @__PURE__ */ X(he, {
732
+ children: /* @__PURE__ */ Y(ge, {
733
733
  attachment: at(e),
734
- searchQuery: G,
734
+ searchQuery: U,
735
735
  onClick: b,
736
736
  isSelected: e.name === C,
737
- labels: { clickLabel: M.openFileLabel(e.name) }
737
+ labels: { clickLabel: j.openFileLabel(e.name) }
738
738
  })
739
739
  }, e.name))
740
740
  }),
741
- /* @__PURE__ */ X(P, {
741
+ /* @__PURE__ */ Y(M, {
742
742
  visuallyHidden: !0,
743
- as: F.Span,
744
- children: G === "" ? "" : M.contextResultCountLabel(W.length)
743
+ as: ne.Span,
744
+ children: U === "" ? "" : j.contextResultCountLabel(H.length)
745
745
  })
746
- ] }), xe = !T;
747
- return /* @__PURE__ */ Z("div", {
748
- style: de,
746
+ ] }), Se = !T;
747
+ return /* @__PURE__ */ X("div", {
748
+ style: pe,
749
749
  className: f("flex size-full min-h-0 min-w-0 flex-1 flex-col", $.container),
750
- children: [/* @__PURE__ */ Z("header", {
750
+ children: [/* @__PURE__ */ X("header", {
751
751
  className: f("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
752
752
  children: [
753
- /* @__PURE__ */ X(k, {
754
- icon: /* @__PURE__ */ X(z, {
753
+ /* @__PURE__ */ Y(k, {
754
+ icon: /* @__PURE__ */ Y(I, {
755
755
  size: x.LG,
756
756
  className: "rtl:scale-x-[-1]",
757
757
  "aria-hidden": !0,
758
758
  stroke: S
759
759
  }),
760
- "aria-label": M.backLabel,
760
+ "aria-label": j.backLabel,
761
761
  onClick: p
762
762
  }),
763
- /* @__PURE__ */ X("h1", {
764
- className: f("min-w-0 flex-1", ee, $.title),
765
- children: /* @__PURE__ */ X(w, { text: t.name })
763
+ /* @__PURE__ */ Y("h1", {
764
+ className: f("min-w-0 flex-1", re, $.title),
765
+ children: /* @__PURE__ */ Y(w, { text: t.name })
766
766
  }),
767
- /* @__PURE__ */ X(O, {
768
- label: s ? M.unpinLabel : M.pinLabel,
769
- iconBefore: X(s ? it : oe, {
767
+ /* @__PURE__ */ Y(O, {
768
+ label: s ? j.unpinLabel : j.pinLabel,
769
+ iconBefore: Y(s ? it : z, {
770
770
  size: x.MD,
771
771
  "aria-hidden": !0,
772
772
  stroke: S
773
773
  }),
774
774
  "aria-disabled": c || void 0,
775
- onClick: ve,
775
+ onClick: ye,
776
776
  className: "shrink-0"
777
777
  }),
778
- h && /* @__PURE__ */ X(R, {
779
- label: M.publishLabel,
780
- iconBefore: /* @__PURE__ */ X(U, {
778
+ h && /* @__PURE__ */ Y(F, {
779
+ label: j.publishLabel,
780
+ iconBefore: /* @__PURE__ */ Y(fe, {
781
781
  size: x.MD,
782
782
  "aria-hidden": !0,
783
783
  stroke: S
@@ -785,9 +785,9 @@ var be = /* @__PURE__ */ function(e) {
785
785
  onClick: h,
786
786
  className: "hidden shrink-0 desktop:inline-flex"
787
787
  }),
788
- g && /* @__PURE__ */ X(R, {
789
- label: M.editLabel,
790
- iconBefore: /* @__PURE__ */ X(V, {
788
+ g && /* @__PURE__ */ Y(F, {
789
+ label: j.editLabel,
790
+ iconBefore: /* @__PURE__ */ Y(R, {
791
791
  size: x.MD,
792
792
  "aria-hidden": !0,
793
793
  stroke: S
@@ -795,56 +795,56 @@ var be = /* @__PURE__ */ function(e) {
795
795
  onClick: g,
796
796
  className: "hidden shrink-0 desktop:inline-flex"
797
797
  }),
798
- _e(!1, "hidden desktop:block"),
799
- _e(!0, "desktop:hidden")
798
+ ve(!1, "hidden desktop:block"),
799
+ ve(!0, "desktop:hidden")
800
800
  ]
801
- }), /* @__PURE__ */ Z("div", {
802
- className: f("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", xe && "desktop:flex-row desktop:overflow-hidden", A == null && xe && "desktop:justify-end"),
803
- children: [A != null && /* @__PURE__ */ X("section", {
804
- "aria-label": j,
805
- className: f("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", xe && "desktop:overflow-y-auto"),
806
- children: /* @__PURE__ */ X("div", {
801
+ }), /* @__PURE__ */ X("div", {
802
+ className: f("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", Se && "desktop:flex-row desktop:overflow-hidden", A == null && Se && "desktop:justify-end"),
803
+ children: [A != null && /* @__PURE__ */ Y("section", {
804
+ "aria-label": ee,
805
+ className: f("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", Se && "desktop:overflow-y-auto"),
806
+ children: /* @__PURE__ */ Y("div", {
807
807
  className: "mx-auto flex w-full max-w-[748px] min-w-0 flex-col gap-5",
808
808
  children: A
809
809
  })
810
- }), /* @__PURE__ */ Z("aside", {
811
- "aria-labelledby": pe,
812
- className: f("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", xe && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
810
+ }), /* @__PURE__ */ X("aside", {
811
+ "aria-labelledby": he,
812
+ className: f("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", Se && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
813
813
  children: [
814
- /* @__PURE__ */ X("h2", {
815
- id: pe,
816
- className: f(te, $.title),
817
- children: M.detailsLabel
814
+ /* @__PURE__ */ Y("h2", {
815
+ id: he,
816
+ className: f(ie, $.title),
817
+ children: j.detailsLabel
818
818
  }),
819
- t.description !== "" && /* @__PURE__ */ Z("section", {
819
+ t.description !== "" && /* @__PURE__ */ X("section", {
820
820
  className: "flex min-w-0 flex-col gap-1",
821
- children: [/* @__PURE__ */ X("h3", {
822
- className: f(ie, $.secondary),
823
- children: M.descriptionLabel
824
- }), /* @__PURE__ */ X("p", {
825
- className: f("wrap-break-word whitespace-pre-line", H, $.body),
821
+ children: [/* @__PURE__ */ Y("h3", {
822
+ className: f(se, $.secondary),
823
+ children: j.descriptionLabel
824
+ }), /* @__PURE__ */ Y("p", {
825
+ className: f("wrap-break-word whitespace-pre-line", B, $.body),
826
826
  children: t.description
827
827
  })]
828
828
  }),
829
- t.instructions !== "" && /* @__PURE__ */ Z("section", {
829
+ t.instructions !== "" && /* @__PURE__ */ X("section", {
830
830
  className: "flex min-w-0 flex-col gap-1",
831
- children: [/* @__PURE__ */ X("h3", {
832
- className: f(ie, $.secondary),
833
- children: M.instructionsLabel
834
- }), /* @__PURE__ */ X("div", {
835
- className: f("min-w-0 wrap-break-word", H, $.body),
836
- children: /* @__PURE__ */ X(i, {
831
+ children: [/* @__PURE__ */ Y("h3", {
832
+ className: f(se, $.secondary),
833
+ children: j.instructionsLabel
834
+ }), /* @__PURE__ */ Y("div", {
835
+ className: f("min-w-0 wrap-break-word", B, $.body),
836
+ children: /* @__PURE__ */ Y(i, {
837
837
  content: t.instructions,
838
- classNames: J
838
+ classNames: K
839
839
  })
840
840
  })]
841
841
  }),
842
- /* @__PURE__ */ Z("section", {
842
+ /* @__PURE__ */ X("section", {
843
843
  className: "flex min-w-0 flex-col gap-2",
844
- children: [/* @__PURE__ */ X("h3", {
845
- className: f(ie, $.secondary),
846
- children: M.contextLabel
847
- }), be()]
844
+ children: [/* @__PURE__ */ Y("h3", {
845
+ className: f(se, $.secondary),
846
+ children: j.contextLabel
847
+ }), xe()]
848
848
  })
849
849
  ]
850
850
  })]
@@ -855,7 +855,7 @@ var be = /* @__PURE__ */ function(e) {
855
855
  readDot: "_readDot_1030u_6",
856
856
  unreadDot: "_unreadDot_1030u_10"
857
857
  }, ct = ({ item: t, labels: n, rowTitleClassName: r, unreadRowTitleClassName: i, onOpen: a, onRename: o, onDelete: s }) => {
858
- let c = K(), [l, u] = Y(!1), d = t.isUnread === !0, p = q(() => [...o ? [{
858
+ let c = W(), [l, u] = q(!1), d = t.isUnread === !0, p = G(() => [...o ? [{
859
859
  key: "rename",
860
860
  label: n.renameLabel,
861
861
  onClick: () => o(t.id)
@@ -871,48 +871,48 @@ var be = /* @__PURE__ */ function(e) {
871
871
  s,
872
872
  o
873
873
  ]);
874
- return /* @__PURE__ */ Z("li", {
874
+ return /* @__PURE__ */ X("li", {
875
875
  className: f("group/row flex min-w-0 items-center gap-1 rounded-xl", st.row),
876
876
  children: [
877
- /* @__PURE__ */ Z("button", {
877
+ /* @__PURE__ */ X("button", {
878
878
  type: "button",
879
879
  "aria-label": n.openLabel(t.title, t.authorName),
880
880
  "aria-describedby": d ? c : void 0,
881
881
  className: "flex min-w-0 flex-1 items-center gap-3 rounded-xl p-3 text-start focus-visible:outline-2 focus-visible:-outline-offset-2",
882
882
  onClick: () => a(t.id),
883
883
  children: [
884
- t.leading ?? /* @__PURE__ */ X("span", {
884
+ t.leading ?? /* @__PURE__ */ Y("span", {
885
885
  "aria-hidden": !0,
886
886
  className: "flex size-4 shrink-0 items-center justify-center",
887
- children: /* @__PURE__ */ X("span", { className: f("size-[7.11px] rounded-full", d ? st.unreadDot : st.readDot) })
887
+ children: /* @__PURE__ */ Y("span", { className: f("size-[7.11px] rounded-full", d ? st.unreadDot : st.readDot) })
888
888
  }),
889
- /* @__PURE__ */ X(w, {
889
+ /* @__PURE__ */ Y(w, {
890
890
  text: t.title,
891
891
  className: f("min-w-0 flex-1", d ? i : r)
892
892
  }),
893
- t.trailing ?? (d && t.leading != null && /* @__PURE__ */ X("span", {
893
+ t.trailing ?? (d && t.leading != null && /* @__PURE__ */ Y("span", {
894
894
  "aria-hidden": !0,
895
895
  className: "flex size-6 shrink-0 items-center justify-center",
896
- children: /* @__PURE__ */ X("span", { className: f("size-[7.11px] rounded-full", st.unreadDot) })
896
+ children: /* @__PURE__ */ Y("span", { className: f("size-[7.11px] rounded-full", st.unreadDot) })
897
897
  }))
898
898
  ]
899
899
  }),
900
- d && /* @__PURE__ */ X("span", {
900
+ d && /* @__PURE__ */ Y("span", {
901
901
  id: c,
902
902
  className: "sr-only",
903
903
  children: n.unreadLabel ?? "Unread"
904
904
  }),
905
- p.length > 0 && /* @__PURE__ */ X(e, {
905
+ p.length > 0 && /* @__PURE__ */ Y(e, {
906
906
  items: p,
907
907
  title: n.moreActionsLabel(t.title),
908
908
  closeLabel: n.closeLabel,
909
909
  placement: "bottom-end",
910
910
  onOpenChange: u,
911
- children: /* @__PURE__ */ X(k, {
911
+ children: /* @__PURE__ */ Y(k, {
912
912
  "aria-label": n.moreActionsLabel(t.title),
913
913
  size: C.Small,
914
914
  className: f("me-2 shrink-0", !l && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
915
- icon: /* @__PURE__ */ X(B, {
915
+ icon: /* @__PURE__ */ Y(L, {
916
916
  "aria-hidden": !0,
917
917
  size: x.SM,
918
918
  stroke: S
@@ -921,8 +921,8 @@ var be = /* @__PURE__ */ function(e) {
921
921
  })
922
922
  ]
923
923
  });
924
- }, lt = W(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, isEmptyStateShown: c = !0, onOpen: u, onRename: d, onDelete: p, labels: m, typography: h, colors: g }) => {
925
- let _ = K(), v = h?.titleClassName ?? "dial-body-semi-text", y = h?.rowTitleClassName ?? "dial-body-text", b = h?.unreadRowTitleClassName ?? "dial-body-semi-text", x = q(() => l({
924
+ }, lt = H(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, isEmptyStateShown: c = !0, onOpen: u, onRename: d, onDelete: p, labels: m, typography: h, colors: g }) => {
925
+ let _ = W(), v = h?.titleClassName ?? "dial-body-semi-text", y = h?.rowTitleClassName ?? "dial-body-text", b = h?.unreadRowTitleClassName ?? "dial-body-semi-text", x = G(() => l({
926
926
  "--pcl-read-dot": g?.readDot,
927
927
  "--pcl-unread-dot": g?.unreadDot,
928
928
  "--pcl-row-hover": g?.rowHoverBackground
@@ -931,50 +931,50 @@ var be = /* @__PURE__ */ function(e) {
931
931
  g?.unreadDot,
932
932
  g?.rowHoverBackground
933
933
  ]), S = h?.messageClassName ?? "dial-small-text", C = !t && !n && e.length === 0;
934
- return C && !c ? null : /* @__PURE__ */ Z("section", {
934
+ return C && !c ? null : /* @__PURE__ */ X("section", {
935
935
  "aria-labelledby": C ? void 0 : _,
936
936
  "aria-label": C ? m.title : void 0,
937
937
  className: "flex min-w-0 flex-col gap-2 pt-3",
938
938
  style: x,
939
939
  children: [
940
- !C && /* @__PURE__ */ X("h2", {
940
+ !C && /* @__PURE__ */ Y("h2", {
941
941
  id: _,
942
942
  className: f("m-0", v),
943
943
  children: m.title
944
944
  }),
945
- /* @__PURE__ */ X(P, {
945
+ /* @__PURE__ */ Y(M, {
946
946
  visuallyHidden: !0,
947
- children: t ? m.loadingLabel : n ? m.errorLabel : C ? /* @__PURE__ */ Z(me, { children: [
948
- /* @__PURE__ */ X("span", { children: m.emptyTitle }),
947
+ children: t ? m.loadingLabel : n ? m.errorLabel : C ? /* @__PURE__ */ X(J, { children: [
948
+ /* @__PURE__ */ Y("span", { children: m.emptyTitle }),
949
949
  " ",
950
- /* @__PURE__ */ X("span", { children: m.emptyDescription })
950
+ /* @__PURE__ */ Y("span", { children: m.emptyDescription })
951
951
  ] }) : null
952
952
  }),
953
- t ? /* @__PURE__ */ X("div", {
953
+ t ? /* @__PURE__ */ Y("div", {
954
954
  className: "flex justify-center py-6",
955
- children: /* @__PURE__ */ X("span", {
955
+ children: /* @__PURE__ */ Y("span", {
956
956
  "aria-hidden": !0,
957
- children: /* @__PURE__ */ X(re, {})
957
+ children: /* @__PURE__ */ Y(oe, {})
958
958
  })
959
- }) : n ? /* @__PURE__ */ Z("div", {
959
+ }) : n ? /* @__PURE__ */ X("div", {
960
960
  className: "flex flex-col items-center gap-3 py-6 text-center",
961
- children: [/* @__PURE__ */ X("p", {
961
+ children: [/* @__PURE__ */ Y("p", {
962
962
  "aria-hidden": !0,
963
963
  className: f("m-0", S),
964
964
  children: m.errorLabel
965
- }), /* @__PURE__ */ X(O, {
965
+ }), /* @__PURE__ */ Y(O, {
966
966
  label: m.retryLabel,
967
967
  onClick: r
968
968
  })]
969
- }) : C ? /* @__PURE__ */ X("div", {
969
+ }) : C ? /* @__PURE__ */ Y("div", {
970
970
  "aria-hidden": !0,
971
- children: /* @__PURE__ */ X(o, {
971
+ children: /* @__PURE__ */ Y(o, {
972
972
  label: m.emptyTitle,
973
973
  description: m.emptyDescription
974
974
  })
975
- }) : /* @__PURE__ */ Z(me, { children: [/* @__PURE__ */ X("ul", {
975
+ }) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("ul", {
976
976
  className: "m-0 flex min-w-0 list-none flex-col gap-2 p-0",
977
- children: e.map((e) => /* @__PURE__ */ X(ct, {
977
+ children: e.map((e) => /* @__PURE__ */ Y(ct, {
978
978
  item: e,
979
979
  labels: m,
980
980
  rowTitleClassName: y,
@@ -983,7 +983,7 @@ var be = /* @__PURE__ */ function(e) {
983
983
  onRename: d,
984
984
  onDelete: p
985
985
  }, e.id))
986
- }), i && s && /* @__PURE__ */ X(N, {
986
+ }), i && s && /* @__PURE__ */ Y(te, {
987
987
  className: "self-start",
988
988
  label: m.loadMoreLabel ?? "See more",
989
989
  disabled: a,
@@ -991,49 +991,49 @@ var be = /* @__PURE__ */ function(e) {
991
991
  })] })
992
992
  ]
993
993
  });
994
- }), ut = W(({ composer: e, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: l, onLoadMore: u, onOpen: d, onRename: f, onDelete: p, labels: m, listTypography: h, listColors: g }) => {
995
- let v = K(), b = J(null), [x, S] = Y(null), [C, w] = Y(""), [T, E] = Y(), [D, O] = Y(!1), [k, A] = Y(null), [M, N] = Y(!1), P = J(null), F = G(() => {
996
- P.current = document.activeElement;
997
- }, []), I = G(() => {
998
- let e = P.current;
999
- P.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
1000
- }, []), L = G((e) => {
1001
- P.current = null, window.setTimeout(() => {
994
+ }), ut = H(({ composer: e, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: l, onLoadMore: u, onOpen: d, onRename: f, onDelete: p, labels: m, listTypography: h, listColors: g }) => {
995
+ let v = W(), b = K(null), [x, S] = q(null), [C, w] = q(""), [T, E] = q(), [D, O] = q(!1), [k, A] = q(null), [j, te] = q(!1), M = K(null), ne = U(() => {
996
+ M.current = document.activeElement;
997
+ }, []), N = U(() => {
998
+ let e = M.current;
999
+ M.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
1000
+ }, []), P = U((e) => {
1001
+ M.current = null, window.setTimeout(() => {
1002
1002
  let t = b.current;
1003
1003
  if (!t) return;
1004
1004
  let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
1005
1005
  r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
1006
1006
  }, 0);
1007
- }, []), R = G((e) => i.find((t) => t.id === e) ?? null, [i]);
1008
- pe(() => {
1007
+ }, []), F = U((e) => i.find((t) => t.id === e) ?? null, [i]);
1008
+ he(() => {
1009
1009
  let e = (e) => e != null && i.some((t) => t.id === e.id);
1010
- x && !D && !e(x) && (S(null), L(0)), k && !M && !e(k) && (A(null), L(0));
1010
+ x && !D && !e(x) && (S(null), P(0)), k && !j && !e(k) && (A(null), P(0));
1011
1011
  }, [
1012
1012
  k,
1013
- L,
1014
- M,
1013
+ P,
1014
+ j,
1015
1015
  D,
1016
1016
  i,
1017
1017
  x
1018
1018
  ]);
1019
- let ne = G((e) => {
1020
- F();
1021
- let t = R(e);
1019
+ let ae = U((e) => {
1020
+ ne();
1021
+ let t = F(e);
1022
1022
  S(t), w(t?.title ?? ""), E(void 0);
1023
- }, [R, F]), re = G((e) => {
1024
- F(), A(R(e));
1025
- }, [R, F]), z = G(() => {
1026
- D || (S(null), I());
1027
- }, [D, I]), ie = G(() => {
1028
- M || (A(null), I());
1029
- }, [M, I]), B = G(async () => {
1023
+ }, [F, ne]), oe = U((e) => {
1024
+ ne(), A(F(e));
1025
+ }, [F, ne]), I = U(() => {
1026
+ D || (S(null), N());
1027
+ }, [D, N]), se = U(() => {
1028
+ j || (A(null), N());
1029
+ }, [j, N]), L = U(async () => {
1030
1030
  if (!x || !f || D) return;
1031
1031
  let e = C.trim();
1032
1032
  if (!e) E(m.renameEmptyError);
1033
1033
  else {
1034
1034
  O(!0);
1035
1035
  try {
1036
- await f(x.id, e), S(null), I();
1036
+ await f(x.id, e), S(null), N();
1037
1037
  } catch {} finally {
1038
1038
  O(!1);
1039
1039
  }
@@ -1044,50 +1044,50 @@ var be = /* @__PURE__ */ function(e) {
1044
1044
  f,
1045
1045
  x,
1046
1046
  C,
1047
- I
1048
- ]), ae = G((e) => {
1049
- e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), B());
1050
- }, [B]), V = G(async () => {
1047
+ N
1048
+ ]), ce = U((e) => {
1049
+ e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), L());
1050
+ }, [L]), R = U(async () => {
1051
1051
  if (!k || !p) return;
1052
1052
  let e = i.findIndex((e) => e.id === k.id);
1053
- N(!0);
1053
+ te(!0);
1054
1054
  try {
1055
- await p(k.id), A(null), L(Math.max(e, 0));
1055
+ await p(k.id), A(null), P(Math.max(e, 0));
1056
1056
  } catch {} finally {
1057
- N(!1);
1057
+ te(!1);
1058
1058
  }
1059
1059
  }, [
1060
1060
  k,
1061
- L,
1061
+ P,
1062
1062
  i,
1063
1063
  p
1064
- ]), oe = q(() => [{
1064
+ ]), z = G(() => [{
1065
1065
  label: m.renameCancelLabel ?? "Cancel",
1066
1066
  variant: y.Primary,
1067
1067
  appearance: _.Ghost,
1068
1068
  disabled: D,
1069
- onClick: z
1069
+ onClick: I
1070
1070
  }, {
1071
1071
  label: m.renameSaveLabel,
1072
1072
  variant: y.Primary,
1073
1073
  disabled: D,
1074
1074
  onClick: () => {
1075
- B();
1075
+ L();
1076
1076
  }
1077
1077
  }], [
1078
- z,
1079
- B,
1078
+ I,
1079
+ L,
1080
1080
  D,
1081
1081
  m.renameCancelLabel,
1082
1082
  m.renameSaveLabel
1083
1083
  ]);
1084
- return /* @__PURE__ */ Z(me, { children: [
1084
+ return /* @__PURE__ */ X(J, { children: [
1085
1085
  e,
1086
1086
  n,
1087
- /* @__PURE__ */ X("div", {
1087
+ /* @__PURE__ */ Y("div", {
1088
1088
  ref: b,
1089
1089
  className: "contents",
1090
- children: /* @__PURE__ */ X(lt, {
1090
+ children: /* @__PURE__ */ Y(lt, {
1091
1091
  items: i,
1092
1092
  isLoading: a,
1093
1093
  hasError: o,
@@ -1097,45 +1097,45 @@ var be = /* @__PURE__ */ function(e) {
1097
1097
  onLoadMore: u,
1098
1098
  isEmptyStateShown: !r,
1099
1099
  onOpen: d,
1100
- onRename: f ? ne : void 0,
1101
- onDelete: p ? re : void 0,
1100
+ onRename: f ? ae : void 0,
1101
+ onDelete: p ? oe : void 0,
1102
1102
  labels: m.list,
1103
1103
  typography: h,
1104
1104
  colors: g
1105
1105
  })
1106
1106
  }),
1107
- x && /* @__PURE__ */ X(ee, {
1107
+ x && /* @__PURE__ */ Y(re, {
1108
1108
  open: !0,
1109
1109
  header: m.renameTitle,
1110
- size: te.Sm,
1111
- mainButtons: oe,
1112
- onClose: z,
1113
- children: /* @__PURE__ */ X("div", {
1110
+ size: ie.Sm,
1111
+ mainButtons: z,
1112
+ onClose: I,
1113
+ children: /* @__PURE__ */ Y("div", {
1114
1114
  className: "px-6 py-4",
1115
- children: /* @__PURE__ */ X(j, {
1115
+ children: /* @__PURE__ */ Y(ee, {
1116
1116
  id: v,
1117
1117
  value: C,
1118
1118
  labelProps: { label: m.renameInputLabel },
1119
1119
  error: T,
1120
1120
  disabled: D,
1121
- onKeyDown: ae,
1121
+ onKeyDown: ce,
1122
1122
  onChange: (e) => {
1123
1123
  w(e ?? ""), E(void 0);
1124
1124
  }
1125
1125
  })
1126
1126
  })
1127
1127
  }),
1128
- k && /* @__PURE__ */ X(t, {
1128
+ k && /* @__PURE__ */ Y(t, {
1129
1129
  open: !0,
1130
1130
  title: m.deleteTitle(k.title),
1131
1131
  names: [k.title],
1132
1132
  message: m.deleteDescription,
1133
1133
  labels: m.deleteDialog,
1134
- isLoading: M,
1134
+ isLoading: j,
1135
1135
  onConfirm: () => {
1136
- V();
1136
+ R();
1137
1137
  },
1138
- onClose: ie
1138
+ onClose: se
1139
1139
  })
1140
1140
  ] });
1141
1141
  }), dt = {
@@ -1147,51 +1147,51 @@ var be = /* @__PURE__ */ function(e) {
1147
1147
  contentType: e.contentType,
1148
1148
  type: u(e.contentType),
1149
1149
  status: s.Idle
1150
- }), mt = W(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = ft, labels: o, styles: s }) => {
1151
- let c = K(), u = K(), d = J(null), p = J(!1), [m, h] = Y(!1), { colors: g, typography: _ } = s ?? {}, v = _?.titleClassName ?? "dial-body-semi-text", y = _?.helperClassName ?? "dial-tiny-text", b = o?.title ?? "Outputs", x = o?.errorLabel ?? "Could not load outputs", S = q(() => l({
1150
+ }), mt = H(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = ft, labels: o, styles: s }) => {
1151
+ let c = W(), u = W(), d = K(null), p = K(!1), [m, h] = q(!1), { colors: g, typography: _ } = s ?? {}, v = _?.titleClassName ?? "dial-body-semi-text", y = _?.helperClassName ?? "dial-tiny-text", b = o?.title ?? "Outputs", x = o?.errorLabel ?? "Could not load outputs", S = G(() => l({
1152
1152
  "--po-heading-text": g?.headingText,
1153
1153
  "--po-secondary-text": g?.secondaryText
1154
- }), [g?.headingText, g?.secondaryText]), C = G(() => h((e) => !e), []), w = G(() => {
1154
+ }), [g?.headingText, g?.secondaryText]), C = U(() => h((e) => !e), []), w = U(() => {
1155
1155
  p.current = !0, i?.();
1156
1156
  }, [i]);
1157
- pe(() => {
1157
+ he(() => {
1158
1158
  !r && p.current && (p.current = !1, d.current?.focus());
1159
1159
  }, [r]);
1160
- let T = r || e.length > 0, E = e.length > a, D = m || !E ? e : e.slice(0, a), k = o?.openOutputLabel ?? ((e) => `Preview ${e}`), A = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, j = o?.showLessLabel ?? "Show less";
1161
- return /* @__PURE__ */ Z("div", {
1160
+ let T = r || e.length > 0, E = e.length > a, D = m || !E ? e : e.slice(0, a), k = o?.openOutputLabel ?? ((e) => `Preview ${e}`), A = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, ee = o?.showLessLabel ?? "Show less";
1161
+ return /* @__PURE__ */ X("div", {
1162
1162
  className: "contents",
1163
1163
  style: S,
1164
- children: [T && /* @__PURE__ */ Z("section", {
1164
+ children: [T && /* @__PURE__ */ X("section", {
1165
1165
  "aria-labelledby": c,
1166
1166
  className: "flex min-w-0 flex-col gap-2 pt-3",
1167
- children: [/* @__PURE__ */ Z("div", {
1167
+ children: [/* @__PURE__ */ X("div", {
1168
1168
  className: "flex min-w-0 items-center justify-between gap-2",
1169
- children: [/* @__PURE__ */ X("h2", {
1169
+ children: [/* @__PURE__ */ Y("h2", {
1170
1170
  ref: d,
1171
1171
  id: c,
1172
1172
  tabIndex: -1,
1173
1173
  className: f("m-0", dt.title, v),
1174
1174
  children: b
1175
- }), !r && E && /* @__PURE__ */ X(N, {
1176
- label: m ? j : A,
1175
+ }), !r && E && /* @__PURE__ */ Y(te, {
1176
+ label: m ? ee : A,
1177
1177
  "aria-expanded": m,
1178
1178
  "aria-controls": u,
1179
1179
  onClick: C
1180
1180
  })]
1181
- }), r ? /* @__PURE__ */ Z(me, { children: [/* @__PURE__ */ X("p", {
1181
+ }), r ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("p", {
1182
1182
  "aria-hidden": !0,
1183
1183
  className: f("m-0", dt.secondary, y),
1184
1184
  children: x
1185
- }), i && /* @__PURE__ */ X(O, {
1185
+ }), i && /* @__PURE__ */ Y(O, {
1186
1186
  className: "self-start",
1187
1187
  label: o?.retryLabel ?? "Retry",
1188
1188
  onClick: w
1189
- })] }) : /* @__PURE__ */ X("ul", {
1189
+ })] }) : /* @__PURE__ */ Y("ul", {
1190
1190
  id: u,
1191
1191
  className: f("m-0 flex min-w-0 list-none gap-2 p-0", m ? "flex-wrap" : "flex-nowrap overflow-x-auto"),
1192
- children: D.map((e) => /* @__PURE__ */ X("li", {
1192
+ children: D.map((e) => /* @__PURE__ */ Y("li", {
1193
1193
  className: "shrink-0",
1194
- children: /* @__PURE__ */ X(he, {
1194
+ children: /* @__PURE__ */ Y(ge, {
1195
1195
  attachment: pt(e),
1196
1196
  onClick: t,
1197
1197
  isSelected: e.name === n,
@@ -1199,32 +1199,32 @@ var be = /* @__PURE__ */ function(e) {
1199
1199
  })
1200
1200
  }, e.name))
1201
1201
  })]
1202
- }), /* @__PURE__ */ X(P, {
1202
+ }), /* @__PURE__ */ Y(M, {
1203
1203
  visuallyHidden: !0,
1204
1204
  children: r ? x : ""
1205
1205
  })]
1206
1206
  });
1207
- }), ht = W(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Z("nav", {
1207
+ }), ht = H(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ X("nav", {
1208
1208
  "aria-label": i,
1209
1209
  className: f("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1210
- children: [/* @__PURE__ */ X(k, {
1210
+ children: [/* @__PURE__ */ Y(k, {
1211
1211
  "aria-label": i,
1212
- icon: /* @__PURE__ */ X(z, {
1212
+ icon: /* @__PURE__ */ Y(I, {
1213
1213
  "aria-hidden": !0,
1214
1214
  size: x.MD,
1215
1215
  stroke: S,
1216
1216
  className: "rtl:scale-x-[-1]"
1217
1217
  }),
1218
1218
  onClick: n
1219
- }), /* @__PURE__ */ X("a", {
1219
+ }), /* @__PURE__ */ Y("a", {
1220
1220
  href: t,
1221
1221
  onClick: r,
1222
1222
  className: "min-w-0 hover:underline focus-visible:underline",
1223
- children: /* @__PURE__ */ X(w, {
1223
+ children: /* @__PURE__ */ Y(w, {
1224
1224
  text: e,
1225
1225
  className: f("min-w-0", o)
1226
1226
  })
1227
1227
  })]
1228
1228
  }));
1229
1229
  //#endregion
1230
- export { Ie as ContextFileRejection, Re as PROJECT_NAME_MAX_BYTES, ht as ProjectChatHeader, lt as ProjectConversationList, ut as ProjectConversationsPanel, rt as ProjectCreateForm, Le as ProjectNameError, mt as ProjectOutputs, Ne as ProjectSource, ot as ProjectView, Me as Projects, be as ProjectsSortKey, Qe as checkContextFiles, $e as filterContextFileItems, qe as getContextFilesSize, Ge as isStoredContextFile, Ue as validateProjectName };
1230
+ export { Ie as ContextFileRejection, Re as PROJECT_NAME_MAX_BYTES, ht as ProjectChatHeader, lt as ProjectConversationList, ut as ProjectConversationsPanel, rt as ProjectCreateForm, Le as ProjectNameError, mt as ProjectOutputs, Ne as ProjectSource, ot as ProjectView, Me as Projects, xe as ProjectsSortKey, Qe as checkContextFiles, $e as filterContextFileItems, qe as getContextFilesSize, Ge as isStoredContextFile, Ue as validateProjectName };