@epam/ai-dial-projects 1.3.0-dev.357 → 1.3.0-dev.360

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