@epam/ai-dial-conversation-stages 1.2.0-dev.209 → 1.2.0-dev.213

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAsNlD,CAAC"}
1
+ {"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA2NlD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
1
+ import { DisplayAttachment, Stage } from '@epam/ai-dial-chat-shared';
2
2
  import { FC } from 'react';
3
3
  import { StagesPanelLabels, StageTypography } from '../../models/stages-props';
4
4
  /** Props for {@link StageItem}. */
@@ -13,6 +13,8 @@ export interface StageItemProps {
13
13
  labels?: StagesPanelLabels;
14
14
  /** Overrides the displayed name; used to relabel individual attempts (e.g. `'Attempt 2'`) inside a `×N` group. */
15
15
  nameOverride?: string;
16
+ /** Called when a stage attachment tile is clicked/activated. Receives the mapped display attachment. */
17
+ onAttachmentClick?: (attachment: DisplayAttachment) => void;
16
18
  }
17
19
  /** Renders a single stage row, optionally expandable to show its content. */
18
20
  export declare const StageItem: FC<StageItemProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAMnC,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kHAAkH;IAClH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAwGxC,CAAC"}
1
+ {"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAG1E,OAAO,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAOnC,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kHAAkH;IAClH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7D;AAyCD,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAuHxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAwHnC,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAoE5C,CAAC"}
1
+ {"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AA4HnC,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAuE5C,CAAC"}
package/index.css CHANGED
@@ -1,2 +1,2 @@
1
1
  ._panel_8he9e_1{color:var(--cs-text,var(--text-primary,#161b2d))}._row_8he9e_5:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._collapseButton_8he9e_9{background:var(--cs-button-bg,transparent)}._stageHeader_8he9e_18._stageHeader_8he9e_18:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._stageHeader_8he9e_18._stageHeader_8he9e_18>svg{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._stageRegion_8he9e_27._stageRegion_8he9e_27{color:inherit}._stageName_8he9e_31{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._stageNameFailed_8he9e_35{color:var(--cs-failed-text,var(--text-warning,#7f6300))}._monoName_8he9e_39{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}._tag_8he9e_43{color:var(--cs-tag-text,var(--text-tertiary,#848e9c))}._count_8he9e_47{color:var(--cs-count-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._duration_8he9e_52{color:var(--cs-duration-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._iconSecondary_8he9e_57{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._iconCompleted_8he9e_62{color:var(--cs-icon-completed,var(--text-tertiary,#848e9c))}._iconError_8he9e_66{color:var(--cs-icon-error,var(--text-warning,#7f6300))}._stageContent_8he9e_70{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._codeBlock_8he9e_74{background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._codeInline_8he9e_80{background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border:1px solid var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._blockquote_8he9e_86{border-color:var(--cs-stage-text,var(--text-secondary,#57647a));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._tableCell_8he9e_91{border-color:var(--cs-border,var(--stroke-secondary,#d1dbea));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._toggleButton_1kyyc_7._toggleButton_1kyyc_7{color:var(--cs-cg-label,var(--text-secondary,#57647a));text-align:start;width:100%;min-width:0}._toggleButton_1kyyc_7._toggleButton_1kyyc_7:hover{color:var(--cs-cg-label-hover,var(--text-primary,#161b2d));background:0 0}._toggleButton_1kyyc_7._toggleButton_1kyyc_7>svg{width:12px;height:12px;color:inherit}._toggleButton_1kyyc_7._toggleButton_1kyyc_7>span>span{white-space:normal}._groupRegion_1kyyc_28._groupRegion_1kyyc_28{color:inherit}._executedLabel_1kyyc_32{color:var(--cs-cg-label,var(--text-secondary,#57647a))}._stepsCount_1kyyc_36{color:var(--cs-cg-steps-count,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._doneIcon_1kyyc_41{color:var(--cs-cg-done,var(--text-success,#007274))}._failedText_1kyyc_45{color:var(--cs-cg-failed,var(--text-warning,#7f6300))}._liveName_1kyyc_49{color:var(--cs-cg-label,var(--text-primary,#161b2d))}
2
- /*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.collapse{visibility:collapse}.-mt-1{margin-top:-.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.max-h-\[300px\]{max-height:300px}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[22rem\]{max-width:22rem}.flex-none{flex:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.ps-5{padding-inline-start:1.25rem}.ps-6{padding-inline-start:1.5rem}.ps-8{padding-inline-start:2rem}.pt-1{padding-top:.25rem}.text-start{text-align:start}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.last\:mb-0:last-child{margin-bottom:0}
2
+ /*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.collapse{visibility:collapse}.-mt-1{margin-top:-.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.max-h-\[300px\]{max-height:300px}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[22rem\]{max-width:22rem}.flex-none{flex:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.ps-5{padding-inline-start:1.25rem}.ps-6{padding-inline-start:1.5rem}.ps-8{padding-inline-start:2rem}.pt-1{padding-top:.25rem}.text-start{text-align:start}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.last\:mb-0:last-child{margin-bottom:0}
package/index.js CHANGED
@@ -1,46 +1,46 @@
1
- import { MarkdownCodeBlock as e, MarkdownRenderer as t, StageStatus as n, buildCssVars as r, mergeClasses as i } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as a, DIAL_ICON_SIZE as o, DIAL_KIT_ICON_STROKE as s, EllipsisTooltip as c, Spinner as l } from "@epam/ai-dial-ui-kit";
3
- import { IconAlertCircle as u, IconCheck as d } from "@tabler/icons-react";
4
- import { memo as f, useEffect as p, useRef as m, useState as h } from "react";
5
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
1
+ import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, MarkdownCodeBlock as r, MarkdownRenderer as i, RequestStatus as a, StageStatus as o, buildCssVars as s, mergeClasses as c, messageAttachmentsToDisplayAttachments as l, normalizeMimeType as u } from "@epam/ai-dial-chat-shared";
2
+ import { Accordion as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, ElementSize as m, EllipsisTooltip as h, Highlight as g, Skeleton as _, SkeletonVariant as v, Spinner as y, StaticIconButton as b } from "@epam/ai-dial-ui-kit";
3
+ import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as L, IconFileTypePng as ee, IconFileTypePpt as R, IconFileTypeRs as z, IconFileTypeSql as te, IconFileTypeSvg as ne, IconFileTypeTs as re, IconFileTypeTsx as B, IconFileTypeTxt as ie, IconFileTypeVue as ae, IconFileTypeXls as oe, IconFileTypeXml as se, IconFileTypeZip as ce, IconMusic as le, IconPhoto as V, IconReload as ue, IconTerminal2 as de, IconVideo as fe, IconX as pe } from "@tabler/icons-react";
4
+ import { memo as me, useCallback as he, useEffect as H, useId as ge, useMemo as U, useRef as _e, useState as ve } from "react";
5
+ import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
6
6
  //#region src/constants/public-class-names.ts
7
- var y = {
7
+ var q = {
8
8
  panel: "dial-conversation-stages-panel",
9
9
  group: "dial-conversation-stages-group",
10
10
  groupToggle: "dial-conversation-stages-group-toggle"
11
- }, b = /[([][^()[\]]*[)\]]/g, x = /(\d+(?:\.\d+)?)\s*s\b/, S = /\bStart:\s*(\d{1,2}):([0-5]\d):([0-5]\d(?:\.\d+)?)\b/i, C = (e) => {
11
+ }, ye = /[([][^()[\]]*[)\]]/g, be = /(\d+(?:\.\d+)?)\s*s\b/, xe = /\bStart:\s*(\d{1,2}):([0-5]\d):([0-5]\d(?:\.\d+)?)\b/i, Se = (e) => {
12
12
  let t = e.trimEnd();
13
13
  return t.endsWith(":") ? t.slice(0, -1) : t;
14
- }, w = 1440 * 60, T = w / 2, E = (e) => {
15
- let t = S.exec(e);
14
+ }, Ce = 1440 * 60, we = Ce / 2, Te = (e) => {
15
+ let t = xe.exec(e);
16
16
  if (!t) return;
17
17
  let n = Number(t[1]);
18
18
  if (!(n > 23)) return n * 60 * 60 + Number(t[2]) * 60 + Number(t[3]);
19
- }, D = (e) => {
20
- b.lastIndex = 0;
19
+ }, Ee = (e) => {
20
+ ye.lastIndex = 0;
21
21
  let t;
22
- for (; t = b.exec(e);) {
23
- let e = t[0].slice(1, -1), n = x.exec(e);
22
+ for (; t = ye.exec(e);) {
23
+ let e = t[0].slice(1, -1), n = be.exec(e);
24
24
  if (n) return {
25
25
  durationLabel: `${n[1]}s`,
26
26
  groupIndex: t.index,
27
27
  groupLength: t[0].length,
28
- startTimeSeconds: E(e)
28
+ startTimeSeconds: Te(e)
29
29
  };
30
30
  }
31
- }, O = (e) => {
32
- let t = e ?? "", n = D(t);
31
+ }, J = (e) => {
32
+ let t = e ?? "", n = Ee(t);
33
33
  return {
34
- name: C(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
34
+ name: Se(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
35
35
  durationLabel: n?.durationLabel
36
36
  };
37
- }, k = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), A = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, j = (e) => {
37
+ }, De = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), Oe = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, ke = (e) => {
38
38
  if (!e) return;
39
39
  let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
40
40
  return t ? parseFloat(t[1]) : void 0;
41
- }, M = (e) => {
41
+ }, Ae = (e) => {
42
42
  let t = e.flatMap((e) => {
43
- let t = D(e ?? ""), n = j(t?.durationLabel);
43
+ let t = Ee(e ?? ""), n = ke(t?.durationLabel);
44
44
  return n == null ? [] : [{
45
45
  durationSeconds: n,
46
46
  startTimeSeconds: t?.startTimeSeconds
@@ -51,18 +51,18 @@ var y = {
51
51
  let n = 0, r, i = t.flatMap(({ durationSeconds: e, startTimeSeconds: t }) => {
52
52
  if (t == null) return [];
53
53
  let i = t + n;
54
- return r != null && r - i > T && (n += w, i += w), r = i, {
54
+ return r != null && r - i > we && (n += Ce, i += Ce), r = i, {
55
55
  start: i,
56
56
  end: i + e
57
57
  };
58
58
  }).sort((e, t) => e.start - t.start), a = 0, o = i[0].start, s = i[0].end;
59
59
  for (let e of i.slice(1)) e.start <= s ? s = Math.max(s, e.end) : (a += s - o, o = e.start, s = e.end);
60
60
  return a + s - o;
61
- }, N = (e) => [...e].reverse().find((e) => e.status == null), P = "overflow-visible py-0", F = "justify-start gap-2 rounded-lg px-2 py-1.5 text-start", I = (e) => {
61
+ }, je = (e) => [...e].reverse().find((e) => e.status == null), Me = "overflow-visible py-0", Ne = "justify-start gap-2 rounded-lg px-2 py-1.5 text-start", Pe = (e) => {
62
62
  let t = [], n = 0;
63
63
  for (; n < e.length;) {
64
- let r = e[n], i = O(r.name).name, a = n + 1;
65
- for (; a < e.length && O(e[a].name).name === i;) a += 1;
64
+ let r = e[n], i = J(r.name).name, a = n + 1;
65
+ for (; a < e.length && J(e[a].name).name === i;) a += 1;
66
66
  let o = e.slice(n, a);
67
67
  o.length > 1 ? t.push({
68
68
  key: r.index,
@@ -74,7 +74,7 @@ var y = {
74
74
  }), n = a;
75
75
  }
76
76
  return t;
77
- }, L = {
77
+ }, Y = {
78
78
  panel: "_panel_8he9e_1",
79
79
  row: "_row_8he9e_5",
80
80
  collapseButton: "_collapseButton_8he9e_9",
@@ -94,194 +94,577 @@ var y = {
94
94
  codeInline: "_codeInline_8he9e_80",
95
95
  blockquote: "_blockquote_8he9e_86",
96
96
  tableCell: "_tableCell_8he9e_91"
97
- }, R = ({ status: e, isLive: t, runningLabel: r = "Running", failedLabel: i = "Failed" }) => e === n.Failed ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(u, {
98
- size: o.MD,
99
- className: L.iconError,
97
+ }, Fe = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(x, {
98
+ size: f.MD,
99
+ className: Y.iconError,
100
100
  "aria-hidden": !0,
101
- stroke: s
102
- }), /* @__PURE__ */ _("span", {
101
+ stroke: p
102
+ }), /* @__PURE__ */ G("span", {
103
103
  className: "sr-only",
104
- children: i
105
- })] }) : e === n.Completed ? /* @__PURE__ */ _(d, {
106
- size: o.SM,
107
- className: L.iconCompleted,
104
+ children: r
105
+ })] }) : e === o.Completed ? /* @__PURE__ */ G(S, {
106
+ size: f.SM,
107
+ className: Y.iconCompleted,
108
108
  "aria-hidden": !0,
109
- stroke: s
110
- }) : t ? /* @__PURE__ */ _(l, {
109
+ stroke: p
110
+ }) : t ? /* @__PURE__ */ G(y, {
111
111
  size: 16,
112
- ariaLabel: r
113
- }) : null, z = ({ children: t, codeClassName: n, blockClassName: r = "dial-code-text", copyAriaLabel: a }) => /* @__PURE__ */ _(e, {
114
- language: n?.replace(/^language-/, "") ?? "",
115
- value: typeof t == "string" ? t : String(t ?? ""),
116
- codeClassName: r,
117
- containerClassName: i(L.codeBlock, r),
118
- copyLabel: a,
112
+ ariaLabel: n
113
+ }) : null, Ie = (e) => {
114
+ if (e == null) return "";
115
+ let t = e.lastIndexOf(".");
116
+ return t > 0 ? e.slice(0, t) : e;
117
+ }, Le = (e) => {
118
+ if (!e) return E;
119
+ let t = u(e);
120
+ if (t.startsWith("image/")) switch (t) {
121
+ case "image/jpeg": return N;
122
+ case "image/png": return ee;
123
+ case "image/svg+xml": return ne;
124
+ case "image/bmp": return D;
125
+ default: return V;
126
+ }
127
+ if (t.startsWith("video/")) return fe;
128
+ if (t.startsWith("audio/")) return le;
129
+ switch (t) {
130
+ case "application/pdf": return I;
131
+ case "application/msword": return A;
132
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return j;
133
+ case "application/vnd.ms-powerpoint": return R;
134
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return R;
135
+ case "application/vnd.ms-excel": return oe;
136
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return oe;
137
+ case "application/zip":
138
+ case "application/vnd.rar":
139
+ case "application/x-7z-compressed":
140
+ case "application/gzip":
141
+ case "application/x-tar": return ce;
142
+ case "text/csv": return k;
143
+ case "text/plain": return ie;
144
+ case "text/html":
145
+ case "application/xhtml+xml": return M;
146
+ case "application/xml": return se;
147
+ case "application/sql": return te;
148
+ case "text/javascript": return P;
149
+ case "text/jsx": return F;
150
+ case "text/typescript": return re;
151
+ case "text/tsx": return B;
152
+ case "text/css": return O;
153
+ case "text/x-php": return L;
154
+ case "text/x-rustsrc": return z;
155
+ case "text/x-vue": return ae;
156
+ default: return E;
157
+ }
158
+ }, Re = (e) => {
159
+ let { type: n, contentType: r } = e;
160
+ return n === t.Prompt ? de : n === t.Pasted ? C : n === t.Image ? V : Le(r ?? "");
161
+ }, ze = (e) => {
162
+ let t = u(e), r = n[t];
163
+ if (r) return r;
164
+ let i = t.split("/")[1];
165
+ if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
166
+ }, Be = (e, n) => {
167
+ let { type: r, name: i, contentType: a } = e;
168
+ if (r === t.Prompt) return n.promptLabel ?? "Prompt";
169
+ if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
170
+ if (r === t.Image) return n.imageLabel ?? "Image";
171
+ if (a) {
172
+ let e = ze(a);
173
+ if (e) return `.${e}`;
174
+ }
175
+ if (i == null) return "";
176
+ let o = i.lastIndexOf(".");
177
+ return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
178
+ }, Ve = (e, n = {}) => {
179
+ let { type: r, status: i, previewUrl: o, url: s } = e, c = i === a.Loading, l = i === a.Error, u = r === t.Image && !!(o ?? s) && !l, d = r === t.Link && !l;
180
+ return {
181
+ isLoading: c,
182
+ isError: l,
183
+ isImage: u,
184
+ isLink: d,
185
+ BottomIcon: d ? null : Re(e),
186
+ typeLabel: d ? null : Be(e, n)
187
+ };
188
+ }, He = "flex size-[84px] items-center justify-center rounded-xl border", X = {
189
+ tray: "dial-ai-attachment-tray",
190
+ trayItem: "dial-ai-attachment-tray-item",
191
+ tile: "dial-ai-attachment-tile",
192
+ tileSelected: "dial-ai-attachment-tile-selected",
193
+ tileName: "dial-ai-attachment-tile-name",
194
+ tileType: "dial-ai-attachment-tile-type",
195
+ tileAction: "dial-ai-attachment-tile-action"
196
+ }, Z = {
197
+ tile: "_tile_s2es2_12",
198
+ hovered: "_hovered_s2es2_18",
199
+ selected: "_selected_s2es2_28",
200
+ tileError: "_tileError_s2es2_33",
201
+ nameText: "_nameText_s2es2_38",
202
+ typeText: "_typeText_s2es2_42",
203
+ retryIcon: "_retryIcon_s2es2_46",
204
+ track: "_track_s2es2_50",
205
+ actionButton: "_actionButton_s2es2_56",
206
+ imageActionButton: "_imageActionButton_s2es2_60"
207
+ }, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ G(b, {
208
+ icon: a,
209
+ size: m.Small,
210
+ className: c("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o, X.tileAction),
211
+ "aria-label": e,
212
+ "aria-describedby": t ? n : void 0,
213
+ onClick: (e) => {
214
+ e.stopPropagation(), r(i);
215
+ }
216
+ }), Ue = ({ ...e }) => /* @__PURE__ */ G(Q, {
217
+ icon: /* @__PURE__ */ G(ue, {
218
+ size: f.SM,
219
+ "aria-hidden": !0,
220
+ stroke: p
221
+ }),
222
+ className: Z.retryIcon,
223
+ ...e
224
+ }), We = ({ ...e }) => /* @__PURE__ */ G(Q, {
225
+ icon: /* @__PURE__ */ G(w, {
226
+ size: f.SM,
227
+ "aria-hidden": !0,
228
+ stroke: p
229
+ }),
230
+ ...e
231
+ }), Ge = ({ ...e }) => /* @__PURE__ */ G(Q, {
232
+ icon: /* @__PURE__ */ G(T, {
233
+ size: f.SM,
234
+ "aria-hidden": !0,
235
+ stroke: p
236
+ }),
237
+ ...e
238
+ }), Ke = ({ ...e }) => /* @__PURE__ */ G(Q, {
239
+ icon: /* @__PURE__ */ G(pe, {
240
+ size: f.SM,
241
+ "aria-hidden": !0,
242
+ stroke: p
243
+ }),
244
+ ...e
245
+ }), qe = {
246
+ [e.Network]: "Upload failed · network error",
247
+ [e.UnsupportedType]: "Upload failed · unsupported file type",
248
+ [e.FileTooLarge]: "Upload failed · file too large"
249
+ }, Je = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isPasted: u, isLink: d, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: _ }) => {
250
+ let { clickLabel: v = "Download attachment", retryLabel: b = "Retry upload", removeLabel: x = "Remove attachment", openInNewTabLabel: S = "Open in new tab", sizeLabel: C, uploadingLabel: w = "Uploading", errorReasonLabels: T, genericErrorLabel: E = "Upload failed" } = o ?? {}, { typography: D, className: O } = s ?? {}, { id: k, name: A, status: j, errorReason: M } = t, N = j === a.Loading, P = j === a.Error, F = ge(), I = P ? M && (T?.[M] ?? qe[M]) || E : "", { BottomIcon: L, typeLabel: ee } = Ve(t), R = !P && !N && l && !d, z = P && !!i && M !== e.UnsupportedType && M !== e.FileTooLarge, te = Number(!!R) + Number(!!z) + Number(!!d) + Number(!!h), ne = te > 1 ? "pe-11" : te === 1 ? "pe-5" : void 0, re = (e) => {
251
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
252
+ }, B = U(() => u ? A : Ie(A), [u, A]), ie = he(() => {
253
+ window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
254
+ }, [t]), ae = c(He, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !P && Z.hovered, _ && Z.selected, P && Z.tileError, X.tile, _ && X.tileSelected), oe = /* @__PURE__ */ G("div", {
255
+ title: B,
256
+ className: c(D?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", Z.nameText, !P && ne, X.tileName),
257
+ children: n ? /* @__PURE__ */ G(g, {
258
+ text: B,
259
+ query: n,
260
+ maxLines: 2
261
+ }) : B
262
+ }), se = L && /* @__PURE__ */ K("div", {
263
+ className: c("flex w-full items-center gap-1", P && ne, X.tileType),
264
+ children: [/* @__PURE__ */ G(L, {
265
+ size: 16,
266
+ className: Z.typeText,
267
+ "aria-hidden": !0
268
+ }), /* @__PURE__ */ G("span", {
269
+ className: c(D?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
270
+ children: C ? `${ee} · ${C}` : ee
271
+ })]
272
+ }), ce = () => {
273
+ m && p ? p(k) : r && r(k);
274
+ }, le = /* @__PURE__ */ K(W, { children: [
275
+ oe,
276
+ se,
277
+ N && /* @__PURE__ */ G("div", {
278
+ role: "progressbar",
279
+ "aria-label": w,
280
+ className: c("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
281
+ children: /* @__PURE__ */ G(y, { size: 32 })
282
+ }),
283
+ /* @__PURE__ */ K("div", {
284
+ className: "absolute end-1 top-1 flex gap-1",
285
+ children: [
286
+ R && /* @__PURE__ */ G(We, {
287
+ ariaLabel: v,
288
+ errorTitle: I,
289
+ errorDescId: F,
290
+ onClick: l,
291
+ id: k
292
+ }),
293
+ z && /* @__PURE__ */ G(Ue, {
294
+ ariaLabel: b,
295
+ errorTitle: I,
296
+ errorDescId: F,
297
+ onClick: i,
298
+ id: k
299
+ }),
300
+ d && /* @__PURE__ */ G(Ge, {
301
+ ariaLabel: S,
302
+ errorTitle: I,
303
+ errorDescId: F,
304
+ onClick: ie
305
+ }),
306
+ h && /* @__PURE__ */ G(Ke, {
307
+ ariaLabel: x,
308
+ errorTitle: I,
309
+ errorDescId: F,
310
+ onClick: h,
311
+ id: k
312
+ })
313
+ ]
314
+ }),
315
+ P && /* @__PURE__ */ G("span", {
316
+ id: F,
317
+ role: "status",
318
+ "aria-live": "polite",
319
+ className: "sr-only",
320
+ children: I
321
+ })
322
+ ] });
323
+ return /* @__PURE__ */ G("div", {
324
+ style: f,
325
+ className: c("inline-flex", O),
326
+ children: /* @__PURE__ */ G("div", {
327
+ role: "button",
328
+ tabIndex: 0,
329
+ "aria-label": v,
330
+ "aria-busy": N,
331
+ onClick: ce,
332
+ onKeyDown: re,
333
+ style: f,
334
+ className: c(ae, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
335
+ children: le
336
+ })
337
+ });
338
+ }, Ye = /* @__PURE__ */ function(e) {
339
+ return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
340
+ }({}), Xe = ({ enabled: e, src: t }) => {
341
+ let n = _e(null), [r, i] = ve("idle");
342
+ return H(() => {
343
+ i(e && t ? "loading" : "idle");
344
+ }, [e, t]), H(() => {
345
+ let r = n.current;
346
+ if (!r || !e || !t) return;
347
+ let a = () => i("loaded"), o = () => i("error");
348
+ return r.addEventListener("load", a), r.addEventListener("error", o), r.complete && i(r.naturalWidth > 0 ? "loaded" : "error"), () => {
349
+ r.removeEventListener("load", a), r.removeEventListener("error", o);
350
+ };
351
+ }, [e, t]), {
352
+ imageRef: n,
353
+ imageLoadStatus: r
354
+ };
355
+ }, Ze = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
356
+ let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } = U(() => Ve(e), [e]), D = r !== void 0 && !C && !w && !T, { imageRef: O, imageLoadStatus: k } = Xe({
357
+ enabled: E,
358
+ src: S
359
+ }), A = () => {
360
+ C && n ? n(b) : D && r && r(b);
361
+ };
362
+ return /* @__PURE__ */ G("div", {
363
+ className: c(He, "group/attachment-tile", D && "cursor-pointer", Z.tile, u && Z.selected, y, X.tile, u && X.tileSelected),
364
+ onClick: A,
365
+ onKeyDown: (e) => {
366
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), A());
367
+ },
368
+ tabIndex: 0,
369
+ role: "button",
370
+ style: o,
371
+ "aria-label": D ? d : C ? m : void 0,
372
+ children: /* @__PURE__ */ K("div", {
373
+ className: "relative h-full w-full overflow-hidden",
374
+ children: [
375
+ /* @__PURE__ */ K("div", {
376
+ className: "absolute end-1 top-1 z-10 flex gap-1",
377
+ children: [a && /* @__PURE__ */ G(Ke, {
378
+ ariaLabel: h,
379
+ onClick: a,
380
+ id: b,
381
+ className: Z.imageActionButton
382
+ }), s && /* @__PURE__ */ G(We, {
383
+ ariaLabel: g,
384
+ onClick: s,
385
+ id: b,
386
+ className: Z.imageActionButton
387
+ })]
388
+ }),
389
+ k !== Ye.Loaded && /* @__PURE__ */ G(_, {
390
+ variant: v.Rectangular,
391
+ width: "100%",
392
+ height: "100%",
393
+ active: k === Ye.Loading,
394
+ overlay: /* @__PURE__ */ G(V, {
395
+ size: f.LG,
396
+ className: Z.typeText,
397
+ "aria-hidden": !0,
398
+ stroke: p
399
+ }),
400
+ className: "absolute inset-0 rounded-xl"
401
+ }),
402
+ /* @__PURE__ */ G("img", {
403
+ ref: O,
404
+ src: S,
405
+ alt: x,
406
+ loading: "lazy",
407
+ decoding: "async",
408
+ className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", k === Ye.Loaded ? "opacity-100" : "opacity-0")
409
+ })
410
+ ]
411
+ })
412
+ });
413
+ }, Qe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
414
+ let { colors: f } = u ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = s({
415
+ "--ai-tile-bg": f?.background,
416
+ "--ai-tile-border": f?.border,
417
+ "--ai-tile-bg-hover": f?.backgroundHover,
418
+ "--ai-tile-border-hover": f?.borderHover,
419
+ "--ai-tile-bg-selected": f?.backgroundSelected,
420
+ "--ai-tile-border-selected": f?.borderSelected,
421
+ "--ai-tile-focus-outline": f?.focusOutline,
422
+ "--ai-tile-bg-error": f?.backgroundError,
423
+ "--ai-tile-border-error": f?.borderError,
424
+ "--ai-tile-error-text": f?.errorText,
425
+ "--ai-tile-name-text": f?.nameText,
426
+ "--ai-tile-type-text": f?.typeText,
427
+ "--ai-tile-hover-icon-bg": f?.hoverIconBackground,
428
+ "--ai-tile-hover-icon-color": f?.hoverIconColor,
429
+ "--ai-tile-progress-track": f?.trackBackground
430
+ }), { isImage: g, isLink: _ } = U(() => Ve(e), [e]);
431
+ return g ? /* @__PURE__ */ G(Ze, {
432
+ attachment: e,
433
+ labels: l,
434
+ onClick: o,
435
+ onExpand: a,
436
+ styles: u,
437
+ onRemove: r,
438
+ cssVars: h,
439
+ onDownload: c,
440
+ isSelected: d
441
+ }) : /* @__PURE__ */ G(Je, {
442
+ attachment: e,
443
+ searchQuery: n,
444
+ onClick: o,
445
+ onRetry: i,
446
+ onRemove: r,
447
+ onDownload: c,
448
+ isLink: _,
449
+ isPasted: p,
450
+ styles: u,
451
+ labels: l,
452
+ onExpand: a,
453
+ cssVars: h,
454
+ isExpandable: m,
455
+ isSelected: d
456
+ });
457
+ }, $e = (e) => {
458
+ let t = l(e);
459
+ if (!e?.length) return t;
460
+ let n = /* @__PURE__ */ new Map();
461
+ for (let t of e) {
462
+ let e = t.url ?? t.data ?? t.title;
463
+ n.has(e) || n.set(e, t.type);
464
+ }
465
+ return t.map((e) => {
466
+ let t = n.get(e.id);
467
+ return t ? {
468
+ ...e,
469
+ contentType: t
470
+ } : e;
471
+ });
472
+ }, et = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i }) => /* @__PURE__ */ G(r, {
473
+ language: t?.replace(/^language-/, "") ?? "",
474
+ value: typeof e == "string" ? e : String(e ?? ""),
475
+ codeClassName: n,
476
+ containerClassName: c(Y.codeBlock, n),
477
+ copyLabel: i,
119
478
  hideDownload: !0
120
- }), B = f(({ content: e, typography: n, copyAriaLabel: r = "Copy" }) => {
121
- let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text", L.stageContent, a);
122
- return /* @__PURE__ */ _(t, {
479
+ }), tt = me(({ content: e, typography: t, copyAriaLabel: n = "Copy" }) => {
480
+ let r = "mb-1.5 last:mb-0", a = c(t?.headingClassName ?? "dial-small-semi-text", Y.stageContent, r);
481
+ return /* @__PURE__ */ G(i, {
123
482
  content: e,
124
483
  classNames: {
125
- h1: o,
126
- h2: o,
127
- h3: o,
128
- h4: o,
129
- h5: o,
130
- h6: o,
131
- p: i(n?.contentClassName ?? "dial-tiny-text", L.stageContent, "mb-1.5"),
132
- ul: i(n?.contentClassName ?? "dial-tiny-text", L.stageContent, a),
133
- ol: i(n?.contentClassName ?? "dial-tiny-text", L.stageContent, a),
134
- strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text", L.stageContent),
135
- codeInline: L.codeInline,
136
- blockquote: i(n?.contentClassName ?? "dial-tiny-text", L.blockquote, a),
137
- link: i(n?.contentClassName ?? "dial-tiny-text", L.stageContent),
138
- tableCell: i(n?.contentClassName ?? "dial-tiny-text", L.tableCell)
484
+ h1: a,
485
+ h2: a,
486
+ h3: a,
487
+ h4: a,
488
+ h5: a,
489
+ h6: a,
490
+ p: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent, "mb-1.5"),
491
+ ul: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent, r),
492
+ ol: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent, r),
493
+ strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", Y.stageContent),
494
+ codeInline: Y.codeInline,
495
+ blockquote: c(t?.contentClassName ?? "dial-tiny-text", Y.blockquote, r),
496
+ link: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent),
497
+ tableCell: c(t?.contentClassName ?? "dial-tiny-text", Y.tableCell)
139
498
  },
140
- components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ _(z, {
141
- codeClassName: t,
142
- blockClassName: n?.codeBlockClassName,
143
- copyAriaLabel: r,
499
+ components: { code: ({ children: e, className: r }) => r?.includes("language-") ? /* @__PURE__ */ G(et, {
500
+ codeClassName: r,
501
+ blockClassName: t?.codeBlockClassName,
502
+ copyAriaLabel: n,
144
503
  children: e
145
- }) : /* @__PURE__ */ _("code", {
146
- className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-code-text rounded-md", L.codeInline),
504
+ }) : /* @__PURE__ */ G("code", {
505
+ className: c("inline-block px-1.5 py-1", t?.codeClassName ?? "dial-code-text rounded-md", Y.codeInline),
147
506
  children: e
148
507
  }) }
149
508
  });
150
- }), V = ({ stage: e, isLive: t, typography: r, labels: o, nameOverride: s }) => {
151
- let { copyAriaLabel: l = "Copy stage content", runningAriaLabel: u, failedAriaLabel: d } = o ?? {}, { name: f, durationLabel: p } = O(e.name), m = s ?? f, h = !s && k(f), y = e.status === n.Failed, b = !!e.content, x = /* @__PURE__ */ v(g, { children: [
152
- /* @__PURE__ */ _("span", {
509
+ }), nt = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
510
+ let r = he((t) => {
511
+ let r = e.find((e) => e.id === t);
512
+ r && n?.(r);
513
+ }, [e, n]);
514
+ return /* @__PURE__ */ G("div", {
515
+ role: "list",
516
+ className: "flex flex-wrap gap-3",
517
+ children: e.map((e) => /* @__PURE__ */ G("div", {
518
+ role: "listitem",
519
+ children: /* @__PURE__ */ G(Qe, {
520
+ attachment: e,
521
+ onClick: n && r,
522
+ labels: { clickLabel: t }
523
+ })
524
+ }, e.id))
525
+ });
526
+ }, rt = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a }) => {
527
+ let { copyAriaLabel: s = "Copy stage content", runningAriaLabel: l, failedAriaLabel: u, attachmentClickLabel: f = "Preview search result" } = r ?? {}, p = U(() => $e(e.attachments), [e.attachments]), { name: m, durationLabel: g } = J(e.name), _ = i ?? m, v = !i && De(m), y = e.status === o.Failed, b = !!e.content || !!e.attachments?.length, x = /* @__PURE__ */ K(W, { children: [
528
+ /* @__PURE__ */ G("span", {
153
529
  className: "flex flex-none items-center",
154
- children: /* @__PURE__ */ _(R, {
530
+ children: /* @__PURE__ */ G(Fe, {
155
531
  status: e.status,
156
532
  isLive: t,
157
- runningLabel: u,
158
- failedLabel: d
533
+ runningLabel: l,
534
+ failedLabel: u
159
535
  })
160
536
  }),
161
- /* @__PURE__ */ _("span", {
162
- className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", L.stageName, y && L.stageNameFailed, h && L.monoName),
163
- children: /* @__PURE__ */ _(c, { text: m || e.status || "" })
537
+ /* @__PURE__ */ G("span", {
538
+ className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", Y.stageName, y && Y.stageNameFailed, v && Y.monoName),
539
+ children: /* @__PURE__ */ G(h, { text: _ || e.status || "" })
164
540
  }),
165
- e.tag && /* @__PURE__ */ _("span", {
166
- className: i("flex-none", r?.tagClassName ?? "dial-tiny-lead-text", L.tag),
541
+ e.tag && /* @__PURE__ */ G("span", {
542
+ className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", Y.tag),
167
543
  children: e.tag
168
544
  }),
169
- p && /* @__PURE__ */ _("span", {
170
- className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", L.duration),
171
- children: p
545
+ g && /* @__PURE__ */ G("span", {
546
+ className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", Y.duration),
547
+ children: g
172
548
  })
173
549
  ] });
174
- return b ? /* @__PURE__ */ _(a, {
175
- title: /* @__PURE__ */ _("span", {
550
+ return b ? /* @__PURE__ */ K(d, {
551
+ title: /* @__PURE__ */ G("span", {
176
552
  className: "flex min-w-0 items-center gap-2",
177
553
  children: x
178
554
  }),
179
- className: P,
180
- headerClassName: i(F, L.row, L.stageHeader),
181
- contentClassName: i("-mt-1 flex flex-col gap-3 px-0 py-1 ps-8", L.stageRegion),
182
- children: /* @__PURE__ */ _("div", {
555
+ className: Me,
556
+ headerClassName: c(Ne, Y.row, Y.stageHeader),
557
+ contentClassName: c("-mt-1 flex flex-col gap-3 px-0 py-1 ps-8", Y.stageRegion),
558
+ children: [e.content && /* @__PURE__ */ G("div", {
183
559
  className: "max-h-[300px] overflow-y-auto",
184
- children: /* @__PURE__ */ _(B, {
185
- content: e.content ?? "",
186
- typography: r,
187
- copyAriaLabel: l
560
+ children: /* @__PURE__ */ G(tt, {
561
+ content: e.content,
562
+ typography: n,
563
+ copyAriaLabel: s
188
564
  })
189
- })
190
- }) : /* @__PURE__ */ _("div", {
191
- className: i("flex w-full items-center gap-2 px-2 py-1.5", L.row),
565
+ }), p.length > 0 && /* @__PURE__ */ G(nt, {
566
+ attachments: p,
567
+ clickLabel: f,
568
+ onAttachmentClick: a
569
+ })]
570
+ }) : /* @__PURE__ */ G("div", {
571
+ className: c("flex w-full items-center gap-2 px-2 py-1.5", Y.row),
192
572
  children: x
193
573
  });
194
- }, H = ({ row: e, isLive: t, typography: r, labels: o }) => {
195
- let { runningAriaLabel: s, failedAriaLabel: l, attemptLabel: u = (e) => `Attempt ${e}` } = o ?? {}, d = e.attempts?.some((e) => e.status == null) ?? !1, f = e.attempts?.some((e) => e.status === n.Failed), p = d ? null : f ? n.Failed : n.Completed, m = M((e.attempts || []).map((e) => e.name)), h = m > 0 ? A(m) : void 0;
196
- return /* @__PURE__ */ _(a, {
197
- title: /* @__PURE__ */ v("span", {
574
+ }, it = ({ row: e, isLive: t, typography: n, labels: r, onAttachmentClick: i }) => {
575
+ let { runningAriaLabel: a, failedAriaLabel: s, attemptLabel: l = (e) => `Attempt ${e}` } = r ?? {}, u = e.attempts?.some((e) => e.status == null) ?? !1, f = e.attempts?.some((e) => e.status === o.Failed), p = u ? null : f ? o.Failed : o.Completed, m = Ae((e.attempts || []).map((e) => e.name)), g = m > 0 ? Oe(m) : void 0;
576
+ return /* @__PURE__ */ G(d, {
577
+ title: /* @__PURE__ */ K("span", {
198
578
  className: "flex min-w-0 items-center gap-2",
199
579
  children: [
200
- /* @__PURE__ */ _("span", {
580
+ /* @__PURE__ */ G("span", {
201
581
  className: "flex flex-none items-center",
202
- children: /* @__PURE__ */ _(R, {
582
+ children: /* @__PURE__ */ G(Fe, {
203
583
  status: p,
204
584
  isLive: t,
205
- runningLabel: s,
206
- failedLabel: l
585
+ runningLabel: a,
586
+ failedLabel: s
207
587
  })
208
588
  }),
209
- /* @__PURE__ */ _("span", {
210
- className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", L.stageName, f && L.stageNameFailed),
211
- children: /* @__PURE__ */ _(c, { text: e.name })
589
+ /* @__PURE__ */ G("span", {
590
+ className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", Y.stageName, f && Y.stageNameFailed),
591
+ children: /* @__PURE__ */ G(h, { text: e.name })
212
592
  }),
213
- /* @__PURE__ */ v("span", {
214
- className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", L.count),
593
+ /* @__PURE__ */ K("span", {
594
+ className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", Y.count),
215
595
  children: ["×", e.attempts?.length ?? 0]
216
596
  }),
217
- h && /* @__PURE__ */ _("span", {
218
- className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", L.duration),
219
- children: h
597
+ g && /* @__PURE__ */ G("span", {
598
+ className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", Y.duration),
599
+ children: g
220
600
  })
221
601
  ]
222
602
  }),
223
- className: P,
224
- headerClassName: i(F, L.collapseButton, L.row, L.stageHeader),
225
- contentClassName: i("-mt-2 px-0 ps-6", L.stageRegion),
226
- children: /* @__PURE__ */ _("ul", {
603
+ className: Me,
604
+ headerClassName: c(Ne, Y.collapseButton, Y.row, Y.stageHeader),
605
+ contentClassName: c("-mt-2 px-0 ps-6", Y.stageRegion),
606
+ children: /* @__PURE__ */ G("ul", {
227
607
  role: "list",
228
608
  className: "flex flex-col gap-0.5",
229
- children: e.attempts?.map((e, n) => /* @__PURE__ */ _("li", {
609
+ children: e.attempts?.map((e, a) => /* @__PURE__ */ G("li", {
230
610
  role: "listitem",
231
- children: /* @__PURE__ */ _(V, {
611
+ children: /* @__PURE__ */ G(rt, {
232
612
  stage: e,
233
- nameOverride: u(n + 1),
613
+ nameOverride: l(a + 1),
234
614
  isLive: t && e.status == null,
235
- typography: r,
236
- labels: o
615
+ typography: n,
616
+ labels: r,
617
+ onAttachmentClick: i
237
618
  })
238
619
  }, e.index))
239
620
  })
240
621
  });
241
- }, U = ({ stages: e, isStreaming: t, className: n, styles: a, labels: o }) => {
242
- let { colors: s, typography: c } = a ?? {}, l = r({
243
- "--cs-text": s?.text,
244
- "--cs-row-hover": s?.rowHoverColor,
245
- "--cs-button-bg": s?.collapsedButtonBg,
246
- "--cs-stage-text": s?.stageTextColor,
247
- "--cs-failed-text": s?.failedColor,
248
- "--cs-tag-text": s?.tagTextColor,
249
- "--cs-count-text": s?.countTextColor,
250
- "--cs-duration-text": s?.durationTextColor,
251
- "--cs-icon-secondary": s?.iconSecondaryColor,
252
- "--cs-icon-completed": s?.iconCompletedColor,
253
- "--cs-icon-error": s?.iconErrorColor,
254
- "--cs-code-bg": s?.codeBg,
255
- "--cs-code-border": s?.codeBorderColor,
256
- "--cs-code-text": s?.codeTextColor,
257
- "--cs-border": s?.borderColor
258
- }), u = I(e);
259
- return /* @__PURE__ */ _("div", {
260
- style: l,
261
- className: i("w-full", L.panel, n, y.panel),
262
- children: /* @__PURE__ */ _("ul", {
622
+ }, at = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a }) => {
623
+ let { colors: o, typography: l } = r ?? {}, u = s({
624
+ "--cs-text": o?.text,
625
+ "--cs-row-hover": o?.rowHoverColor,
626
+ "--cs-button-bg": o?.collapsedButtonBg,
627
+ "--cs-stage-text": o?.stageTextColor,
628
+ "--cs-failed-text": o?.failedColor,
629
+ "--cs-tag-text": o?.tagTextColor,
630
+ "--cs-count-text": o?.countTextColor,
631
+ "--cs-duration-text": o?.durationTextColor,
632
+ "--cs-icon-secondary": o?.iconSecondaryColor,
633
+ "--cs-icon-completed": o?.iconCompletedColor,
634
+ "--cs-icon-error": o?.iconErrorColor,
635
+ "--cs-code-bg": o?.codeBg,
636
+ "--cs-code-border": o?.codeBorderColor,
637
+ "--cs-code-text": o?.codeTextColor,
638
+ "--cs-border": o?.borderColor
639
+ }), d = Pe(e);
640
+ return /* @__PURE__ */ G("div", {
641
+ style: u,
642
+ className: c("w-full", Y.panel, n, q.panel),
643
+ children: /* @__PURE__ */ G("ul", {
263
644
  role: "list",
264
645
  className: "flex w-full flex-col gap-0.5 ps-5",
265
- children: u.map((e) => e.stage ? /* @__PURE__ */ _("li", {
646
+ children: d.map((e) => e.stage ? /* @__PURE__ */ G("li", {
266
647
  role: "listitem",
267
- children: /* @__PURE__ */ _(V, {
648
+ children: /* @__PURE__ */ G(rt, {
268
649
  stage: e.stage,
269
650
  isLive: t && e.stage.status == null,
270
- typography: c,
271
- labels: o
651
+ typography: l,
652
+ labels: i,
653
+ onAttachmentClick: a
272
654
  })
273
- }, e.key) : /* @__PURE__ */ _("li", {
655
+ }, e.key) : /* @__PURE__ */ G("li", {
274
656
  role: "listitem",
275
- children: /* @__PURE__ */ _(H, {
657
+ children: /* @__PURE__ */ G(it, {
276
658
  row: e,
277
659
  isLive: t && (e.attempts?.some((e) => e.status == null) ?? !1),
278
- typography: c,
279
- labels: o
660
+ typography: l,
661
+ labels: i,
662
+ onAttachmentClick: a
280
663
  })
281
664
  }, e.key))
282
665
  })
283
666
  });
284
- }, W = {
667
+ }, $ = {
285
668
  toggleButton: "_toggleButton_1kyyc_7",
286
669
  groupRegion: "_groupRegion_1kyyc_28",
287
670
  executedLabel: "_executedLabel_1kyyc_32",
@@ -289,140 +672,143 @@ var y = {
289
672
  doneIcon: "_doneIcon_1kyyc_41",
290
673
  failedText: "_failedText_1kyyc_45",
291
674
  liveName: "_liveName_1kyyc_49"
292
- }, G = ({ stages: e, isStreaming: t, labels: u, className: f, styles: g }) => {
293
- let { executedLabel: b = "Executed", stepsLabel: x = () => "steps", failedCountLabel: S = (e) => `${e} failed`, runningAriaLabel: C = "Running", copyAriaLabel: w, failedAriaLabel: T, attemptLabel: E } = u ?? {}, [D, k] = h(t), j = m(t);
294
- p(() => {
295
- j.current && !t && k(!1), j.current = t;
675
+ }, ot = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a }) => {
676
+ let { executedLabel: l = "Executed", stepsLabel: u = () => "steps", failedCountLabel: m = (e) => `${e} failed`, runningAriaLabel: g = "Running", copyAriaLabel: _, failedAriaLabel: v, attemptLabel: b, attachmentClickLabel: x } = n ?? {}, [C, w] = ve(t), T = _e(t);
677
+ H(() => {
678
+ T.current && !t && w(!1), T.current = t;
296
679
  }, [t]);
297
- let { colors: P, panel: F } = g ?? {}, I = g?.typography ?? { fontClassName: "dial-small-text" }, L = r({
298
- "--cs-cg-label": P?.labelColor,
299
- "--cs-cg-label-hover": P?.labelHoverColor,
300
- "--cs-cg-steps-count": P?.stepsCountColor,
301
- "--cs-cg-done": P?.doneColor,
302
- "--cs-cg-failed": P?.failedColor,
303
- "--cs-text": F?.text,
304
- "--cs-row-hover": F?.rowHoverColor,
305
- "--cs-button-bg": F?.collapsedButtonBg,
306
- "--cs-stage-text": F?.stageTextColor,
307
- "--cs-failed-text": F?.failedColor,
308
- "--cs-tag-text": F?.tagTextColor,
309
- "--cs-count-text": F?.countTextColor,
310
- "--cs-duration-text": F?.durationTextColor,
311
- "--cs-icon-secondary": F?.iconSecondaryColor,
312
- "--cs-icon-completed": F?.iconCompletedColor,
313
- "--cs-icon-error": F?.iconErrorColor,
314
- "--cs-code-bg": F?.codeBg,
315
- "--cs-code-border": F?.codeBorderColor,
316
- "--cs-code-text": F?.codeTextColor,
317
- "--cs-border": F?.borderColor
680
+ let { colors: E, panel: D } = i ?? {}, O = i?.typography ?? { fontClassName: "dial-small-text" }, k = s({
681
+ "--cs-cg-label": E?.labelColor,
682
+ "--cs-cg-label-hover": E?.labelHoverColor,
683
+ "--cs-cg-steps-count": E?.stepsCountColor,
684
+ "--cs-cg-done": E?.doneColor,
685
+ "--cs-cg-failed": E?.failedColor,
686
+ "--cs-text": D?.text,
687
+ "--cs-row-hover": D?.rowHoverColor,
688
+ "--cs-button-bg": D?.collapsedButtonBg,
689
+ "--cs-stage-text": D?.stageTextColor,
690
+ "--cs-failed-text": D?.failedColor,
691
+ "--cs-tag-text": D?.tagTextColor,
692
+ "--cs-count-text": D?.countTextColor,
693
+ "--cs-duration-text": D?.durationTextColor,
694
+ "--cs-icon-secondary": D?.iconSecondaryColor,
695
+ "--cs-icon-completed": D?.iconCompletedColor,
696
+ "--cs-icon-error": D?.iconErrorColor,
697
+ "--cs-code-bg": D?.codeBg,
698
+ "--cs-code-border": D?.codeBorderColor,
699
+ "--cs-code-text": D?.codeTextColor,
700
+ "--cs-border": D?.borderColor
318
701
  });
319
702
  if (e.length === 0) return null;
320
- let R = {
321
- copyAriaLabel: w,
322
- runningAriaLabel: C,
323
- failedAriaLabel: T,
324
- attemptLabel: E
703
+ let A = {
704
+ copyAriaLabel: _,
705
+ runningAriaLabel: g,
706
+ failedAriaLabel: v,
707
+ attemptLabel: b,
708
+ attachmentClickLabel: x
325
709
  };
326
- if (e.length === 1) return /* @__PURE__ */ _(U, {
710
+ if (e.length === 1) return /* @__PURE__ */ G(at, {
327
711
  stages: e,
328
712
  isStreaming: t,
329
- className: f,
713
+ className: r,
330
714
  styles: {
331
- colors: F,
332
- typography: g?.typography
715
+ colors: D,
716
+ typography: i?.typography
333
717
  },
334
- labels: R
718
+ labels: A,
719
+ onAttachmentClick: a
335
720
  });
336
- let z = e.some((e) => e.status === n.Failed), B = M(e.map((e) => e.name)), V = B > 0 ? A(B) : void 0, H;
721
+ let j = e.some((e) => e.status === o.Failed), M = Ae(e.map((e) => e.name)), N = M > 0 ? Oe(M) : void 0, P;
337
722
  if (t) {
338
- let t = O((N(e) ?? e[e.length - 1]).name).name;
339
- H = /* @__PURE__ */ v("span", {
723
+ let t = J((je(e) ?? e[e.length - 1]).name).name;
724
+ P = /* @__PURE__ */ K("span", {
340
725
  role: "status",
341
726
  "aria-live": "polite",
342
727
  className: "flex min-w-0 items-center gap-2",
343
- children: [/* @__PURE__ */ _("span", {
728
+ children: [/* @__PURE__ */ G("span", {
344
729
  className: "flex flex-none items-center",
345
- children: /* @__PURE__ */ _(l, {
730
+ children: /* @__PURE__ */ G(y, {
346
731
  size: 14,
347
- ariaLabel: C
732
+ ariaLabel: g
348
733
  })
349
- }), t && /* @__PURE__ */ _("span", {
350
- className: i("min-w-0 max-w-[22rem] truncate", I.fontClassName, W.liveName),
351
- children: /* @__PURE__ */ _(c, { text: t })
734
+ }), t && /* @__PURE__ */ G("span", {
735
+ className: c("min-w-0 max-w-[22rem] truncate", O.fontClassName, $.liveName),
736
+ children: /* @__PURE__ */ G(h, { text: t })
352
737
  })]
353
738
  });
354
- } else if (z) {
355
- let t = e.filter((e) => e.status === n.Failed).length;
356
- H = /* @__PURE__ */ v("span", {
739
+ } else if (j) {
740
+ let t = e.filter((e) => e.status === o.Failed).length;
741
+ P = /* @__PURE__ */ K("span", {
357
742
  className: "inline-flex items-center gap-1",
358
743
  children: [
359
- /* @__PURE__ */ v("span", {
360
- className: i(I.fontClassName, W.executedLabel),
744
+ /* @__PURE__ */ K("span", {
745
+ className: c(O.fontClassName, $.executedLabel),
361
746
  children: [
362
- b,
747
+ l,
363
748
  " ",
364
749
  e.length,
365
750
  " ",
366
- x(e.length)
751
+ u(e.length)
367
752
  ]
368
753
  }),
369
- /* @__PURE__ */ _("span", {
370
- className: i(I.fontClassName, W.failedText),
371
- children: S(t)
754
+ /* @__PURE__ */ G("span", {
755
+ className: c(O.fontClassName, $.failedText),
756
+ children: m(t)
372
757
  }),
373
- V && /* @__PURE__ */ _("span", {
374
- className: i(I.fontClassName, W.stepsCount),
375
- children: V
758
+ N && /* @__PURE__ */ G("span", {
759
+ className: c(O.fontClassName, $.stepsCount),
760
+ children: N
376
761
  })
377
762
  ]
378
763
  });
379
- } else H = /* @__PURE__ */ v("span", {
764
+ } else P = /* @__PURE__ */ K("span", {
380
765
  className: "inline-flex items-center gap-1",
381
766
  children: [
382
- /* @__PURE__ */ _(d, {
383
- size: o.SM,
384
- className: W.doneIcon,
767
+ /* @__PURE__ */ G(S, {
768
+ size: f.SM,
769
+ className: $.doneIcon,
385
770
  "aria-hidden": !0,
386
- stroke: s
771
+ stroke: p
387
772
  }),
388
- /* @__PURE__ */ v("span", {
389
- className: i(I.fontClassName, W.executedLabel),
773
+ /* @__PURE__ */ K("span", {
774
+ className: c(O.fontClassName, $.executedLabel),
390
775
  children: [
391
- b,
776
+ l,
392
777
  " ",
393
778
  e.length,
394
779
  " ",
395
- x(e.length)
780
+ u(e.length)
396
781
  ]
397
782
  }),
398
- V && /* @__PURE__ */ _("span", {
399
- className: i(I.fontClassName, W.stepsCount),
400
- children: V
783
+ N && /* @__PURE__ */ G("span", {
784
+ className: c(O.fontClassName, $.stepsCount),
785
+ children: N
401
786
  })
402
787
  ]
403
788
  });
404
- return /* @__PURE__ */ _("div", {
405
- style: L,
406
- className: i("flex w-full flex-col gap-1", f, y.group),
407
- children: /* @__PURE__ */ _(a, {
408
- title: H,
409
- expanded: D,
410
- onToggle: k,
789
+ return /* @__PURE__ */ G("div", {
790
+ style: k,
791
+ className: c("flex w-full flex-col gap-1", r, q.group),
792
+ children: /* @__PURE__ */ G(d, {
793
+ title: P,
794
+ expanded: C,
795
+ onToggle: w,
411
796
  className: "overflow-visible py-0",
412
- headerClassName: i("justify-start gap-1 rounded-none px-0", W.toggleButton, y.groupToggle),
413
- contentClassName: i("-mt-2 px-0", W.groupRegion),
414
- children: /* @__PURE__ */ _(U, {
797
+ headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, q.groupToggle),
798
+ contentClassName: c("-mt-2 px-0", $.groupRegion),
799
+ children: /* @__PURE__ */ G(at, {
415
800
  stages: e,
416
801
  isStreaming: t,
417
802
  styles: {
418
- colors: F,
419
- typography: g?.typography
803
+ colors: D,
804
+ typography: i?.typography
420
805
  },
421
- labels: R,
422
- className: "pt-1"
806
+ labels: A,
807
+ className: "pt-1",
808
+ onAttachmentClick: a
423
809
  })
424
810
  })
425
811
  });
426
812
  };
427
813
  //#endregion
428
- export { y as CONVERSATION_STAGES_CLASS, G as CollapsedGroup, U as StagesPanel };
814
+ export { q as CONVERSATION_STAGES_CLASS, ot as CollapsedGroup, at as StagesPanel };
@@ -1,4 +1,4 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
1
+ import { DisplayAttachment, Stage } from '@epam/ai-dial-chat-shared';
2
2
  import { StagesPanelColors } from './stages-props';
3
3
  /** Color overrides for the `CollapsedGroup` component applied as CSS custom properties. */
4
4
  export interface CollapsedGroupColors {
@@ -43,6 +43,8 @@ export interface CollapsedGroupLabels {
43
43
  failedAriaLabel?: string;
44
44
  /** Returns the label for a single attempt inside a collapsed `×N` group. Defaults to `(n) => \`Attempt ${n}\``. */
45
45
  attemptLabel?: (attemptNumber: number) => string;
46
+ /** Accessible label for a stage attachment tile's interactive click action. Defaults to `'Preview search result'`. */
47
+ attachmentClickLabel?: string;
46
48
  }
47
49
  /** Props accepted by the `CollapsedGroup` component. */
48
50
  export interface CollapsedGroupProps {
@@ -56,5 +58,7 @@ export interface CollapsedGroupProps {
56
58
  className?: string;
57
59
  /** Color and typography overrides applied as CSS custom properties. */
58
60
  styles?: CollapsedGroupStyles;
61
+ /** Called when a stage attachment tile is clicked/activated. Forwarded unchanged to the inner `StagesPanel`. */
62
+ onAttachmentClick?: (attachment: DisplayAttachment) => void;
59
63
  }
60
64
  //# sourceMappingURL=collapsed-group.d.ts.map
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AAC/D,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mHAAmH;IACnH,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,sHAAsH;IACtH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,8FAA8F;IAC9F,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,gHAAgH;IAChH,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7D"}
@@ -1,4 +1,4 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
1
+ import { DisplayAttachment, Stage } from '@epam/ai-dial-chat-shared';
2
2
  /** Typography class overrides for stage name and expanded content elements in `StagesPanel`. */
3
3
  export interface StageTypography {
4
4
  /** CSS utility class applied to the stage/step name. Defaults to `'dial-small-text'`. */
@@ -68,6 +68,8 @@ export interface StagesPanelLabels {
68
68
  failedAriaLabel?: string;
69
69
  /** Label for a single attempt given its 1-based number. Defaults to `(n) => \`Attempt ${n}\``. */
70
70
  attemptLabel?: (attemptNumber: number) => string;
71
+ /** Accessible label for a stage attachment tile's interactive click action. Defaults to `'Preview search result'`. */
72
+ attachmentClickLabel?: string;
71
73
  }
72
74
  /** Props accepted by the `StagesPanel` component. */
73
75
  export interface StagesPanelProps {
@@ -81,5 +83,7 @@ export interface StagesPanelProps {
81
83
  styles?: StagesPanelStyles;
82
84
  /** User-visible strings. */
83
85
  labels?: StagesPanelLabels;
86
+ /** Called when a stage attachment tile is clicked/activated. Receives the mapped display attachment. */
87
+ onAttachmentClick?: (attachment: DisplayAttachment) => void;
84
88
  }
85
89
  //# sourceMappingURL=stages-props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stages-props.d.ts","sourceRoot":"","sources":["../../src/models/stages-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wJAAwJ;IACxJ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kJAAkJ;IAClJ,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kIAAkI;IAClI,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gIAAgI;IAChI,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC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7D"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-conversation-stages",
3
3
  "description": "Panel for displaying agent processing stages during LLM response streaming",
4
- "version": "1.2.0-dev.209",
4
+ "version": "1.2.0-dev.213",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,11 +17,12 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@tabler/icons-react": "^3.44.0"
20
+ "@tabler/icons-react": "^3.44.0",
21
+ "@epam/ai-dial-attachment-input": "1.2.0-dev.213"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "react": "^19.2.8",
24
- "@epam/ai-dial-chat-shared": "1.2.0-dev.209",
25
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.213",
25
26
  "@epam/ai-dial-ui-kit": "^0.15.0-dev.27"
26
27
  },
27
28
  "repository": {
@@ -0,0 +1,11 @@
1
+ import { DisplayAttachment, MessageAttachment } from '@epam/ai-dial-chat-shared';
2
+ /**
3
+ * Maps stage attachments to their display-only model, preferring each
4
+ * attachment's own declared `type` for `contentType` over the type inferred
5
+ * from `reference_url`'s path. A stage attachment's `reference_url` points at
6
+ * the source document a search result was extracted from, not at the
7
+ * attachment's own content, so the generic message-attachment mapper's
8
+ * reference-url-first inference produces the wrong content type here.
9
+ */
10
+ export declare const mapStageAttachmentsToDisplay: (attachments?: MessageAttachment[]) => DisplayAttachment[];
11
+ //# sourceMappingURL=stage-attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-attachments.d.ts","sourceRoot":"","sources":["../../src/utils/stage-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,cAAc,iBAAiB,EAAE,KAChC,iBAAiB,EAqBnB,CAAC"}