@epam/ai-dial-projects 1.3.0-dev.256 → 1.3.0-dev.260

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,267 +1,302 @@
1
- import { DeleteConfirmationDialog as e, InitialsAvatar 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 ee, getAttachmentTypeFromMime as l, inferMimeTypeFromPath as u, mergeClasses as d, useAvailableHeightCap as f, useTextRefinement as p } from "@epam/ai-dial-chat-shared";
2
- import { Button as m, ButtonAppearance as h, ButtonDropdown as g, ButtonVariant as _, CardShell as v, DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, Dropdown as x, ElementSize as S, EllipsisTooltip as C, ErrorText as w, FileDropzone as T, FolderPath as E, GhostButton as D, GhostIconButton as O, Highlight as k, Input as te, Label as A, LiveRegion as j, LiveRegionElement as ne, LiveRegionPoliteness as M, MenuItemMark as N, NeutralButton as re, Popup as P, PopupSize as ie, ProgressBar as F, ProgressBarRole as I, Search as L, Spinner as ae, Textarea as R } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowNarrowLeft as z, IconArrowsSort as oe, IconDotsVertical as se, IconPin as ce, IconPinFilled as le } from "@tabler/icons-react";
4
- import { Suspense as ue, lazy as de, memo as B, useCallback as V, useEffect as fe, useId as H, useMemo as U, useRef as W, useState as G } from "react";
5
- import { Fragment as pe, jsx as K, jsxs as q } from "react/jsx-runtime";
6
- import { AttachmentCard as me, FileDndOverlay as he } from "@epam/ai-dial-attachment-input";
7
- import { BuilderFormContainer as ge } from "@epam/ai-dial-builder-form";
8
- import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
1
+ import { DeleteConfirmationDialog as e, InitialsAvatar 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 ee, getAttachmentTypeFromMime as l, inferMimeTypeFromPath as u, mergeClasses as d, useAvailableHeightCap as f, useIsMobile as p, useTextRefinement as m } from "@epam/ai-dial-chat-shared";
2
+ import { Button as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, Dropdown 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, LiveRegion as te, LiveRegionElement as N, LiveRegionPoliteness as P, MenuItemMark as F, NeutralButton as ne, Popup as re, PopupSize as ie, ProgressBar as I, ProgressBarRole as L, Search as ae, Spinner as oe, Textarea as se } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowNarrowLeft as ce, IconArrowsSort as le, IconDotsVertical as ue, IconPin as R, IconPinFilled as de, IconPlus as fe } from "@tabler/icons-react";
4
+ import { Suspense as pe, lazy as z, memo as B, useCallback as V, useEffect as me, useId as H, useMemo as U, useRef as W, useState as G } from "react";
5
+ import { Fragment as he, jsx as K, jsxs as q } from "react/jsx-runtime";
6
+ import { AttachmentCard as ge, FileDndOverlay as _e } from "@epam/ai-dial-attachment-input";
7
+ import { BuilderFormContainer as ve } from "@epam/ai-dial-builder-form";
8
+ import { LazyMarkdownEditor as J } from "@epam/ai-dial-ui-kit/editors";
9
9
  //#region src/types/projects-sort-key.ts
