@epam/ai-dial-projects 1.3.0-dev.259 → 1.3.0-dev.265

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