@epam/ai-dial-attachment-input 1.0.0-rc.3 → 1.0.0-rc.5
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/components/AttachmentCard/AttachmentCard.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/Actions.d.ts +0 -2
- package/components/AttachmentCard/Attachments/Actions.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/File.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +170 -217
- package/models/attachment-card.d.ts +1 -7
- package/models/attachment-card.d.ts.map +1 -1
- package/models/attachment-file-row.d.ts +2 -0
- package/models/attachment-file-row.d.ts.map +1 -1
- package/package.json +2 -2
- package/utils/attachment.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/Audio.d.ts +0 -22
- package/components/AttachmentCard/Attachments/Audio.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,8GAA8G;AAC9G,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAyElD,CAAC"}
|
|
@@ -15,8 +15,6 @@ interface ActionProps {
|
|
|
15
15
|
/** ID of the attachment to retry. */
|
|
16
16
|
id?: string;
|
|
17
17
|
}
|
|
18
|
-
/** Action button for completed uploads. */
|
|
19
|
-
export declare const ActionButton: FC<ActionProps>;
|
|
20
18
|
/** Retry button for failed uploads. */
|
|
21
19
|
export declare const ReloadAction: FC<Omit<ActionProps, 'icon'>>;
|
|
22
20
|
/** Download button for completed uploads. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Actions.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAG5D,UAAU,WAAW;IACnB,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,qCAAqC;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Actions.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAG5D,UAAU,WAAW;IACnB,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,qCAAqC;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AA+BD,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAQtD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAOxD,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAOxD,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAOtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAAE,EAKR,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAmB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA8MlD,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tile_3jao2_1{background:var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--ai-tile-border,var(--stroke-secondary,#d1dbea))}._tile_3jao2_1._hovered_3jao2_5:hover{background:var(--ai-tile-bg-hover,var(--bg-control-neutral-hover,#e0e6f0));border-color:var(--ai-tile-border-hover,var(--ai-tile-border,var(--stroke-secondary,#d1dbea)))}._tile_3jao2_1:focus-visible{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus-black,#161b2d))}._selected_3jao2_15{background:var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f));border-color:var(--ai-tile-border-selected,var(--stroke-accent-alpha,#2764d933))}._tileError_3jao2_20{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_3jao2_25{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_3jao2_29{color:var(--ai-tile-type-text,var(--text-secondary,#57647a))}._retryIcon_3jao2_33{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_3jao2_37{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2d4d))}._actionButton_3jao2_43{background:var(--ai-tile-hover-icon-bg,var(--bg-control-neutral-hover,#e0e6f0))}._imageActionButton_3jao2_47{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#57647a))}._headerIcon_1dmgi_1,._headerLabel_1dmgi_2{color:var(--ai-group-text,var(--text-secondary,#57647a))}._overlay_mzpdp_1{background:var(--ai-fd-bg,var(--bg-backdrop,#161b2d4d))}._icon_mzpdp_5{color:var(--ai-fd-icon,var(--text-accent,#1d4ed8))}._deniedIcon_mzpdp_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
|
|
2
2
|
/*$vite$:1*/
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type { AttachmentCardProps, AttachmentCardColors, AttachmentCardTypograph
|
|
|
6
6
|
export type { AttachmentTrayProps, AttachmentTrayLabels, AttachmentTrayStyles, } from './models/attachment-tray';
|
|
7
7
|
export { type AttachmentGroupProps, type AttachmentGroupLabels, type AttachmentGroupColors, type AttachmentGroupTypography, type AttachmentGroupStyles, } from './models/attachment-group';
|
|
8
8
|
export type { FileDndOverlayProps, FileDndOverlayLabels, FileDndOverlayColors, FileDndOverlayTypography, FileDndOverlayStyles, } from './models/file-dnd-overlay';
|
|
9
|
+
export type { FileAttachmentLabels, FileAttachmentTypography, FileAttachmentStyles, } from './models/attachment-file-row';
|
|
9
10
|
export { useClipboardPaste, type UseClipboardPasteLabels, } from './hooks/useClipboardPaste';
|
|
10
11
|
export { useLazyImageLoad, LazyImageLoadStatus, } from './hooks/useLazyImageLoad';
|
|
11
12
|
export { generateAttachmentId, getAttachmentCardState, getExtFromContentType, getAttachmentIcon, getNameWithoutExtension, mimeTypesToExtensionLabels, isMimeTypeAllowed, } from './utils/attachment';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAA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ME_TYPE_EXT_MAP as n, RequestStatus as r, buildCssVars as i, mergeClasses as a } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
-
import { IconClipboard as f, IconDownload as p, IconExternalLink as m, IconFile as h, IconFileDescription as g, IconFileTypeBmp as _, IconFileTypeCss as v, IconFileTypeCsv as y, IconFileTypeDoc as b, IconFileTypeDocx as x, IconFileTypeHtml as S, IconFileTypeJpg as C, IconFileTypeJs as w, IconFileTypeJsx as T, IconFileTypePdf as E, IconFileTypePhp as D, IconFileTypePng as O, IconFileTypePpt as k, IconFileTypeRs as A, IconFileTypeSql as j, IconFileTypeSvg as M, IconFileTypeTs as N, IconFileTypeTsx as P, IconFileTypeTxt as F, IconFileTypeVue as I, IconFileTypeXls as L, IconFileTypeXml as R, IconFileTypeZip as z, IconFileX as B, IconMusic as ee, IconPaperclip as V, IconPhoto as H, IconReload as te, IconTerminal2 as
|
|
4
|
-
import { DIAL_ICON_SIZE as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { IconClipboard as f, IconDownload as p, IconExternalLink as m, IconFile as h, IconFileDescription as g, IconFileTypeBmp as _, IconFileTypeCss as v, IconFileTypeCsv as y, IconFileTypeDoc as b, IconFileTypeDocx as x, IconFileTypeHtml as S, IconFileTypeJpg as C, IconFileTypeJs as w, IconFileTypeJsx as T, IconFileTypePdf as E, IconFileTypePhp as D, IconFileTypePng as O, IconFileTypePpt as k, IconFileTypeRs as A, IconFileTypeSql as j, IconFileTypeSvg as M, IconFileTypeTs as N, IconFileTypeTsx as P, IconFileTypeTxt as F, IconFileTypeVue as I, IconFileTypeXls as L, IconFileTypeXml as R, IconFileTypeZip as z, IconFileX as B, IconMusic as ee, IconPaperclip as V, IconPhoto as H, IconReload as te, IconTerminal2 as ne, IconVideo as re, IconX as ie } from "@tabler/icons-react";
|
|
4
|
+
import { DIAL_ICON_SIZE as U, ElementSize as ae, GhostIconButton as oe, Highlight as se, Skeleton as ce, SkeletonVariant as le, Spinner as ue, StaticIconButton as de } from "@epam/ai-dial-ui-kit";
|
|
5
|
+
import { Fragment as fe, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
6
6
|
//#region src/utils/attachment.ts
|
|
7
|
-
var
|
|
7
|
+
var K = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) => {
|
|
8
8
|
if (e == null) return "";
|
|
9
9
|
let t = e.lastIndexOf(".");
|
|
10
10
|
return t > 0 ? e.slice(0, t) : e;
|
|
11
|
-
},
|
|
11
|
+
}, me = {
|
|
12
12
|
image: "Image files",
|
|
13
13
|
audio: "Audio files",
|
|
14
14
|
video: "Video files",
|
|
15
15
|
text: "Text files"
|
|
16
|
-
},
|
|
16
|
+
}, he = (e, t = me) => e.map((e) => {
|
|
17
17
|
if (e.endsWith("/*")) {
|
|
18
18
|
let n = e.slice(0, -2);
|
|
19
19
|
return t[n] ?? `${n} files`;
|
|
20
20
|
}
|
|
21
21
|
let n = e.split("/")[1];
|
|
22
22
|
return n == null ? e.toUpperCase() : n.toUpperCase();
|
|
23
|
-
}).join(", "),
|
|
23
|
+
}).join(", "), ge = (e, t) => t.length === 0 ? !1 : t.some((t) => {
|
|
24
24
|
if (t === "*" || t === "*/*") return !0;
|
|
25
25
|
if (t.endsWith("/*")) {
|
|
26
26
|
let n = t.slice(0, -2);
|
|
27
27
|
return e.startsWith(`${n}/`);
|
|
28
28
|
}
|
|
29
29
|
return e === t;
|
|
30
|
-
}),
|
|
30
|
+
}), _e = (e) => {
|
|
31
31
|
if (!e) return h;
|
|
32
32
|
if (e.startsWith("image/")) switch (e) {
|
|
33
33
|
case "image/jpeg":
|
|
@@ -37,7 +37,7 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
37
37
|
case "image/bmp": return _;
|
|
38
38
|
default: return H;
|
|
39
39
|
}
|
|
40
|
-
if (e.startsWith("video/")) return
|
|
40
|
+
if (e.startsWith("video/")) return re;
|
|
41
41
|
if (e.startsWith("audio/")) return ee;
|
|
42
42
|
switch (e) {
|
|
43
43
|
case "application/pdf": return E;
|
|
@@ -76,187 +76,150 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
76
76
|
case "text/x-vue": return I;
|
|
77
77
|
default: return h;
|
|
78
78
|
}
|
|
79
|
-
},
|
|
79
|
+
}, ve = (e) => {
|
|
80
80
|
let { type: n, contentType: r } = e;
|
|
81
|
-
return n === t.Prompt ?
|
|
82
|
-
},
|
|
81
|
+
return n === t.Prompt ? ne : n === t.Pasted ? f : n === t.Image ? H : _e(r ?? "");
|
|
82
|
+
}, ye = (e) => {
|
|
83
83
|
let t = e.toLowerCase().split(";")[0].trim(), r = n[t];
|
|
84
84
|
if (r) return r;
|
|
85
85
|
let i = t.split("/")[1];
|
|
86
86
|
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
87
|
-
},
|
|
87
|
+
}, be = (e, n) => {
|
|
88
88
|
let { type: r, name: i, contentType: a } = e;
|
|
89
89
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
90
90
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
91
91
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
92
92
|
if (a) {
|
|
93
|
-
let e =
|
|
93
|
+
let e = ye(a);
|
|
94
94
|
if (e) return `.${e}`;
|
|
95
95
|
}
|
|
96
|
+
if (i == null) return "";
|
|
96
97
|
let o = i.lastIndexOf(".");
|
|
97
98
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
98
|
-
},
|
|
99
|
-
let { type: i, status: a, previewUrl: o, url: s } = e, c = a === r.Loading, l = a === r.Error, u = i === t.Image && !!(o ?? s) && !l, d = i === t.
|
|
99
|
+
}, q = (e, n = {}) => {
|
|
100
|
+
let { type: i, status: a, previewUrl: o, url: s } = e, c = a === r.Loading, l = a === r.Error, u = i === t.Image && !!(o ?? s) && !l, d = i === t.Link && !l;
|
|
100
101
|
return {
|
|
101
102
|
isLoading: c,
|
|
102
103
|
isError: l,
|
|
103
104
|
isImage: u,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
typeLabel: f ? null : ge(e, n)
|
|
105
|
+
isLink: d,
|
|
106
|
+
BottomIcon: d ? null : ve(e),
|
|
107
|
+
typeLabel: d ? null : be(e, n)
|
|
108
108
|
};
|
|
109
|
-
},
|
|
110
|
-
tile: "
|
|
111
|
-
hovered: "
|
|
112
|
-
selected: "
|
|
113
|
-
tileError: "
|
|
114
|
-
nameText: "
|
|
115
|
-
typeText: "
|
|
116
|
-
retryIcon: "
|
|
117
|
-
track: "
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
}, xe = 5, Se = "flex size-[84px] items-center justify-center rounded-xl border", J = {
|
|
110
|
+
tile: "_tile_3jao2_1",
|
|
111
|
+
hovered: "_hovered_3jao2_5",
|
|
112
|
+
selected: "_selected_3jao2_15",
|
|
113
|
+
tileError: "_tileError_3jao2_20",
|
|
114
|
+
nameText: "_nameText_3jao2_25",
|
|
115
|
+
typeText: "_typeText_3jao2_29",
|
|
116
|
+
retryIcon: "_retryIcon_3jao2_33",
|
|
117
|
+
track: "_track_3jao2_37",
|
|
118
|
+
actionButton: "_actionButton_3jao2_43",
|
|
119
|
+
imageActionButton: "_imageActionButton_3jao2_47"
|
|
120
|
+
}, Y = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: o, className: s }) => /* @__PURE__ */ W(de, {
|
|
120
121
|
icon: o,
|
|
121
|
-
size:
|
|
122
|
-
className: a("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", s),
|
|
122
|
+
size: ae.Small,
|
|
123
|
+
className: a("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", J.actionButton, s),
|
|
123
124
|
"aria-label": e,
|
|
124
125
|
"aria-describedby": t ? n : void 0,
|
|
125
126
|
onClick: (e) => {
|
|
126
127
|
e.stopPropagation(), r(i);
|
|
127
128
|
}
|
|
128
|
-
}),
|
|
129
|
-
icon: /* @__PURE__ */
|
|
130
|
-
size:
|
|
129
|
+
}), Ce = ({ ...e }) => /* @__PURE__ */ W(Y, {
|
|
130
|
+
icon: /* @__PURE__ */ W(te, {
|
|
131
|
+
size: U.SM,
|
|
131
132
|
"aria-hidden": !0
|
|
132
133
|
}),
|
|
133
|
-
className:
|
|
134
|
+
className: J.retryIcon,
|
|
134
135
|
...e
|
|
135
|
-
}),
|
|
136
|
-
icon: /* @__PURE__ */
|
|
137
|
-
size:
|
|
136
|
+
}), we = ({ ...e }) => /* @__PURE__ */ W(Y, {
|
|
137
|
+
icon: /* @__PURE__ */ W(p, {
|
|
138
|
+
size: U.SM,
|
|
138
139
|
"aria-hidden": !0
|
|
139
140
|
}),
|
|
140
141
|
...e
|
|
141
|
-
}),
|
|
142
|
-
icon: /* @__PURE__ */
|
|
143
|
-
size:
|
|
142
|
+
}), Te = ({ ...e }) => /* @__PURE__ */ W(Y, {
|
|
143
|
+
icon: /* @__PURE__ */ W(m, {
|
|
144
|
+
size: U.SM,
|
|
144
145
|
"aria-hidden": !0
|
|
145
146
|
}),
|
|
146
147
|
...e
|
|
147
|
-
}),
|
|
148
|
-
icon: /* @__PURE__ */
|
|
149
|
-
size:
|
|
148
|
+
}), Ee = ({ ...e }) => /* @__PURE__ */ W(Y, {
|
|
149
|
+
icon: /* @__PURE__ */ W(ie, {
|
|
150
|
+
size: U.SM,
|
|
150
151
|
"aria-hidden": !0
|
|
151
152
|
}),
|
|
152
|
-
className: Z.hoverIcon,
|
|
153
153
|
...e
|
|
154
|
-
}),
|
|
155
|
-
let { clickLabel: u = "Open attachment", downloadLabel: d = "Download attachment", removeLabel: f = "Remove attachment" } = o ?? {}, { typography: p, className: m } = s ?? {}, h = () => {
|
|
156
|
-
n?.(e.id);
|
|
157
|
-
};
|
|
158
|
-
return /* @__PURE__ */ J("div", {
|
|
159
|
-
style: c,
|
|
160
|
-
...n == null ? {} : {
|
|
161
|
-
role: "button",
|
|
162
|
-
tabIndex: 0,
|
|
163
|
-
"aria-label": u,
|
|
164
|
-
onClick: h,
|
|
165
|
-
onKeyDown: (e) => {
|
|
166
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
className: a("group/attachment-tile relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (r || i) && "pe-8", l && Z.selected, m),
|
|
170
|
-
children: [
|
|
171
|
-
/* @__PURE__ */ q("span", {
|
|
172
|
-
title: e.name,
|
|
173
|
-
className: a(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Z.nameText),
|
|
174
|
-
children: t ? /* @__PURE__ */ q(ce, {
|
|
175
|
-
text: e.name,
|
|
176
|
-
query: t,
|
|
177
|
-
maxLines: 1
|
|
178
|
-
}) : e.name
|
|
179
|
-
}),
|
|
180
|
-
e.playUrl && /* @__PURE__ */ q("audio", {
|
|
181
|
-
controls: !0,
|
|
182
|
-
src: e.playUrl,
|
|
183
|
-
"aria-label": e.name,
|
|
184
|
-
className: "w-full",
|
|
185
|
-
preload: "metadata",
|
|
186
|
-
onClick: (e) => e.stopPropagation()
|
|
187
|
-
}),
|
|
188
|
-
r && /* @__PURE__ */ q(ve, {
|
|
189
|
-
ariaLabel: d,
|
|
190
|
-
onClick: r,
|
|
191
|
-
id: e.id
|
|
192
|
-
}),
|
|
193
|
-
i && /* @__PURE__ */ q(be, {
|
|
194
|
-
ariaLabel: f,
|
|
195
|
-
onClick: i,
|
|
196
|
-
id: e.id
|
|
197
|
-
})
|
|
198
|
-
]
|
|
199
|
-
});
|
|
200
|
-
}, Se = 5, Ce = "flex size-[84px] items-center justify-center rounded-xl border", we = {
|
|
154
|
+
}), De = {
|
|
201
155
|
[e.Network]: "Upload failed · network error",
|
|
202
156
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
203
|
-
},
|
|
204
|
-
let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", sizeLabel: S, uploadingLabel: C = "Uploading", errorReasonLabels: w, genericErrorLabel: T = "Upload failed" } = u ?? {}, { typography: E, className: D } = d ?? {}, { id: O, name: k, status: A, errorReason: j } =
|
|
205
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(
|
|
206
|
-
}, V = l(() => p ? k :
|
|
207
|
-
window.open(
|
|
208
|
-
}, [
|
|
157
|
+
}, Oe = ({ attachment: t, searchQuery: n = "", onClick: i, onRetry: s, labels: u, styles: d, onDownload: f, isPasted: p, isLink: m, cssVars: h, onExpand: g, isExpandable: _, onRemove: v, isSelected: y }) => {
|
|
158
|
+
let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", sizeLabel: S, uploadingLabel: C = "Uploading", errorReasonLabels: w, genericErrorLabel: T = "Upload failed" } = u ?? {}, { typography: E, className: D } = d ?? {}, { id: O, name: k, status: A, errorReason: j } = t, M = A === r.Loading, N = A === r.Error, P = c(), F = N ? j && (w?.[j] ?? De[j]) || T : "", { BottomIcon: I, typeLabel: L } = q(t), R = !N && !M && f && !m, z = N && !!s && j !== e.UnsupportedType, B = R || z ? "pe-5" : void 0, ee = (e) => {
|
|
159
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(t.id));
|
|
160
|
+
}, V = l(() => p ? k : pe(k), [p, k]), H = o(() => {
|
|
161
|
+
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
162
|
+
}, [t]), te = a(Se, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", J.tile, !N && J.hovered, y && J.selected, N && J.tileError), ne = /* @__PURE__ */ W("div", {
|
|
209
163
|
title: V,
|
|
210
|
-
className: a(E?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all",
|
|
211
|
-
children:
|
|
212
|
-
|
|
164
|
+
className: a(E?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", J.nameText, !N && B),
|
|
165
|
+
children: n ? /* @__PURE__ */ W(se, {
|
|
166
|
+
text: V,
|
|
167
|
+
query: n,
|
|
168
|
+
maxLines: 2
|
|
169
|
+
}) : V
|
|
170
|
+
}), re = I && /* @__PURE__ */ G("div", {
|
|
213
171
|
className: a("flex w-full items-center gap-1", N && B),
|
|
214
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ W(I, {
|
|
215
173
|
size: 16,
|
|
216
|
-
className:
|
|
174
|
+
className: J.typeText,
|
|
217
175
|
"aria-hidden": !0
|
|
218
|
-
}), /* @__PURE__ */
|
|
219
|
-
className: a(E?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate",
|
|
176
|
+
}), /* @__PURE__ */ W("span", {
|
|
177
|
+
className: a(E?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", J.typeText),
|
|
220
178
|
children: S ? `${L} · ${S}` : L
|
|
221
179
|
})]
|
|
222
|
-
}),
|
|
180
|
+
}), ie = () => {
|
|
223
181
|
_ && g ? g(O) : i && i(O);
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
182
|
+
}, U = /* @__PURE__ */ G(fe, { children: [
|
|
183
|
+
ne,
|
|
184
|
+
re,
|
|
185
|
+
M && /* @__PURE__ */ W("div", {
|
|
228
186
|
"aria-label": C,
|
|
229
|
-
className: a("absolute
|
|
230
|
-
children: /* @__PURE__ */
|
|
187
|
+
className: a("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", J.track),
|
|
188
|
+
children: /* @__PURE__ */ W(ue, { size: 32 })
|
|
231
189
|
}),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
190
|
+
/* @__PURE__ */ G("div", {
|
|
191
|
+
className: a("absolute right-0 top-0 flex gap-1"),
|
|
192
|
+
children: [
|
|
193
|
+
R && /* @__PURE__ */ W(we, {
|
|
194
|
+
ariaLabel: b,
|
|
195
|
+
errorTitle: F,
|
|
196
|
+
errorDescId: P,
|
|
197
|
+
onClick: f,
|
|
198
|
+
id: O
|
|
199
|
+
}),
|
|
200
|
+
z && /* @__PURE__ */ W(Ce, {
|
|
201
|
+
ariaLabel: x,
|
|
202
|
+
errorTitle: F,
|
|
203
|
+
errorDescId: P,
|
|
204
|
+
onClick: s,
|
|
205
|
+
id: O
|
|
206
|
+
}),
|
|
207
|
+
m && /* @__PURE__ */ W(Te, {
|
|
208
|
+
ariaLabel: x,
|
|
209
|
+
errorTitle: F,
|
|
210
|
+
errorDescId: P,
|
|
211
|
+
onClick: H
|
|
212
|
+
}),
|
|
213
|
+
v && /* @__PURE__ */ W(Ee, {
|
|
214
|
+
ariaLabel: x,
|
|
215
|
+
errorTitle: F,
|
|
216
|
+
errorDescId: P,
|
|
217
|
+
onClick: v,
|
|
218
|
+
id: O
|
|
219
|
+
})
|
|
220
|
+
]
|
|
258
221
|
}),
|
|
259
|
-
N && /* @__PURE__ */
|
|
222
|
+
N && /* @__PURE__ */ W("span", {
|
|
260
223
|
id: P,
|
|
261
224
|
role: "status",
|
|
262
225
|
"aria-live": "polite",
|
|
@@ -264,23 +227,23 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
264
227
|
children: F
|
|
265
228
|
})
|
|
266
229
|
] });
|
|
267
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ W("div", {
|
|
268
231
|
style: h,
|
|
269
232
|
className: a("inline-flex", D),
|
|
270
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ W("div", {
|
|
271
234
|
role: "button",
|
|
272
235
|
tabIndex: 0,
|
|
273
236
|
"aria-label": b,
|
|
274
|
-
onClick:
|
|
237
|
+
onClick: ie,
|
|
275
238
|
onKeyDown: ee,
|
|
276
239
|
style: h,
|
|
277
240
|
className: a(te, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
278
|
-
children:
|
|
241
|
+
children: U
|
|
279
242
|
})
|
|
280
243
|
});
|
|
281
|
-
},
|
|
244
|
+
}, X = /* @__PURE__ */ function(e) {
|
|
282
245
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
283
|
-
}({}),
|
|
246
|
+
}({}), ke = ({ enabled: e, src: t }) => {
|
|
284
247
|
let n = u(null), [r, i] = d("idle");
|
|
285
248
|
return s(() => {
|
|
286
249
|
i(e && t ? "loading" : "idle");
|
|
@@ -295,15 +258,15 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
295
258
|
imageRef: n,
|
|
296
259
|
imageLoadStatus: r
|
|
297
260
|
};
|
|
298
|
-
},
|
|
299
|
-
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text" } = i ?? {}, { className: m } = u ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = l(() =>
|
|
261
|
+
}, Ae = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: o, cssVars: s, onDownload: c, styles: u, isSelected: d }) => {
|
|
262
|
+
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text" } = i ?? {}, { className: m } = u ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = l(() => q(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = ke({
|
|
300
263
|
enabled: x,
|
|
301
264
|
src: _
|
|
302
265
|
}), T = () => {
|
|
303
266
|
v && n ? n(h) : S && r && r(h);
|
|
304
267
|
};
|
|
305
|
-
return /* @__PURE__ */
|
|
306
|
-
className: a(
|
|
268
|
+
return /* @__PURE__ */ W("div", {
|
|
269
|
+
className: a(Se, "group/attachment-tile", S && "cursor-pointer", J.tile, d && J.selected, m),
|
|
307
270
|
onClick: T,
|
|
308
271
|
onKeyDown: (e) => {
|
|
309
272
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), T());
|
|
@@ -312,43 +275,43 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
312
275
|
role: "button",
|
|
313
276
|
style: s,
|
|
314
277
|
"aria-label": S ? f : v ? p : void 0,
|
|
315
|
-
children: /* @__PURE__ */
|
|
278
|
+
children: /* @__PURE__ */ G("div", {
|
|
316
279
|
className: "relative h-full w-full overflow-hidden",
|
|
317
280
|
children: [
|
|
318
|
-
o && /* @__PURE__ */
|
|
281
|
+
o && /* @__PURE__ */ W(Ee, {
|
|
319
282
|
onClick: o,
|
|
320
283
|
id: h,
|
|
321
|
-
className:
|
|
284
|
+
className: J.imageActionButton
|
|
322
285
|
}),
|
|
323
|
-
c && /* @__PURE__ */
|
|
286
|
+
c && /* @__PURE__ */ W(we, {
|
|
324
287
|
onClick: c,
|
|
325
288
|
id: h,
|
|
326
|
-
className:
|
|
289
|
+
className: J.imageActionButton
|
|
327
290
|
}),
|
|
328
|
-
w !==
|
|
329
|
-
variant:
|
|
291
|
+
w !== X.Loaded && /* @__PURE__ */ W(ce, {
|
|
292
|
+
variant: le.Rectangular,
|
|
330
293
|
width: "100%",
|
|
331
294
|
height: "100%",
|
|
332
|
-
active: w ===
|
|
333
|
-
overlay: /* @__PURE__ */
|
|
334
|
-
size:
|
|
335
|
-
className:
|
|
295
|
+
active: w === X.Loading,
|
|
296
|
+
overlay: /* @__PURE__ */ W(H, {
|
|
297
|
+
size: U.LG,
|
|
298
|
+
className: J.typeText,
|
|
336
299
|
"aria-hidden": !0
|
|
337
300
|
}),
|
|
338
301
|
className: "absolute inset-0 rounded-xl"
|
|
339
302
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ W("img", {
|
|
341
304
|
ref: C,
|
|
342
305
|
src: _,
|
|
343
306
|
alt: g,
|
|
344
307
|
loading: "lazy",
|
|
345
308
|
decoding: "async",
|
|
346
|
-
className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", w ===
|
|
309
|
+
className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === X.Loaded ? "opacity-100" : "opacity-0")
|
|
347
310
|
})
|
|
348
311
|
]
|
|
349
312
|
})
|
|
350
313
|
});
|
|
351
|
-
},
|
|
314
|
+
}, Z = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: u, styles: d, isSelected: f }) => {
|
|
352
315
|
let { colors: p } = d ?? {}, m = e.type === t.Pasted, h = m && o !== void 0, g = i({
|
|
353
316
|
"--ai-tile-bg": p?.background,
|
|
354
317
|
"--ai-tile-border": p?.border,
|
|
@@ -364,20 +327,9 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
364
327
|
"--ai-tile-type-text": p?.typeText,
|
|
365
328
|
"--ai-tile-hover-icon-bg": p?.hoverIconBackground,
|
|
366
329
|
"--ai-tile-hover-icon-color": p?.hoverIconColor,
|
|
367
|
-
"--ai-tile-progress-track": p?.trackBackground
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
return v ? /* @__PURE__ */ q(xe, {
|
|
371
|
-
attachment: e,
|
|
372
|
-
labels: u,
|
|
373
|
-
onClick: s,
|
|
374
|
-
onDownload: c,
|
|
375
|
-
onRemove: r,
|
|
376
|
-
searchQuery: n,
|
|
377
|
-
styles: d,
|
|
378
|
-
cssVars: g,
|
|
379
|
-
isSelected: f
|
|
380
|
-
}) : _ ? /* @__PURE__ */ q(De, {
|
|
330
|
+
"--ai-tile-progress-track": p?.trackBackground
|
|
331
|
+
}), { isImage: _, isLink: v } = l(() => q(e), [e]);
|
|
332
|
+
return _ ? /* @__PURE__ */ W(Ae, {
|
|
381
333
|
attachment: e,
|
|
382
334
|
labels: u,
|
|
383
335
|
onClick: s,
|
|
@@ -387,13 +339,14 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
387
339
|
cssVars: g,
|
|
388
340
|
onDownload: c,
|
|
389
341
|
isSelected: f
|
|
390
|
-
}) : /* @__PURE__ */
|
|
342
|
+
}) : /* @__PURE__ */ W(Oe, {
|
|
391
343
|
attachment: e,
|
|
344
|
+
searchQuery: n,
|
|
392
345
|
onClick: s,
|
|
393
346
|
onRetry: a,
|
|
394
347
|
onRemove: r,
|
|
395
348
|
onDownload: c,
|
|
396
|
-
isLink:
|
|
349
|
+
isLink: v,
|
|
397
350
|
isPasted: m,
|
|
398
351
|
styles: d,
|
|
399
352
|
labels: u,
|
|
@@ -402,15 +355,15 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
402
355
|
isExpandable: h,
|
|
403
356
|
isSelected: f
|
|
404
357
|
});
|
|
405
|
-
},
|
|
358
|
+
}, je = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: o, styles: s }) => {
|
|
406
359
|
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = o ?? {}, { className: f } = s ?? {};
|
|
407
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
360
|
+
return e.length === 0 ? null : /* @__PURE__ */ W("div", {
|
|
408
361
|
role: "list",
|
|
409
362
|
"aria-label": c,
|
|
410
363
|
className: a("flex w-full min-w-0 gap-2 overflow-x-auto", f),
|
|
411
|
-
children: e.map((e) => /* @__PURE__ */
|
|
364
|
+
children: e.map((e) => /* @__PURE__ */ W("div", {
|
|
412
365
|
role: "listitem",
|
|
413
|
-
children: /* @__PURE__ */
|
|
366
|
+
children: /* @__PURE__ */ W(Z, {
|
|
414
367
|
attachment: e,
|
|
415
368
|
onRemove: t,
|
|
416
369
|
onRetry: n,
|
|
@@ -424,11 +377,11 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
424
377
|
})
|
|
425
378
|
}, e.id))
|
|
426
379
|
});
|
|
427
|
-
},
|
|
428
|
-
headerIcon: "
|
|
429
|
-
headerLabel: "
|
|
430
|
-
},
|
|
431
|
-
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) =>
|
|
380
|
+
}, Q = {
|
|
381
|
+
headerIcon: "_headerIcon_1dmgi_1",
|
|
382
|
+
headerLabel: "_headerLabel_1dmgi_2"
|
|
383
|
+
}, Me = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ne = ({ attachments: e, onAttachmentClick: n, onDownloadAll: o, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
|
|
384
|
+
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => Me(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = c ?? {}, { typography: S, colors: C, className: w } = l ?? {}, T = i({ "--ai-group-text": C?.text });
|
|
432
385
|
if (e.length === 0) return null;
|
|
433
386
|
let E = e.some((e) => e.type === t.Image), D = e.some((e) => e.type !== t.Image), O = E && D, k = e.length >= 5, A = O ? V : E ? H : h, j = v(e.length), M = () => {
|
|
434
387
|
let t = e.filter((e) => e.status === r.Idle);
|
|
@@ -437,39 +390,39 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
437
390
|
let n = e.find((e) => e.id === t);
|
|
438
391
|
n && o?.([n]);
|
|
439
392
|
};
|
|
440
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ G("div", {
|
|
441
394
|
role: "group",
|
|
442
395
|
"aria-label": d,
|
|
443
396
|
style: T,
|
|
444
|
-
className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]",
|
|
445
|
-
children: [/* @__PURE__ */
|
|
397
|
+
className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Q.container, w),
|
|
398
|
+
children: [/* @__PURE__ */ G("div", {
|
|
446
399
|
className: "flex items-center justify-between",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ G("div", {
|
|
448
401
|
className: "flex items-center gap-1",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
450
|
-
size:
|
|
451
|
-
className: a("shrink-0",
|
|
402
|
+
children: [/* @__PURE__ */ W(A, {
|
|
403
|
+
size: U.SM,
|
|
404
|
+
className: a("shrink-0", Q.headerIcon),
|
|
452
405
|
"aria-hidden": !0
|
|
453
|
-
}), /* @__PURE__ */
|
|
454
|
-
className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text",
|
|
406
|
+
}), /* @__PURE__ */ W("span", {
|
|
407
|
+
className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text", Q.headerLabel),
|
|
455
408
|
children: j
|
|
456
409
|
})]
|
|
457
|
-
}), e.length >= 2 && (o || n) && /* @__PURE__ */
|
|
458
|
-
icon: /* @__PURE__ */
|
|
459
|
-
size:
|
|
410
|
+
}), e.length >= 2 && (o || n) && /* @__PURE__ */ W(oe, {
|
|
411
|
+
icon: /* @__PURE__ */ W(p, {
|
|
412
|
+
size: U.SM,
|
|
460
413
|
"aria-hidden": !0
|
|
461
414
|
}),
|
|
462
|
-
size:
|
|
415
|
+
size: ae.Small,
|
|
463
416
|
"aria-label": g,
|
|
464
417
|
onClick: M
|
|
465
418
|
})]
|
|
466
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ W("div", {
|
|
467
420
|
role: "list",
|
|
468
421
|
"aria-label": j,
|
|
469
422
|
className: a("gap-3", k ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
470
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
423
|
+
children: e.map((e, t) => /* @__PURE__ */ W("div", {
|
|
471
424
|
role: "listitem",
|
|
472
|
-
children: /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ W(Z, {
|
|
473
426
|
attachment: e,
|
|
474
427
|
onClick: n,
|
|
475
428
|
onDownload: N,
|
|
@@ -487,7 +440,7 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
487
440
|
}, `${e.id}-${t}`))
|
|
488
441
|
})]
|
|
489
442
|
});
|
|
490
|
-
},
|
|
443
|
+
}, $ = {
|
|
491
444
|
overlay: "_overlay_mzpdp_1",
|
|
492
445
|
icon: "_icon_mzpdp_5",
|
|
493
446
|
deniedIcon: "_deniedIcon_mzpdp_9"
|
|
@@ -498,29 +451,29 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
498
451
|
"--ai-fd-bg": c?.background,
|
|
499
452
|
"--ai-fd-icon": c?.icon,
|
|
500
453
|
"--ai-fd-denied-icon": c?.deniedIcon
|
|
501
|
-
}), d = o ?? (t ? "Attach files" : "No attachments allowed"), f = s ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), p = t ?
|
|
454
|
+
}), d = o ?? (t ? "Attach files" : "No attachments allowed"), f = s ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), p = t ? $.icon : $.deniedIcon, m = (e) => {
|
|
502
455
|
e.preventDefault();
|
|
503
456
|
}, h = t ? g : B;
|
|
504
|
-
return /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ W("div", {
|
|
505
458
|
role: "status",
|
|
506
459
|
"aria-live": "polite",
|
|
507
|
-
className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm",
|
|
460
|
+
className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", $.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
|
|
508
461
|
onDragOver: t ? void 0 : m,
|
|
509
462
|
onDrop: t ? void 0 : m,
|
|
510
463
|
style: u,
|
|
511
|
-
children: /* @__PURE__ */
|
|
464
|
+
children: /* @__PURE__ */ G("div", {
|
|
512
465
|
className: "flex flex-col items-center text-center",
|
|
513
466
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ W(h, {
|
|
515
468
|
size: 100,
|
|
516
469
|
className: p,
|
|
517
470
|
"aria-hidden": !0
|
|
518
471
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ W("span", {
|
|
520
473
|
className: a("mt-5", l?.titleClassName ?? "dial-h3-text"),
|
|
521
474
|
children: d
|
|
522
475
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ W("span", {
|
|
524
477
|
className: a("mt-4", l?.subtitleClassName ?? "dial-small-text"),
|
|
525
478
|
children: f
|
|
526
479
|
})
|
|
@@ -538,7 +491,7 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
538
491
|
let i = e.getAsFile();
|
|
539
492
|
if (!i) continue;
|
|
540
493
|
let o = new File([i], a, { type: i.type }), s = {
|
|
541
|
-
id:
|
|
494
|
+
id: K(),
|
|
542
495
|
name: a,
|
|
543
496
|
contentType: i.type,
|
|
544
497
|
file: o,
|
|
@@ -554,7 +507,7 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
554
507
|
let l = i.clipboardData.getData("text/plain");
|
|
555
508
|
if (l.length > n) {
|
|
556
509
|
let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || s, o = new File([l], a, { type: "text/plain" }), c = {
|
|
557
|
-
id:
|
|
510
|
+
id: K(),
|
|
558
511
|
name: a,
|
|
559
512
|
contentType: "text/plain",
|
|
560
513
|
file: o,
|
|
@@ -571,4 +524,4 @@ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) =
|
|
|
571
524
|
]) };
|
|
572
525
|
}, Ie = 100;
|
|
573
526
|
//#endregion
|
|
574
|
-
export {
|
|
527
|
+
export { xe as ATTACHMENT_COLLAPSE_THRESHOLD, Z as AttachmentCard, Ne as AttachmentGroup, je as AttachmentTray, Pe as FileDndOverlay, X as LazyImageLoadStatus, Ie as MAX_UPLOADS_PER_MINUTE, K as generateAttachmentId, q as getAttachmentCardState, _e as getAttachmentIcon, ye as getExtFromContentType, pe as getNameWithoutExtension, ge as isMimeTypeAllowed, he as mimeTypesToExtensionLabels, Fe as useClipboardPaste, ke as useLazyImageLoad };
|
|
@@ -19,8 +19,6 @@ export interface AttachmentCardState {
|
|
|
19
19
|
isImage: boolean;
|
|
20
20
|
/** Whether the attachment should render as a link tile. */
|
|
21
21
|
isLink: boolean;
|
|
22
|
-
/** Whether the attachment should render as an audio player tile. */
|
|
23
|
-
isAudio: boolean;
|
|
24
22
|
/** Icon component representing the attachment's type. */
|
|
25
23
|
BottomIcon: Icon | null;
|
|
26
24
|
/** Human-readable type/status label rendered next to `BottomIcon`. */
|
|
@@ -58,14 +56,12 @@ export interface AttachmentCardColors {
|
|
|
58
56
|
hoverIconColor?: string;
|
|
59
57
|
/** Upload progress track background color. */
|
|
60
58
|
trackBackground?: string;
|
|
61
|
-
/** Upload progress indeterminate fill color. */
|
|
62
|
-
fillBackground?: string;
|
|
63
59
|
}
|
|
64
60
|
/** Typography overrides for the `AttachmentCard` component. */
|
|
65
61
|
export interface AttachmentCardTypography {
|
|
66
62
|
/** Utility class applied to the file name text. Defaults to `'dial-tiny-text'`. */
|
|
67
63
|
fontClassName?: string;
|
|
68
|
-
/** Utility class applied to the bottom meta label (file type / status). Defaults to `'dial-
|
|
64
|
+
/** Utility class applied to the bottom meta label (file type / status). Defaults to `'dial-caption-text'`. */
|
|
69
65
|
metaClassName?: string;
|
|
70
66
|
}
|
|
71
67
|
/** Combined style overrides (colors, typography, and shape) for the `AttachmentCard` component. */
|
|
@@ -89,8 +85,6 @@ export interface AttachmentCardLabels extends AttachmentTypeLabels {
|
|
|
89
85
|
expandLabel?: string;
|
|
90
86
|
/** Accessible label for the loading spinner shown while the attachment is uploading. Defaults to `'Loading attachment'`. */
|
|
91
87
|
loadingLabel?: string;
|
|
92
|
-
/** Status message announced to assistive tech when the upload fails. Defaults to `'Upload failed'`. */
|
|
93
|
-
uploadFailedStatusLabel?: string;
|
|
94
88
|
/** Accessible label for the download button. Defaults to `'Download attachment'`. */
|
|
95
89
|
downloadLabel?: string;
|
|
96
90
|
/** Accessible label for the open-in-new-tab button. Defaults to `'Open in new tab'`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-card.d.ts","sourceRoot":"","sources":["../../src/models/attachment-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,wGAAwG;AACxG,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"attachment-card.d.ts","sourceRoot":"","sources":["../../src/models/attachment-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,wGAAwG;AACxG,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,sEAAsE;IACtE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;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CAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,gGAAgG;IAChG,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,8JAA8J;IAC9J,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,wFAAwF;IACxF,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -34,6 +34,8 @@ export interface FileAttachmentStyles {
|
|
|
34
34
|
export interface FileAttachmentProps {
|
|
35
35
|
/** The non-previewable attachment this row represents. */
|
|
36
36
|
attachment: DisplayAttachment;
|
|
37
|
+
/** Current search query — when set, matches in the file name are highlighted. Defaults to `''`. */
|
|
38
|
+
searchQuery?: string;
|
|
37
39
|
/** Called when the user clicks the row or its download button. */
|
|
38
40
|
onClick?: (id: string) => void;
|
|
39
41
|
/** Called when the user retries a failed upload. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-file-row.d.ts","sourceRoot":"","sources":["../../src/models/attachment-file-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EA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AE,MAAM,CAAC;CACxB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,UAAU,EAAE,iBAAiB,CAAC;IAC9B,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,uDAAuD;IACvD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,qIAAqI;IACrI,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mCAAmC;IACnC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-attachment-input",
|
|
3
3
|
"description": "File attachment input components with upload validation, drag-and-drop, and progress tracking",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.5",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.0.0-rc.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.0.0-rc.5",
|
|
21
21
|
"@tabler/icons-react": "^3.44.0",
|
|
22
22
|
"react": "^19.0.0",
|
|
23
23
|
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAgChD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,QAAO,MACgB,CAAC;AAEzD,4GAA4G;AAC5G,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAItD,CAAC;AASF,uHAAuH;AACvH,eAAO,MAAM,0BAA0B,GACrC,OAAO,MAAM,EAAE,EACf,iBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAwB,KAC5D,MAUF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,OAUF,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,IA0FvD,CAAC;AAUF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAgChD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,QAAO,MACgB,CAAC;AAEzD,4GAA4G;AAC5G,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAItD,CAAC;AASF,uHAAuH;AACvH,eAAO,MAAM,0BAA0B,GACrC,OAAO,MAAM,EAAE,EACf,iBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAwB,KAC5D,MAUF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,OAUF,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,IA0FvD,CAAC;AAUF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;AA6BF,qHAAqH;AACrH,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,aAAY,oBAAyB,KACpC,mBAiBF,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
-
import { CSSProperties, FC } from 'react';
|
|
3
|
-
import { AttachmentCardLabels, AttachmentCardStyles } from '../../../models/attachment-card';
|
|
4
|
-
interface AudioAttachmentProps {
|
|
5
|
-
attachment: DisplayAttachment;
|
|
6
|
-
searchQuery?: string;
|
|
7
|
-
/** Called when the user clicks the card body — opens the attachment canvas. */
|
|
8
|
-
onClick?: (id: string) => void;
|
|
9
|
-
/** Called when the user clicks the download button. */
|
|
10
|
-
onDownload?: (id: string) => void;
|
|
11
|
-
/** Called when the user clicks the remove button. */
|
|
12
|
-
onRemove?: (id: string) => void;
|
|
13
|
-
labels?: AttachmentCardLabels;
|
|
14
|
-
styles?: AttachmentCardStyles;
|
|
15
|
-
cssVars?: CSSProperties;
|
|
16
|
-
/** Whether this attachment is the one currently open in the canvas panel. Renders the tile's selected visual state. */
|
|
17
|
-
isSelected?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/** Widescreen tile for a single audio attachment inside the composer tray. */
|
|
20
|
-
export declare const AudioAttachment: FC<AudioAttachmentProps>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=Audio.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Audio.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Audio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAIzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uDAAuD;IACvD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAyFpD,CAAC"}
|