10
- var ve = /* @__PURE__ */ function(e) {
10
+ var Y = /* @__PURE__ */ function(e) {
11
11
  return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
12
- }({}), J = (e, t) => {
12
+ }({}), ye = (e, t) => {
13
13
  let n = t.trim().toLocaleLowerCase();
14
14
  return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
15
- }, ye = (e, t, n) => {
15
+ }, be = (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 === ve.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
- let o = t === ve.Oldest ? 1 : -1;
20
+ if (t === Y.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
+ let o = t === Y.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
- }, be = 60, xe = 3600, Y = 24 * xe, Se = [
27
- ["year", 365 * Y],
28
- ["month", 30 * Y],
29
- ["week", 7 * Y],
30
- ["day", Y],
31
- ["hour", xe],
32
- ["minute", be]
33
- ], Ce = (e, t, n) => {
26
+ }, xe = 60, Se = 3600, X = 24 * Se, Ce = [
27
+ ["year", 365 * X],
28
+ ["month", 30 * X],
29
+ ["week", 7 * X],
30
+ ["day", X],
31
+ ["hour", Se],
32
+ ["minute", xe]
33
+ ], we = (e, t, n) => {
34
34
  let r = (t - e) / 1e3;
35
- for (let [e, t] of Se) {
35
+ for (let [e, t] of Ce) {
36
36
  let i = Math.floor(r / t);
37
37
  if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
38
38
  }
39
39
  return new Intl.RelativeTimeFormat(n, { numeric: "auto" }).format(0, "second");
40
- }, X = {
41
- card: "_card_1cdi4_1",
42
- title: "_title_1cdi4_5",
43
- updatedAt: "_updatedAt_1cdi4_9",
44
- path: "_path_1cdi4_13",
45
- pin: "_pin_1cdi4_17",
46
- link: "_link_1cdi4_23",
47
- aboveLink: "_aboveLink_1cdi4_39",
48
- interactive: "_interactive_1cdi4_44"
49
- }, we = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Te = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ee = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, href: a, onOpen: o, now: s, locale: c, updatedAtClassName: ee, titleClassName: l, pathLabelClassName: u, pathLeafClassName: f }) => {
50
- let p = /* @__PURE__ */ K(k, {
40
+ }, Z = {
41
+ card: "_card_1gkfw_1",
42
+ title: "_title_1gkfw_5",
43
+ updatedAt: "_updatedAt_1gkfw_9",
44
+ path: "_path_1gkfw_13",
45
+ pin: "_pin_1gkfw_17",
46
+ pinToggle: "_pinToggle_1gkfw_22",
47
+ pinToggleIdle: "_pinToggleIdle_1gkfw_29",
48
+ link: "_link_1gkfw_39",
49
+ aboveLink: "_aboveLink_1gkfw_55",
50
+ interactive: "_interactive_1gkfw_60"
51
+ }, Te = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Ee = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, De = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: ee, locale: l, updatedAtClassName: u, titleClassName: f, pathLabelClassName: p, pathLeafClassName: m }) => {
52
+ let h = /* @__PURE__ */ K(A, {
51
53
  text: e.name,
52
54
  query: t,
53
55
  maxLines: 1,
54
- className: d("min-w-0", l, X.title, a != null && X.aboveLink)
56
+ className: d("min-w-0", f, Z.title, s != null && Z.aboveLink)
55
57
  });
56
58
  return /* @__PURE__ */ K("li", {
57
59
  className: "flex min-w-0",
58
- children: /* @__PURE__ */ q(v, {
60
+ children: /* @__PURE__ */ q(y, {
59
61
  "aria-label": e.name,
60
- className: d("relative flex w-full min-w-0 flex-col gap-2", X.card, a != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", a != null && X.interactive),
62
+ className: d("relative flex w-full min-w-0 flex-col gap-2", Z.card, s != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", s != null && Z.interactive),
61
63
  children: [
62
64
  e.updatedAt != null && /* @__PURE__ */ K("time", {
63
65
  dateTime: new Date(e.updatedAt).toISOString(),
64
- className: d(ee, X.updatedAt),
65
- children: Ce(e.updatedAt, s, c)
66
+ className: d(u, Z.updatedAt, (e.isPinned || o != null) && "pe-6"),
67
+ children: we(e.updatedAt, ee, l)
66
68
  }),
67
69
  /* @__PURE__ */ q("div", {
68
- className: "flex min-w-0 items-center gap-2",
69
- children: [a == null ? /* @__PURE__ */ K("div", {
70
+ className: d("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
71
+ children: [s == null ? /* @__PURE__ */ K("div", {
70
72
  className: "min-w-0 flex-1",
71
- children: p
73
+ children: h
72
74
  }) : /* @__PURE__ */ K("a", {
73
- href: a,
75
+ href: s,
74
76
  onClick: (t) => {
75
- o != null && Te(t) && (t.preventDefault(), o(e.id));
77
+ c != null && Ee(t) && (t.preventDefault(), c(e.id));
76
78
  },
77
- className: d("min-w-0 flex-1", X.link),
78
- children: p
79
- }), e.isPinned && /* @__PURE__ */ q("span", {
80
- className: d("shrink-0", X.pin),
81
- children: [/* @__PURE__ */ K(le, {
82
- size: y.SM,
79
+ className: d("min-w-0 flex-1", Z.link),
80
+ children: h
81
+ }), o == null ? e.isPinned && /* @__PURE__ */ q("span", {
82
+ className: d("absolute inset-e-5 top-5 flex", Z.pin),
83
+ children: [/* @__PURE__ */ K(de, {
84
+ size: b.SM,
83
85
  "aria-hidden": !0
84
86
  }), /* @__PURE__ */ K("span", {
85
87
  className: "sr-only",
86
88
  children: i
87
89
  })]
90
+ }) : /* @__PURE__ */ K(k, {
91
+ size: C.Small,
92
+ icon: e.isPinned ? /* @__PURE__ */ K(de, {
93
+ size: b.SM,
94
+ "aria-hidden": !0
95
+ }) : /* @__PURE__ */ K(R, {
96
+ size: b.SM,
97
+ "aria-hidden": !0,
98
+ stroke: x
99
+ }),
100
+ "aria-label": a,
101
+ "aria-pressed": e.isPinned === !0,
102
+ onClick: () => o(e.id, !e.isPinned),
103
+ className: d("absolute inset-e-4 top-4", Z.pinToggle, !e.isPinned && Z.pinToggleIdle)
88
104
  })]
89
105
  }),
90
- /* @__PURE__ */ K(E, {
91
- segments: we(n, e.parentPath),
106
+ /* @__PURE__ */ K(D, {
107
+ segments: Te(n, e.parentPath),
92
108
  ariaLabel: r,
93
- labelClassName: d(u, X.path),
94
- leafClassName: d(f, X.path),
95
- className: d(a != null && X.aboveLink)
109
+ labelClassName: d(p, Z.path),
110
+ leafClassName: d(m, Z.path),
111
+ className: d(s != null && Z.aboveLink)
96
112
  })
97
113
  ]
98
114
  })
99
115
  });
100
- }, Z = {
101
- container: "_container_qfuxj_1",
102
- subtitle: "_subtitle_qfuxj_5",
103
- sortButton: "_sortButton_qfuxj_9"
104
- }, De = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onOpenProject: s, getProjectHref: c, searchQuery: l, onSearchQueryChange: u, sortKey: f, onSortKeyChange: p, labels: v, locale: x, styles: C }) => {
105
- let { colors: w, typography: T } = C ?? {}, E = T?.titleClassName ?? "dial-h2-text", O = T?.subtitleClassName ?? "dial-body-text", k = T?.cardTitleClassName ?? "dial-body-semi-text", te = T?.pathLabelClassName ?? "dial-tiny-text", A = T?.pathLeafClassName ?? "dial-tiny-semi-text", M = T?.updatedAtClassName ?? "dial-tiny-text", re = T?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", P = ee({
106
- "--pr-bg": w?.background,
107
- "--pr-subtitle-text": w?.subtitleText,
108
- "--pr-sort-text": w?.sortButtonText,
109
- "--pr-card-bg": w?.cardBackground,
110
- "--pr-card-title-text": w?.cardTitleText,
111
- "--pr-updated-at-text": w?.updatedAtText,
112
- "--pr-path-text": w?.pathText,
113
- "--pr-card-focus-outline": w?.cardFocusOutline
114
- }), [ie] = G(() => Date.now()), F = l.trim(), I = r.length > 0, R = I && e.length === 0, z = U(() => ye(J(e, l), f, x), [
116
+ }, Oe = {
117
+ container: "_container_4rer8_1",
118
+ subtitle: "_subtitle_4rer8_5",
119
+ sortButton: "_sortButton_4rer8_9"
120
+ }, ke = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onTogglePin: s, onOpenProject: c, getProjectHref: l, searchQuery: u, onSearchQueryChange: f, sortKey: m, onSortKeyChange: y, labels: S, locale: w, styles: T }) => {
121
+ let { colors: E, typography: D } = T ?? {}, k = D?.titleClassName ?? "dial-h1-text", A = D?.subtitleClassName ?? "dial-body-text", j = D?.cardTitleClassName ?? "dial-body-semi-text", M = D?.pathLabelClassName ?? "dial-tiny-text", P = D?.pathLeafClassName ?? "dial-tiny-semi-text", ne = D?.updatedAtClassName ?? "dial-tiny-text", re = D?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", ie = ee({
122
+ "--pr-bg": E?.background,
123
+ "--pr-subtitle-text": E?.subtitleText,
124
+ "--pr-sort-text": E?.sortButtonText,
125
+ "--pr-card-bg": E?.cardBackground,
126
+ "--pr-card-title-text": E?.cardTitleText,
127
+ "--pr-updated-at-text": E?.updatedAtText,
128
+ "--pr-path-text": E?.pathText,
129
+ "--pr-card-focus-outline": E?.cardFocusOutline
130
+ }), I = p(), L = U(() => Date.now(), [e]), se = u.trim(), ce = r.length > 0, ue = ce && e.length === 0, R = U(() => be(ye(e, u), m, w), [
115
131
  e,
116
- l,
117
- f,
118
- x
119
- ]), se = v.sortOptions.find((e) => e.value === f)?.label ?? v.sortLabel, ce = U(() => v.sortOptions.map((e) => ({
132
+ u,
133
+ m,
134
+ w
135
+ ]), de = S.sortOptions.find((e) => e.value === m)?.label ?? S.sortLabel, pe = U(() => S.sortOptions.map((e) => ({
120
136
  key: e.value,
121
137
  label: e.label,
122
- mark: N.Check,
123
- checked: e.value === f,
124
- onClick: () => p(e.value)
138
+ mark: F.Check,
139
+ checked: e.value === m,
140
+ onClick: () => y(e.value)
125
141
  })), [
126
- v.sortOptions,
127
- f,
128
- p
129
- ]), le = (e) => {
130
- u(e ?? "");
131
- }, ue = () => {
132
- if (!t) return n ? v.errorLabel : I ? v.incompleteLabel : e.length === 0 ? v.emptyStateLabel : z.length === 0 ? v.noResultsLabel : v.resultCountLabel(z.length);
133
- }, de = (e, t) => a ? /* @__PURE__ */ K(m, {
134
- label: v.createProjectLabel,
142
+ S.sortOptions,
143
+ m,
144
+ y
145
+ ]), z = (e) => {
146
+ f(e ?? "");
147
+ }, B = () => {
148
+ if (!t) return n ? S.errorLabel : ce ? S.incompleteLabel : e.length === 0 ? S.emptyStateLabel : R.length === 0 ? S.noResultsLabel : S.resultCountLabel(R.length);
149
+ }, V = (e, t) => a ? /* @__PURE__ */ K(h, {
150
+ label: S.createProjectLabel,
135
151
  variant: e,
136
152
  onClick: a,
137
153
  className: d("shrink-0", t)
138
- }) : void 0, B = () => t ? /* @__PURE__ */ K(ae, {}) : n || R ? /* @__PURE__ */ q("div", {
154
+ }) : void 0, me = () => t ? /* @__PURE__ */ K(oe, {}) : n || ue ? /* @__PURE__ */ q("div", {
139
155
  className: "flex flex-col items-center gap-3",
140
156
  children: [/* @__PURE__ */ K("p", {
141
- className: d(O, Z.subtitle),
142
- children: n ? v.errorLabel : v.incompleteLabel
143
- }), /* @__PURE__ */ K(D, {
144
- label: v.retryLabel,
157
+ className: d(A, Oe.subtitle),
158
+ children: n ? S.errorLabel : S.incompleteLabel
159
+ }), /* @__PURE__ */ K(O, {
160
+ label: S.retryLabel,
145
161
  onClick: i
146
162
  })]
147
163
  }) : e.length === 0 ? /* @__PURE__ */ K(o, {
148
- label: v.emptyStateLabel,
149
- description: v.emptyStateDescription,
150
- action: de(_.Secondary, "mt-2"),
151
- containerClassName: "p-3",
164
+ label: S.emptyStateLabel,
165
+ description: S.emptyStateDescription,
166
+ action: V(v.Secondary, "mt-2"),
167
+ containerClassName: W,
152
168
  labelClassName: "mt-3",
153
169
  descriptionClassName: re
154
- }) : z.length === 0 ? /* @__PURE__ */ K(o, {
155
- label: v.noResultsLabel,
156
- containerClassName: "p-3",
170
+ }) : R.length === 0 ? /* @__PURE__ */ K(o, {
171
+ label: S.noResultsLabel,
172
+ containerClassName: W,
157
173
  labelClassName: "mt-3"
158
174
  }) : /* @__PURE__ */ K("ul", {
159
- className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-5 p-0 desktop:grid-cols-3",
160
- children: z.map((e) => /* @__PURE__ */ K(Ee, {
175
+ 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",
176
+ children: R.map((e) => /* @__PURE__ */ K(De, {
161
177
  project: e,
162
- searchQuery: F,
163
- sourceLabel: v.sourceLabels[e.source],
164
- folderPathLabel: v.folderPathLabel,
165
- pinnedLabel: v.pinnedLabel ?? "Pinned",
166
- href: c?.(e.id),
167
- onOpen: s,
168
- now: ie,
169
- locale: x,
170
- updatedAtClassName: M,
171
- titleClassName: k,
172
- pathLabelClassName: te,
173
- pathLeafClassName: A
178
+ searchQuery: se,
179
+ sourceLabel: S.sourceLabels[e.source],
180
+ folderPathLabel: S.folderPathLabel,
181
+ pinnedLabel: S.pinnedLabel ?? "Pinned",
182
+ pinLabel: S.pinLabel ?? "Pin",
183
+ onTogglePin: s,
184
+ href: l?.(e.id),
185
+ onOpen: c,
186
+ now: L,
187
+ locale: w,
188
+ updatedAtClassName: ne,
189
+ titleClassName: j,
190
+ pathLabelClassName: M,
191
+ pathLeafClassName: P
174
192
  }, e.id))
175
- }), V = t || n || R;
193
+ }), H = t || n || ue, W = "mt-6 p-3 desktop:mt-0";
176
194
  return /* @__PURE__ */ q("div", {
177
- style: P,
178
- className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", Z.container),
179
- children: [
180
- /* @__PURE__ */ q("div", {
181
- className: "flex min-w-0 items-center gap-2 px-4 py-4 desktop:px-8",
182
- children: [/* @__PURE__ */ q("div", {
183
- className: "min-w-0 flex-1",
184
- children: [/* @__PURE__ */ K("h1", {
185
- className: d("wrap-break-word", E),
186
- children: v.title
187
- }), v.subtitle && /* @__PURE__ */ K("p", {
188
- className: d("mt-0.5", O, Z.subtitle),
189
- children: v.subtitle
190
- })]
191
- }), de(_.Primary)]
192
- }),
193
- /* @__PURE__ */ q("div", {
194
- className: "flex flex-col gap-3 px-4 pt-4 pb-5 desktop:flex-row desktop:items-center desktop:px-8",
195
- children: [/* @__PURE__ */ K("div", {
196
- role: "search",
197
- className: "min-w-0 flex-1",
198
- children: /* @__PURE__ */ K(L, {
199
- value: l,
200
- onChange: le,
201
- placeholder: v.searchPlaceholder,
202
- clearLabel: v.clearSearchLabel,
203
- "aria-label": v.searchAriaLabel,
204
- size: S.Large
205
- })
206
- }), v.sortOptions.length > 0 && /* @__PURE__ */ K("div", {
207
- role: "group",
208
- "aria-label": v.sortLabel,
209
- className: "shrink-0",
210
- children: /* @__PURE__ */ K(g, {
211
- items: ce,
212
- label: se,
213
- variant: _.Primary,
214
- appearance: h.Ghost,
215
- iconBefore: /* @__PURE__ */ K(oe, {
216
- size: y.SM,
217
- "aria-hidden": !0,
218
- stroke: b
219
- }),
220
- className: Z.sortButton
221
- })
222
- })]
223
- }),
224
- /* @__PURE__ */ K(j, {
225
- visuallyHidden: !0,
226
- as: ne.Span,
227
- children: ue()
228
- }),
229
- /* @__PURE__ */ q("div", {
230
- className: "flex w-full min-w-0 flex-1 flex-col items-center gap-5 px-4 pt-6 pb-8 desktop:px-8",
231
- children: [I && !t && !n && !R && /* @__PURE__ */ q("div", {
232
- className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
233
- children: [/* @__PURE__ */ K("p", {
234
- className: d(O, Z.subtitle),
235
- children: v.incompleteLabel
236
- }), /* @__PURE__ */ K(D, {
237
- label: v.retryLabel,
238
- onClick: i
195
+ style: ie,
196
+ className: d("relative flex h-full w-full min-w-0 flex-col", Oe.container),
197
+ children: [/* @__PURE__ */ q("div", {
198
+ className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto",
199
+ children: [
200
+ I ? /* @__PURE__ */ K("h1", {
201
+ className: "sr-only",
202
+ children: S.title
203
+ }) : /* @__PURE__ */ q("div", {
204
+ className: "flex min-w-0 items-start gap-2 px-8 py-4",
205
+ children: [/* @__PURE__ */ q("div", {
206
+ className: "flex min-h-10 min-w-0 flex-1 flex-col justify-center gap-0.5",
207
+ children: [/* @__PURE__ */ K("h1", {
208
+ className: d("wrap-break-word", k),
209
+ children: S.title
210
+ }), S.subtitle && /* @__PURE__ */ K("p", {
211
+ className: d(A, Oe.subtitle),
212
+ children: S.subtitle
213
+ })]
214
+ }), V(v.Primary)]
215
+ }),
216
+ /* @__PURE__ */ q("div", {
217
+ className: "flex items-center gap-2 p-4 desktop:gap-3 desktop:px-8 desktop:pt-4 desktop:pb-5",
218
+ children: [/* @__PURE__ */ K("div", {
219
+ role: "search",
220
+ className: "min-w-0 flex-1",
221
+ children: /* @__PURE__ */ K(ae, {
222
+ value: u,
223
+ onChange: z,
224
+ placeholder: S.searchPlaceholder,
225
+ clearLabel: S.clearSearchLabel,
226
+ "aria-label": S.searchAriaLabel,
227
+ size: I ? C.Standard : C.Large
228
+ })
229
+ }), S.sortOptions.length > 0 && /* @__PURE__ */ K("div", {
230
+ role: "group",
231
+ "aria-label": S.sortLabel,
232
+ className: "shrink-0",
233
+ children: /* @__PURE__ */ K(_, {
234
+ items: pe,
235
+ label: de,
236
+ variant: v.Primary,
237
+ appearance: g.Ghost,
238
+ size: I ? C.Small : C.Standard,
239
+ iconBefore: /* @__PURE__ */ K(le, {
240
+ size: I ? b.SM : b.MD,
241
+ "aria-hidden": !0,
242
+ stroke: x
243
+ }),
244
+ className: d("desktop:px-3", Oe.sortButton)
245
+ })
239
246
  })]
240
- }), /* @__PURE__ */ K("div", {
241
- className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", V && "flex-1 justify-center"),
247
+ }),
248
+ /* @__PURE__ */ K(te, {
249
+ visuallyHidden: !0,
250
+ as: N.Span,
242
251
  children: B()
243
- })]
244
- })
245
- ]
252
+ }),
253
+ /* @__PURE__ */ q("div", {
254
+ 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",
255
+ children: [ce && !t && !n && !ue && /* @__PURE__ */ q("div", {
256
+ className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
257
+ children: [/* @__PURE__ */ K("p", {
258
+ className: d(A, Oe.subtitle),
259
+ children: S.incompleteLabel
260
+ }), /* @__PURE__ */ K(O, {
261
+ label: S.retryLabel,
262
+ onClick: i
263
+ })]
264
+ }), /* @__PURE__ */ K("div", {
265
+ className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", H && "flex-1 justify-center"),
266
+ children: me()
267
+ })]
268
+ })
269
+ ]
270
+ }), I && a && /* @__PURE__ */ K(h, {
271
+ variant: v.Primary,
272
+ iconBefore: /* @__PURE__ */ K(fe, {
273
+ size: b.LG,
274
+ "aria-hidden": !0,
275
+ stroke: x
276
+ }),
277
+ "aria-label": S.createProjectLabel,
278
+ onClick: a,
279
+ className: "absolute inset-e-4 bottom-4 z-10 size-10 rounded-full px-0"
280
+ })]
246
281
  });
247
- }, Oe = /* @__PURE__ */ function(e) {
282
+ }, Ae = /* @__PURE__ */ function(e) {
248
283
  return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
249
- }({}), ke = (e) => !!e.dataTransfer?.types.includes("Files"), Ae = (e) => {
284
+ }({}), je = (e) => !!e.dataTransfer?.types.includes("Files"), Me = (e) => {
250
285
  let [t, n] = G(!1), r = W(0);
251
286
  return {
252
287
  isDragActive: t,
253
288
  handlers: {
254
289
  onDragEnter: V((e) => {
255
- ke(e) && (e.preventDefault(), r.current += 1, n(!0));
290
+ je(e) && (e.preventDefault(), r.current += 1, n(!0));
256
291
  }, []),
257
292
  onDragLeave: V((e) => {
258
- ke(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
293
+ je(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
259
294
  }, []),
260
295
  onDragOver: V((e) => {
261
- ke(e) && e.preventDefault();
296
+ je(e) && e.preventDefault();
262
297
  }, []),
263
298
  onDrop: V((t) => {
264
- if (!ke(t)) return;
299
+ if (!je(t)) return;
265
300
  t.preventDefault(), r.current = 0, n(!1);
266
301
  let i = Array.from(t.dataTransfer?.files ?? []);
267
302
  i.length > 0 && e(i);
@@ -270,36 +305,36 @@ var ve = /* @__PURE__ */ function(e) {
270
305
  };
271
306
  }, Q = /* @__PURE__ */ function(e) {
272
307
  return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
273
- }({}), je = /* @__PURE__ */ function(e) {
308
+ }({}), Ne = /* @__PURE__ */ function(e) {
274
309
  return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
275
- }({}), Me = 255, Ne = new RegExp(a.source, "u"), Pe = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Fe = /* @__PURE__ */ new Set([
310
+ }({}), Pe = 255, Fe = new RegExp(a.source, "u"), Ie = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Le = /* @__PURE__ */ new Set([
276
311
  ".",
277
312
  "..",
278
313
  "v",
279
314
  "files",
280
315
  ".dial-resource",
281
316
  ".dial-folder"
282
- ]), Ie = (e) => new TextEncoder().encode(e).length, Le = (e) => {
317
+ ]), Re = (e) => new TextEncoder().encode(e).length, ze = (e) => {
283
318
  let t = e.trim();
284
- return t.length === 0 ? je.Required : Ie(t) > 255 ? je.TooLong : Ne.test(t) || Pe.test(t) ? je.InvalidCharacters : Fe.has(t) ? je.Reserved : null;
285
- }, Re = (e) => {
319
+ return t.length === 0 ? Ne.Required : Re(t) > 255 ? Ne.TooLong : Fe.test(t) || Ie.test(t) ? Ne.InvalidCharacters : Le.has(t) ? Ne.Reserved : null;
320
+ }, Be = (e) => {
286
321
  let t = e.lastIndexOf(".");
287
322
  return t > 0 ? e.slice(t + 1).toLowerCase() : "";
288
- }, ze = (e) => "isStored" in e && e.isStored, Be = (e) => ze(e) ? e.size : e.file.size, Ve = (e) => e.reduce((e, t) => e + Be(t), 0), He = 0, Ue = () => (He += 1, `project-context-${Date.now()}-${He}`), We = (e) => {
323
+ }, Ve = (e) => "isStored" in e && e.isStored, He = (e) => Ve(e) ? e.size : e.file.size, Ue = (e) => e.reduce((e, t) => e + He(t), 0), We = 0, Ge = () => (We += 1, `project-context-${Date.now()}-${We}`), Ke = (e) => {
289
324
  let t = e.type || u(e.name) || "application/octet-stream";
290
325
  return {
291
- id: Ue(),
326
+ id: Ge(),
292
327
  name: e.name,
293
328
  contentType: t,
294
329
  type: l(t),
295
330
  status: s.Idle,
296
331
  file: e
297
332
  };
298
- }, Ge = (e, t, n, r) => Le(e.name) != null || e.name.trim() !== e.name ? Q.InvalidName : r.allowedExtensions.includes(Re(e.name)) ? t.has(e.name) ? Q.Duplicate : e.size > r.maxFileBytes ? Q.TooLarge : n + e.size > r.maxTotalBytes ? Q.CapacityExceeded : null : Q.UnsupportedType, Ke = (e, t, n) => {
299
- let r = new Set(t.map((e) => e.name)), i = Ve(t), a = [], o = [];
333
+ }, qe = (e, t, n, r) => ze(e.name) != null || e.name.trim() !== e.name ? Q.InvalidName : r.allowedExtensions.includes(Be(e.name)) ? t.has(e.name) ? Q.Duplicate : e.size > r.maxFileBytes ? Q.TooLarge : n + e.size > r.maxTotalBytes ? Q.CapacityExceeded : null : Q.UnsupportedType, Je = (e, t, n) => {
334
+ let r = new Set(t.map((e) => e.name)), i = Ue(t), a = [], o = [];
300
335
  for (let t of e) {
301
- let e = Ge(t, r, i, n);
302
- e == null ? (r.add(t.name), i += t.size, a.push(We(t))) : o.push({
336
+ let e = qe(t, r, i, n);
337
+ e == null ? (r.add(t.name), i += t.size, a.push(Ke(t))) : o.push({
303
338
  name: t.name,
304
339
  reason: e
305
340
  });
@@ -308,37 +343,37 @@ var ve = /* @__PURE__ */ function(e) {
308
343
  accepted: a,
309
344
  rejected: o
310
345
  };
311
- }, qe = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), Je = (e, t) => {
346
+ }, Ye = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), Xe = (e, t) => {
312
347
  let n = t.trim().toLowerCase();
313
348
  return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
314
- }, Ye = {
349
+ }, Ze = {
315
350
  track: "_track_1eyt2_1",
316
351
  text: "_text_1eyt2_11"
317
- }, Xe = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
352
+ }, Qe = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
318
353
  if (e <= 0) return null;
319
- let a = r(qe(e, t));
354
+ let a = r(Ye(e, t));
320
355
  return /* @__PURE__ */ q("div", {
321
356
  className: "flex min-w-0 items-center gap-2",
322
- children: [/* @__PURE__ */ K(F, {
323
- role: I.Meter,
357
+ children: [/* @__PURE__ */ K(I, {
358
+ role: L.Meter,
324
359
  value: e,
325
360
  max: t,
326
- size: S.Small,
361
+ size: C.Small,
327
362
  "aria-label": n,
328
363
  "aria-valuetext": a,
329
- className: d("w-[60px] shrink-0", Ye.track)
364
+ className: d("w-[60px] shrink-0", Ze.track)
330
365
  }), /* @__PURE__ */ K("span", {
331
366
  "aria-hidden": !0,
332
- className: d("whitespace-nowrap", i, Ye.text),
367
+ className: d("whitespace-nowrap", i, Ze.text),
333
368
  children: a
334
369
  })]
335
370
  });
336
- }, Ze = {
371
+ }, $e = {
337
372
  formColumn: "_formColumn_1fxsc_1",
338
373
  helper: "_helper_1fxsc_10",
339
374
  label: "_label_1fxsc_14"
340
- }, Qe = de(async () => ({ default: (await _e()).MarkdownEditor })), $e = "device", et = "file-manager", tt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, allowedExtensions: s, maxFileBytes: l, maxTotalBytes: u, onPickFromFileManager: m, onRefineDescription: h, onRefineInstructions: v, onBack: x, onCancel: C, onSubmit: E, isSubmitting: D = !1, labels: O, markdownEditorTheme: k, className: N, styles: re }) => {
341
- let P = H(), ie = H(), F = H(), I = H(), L = H(), oe = W(null), se = W(null), ce = f(), [le, de] = G(!1), [B, pe] = G([]), [_e, ve] = G(""), J = W(void 0), ye = V((e) => e ? async (t, n) => {
375
+ }, et = z(async () => ({ default: (await J()).MarkdownEditor })), tt = "device", nt = "file-manager", rt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, allowedExtensions: s, maxFileBytes: l, maxTotalBytes: u, onPickFromFileManager: p, onRefineDescription: h, onRefineInstructions: g, onBack: y, onCancel: S, onSubmit: w, isSubmitting: D = !1, labels: O, markdownEditorTheme: k, className: A, styles: F }) => {
376
+ let ne = H(), re = H(), ie = H(), I = H(), L = H(), ae = W(null), le = W(null), ue = f(), [R, de] = G(!1), [fe, z] = G([]), [B, he] = G(""), J = W(void 0), Y = V((e) => e ? async (t, n) => {
342
377
  if (J.current && !J.current.aborted) throw new DOMException("Busy", "AbortError");
343
378
  J.current = n;
344
379
  try {
@@ -346,66 +381,66 @@ var ve = /* @__PURE__ */ function(e) {
346
381
  } finally {
347
382
  J.current === n && (J.current = void 0);
348
383
  }
349
- } : void 0, []), be = U(() => ye(h), [ye, h]), xe = U(() => ye(v), [ye, v]), Y = p({
384
+ } : void 0, []), ye = U(() => Y(h), [Y, h]), be = U(() => Y(g), [Y, g]), xe = m({
350
385
  value: e.description,
351
386
  onChange: (e) => i("description", e),
352
- onRefine: be,
387
+ onRefine: ye,
353
388
  disabled: D
354
- }), Se = p({
389
+ }), Se = m({
355
390
  value: e.instructions,
356
391
  onChange: (e) => i("instructions", e),
357
- onRefine: xe,
392
+ onRefine: be,
358
393
  disabled: D
359
- }), Ce = Y.isPending || Se.isPending, X = Le(e.name), we = t.name ?? (le && X != null ? O.nameErrors[X] : void 0), Te = X != null || D || Ce;
360
- fe(() => {
361
- t.name && oe.current?.focus();
394
+ }), X = xe.isPending || Se.isPending, Ce = ze(e.name), we = t.name ?? (R && Ce != null ? O.nameErrors[Ce] : void 0), Z = Ce != null || D || X;
395
+ me(() => {
396
+ t.name && ae.current?.focus();
362
397
  }, [t.name]);
363
- let Ee = U(() => Ve(a), [a]), Z = U(() => s.map((e) => `.${e}`).join(","), [s]), De = (e) => {
398
+ let Te = U(() => Ue(a), [a]), Ee = U(() => s.map((e) => `.${e}`).join(","), [s]), De = (e) => {
364
399
  if (e.length === 0) return;
365
- let { accepted: t, rejected: n } = Ke(e, a, {
400
+ let { accepted: t, rejected: n } = Je(e, a, {
366
401
  allowedExtensions: s,
367
402
  maxFileBytes: l,
368
403
  maxTotalBytes: u
369
404
  });
370
- pe(n), t.length > 0 && o([...a, ...t]), ve([t.length > 0 ? O.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => O.fileRejections[t](e))].filter(Boolean).join(" "));
371
- }, { isDragActive: Oe, handlers: ke } = Ae(De), Q = (e) => {
405
+ z(n), t.length > 0 && o([...a, ...t]), he([t.length > 0 ? O.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => O.fileRejections[t](e))].filter(Boolean).join(" "));
406
+ }, { isDragActive: Oe, handlers: ke } = Me(De), Ae = (e) => {
372
407
  let t = a.find((t) => t.id === e);
373
- o(a.filter((t) => t.id !== e)), pe([]), t && ve(O.fileRemovedStatus(t.name));
408
+ o(a.filter((t) => t.id !== e)), z([]), t && he(O.fileRemovedStatus(t.name));
374
409
  }, je = (e) => {
375
410
  De(Array.from(e.target.files ?? [])), e.target.value = "";
376
- }, Me = async () => {
377
- if (m) try {
378
- let e = await m();
411
+ }, Q = async () => {
412
+ if (p) try {
413
+ let e = await p();
379
414
  e && De(e);
380
415
  } catch {}
381
416
  }, Ne = [{
382
- key: $e,
417
+ key: tt,
383
418
  label: O.addFromDeviceLabel,
384
- onClick: () => se.current?.click()
385
- }, ...m ? [{
386
- key: et,
419
+ onClick: () => le.current?.click()
420
+ }, ...p ? [{
421
+ key: nt,
387
422
  label: O.addFromFileManagerLabel,
388
- onClick: () => void Me()
423
+ onClick: () => void Q()
389
424
  }] : []], Pe = () => {
390
- !Te && (!J.current || J.current.aborted) && E();
391
- }, { colors: Fe, typography: Ie } = re ?? {}, Re = Ie?.titleClassName ?? "dial-h1-text", ze = d(Ie?.labelClassName ?? "dial-tiny-semi-text", Ze.label), Be = Ie?.helperClassName ?? "dial-tiny-text", He = ee({
425
+ !Z && (!J.current || J.current.aborted) && w();
426
+ }, { colors: Fe, typography: Ie } = F ?? {}, Le = Ie?.titleClassName ?? "dial-h1-text", Re = d(Ie?.labelClassName ?? "dial-tiny-semi-text", $e.label), Be = Ie?.helperClassName ?? "dial-tiny-text", Ve = ee({
392
427
  "--pcf-helper-text": Fe?.helperText,
393
428
  "--pcf-label-text": Fe?.labelText,
394
429
  "--pcf-meter-track": Fe?.meterTrack,
395
430
  "--pcf-meter-fill": Fe?.meterFill
396
- }), Ue = O.refinement, We = t.context, Ge = !!We;
431
+ }), He = O.refinement, We = t.context, Ge = !!We;
397
432
  return /* @__PURE__ */ q("div", {
398
- className: d("relative flex h-full min-h-0 w-full", N),
433
+ className: d("relative flex h-full min-h-0 w-full", A),
399
434
  ...ke,
400
435
  children: [
401
- /* @__PURE__ */ K(he, {
436
+ /* @__PURE__ */ K(_e, {
402
437
  isVisible: Oe,
403
438
  labels: {
404
439
  title: O.dropOverlayTitle,
405
440
  subtitle: O.dropOverlaySubtitle
406
441
  }
407
442
  }),
408
- /* @__PURE__ */ K(ge, {
443
+ /* @__PURE__ */ K(ve, {
409
444
  labels: {
410
445
  title: O.title,
411
446
  backButtonLabel: O.backLabel,
@@ -413,15 +448,15 @@ var ve = /* @__PURE__ */ function(e) {
413
448
  submitButtonLabel: O.createLabel,
414
449
  submittingLabel: O.submittingLabel ?? O.createLabel
415
450
  },
416
- onBack: x,
417
- onCancel: C,
451
+ onBack: y,
452
+ onCancel: S,
418
453
  onSubmit: Pe,
419
454
  isCancelDisabled: D,
420
- isSubmitDisabled: Te,
455
+ isSubmitDisabled: Z,
421
456
  isSubmitting: D,
422
- backIcon: /* @__PURE__ */ K(z, {
423
- size: y.LG,
424
- stroke: b,
457
+ backIcon: /* @__PURE__ */ K(ce, {
458
+ size: b.LG,
459
+ stroke: x,
425
460
  "aria-hidden": !0,
426
461
  className: "rtl:scale-x-[-1]"
427
462
  }),
@@ -429,19 +464,19 @@ var ve = /* @__PURE__ */ function(e) {
429
464
  colors: { background: Fe?.background },
430
465
  header: {
431
466
  colors: { borderColor: Fe?.headerBorder },
432
- typography: { fontClassName: Re }
467
+ typography: { fontClassName: Le }
433
468
  },
434
- cssVars: He
469
+ cssVars: Ve
435
470
  },
436
471
  children: /* @__PURE__ */ q("div", {
437
- className: d("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", Ze.formColumn),
472
+ className: d("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", $e.formColumn),
438
473
  children: [
439
474
  /* @__PURE__ */ q("div", {
440
475
  className: "flex flex-col gap-1",
441
476
  children: [
442
- /* @__PURE__ */ K(te, {
443
- id: P,
444
- inputRef: oe,
477
+ /* @__PURE__ */ K(j, {
478
+ id: ne,
479
+ inputRef: ae,
445
480
  value: e.name,
446
481
  onChange: (e) => i("name", e ?? ""),
447
482
  onBlur: () => de(!0),
@@ -454,16 +489,16 @@ var ve = /* @__PURE__ */ function(e) {
454
489
  "aria-required": !0,
455
490
  invalid: !!we,
456
491
  "aria-invalid": !!we,
457
- "aria-describedby": we ? ie : void 0
492
+ "aria-describedby": we ? re : void 0
458
493
  }),
459
- /* @__PURE__ */ K(w, {
460
- announce: M.Assertive,
461
- id: ie,
494
+ /* @__PURE__ */ K(T, {
495
+ announce: P.Assertive,
496
+ id: re,
462
497
  className: Be,
463
498
  text: t.name ?? ""
464
499
  }),
465
- we && !t.name && /* @__PURE__ */ K(w, {
466
- id: ie,
500
+ we && !t.name && /* @__PURE__ */ K(T, {
501
+ id: re,
467
502
  className: Be,
468
503
  text: we
469
504
  })
@@ -471,42 +506,42 @@ var ve = /* @__PURE__ */ function(e) {
471
506
  }),
472
507
  /* @__PURE__ */ K(c, {
473
508
  isEnabled: !!h,
474
- fieldId: F,
509
+ fieldId: ie,
475
510
  label: O.descriptionLabel,
476
- labelClassName: ze,
477
- labels: Ue,
478
- refinement: Y,
479
- disabled: D || Ce,
480
- children: /* @__PURE__ */ K(R, {
481
- id: F,
511
+ labelClassName: Re,
512
+ labels: He,
513
+ refinement: xe,
514
+ disabled: D || X,
515
+ children: /* @__PURE__ */ K(se, {
516
+ id: ie,
482
517
  value: e.description,
483
518
  onChange: (e) => {
484
- Y.reset(), i("description", e);
519
+ xe.reset(), i("description", e);
485
520
  },
486
521
  placeholder: O.descriptionPlaceholder,
487
522
  labelProps: h ? void 0 : { label: O.descriptionLabel }
488
523
  })
489
524
  }),
490
525
  /* @__PURE__ */ K(c, {
491
- isEnabled: !!v,
526
+ isEnabled: !!g,
492
527
  fieldId: I,
493
528
  label: O.instructionsLabel,
494
- labelClassName: ze,
495
- labels: Ue,
529
+ labelClassName: Re,
530
+ labels: He,
496
531
  refinement: Se,
497
- disabled: D || Ce,
532
+ disabled: D || X,
498
533
  children: /* @__PURE__ */ q("div", {
499
534
  className: "flex flex-1 flex-col gap-2",
500
- children: [!v && /* @__PURE__ */ K(A, {
535
+ children: [!g && /* @__PURE__ */ K(M, {
501
536
  htmlFor: I,
502
- className: ze,
537
+ className: Re,
503
538
  label: O.instructionsLabel
504
539
  }), /* @__PURE__ */ K("div", {
505
- ref: ce,
540
+ ref: ue,
506
541
  className: d("w-full", n, r),
507
- children: /* @__PURE__ */ K(ue, {
508
- fallback: /* @__PURE__ */ K(ae, {}),
509
- children: /* @__PURE__ */ K(Qe, {
542
+ children: /* @__PURE__ */ K(pe, {
543
+ fallback: /* @__PURE__ */ K(oe, {}),
544
+ children: /* @__PURE__ */ K(et, {
510
545
  id: I,
511
546
  value: e.instructions,
512
547
  onChange: (e) => {
@@ -528,52 +563,52 @@ var ve = /* @__PURE__ */ function(e) {
528
563
  className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
529
564
  children: [/* @__PURE__ */ K("h2", {
530
565
  id: L,
531
- className: ze,
566
+ className: Re,
532
567
  children: O.contextLabel
533
568
  }), /* @__PURE__ */ q("div", {
534
569
  className: "flex min-w-0 items-center gap-4",
535
- children: [/* @__PURE__ */ K(Xe, {
536
- usedBytes: Ee,
570
+ children: [/* @__PURE__ */ K(Qe, {
571
+ usedBytes: Te,
537
572
  maxBytes: u,
538
573
  ariaLabel: O.capacityMeterLabel,
539
574
  formatLabel: O.capacityLabel,
540
575
  textClassName: Be
541
- }), /* @__PURE__ */ K(g, {
576
+ }), /* @__PURE__ */ K(_, {
542
577
  items: Ne,
543
578
  label: O.addLabel,
544
- variant: _.Neutral,
545
- size: S.Small,
579
+ variant: v.Neutral,
580
+ size: C.Small,
546
581
  disabled: D
547
582
  })]
548
583
  })]
549
584
  }),
550
585
  /* @__PURE__ */ K("input", {
551
- ref: se,
586
+ ref: le,
552
587
  type: "file",
553
588
  multiple: !0,
554
- accept: Z,
589
+ accept: Ee,
555
590
  tabIndex: -1,
556
591
  "aria-hidden": !0,
557
592
  className: "sr-only",
558
593
  onChange: je
559
594
  }),
560
- /* @__PURE__ */ K(T, {
595
+ /* @__PURE__ */ K(E, {
561
596
  label: O.dropZoneLabel,
562
597
  description: O.dropZoneHint,
563
- accept: Z,
598
+ accept: Ee,
564
599
  multiple: !0,
565
600
  disabled: D,
566
601
  onChange: De,
567
602
  onReject: De
568
603
  }),
569
- B.length > 0 && /* @__PURE__ */ K("ul", {
570
- className: d("flex flex-col gap-1", Be, Ze.helper),
571
- children: B.map(({ name: e, reason: t }) => /* @__PURE__ */ K("li", { children: O.fileRejections[t](e) }, `${t}:${e}`))
604
+ fe.length > 0 && /* @__PURE__ */ K("ul", {
605
+ className: d("flex flex-col gap-1", Be, $e.helper),
606
+ children: fe.map(({ name: e, reason: t }) => /* @__PURE__ */ K("li", { children: O.fileRejections[t](e) }, `${t}:${e}`))
572
607
  }),
573
- /* @__PURE__ */ K(j, {
574
- politeness: M.Assertive,
608
+ /* @__PURE__ */ K(te, {
609
+ politeness: P.Assertive,
575
610
  children: Ge && /* @__PURE__ */ K("p", {
576
- className: d(Be, Ze.helper),
611
+ className: d(Be, $e.helper),
577
612
  children: We
578
613
  })
579
614
  }),
@@ -581,9 +616,9 @@ var ve = /* @__PURE__ */ function(e) {
581
616
  className: "flex min-w-0 flex-wrap gap-2 pt-1",
582
617
  children: a.map((e) => /* @__PURE__ */ K("li", {
583
618
  className: "min-w-0",
584
- children: /* @__PURE__ */ K(me, {
619
+ children: /* @__PURE__ */ K(ge, {
585
620
  attachment: e,
586
- onRemove: Q,
621
+ onRemove: Ae,
587
622
  labels: { removeLabel: O.removeFileLabel(e.name) }
588
623
  })
589
624
  }, e.id))
@@ -593,10 +628,10 @@ var ve = /* @__PURE__ */ function(e) {
593
628
  ]
594
629
  })
595
630
  }),
596
- /* @__PURE__ */ K(j, {
631
+ /* @__PURE__ */ K(te, {
597
632
  visuallyHidden: !0,
598
- as: ne.Span,
599
- children: D ? O.creatingStatus : _e
633
+ as: N.Span,
634
+ children: D ? O.creatingStatus : B
600
635
  })
601
636
  ]
602
637
  });
@@ -607,21 +642,21 @@ var ve = /* @__PURE__ */ function(e) {
607
642
  body: "_body_16lvl_13",
608
643
  secondary: "_secondary_16lvl_17",
609
644
  panel: "_panel_16lvl_21"
610
- }, nt = (e) => ({
645
+ }, it = (e) => ({
611
646
  id: e.name,
612
647
  name: e.name,
613
648
  contentType: e.contentType,
614
649
  type: l(e.contentType),
615
650
  status: s.Idle
616
- }), rt = B(({ project: e, isLoading: t = !1, hasError: n = !1, isNotFound: r = !1, isPinned: a, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: l, onBack: u, onTogglePin: f, onPublish: p, onEdit: h, onShare: g, onDelete: v, onDownload: S, onOpenFile: w, onRetry: T, onBrowseProjects: E, mainContent: k, mainContentLabel: te = "Project content", labels: A, styles: M }) => {
617
- let { colors: N, typography: P } = M ?? {}, ie = P?.titleClassName ?? "dial-h2-text", F = P?.panelTitleClassName ?? "dial-body-semi-text", I = P?.sectionTitleClassName ?? "dial-tiny-text", R = P?.bodyClassName ?? "dial-small-text", oe = P?.helperClassName ?? "dial-tiny-text", ue = P?.instructionsHeadingClassName ?? "dial-small-semi-text", de = ee({
618
- "--pv-bg": N?.background,
619
- "--pv-border": N?.border,
620
- "--pv-heading-text": N?.headingText,
621
- "--pv-body-text": N?.bodyText,
622
- "--pv-secondary-text": N?.secondaryText
623
- }), B = U(() => e?.contextFiles ?? [], [e]), V = U(() => Je(B, c), [B, c]), fe = c.trim(), W = H(), G = U(() => {
624
- let e = d("mb-1 mt-3 first:mt-0", ue);
651
+ }), at = B(({ project: e, isLoading: t = !1, hasError: n = !1, isNotFound: r = !1, isPinned: a, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: l, onBack: u, onTogglePin: f, onPublish: p, onEdit: m, onShare: g, onDelete: _, onDownload: y, onOpenFile: C, onRetry: T, onBrowseProjects: E, mainContent: D, mainContentLabel: A = "Project content", labels: j, styles: M }) => {
652
+ let { colors: P, typography: F } = M ?? {}, re = F?.titleClassName ?? "dial-h2-text", ie = F?.panelTitleClassName ?? "dial-body-semi-text", I = F?.sectionTitleClassName ?? "dial-tiny-text", L = F?.bodyClassName ?? "dial-small-text", se = F?.helperClassName ?? "dial-tiny-text", le = F?.instructionsHeadingClassName ?? "dial-small-semi-text", fe = ee({
653
+ "--pv-bg": P?.background,
654
+ "--pv-border": P?.border,
655
+ "--pv-heading-text": P?.headingText,
656
+ "--pv-body-text": P?.bodyText,
657
+ "--pv-secondary-text": P?.secondaryText
658
+ }), pe = U(() => e?.contextFiles ?? [], [e]), z = U(() => Xe(pe, c), [pe, c]), B = c.trim(), V = H(), me = U(() => {
659
+ let e = d("mb-1 mt-3 first:mt-0", le);
625
660
  return {
626
661
  h1: e,
627
662
  h2: e,
@@ -629,145 +664,145 @@ var ve = /* @__PURE__ */ function(e) {
629
664
  h4: e,
630
665
  h5: e,
631
666
  h6: e,
632
- p: R,
633
- ul: R,
634
- ol: R
667
+ p: L,
668
+ ul: L,
669
+ ol: L
635
670
  };
636
- }, [R, ue]), he = (e) => {
671
+ }, [L, le]), W = (e) => {
637
672
  let t = [];
638
673
  return e && p && t.push({
639
674
  key: "publish",
640
- label: A.publishLabel,
675
+ label: j.publishLabel,
641
676
  onClick: p
642
- }), e && h && t.push({
677
+ }), e && m && t.push({
643
678
  key: "edit",
644
- label: A.editLabel,
645
- onClick: h
679
+ label: j.editLabel,
680
+ onClick: m
646
681
  }), g && t.push({
647
682
  key: "share",
648
- label: A.shareLabel,
683
+ label: j.shareLabel,
649
684
  onClick: g
650
685
  }), t.push({
651
686
  key: "download",
652
- label: A.downloadLabel,
653
- onClick: S
654
- }), v && t.push({
687
+ label: j.downloadLabel,
688
+ onClick: y
689
+ }), _ && t.push({
655
690
  key: "delete",
656
- label: A.deleteLabel,
691
+ label: j.deleteLabel,
657
692
  danger: !0,
658
- onClick: v
693
+ onClick: _
659
694
  }), t;
660
- }, ge = (e, t) => /* @__PURE__ */ K("div", {
695
+ }, G = (e, t) => /* @__PURE__ */ K("div", {
661
696
  className: t,
662
- children: /* @__PURE__ */ K(x, {
663
- items: he(e),
697
+ children: /* @__PURE__ */ K(S, {
698
+ items: W(e),
664
699
  matchReferenceWidth: !1,
665
700
  listClassName: "w-[200px]",
666
- children: /* @__PURE__ */ K(O, {
667
- icon: /* @__PURE__ */ K(se, {
668
- size: y.MD,
701
+ children: /* @__PURE__ */ K(k, {
702
+ icon: /* @__PURE__ */ K(ue, {
703
+ size: b.MD,
669
704
  "aria-hidden": !0,
670
- stroke: b
705
+ stroke: x
671
706
  }),
672
- "aria-label": A.moreActionsLabel
707
+ "aria-label": j.moreActionsLabel
673
708
  })
674
709
  })
675
710
  });
676
711
  return t || n || r || e == null ? /* @__PURE__ */ K("div", {
677
- style: de,
712
+ style: fe,
678
713
  className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
679
- children: t ? /* @__PURE__ */ K(ae, {}) : n ? /* @__PURE__ */ q("div", {
714
+ children: t ? /* @__PURE__ */ K(oe, {}) : n ? /* @__PURE__ */ q("div", {
680
715
  className: "flex flex-col items-center gap-3",
681
716
  children: [/* @__PURE__ */ K("p", {
682
717
  role: "status",
683
- className: d(R, $.body),
684
- children: A.errorLabel
685
- }), /* @__PURE__ */ K(D, {
686
- label: A.retryLabel,
718
+ className: d(L, $.body),
719
+ children: j.errorLabel
720
+ }), /* @__PURE__ */ K(O, {
721
+ label: j.retryLabel,
687
722
  onClick: T
688
723
  })]
689
724
  }) : /* @__PURE__ */ q("div", {
690
725
  className: "flex flex-col items-center gap-3",
691
726
  children: [/* @__PURE__ */ K("p", {
692
- className: d(R, $.body),
693
- children: A.notFoundLabel
694
- }), /* @__PURE__ */ K(D, {
695
- label: A.browseProjectsLabel,
727
+ className: d(L, $.body),
728
+ children: j.notFoundLabel
729
+ }), /* @__PURE__ */ K(O, {
730
+ label: j.browseProjectsLabel,
696
731
  onClick: E
697
732
  })]
698
733
  })
699
734
  }) : /* @__PURE__ */ q("div", {
700
- style: de,
735
+ style: fe,
701
736
  className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
702
737
  children: [/* @__PURE__ */ q("header", {
703
738
  className: d("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
704
739
  children: [
705
- /* @__PURE__ */ K(O, {
706
- icon: /* @__PURE__ */ K(z, {
707
- size: y.LG,
740
+ /* @__PURE__ */ K(k, {
741
+ icon: /* @__PURE__ */ K(ce, {
742
+ size: b.LG,
708
743
  className: "rtl:scale-x-[-1]",
709
744
  "aria-hidden": !0,
710
- stroke: b
745
+ stroke: x
711
746
  }),
712
- "aria-label": A.backLabel,
747
+ "aria-label": j.backLabel,
713
748
  onClick: u
714
749
  }),
715
750
  /* @__PURE__ */ K("h1", {
716
- className: d("min-w-0 flex-1", ie, $.title),
717
- children: /* @__PURE__ */ K(C, { text: e.name })
751
+ className: d("min-w-0 flex-1", re, $.title),
752
+ children: /* @__PURE__ */ K(w, { text: e.name })
718
753
  }),
719
- /* @__PURE__ */ K(O, {
720
- icon: a ? /* @__PURE__ */ K(le, {
721
- size: y.MD,
754
+ /* @__PURE__ */ K(k, {
755
+ icon: a ? /* @__PURE__ */ K(de, {
756
+ size: b.MD,
722
757
  "aria-hidden": !0
723
- }) : /* @__PURE__ */ K(ce, {
724
- size: y.MD,
758
+ }) : /* @__PURE__ */ K(R, {
759
+ size: b.MD,
725
760
  "aria-hidden": !0,
726
- stroke: b
761
+ stroke: x
727
762
  }),
728
- "aria-label": A.pinLabel,
763
+ "aria-label": j.pinLabel,
729
764
  "aria-pressed": a,
730
765
  "aria-disabled": s || void 0,
731
766
  onClick: () => {
732
767
  s || f();
733
768
  }
734
769
  }),
735
- p && /* @__PURE__ */ K(re, {
736
- label: A.publishLabel,
770
+ p && /* @__PURE__ */ K(ne, {
771
+ label: j.publishLabel,
737
772
  onClick: p,
738
773
  className: "hidden shrink-0 desktop:inline-flex"
739
774
  }),
740
- h && /* @__PURE__ */ K(m, {
741
- label: A.editLabel,
742
- variant: _.Primary,
743
- onClick: h,
775
+ m && /* @__PURE__ */ K(h, {
776
+ label: j.editLabel,
777
+ variant: v.Primary,
778
+ onClick: m,
744
779
  className: "hidden shrink-0 desktop:inline-flex"
745
780
  }),
746
- ge(!1, "hidden desktop:block"),
747
- ge(!0, "desktop:hidden")
781
+ G(!1, "hidden desktop:block"),
782
+ G(!0, "desktop:hidden")
748
783
  ]
749
784
  }), /* @__PURE__ */ q("div", {
750
- className: d("flex min-w-0 flex-1 flex-col desktop:flex-row", k == null && "desktop:justify-end"),
751
- children: [k != null && /* @__PURE__ */ K("section", {
752
- "aria-label": te,
785
+ className: d("flex min-w-0 flex-1 flex-col desktop:flex-row", D == null && "desktop:justify-end"),
786
+ children: [D != null && /* @__PURE__ */ K("section", {
787
+ "aria-label": A,
753
788
  className: "flex min-w-0 flex-1 flex-col gap-6 px-4 py-6 desktop:px-8",
754
- children: k
789
+ children: D
755
790
  }), /* @__PURE__ */ q("aside", {
756
- "aria-labelledby": W,
791
+ "aria-labelledby": V,
757
792
  className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:w-[488px] desktop:shrink-0 desktop:border-s desktop:border-t-0 desktop:px-8", $.panel),
758
793
  children: [
759
794
  /* @__PURE__ */ K("h2", {
760
- id: W,
761
- className: d(F, $.title),
762
- children: A.detailsLabel
795
+ id: V,
796
+ className: d(ie, $.title),
797
+ children: j.detailsLabel
763
798
  }),
764
799
  e.description !== "" && /* @__PURE__ */ q("section", {
765
800
  className: "flex min-w-0 flex-col gap-1",
766
801
  children: [/* @__PURE__ */ K("h3", {
767
802
  className: d(I, $.secondary),
768
- children: A.descriptionLabel
803
+ children: j.descriptionLabel
769
804
  }), /* @__PURE__ */ K("p", {
770
- className: d("wrap-break-word whitespace-pre-line", R, $.body),
805
+ className: d("wrap-break-word whitespace-pre-line", L, $.body),
771
806
  children: e.description
772
807
  })]
773
808
  }),
@@ -775,12 +810,12 @@ var ve = /* @__PURE__ */ function(e) {
775
810
  className: "flex min-w-0 flex-col gap-1",
776
811
  children: [/* @__PURE__ */ K("h3", {
777
812
  className: d(I, $.secondary),
778
- children: A.instructionsLabel
813
+ children: j.instructionsLabel
779
814
  }), /* @__PURE__ */ K("div", {
780
- className: d("min-w-0 wrap-break-word", R, $.body),
815
+ className: d("min-w-0 wrap-break-word", L, $.body),
781
816
  children: /* @__PURE__ */ K(i, {
782
817
  content: e.instructions,
783
- classNames: G
818
+ classNames: me
784
819
  })
785
820
  })]
786
821
  }),
@@ -788,37 +823,37 @@ var ve = /* @__PURE__ */ function(e) {
788
823
  className: "flex min-w-0 flex-col gap-2",
789
824
  children: [/* @__PURE__ */ K("h3", {
790
825
  className: d(I, $.secondary),
791
- children: A.contextLabel
792
- }), B.length === 0 ? /* @__PURE__ */ K(o, { label: A.emptyContextLabel }) : /* @__PURE__ */ q(pe, { children: [
826
+ children: j.contextLabel
827
+ }), pe.length === 0 ? /* @__PURE__ */ K(o, { label: j.emptyContextLabel }) : /* @__PURE__ */ q(he, { children: [
793
828
  /* @__PURE__ */ K("div", {
794
829
  role: "search",
795
- children: /* @__PURE__ */ K(L, {
830
+ children: /* @__PURE__ */ K(ae, {
796
831
  value: c,
797
832
  onChange: (e) => l(e ?? ""),
798
- placeholder: A.contextSearchPlaceholder,
799
- clearLabel: A.clearSearchLabel,
800
- "aria-label": A.contextSearchAriaLabel
833
+ placeholder: j.contextSearchPlaceholder,
834
+ clearLabel: j.clearSearchLabel,
835
+ "aria-label": j.contextSearchAriaLabel
801
836
  })
802
837
  }),
803
- V.length === 0 ? /* @__PURE__ */ K("p", {
804
- className: d(oe, $.secondary),
805
- children: A.noContextMatchesLabel
838
+ z.length === 0 ? /* @__PURE__ */ K("p", {
839
+ className: d(se, $.secondary),
840
+ children: j.noContextMatchesLabel
806
841
  }) : /* @__PURE__ */ K("ul", {
807
842
  className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
808
- children: V.map((e) => /* @__PURE__ */ K("li", {
843
+ children: z.map((e) => /* @__PURE__ */ K("li", {
809
844
  className: "min-w-0",
810
- children: /* @__PURE__ */ K(me, {
811
- attachment: nt(e),
812
- searchQuery: fe,
813
- onClick: w,
814
- labels: { clickLabel: A.openFileLabel(e.name) }
845
+ children: /* @__PURE__ */ K(ge, {
846
+ attachment: it(e),
847
+ searchQuery: B,
848
+ onClick: C,
849
+ labels: { clickLabel: j.openFileLabel(e.name) }
815
850
  })
816
851
  }, e.name))
817
852
  }),
818
- /* @__PURE__ */ K(j, {
853
+ /* @__PURE__ */ K(te, {
819
854
  visuallyHidden: !0,
820
- as: ne.Span,
821
- children: fe === "" ? "" : A.contextResultCountLabel(V.length)
855
+ as: N.Span,
856
+ children: B === "" ? "" : j.contextResultCountLabel(z.length)
822
857
  })
823
858
  ] })]
824
859
  })
@@ -826,7 +861,7 @@ var ve = /* @__PURE__ */ function(e) {
826
861
  })]
827
862
  })]
828
863
  });
829
- }), it = 24, at = ({ item: e, labels: n, rowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
864
+ }), ot = 24, st = ({ item: e, labels: n, rowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
830
865
  let s = U(() => [...a ? [{
831
866
  key: "rename",
832
867
  label: n.renameLabel,
@@ -855,28 +890,28 @@ var ve = /* @__PURE__ */ function(e) {
855
890
  className: "shrink-0",
856
891
  children: /* @__PURE__ */ K(t, {
857
892
  name: e.authorName ?? "",
858
- size: it
893
+ size: ot
859
894
  })
860
- }), /* @__PURE__ */ K(C, {
895
+ }), /* @__PURE__ */ K(w, {
861
896
  text: e.title,
862
897
  className: d("min-w-0 flex-1", r)
863
898
  })]
864
- }), s.length > 0 && /* @__PURE__ */ K(x, {
899
+ }), s.length > 0 && /* @__PURE__ */ K(S, {
865
900
  items: s,
866
901
  placement: "bottom-end",
867
- children: /* @__PURE__ */ K(O, {
902
+ children: /* @__PURE__ */ K(k, {
868
903
  "aria-label": n.moreActionsLabel(e.title),
869
- size: S.Small,
904
+ size: C.Small,
870
905
  className: "me-2 shrink-0",
871
- icon: /* @__PURE__ */ K(se, {
906
+ icon: /* @__PURE__ */ K(ue, {
872
907
  "aria-hidden": !0,
873
- size: y.SM,
874
- stroke: b
908
+ size: b.SM,
909
+ stroke: x
875
910
  })
876
911
  })
877
912
  })]
878
913
  });
879
- }, ot = B(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, onOpen: c, onRename: ee, onDelete: l, labels: u, typography: f }) => {
914
+ }, ct = B(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, onOpen: c, onRename: ee, onDelete: l, labels: u, typography: f }) => {
880
915
  let p = H(), m = f?.titleClassName ?? "dial-body-semi-text", h = f?.rowTitleClassName ?? "dial-body-text", g = f?.messageClassName ?? "dial-small-text", _ = !t && !n && e.length === 0;
881
916
  return /* @__PURE__ */ q("section", {
882
917
  "aria-labelledby": _ ? void 0 : p,
@@ -891,7 +926,7 @@ var ve = /* @__PURE__ */ function(e) {
891
926
  className: "flex justify-center py-6",
892
927
  children: [/* @__PURE__ */ K("span", {
893
928
  "aria-hidden": !0,
894
- children: /* @__PURE__ */ K(ae, {})
929
+ children: /* @__PURE__ */ K(oe, {})
895
930
  }), /* @__PURE__ */ K("span", {
896
931
  className: "sr-only",
897
932
  children: u.loadingLabel
@@ -902,7 +937,7 @@ var ve = /* @__PURE__ */ function(e) {
902
937
  children: [/* @__PURE__ */ K("p", {
903
938
  className: d("m-0", g),
904
939
  children: u.errorLabel
905
- }), /* @__PURE__ */ K(D, {
940
+ }), /* @__PURE__ */ K(O, {
906
941
  label: u.retryLabel,
907
942
  onClick: r
908
943
  })]
@@ -912,9 +947,9 @@ var ve = /* @__PURE__ */ function(e) {
912
947
  label: u.emptyTitle,
913
948
  description: u.emptyDescription
914
949
  })
915
- }) : /* @__PURE__ */ q(pe, { children: [/* @__PURE__ */ K("ul", {
950
+ }) : /* @__PURE__ */ q(he, { children: [/* @__PURE__ */ K("ul", {
916
951
  className: "m-0 flex min-w-0 list-none flex-col gap-1 p-0",
917
- children: e.map((e) => /* @__PURE__ */ K(at, {
952
+ children: e.map((e) => /* @__PURE__ */ K(st, {
918
953
  item: e,
919
954
  labels: u,
920
955
  rowTitleClassName: h,
@@ -922,44 +957,44 @@ var ve = /* @__PURE__ */ function(e) {
922
957
  onRename: ee,
923
958
  onDelete: l
924
959
  }, e.id))
925
- }), i && s && /* @__PURE__ */ K(D, {
960
+ }), i && s && /* @__PURE__ */ K(O, {
926
961
  className: "self-center",
927
962
  label: u.loadMoreLabel ?? "Show more",
928
963
  disabled: a,
929
964
  onClick: s
930
965
  })] })]
931
966
  });
932
- }), st = B(({ composer: t, items: n, isLoading: r = !1, hasError: i = !1, onRetry: a, hasMore: o, isLoadingMore: s, onLoadMore: c, onOpen: ee, onRename: l, onDelete: u, labels: d, listTypography: f }) => {
933
- let p = H(), m = W(null), [g, v] = G(null), [y, b] = G(""), [x, S] = G(), [C, w] = G(!1), [T, E] = G(null), [D, O] = G(!1), k = W(null), A = V(() => {
967
+ }), lt = B(({ composer: t, items: n, isLoading: r = !1, hasError: i = !1, onRetry: a, hasMore: o, isLoadingMore: s, onLoadMore: c, onOpen: ee, onRename: l, onDelete: u, labels: d, listTypography: f }) => {
968
+ let p = H(), m = W(null), [h, _] = G(null), [y, b] = G(""), [x, S] = G(), [C, w] = G(!1), [T, E] = G(null), [D, O] = G(!1), k = W(null), A = V(() => {
934
969
  k.current = document.activeElement;
935
- }, []), j = V(() => {
970
+ }, []), M = V(() => {
936
971
  let e = k.current;
937
972
  k.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
938
- }, []), ne = V((e) => {
973
+ }, []), te = V((e) => {
939
974
  k.current = null, window.setTimeout(() => {
940
975
  let t = m.current;
941
976
  if (!t) return;
942
977
  let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
943
978
  r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
944
979
  }, 0);
945
- }, []), M = V((e) => n.find((t) => t.id === e) ?? null, [n]), N = V((e) => {
980
+ }, []), N = V((e) => n.find((t) => t.id === e) ?? null, [n]), P = V((e) => {
946
981
  A();
947
- let t = M(e);
948
- v(t), b(t?.title ?? ""), S(void 0);
949
- }, [M, A]), re = V((e) => {
950
- A(), E(M(e));
951
- }, [M, A]), F = V(() => {
952
- C || (v(null), j());
953
- }, [C, j]), I = V(() => {
954
- D || (E(null), j());
955
- }, [D, j]), L = V(async () => {
956
- if (!g || !l || C) return;
982
+ let t = N(e);
983
+ _(t), b(t?.title ?? ""), S(void 0);
984
+ }, [N, A]), F = V((e) => {
985
+ A(), E(N(e));
986
+ }, [N, A]), ne = V(() => {
987
+ C || (_(null), M());
988
+ }, [C, M]), I = V(() => {
989
+ D || (E(null), M());
990
+ }, [D, M]), L = V(async () => {
991
+ if (!h || !l || C) return;
957
992
  let e = y.trim();
958
993
  if (!e) S(d.renameEmptyError);
959
994
  else {
960
995
  w(!0);
961
996
  try {
962
- await l(g.id, e), v(null), j();
997
+ await l(h.id, e), _(null), M();
963
998
  } catch {} finally {
964
999
  w(!1);
965
1000
  }
@@ -968,51 +1003,51 @@ var ve = /* @__PURE__ */ function(e) {
968
1003
  C,
969
1004
  d.renameEmptyError,
970
1005
  l,
971
- g,
1006
+ h,
972
1007
  y,
973
- j
1008
+ M
974
1009
  ]), ae = V((e) => {
975
1010
  e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), L());
976
- }, [L]), R = V(async () => {
1011
+ }, [L]), oe = V(async () => {
977
1012
  if (!T || !u) return;
978
1013
  let e = n.findIndex((e) => e.id === T.id);
979
1014
  O(!0);
980
1015
  try {
981
- await u(T.id), E(null), ne(Math.max(e, 0));
1016
+ await u(T.id), E(null), te(Math.max(e, 0));
982
1017
  } catch {} finally {
983
1018
  O(!1);
984
1019
  }
985
1020
  }, [
986
1021
  T,
987
- ne,
1022
+ te,
988
1023
  n,
989
1024
  u
990
- ]), z = U(() => [{
1025
+ ]), se = U(() => [{
991
1026
  label: d.renameCancelLabel ?? "Cancel",
992
- variant: _.Primary,
993
- appearance: h.Ghost,
1027
+ variant: v.Primary,
1028
+ appearance: g.Ghost,
994
1029
  disabled: C,
995
- onClick: F
1030
+ onClick: ne
996
1031
  }, {
997
1032
  label: d.renameSaveLabel,
998
- variant: _.Primary,
1033
+ variant: v.Primary,
999
1034
  disabled: C,
1000
1035
  onClick: () => {
1001
1036
  L();
1002
1037
  }
1003
1038
  }], [
1004
- F,
1039
+ ne,
1005
1040
  L,
1006
1041
  C,
1007
1042
  d.renameCancelLabel,
1008
1043
  d.renameSaveLabel
1009
1044
  ]);
1010
- return /* @__PURE__ */ q(pe, { children: [
1045
+ return /* @__PURE__ */ q(he, { children: [
1011
1046
  t,
1012
1047
  /* @__PURE__ */ K("div", {
1013
1048
  ref: m,
1014
1049
  className: "contents",
1015
- children: /* @__PURE__ */ K(ot, {
1050
+ children: /* @__PURE__ */ K(ct, {
1016
1051
  items: n,
1017
1052
  isLoading: r,
1018
1053
  hasError: i,
@@ -1021,21 +1056,21 @@ var ve = /* @__PURE__ */ function(e) {
1021
1056
  isLoadingMore: s,
1022
1057
  onLoadMore: c,
1023
1058
  onOpen: ee,
1024
- onRename: l ? N : void 0,
1025
- onDelete: u ? re : void 0,
1059
+ onRename: l ? P : void 0,
1060
+ onDelete: u ? F : void 0,
1026
1061
  labels: d.list,
1027
1062
  typography: f
1028
1063
  })
1029
1064
  }),
1030
- g && /* @__PURE__ */ K(P, {
1065
+ h && /* @__PURE__ */ K(re, {
1031
1066
  open: !0,
1032
1067
  header: d.renameTitle,
1033
1068
  size: ie.Sm,
1034
- mainButtons: z,
1035
- onClose: F,
1069
+ mainButtons: se,
1070
+ onClose: ne,
1036
1071
  children: /* @__PURE__ */ K("div", {
1037
1072
  className: "px-6 py-4",
1038
- children: /* @__PURE__ */ K(te, {
1073
+ children: /* @__PURE__ */ K(j, {
1039
1074
  id: p,
1040
1075
  value: y,
1041
1076
  labelProps: { label: d.renameInputLabel },
@@ -1056,20 +1091,20 @@ var ve = /* @__PURE__ */ function(e) {
1056
1091
  labels: d.deleteDialog,
1057
1092
  isLoading: D,
1058
1093
  onConfirm: () => {
1059
- R();
1094
+ oe();
1060
1095
  },
1061
1096
  onClose: I
1062
1097
  })
1063
1098
  ] });
1064
- }), ct = B(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ q("nav", {
1099
+ }), ut = B(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ q("nav", {
1065
1100
  "aria-label": i,
1066
1101
  className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1067
- children: [/* @__PURE__ */ K(O, {
1102
+ children: [/* @__PURE__ */ K(k, {
1068
1103
  "aria-label": i,
1069
- icon: /* @__PURE__ */ K(z, {
1104
+ icon: /* @__PURE__ */ K(ce, {
1070
1105
  "aria-hidden": !0,
1071
- size: y.MD,
1072
- stroke: b,
1106
+ size: b.MD,
1107
+ stroke: x,
1073
1108
  className: "rtl:scale-x-[-1]"
1074
1109
  }),
1075
1110
  onClick: n
@@ -1077,11 +1112,11 @@ var ve = /* @__PURE__ */ function(e) {
1077
1112
  href: t,
1078
1113
  onClick: r,
1079
1114
  className: "min-w-0 hover:underline focus-visible:underline",
1080
- children: /* @__PURE__ */ K(C, {
1115
+ children: /* @__PURE__ */ K(w, {
1081
1116
  text: e,
1082
1117
  className: d("min-w-0", o)
1083
1118
  })
1084
1119
  })]
1085
1120
  }));
1086
1121
  //#endregion
1087
- export { Q as ContextFileRejection, Me as PROJECT_NAME_MAX_BYTES, ct as ProjectChatHeader, ot as ProjectConversationList, st as ProjectConversationsPanel, tt as ProjectCreateForm, je as ProjectNameError, Oe as ProjectSource, rt as ProjectView, De as Projects, ve as ProjectsSortKey, Ke as checkContextFiles, Je as filterContextFileItems, Ve as getContextFilesSize, ze as isStoredContextFile, Le as validateProjectName };
1122
+ export { Q as ContextFileRejection, Pe as PROJECT_NAME_MAX_BYTES, ut as ProjectChatHeader, ct as ProjectConversationList, lt as ProjectConversationsPanel, rt as ProjectCreateForm, Ne as ProjectNameError, Ae as ProjectSource, at as ProjectView, ke as Projects, Y as ProjectsSortKey, Je as checkContextFiles, Xe as filterContextFileItems, Ue as getContextFilesSize, Ve as isStoredContextFile, ze as validateProjectName };