@epam/ai-dial-attachment-canvas 1.2.0-dev.1 → 1.2.0-dev.102

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.
Files changed (67) hide show
  1. package/{LazyContentBoundary-CL7J_W9c.js → LazyContentBoundary-tNE1ExbI.js} +2 -1
  2. package/{PdfContent-DhfjgYL-.js → PdfContent-BoAtghsO.js} +1 -1
  3. package/PdfContent.css +1 -1
  4. package/{attachment-canvas-Bp6WeQws.js → attachment-canvas-BgwyzrRC.js} +5 -3
  5. package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
  6. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
  7. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
  8. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts +36 -0
  9. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts.map +1 -0
  10. package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts +3 -0
  11. package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts.map +1 -1
  12. package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -1
  13. package/components/PdfContent/PdfContent.d.ts.map +1 -1
  14. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +5 -3
  15. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
  16. package/constants/public-class-names.d.ts +11 -0
  17. package/constants/public-class-names.d.ts.map +1 -0
  18. package/context/AttachmentCanvasContext.d.ts.map +1 -1
  19. package/hooks/useMcpAppBridge/useMcpAppBridge.d.ts.map +1 -1
  20. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +14 -1
  21. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -1
  22. package/index.css +2 -1
  23. package/index.d.ts +7 -3
  24. package/index.d.ts.map +1 -1
  25. package/index.js +834 -714
  26. package/models/attachment-canvas.d.ts +52 -11
  27. package/models/attachment-canvas.d.ts.map +1 -1
  28. package/ooxml-highlight-surfaces-BzgOKpBV.js +459 -0
  29. package/package.json +6 -6
  30. package/test-setup.d.ts +10 -1
  31. package/test-setup.d.ts.map +1 -1
  32. package/types/attachment-canvas.d.ts +23 -1
  33. package/types/attachment-canvas.d.ts.map +1 -1
  34. package/utils/content.d.ts +16 -2
  35. package/utils/content.d.ts.map +1 -1
  36. package/utils/download.d.ts.map +1 -1
  37. package/utils/ooxml-highlight-geometry.d.ts +87 -3
  38. package/utils/ooxml-highlight-geometry.d.ts.map +1 -1
  39. package/utils/ooxml-highlight-surfaces.d.ts +33 -6
  40. package/utils/ooxml-highlight-surfaces.d.ts.map +1 -1
  41. package/utils/ooxml-table-row-highlight.d.ts +8 -0
  42. package/utils/ooxml-table-row-highlight.d.ts.map +1 -0
  43. package/utils/visualizer.d.ts +29 -1
  44. package/utils/visualizer.d.ts.map +1 -1
  45. package/utils/vite-external-matcher.d.ts +5 -5
  46. package/utils/vite-external-matcher.d.ts.map +1 -1
  47. package/bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js +0 -37832
  48. package/chart-ex-B0DgG3Dt.js +0 -1009
  49. package/comment-occurrence-CqejEuts-7SeKCBXk.js +0 -6
  50. package/comment-ui-runtime-DEtgcmj7-B1G7PH4z.js +0 -170
  51. package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +0 -2
  52. package/comment-ui-runtime-lXwVOgjW-Be4RALsI.js +0 -112
  53. package/comments-CAn2A_Xh-CdgNAj0h.js +0 -282
  54. package/delimited-text-worker-host-DcHj_JZt-DWJmaPag.js +0 -25
  55. package/docx-B9qBTEkj.js +0 -29822
  56. package/line-distribute-IsUGfHXm-DeITjLzJ.js +0 -1234
  57. package/line-metrics-CBbw80Ko-DoOuwYxZ.js +0 -60
  58. package/ooxml-highlight-surfaces-DhK1KJcR.js +0 -294
  59. package/pptx-dkJw0-Vx.js +0 -9179
  60. package/read-only-comment-decoration-BTnWEeo5-BNhbteYc.js +0 -94
  61. package/read-only-comment-margin-plStyGfE-mggNAMB_.js +0 -189
  62. package/render-worker-host-BEfLZvSL-COy91Rd8.js +0 -7
  63. package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +0 -7
  64. package/render-worker-host-C3xwtHnv-BBGHFdo9.js +0 -7
  65. package/renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js +0 -10063
  66. package/visible-index-DPoQYSDt-9lRc-2Ik.js +0 -162
  67. package/xlsx-BAXMTJTG.js +0 -8585
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-attachment-canvas",
3
3
  "description": "Canvas viewer for rendering attachment content — images, PDFs, Office documents, CSV, JSON, markdown, and plain text",
4
- "version": "1.2.0-dev.1",
4
+ "version": "1.2.0-dev.102",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,11 +17,11 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@silurus/ooxml": "^0.86.1",
20
+ "@silurus/ooxml": "^0.87.0",
21
21
  "@tabler/icons-react": "^3.44.0",
22
22
  "react-json-view-lite": "^2.5.0",
23
23
  "react-syntax-highlighter": "^16.1.1",
24
- "@epam/ai-dial-react-pdf-highlighter": "0.2.0",
24
+ "@epam/ai-dial-react-pdf-highlighter": "0.3.0-dev.1",
25
25
  "@epam/ai-dial-shared": "0.48.0",
26
26
  "@epam/ai-dial-visualizer-connector": "0.48.0",
27
27
  "@epam/pdf-highlighter-kit": "^0.0.19",
@@ -29,11 +29,11 @@
29
29
  "@modelcontextprotocol/sdk": "^1.29.0",
30
30
  "@modelcontextprotocol/ext-apps": "1.7.5",
31
31
  "pdfjs-dist": "^5.4.149",
32
- "@epam/ai-dial-sidebar": "1.2.0-dev.1"
32
+ "@epam/ai-dial-sidebar": "1.2.0-dev.102"
33
33
  },
34
34
  "peerDependencies": {
35
- "@epam/ai-dial-chat-shared": "1.2.0-dev.1",
36
- "@epam/ai-dial-ui-kit": "^0.14.2",
35
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.102",
36
+ "@epam/ai-dial-ui-kit": "^0.15.0-dev.12",
37
37
  "react": "^19.2.8"
38
38
  },
39
39
  "repository": {
package/test-setup.d.ts CHANGED
@@ -1,2 +1,11 @@
1
- export {};
1
+ /**
2
+ * Delivers a synthetic resize entry to every mock `ResizeObserver` instance
3
+ * currently observing `target`, mirroring how a real observer fans a single
4
+ * size change out to each of its observers.
5
+ */
6
+ export declare const deliverResizeObserverEntry: (target: Element, contentRect?: Partial<DOMRectReadOnly>) => void;
7
+ /** Clears tracked mock `ResizeObserver` instances so they do not leak between test files. */
8
+ export declare const resetResizeObserverMock: () => void;
9
+ /** Whether any live mock `ResizeObserver` instance is currently observing `target`. */
10
+ export declare const isElementObservedByResizeObserver: (target: Element) => boolean;
2
11
  //# sourceMappingURL=test-setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAwEA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,OAAO,EACf,cAAa,OAAO,CAAC,eAAe,CAAM,SAM3C,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,YAEnC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,iCAAiC,GAAI,QAAQ,OAAO,KAAG,OACW,CAAC"}
@@ -11,11 +11,12 @@ export declare enum AttachmentContentType {
11
11
  Code = "code",
12
12
  Html = "html",
13
13
  Visualizer = "visualizer",
14
+ GroupedVisualizer = "grouped_visualizer",
14
15
  McpApp = "mcp_app",
15
16
  Unsupported = "unsupported",
16
17
  Error = "error"
17
18
  }
18
- /** Supported document formats rendered by the bundled `@silurus/ooxml` runtime. */
19
+ /** Supported document formats rendered by the installed `@silurus/ooxml` runtime. */
19
20
  export declare enum OoxmlFileType {
20
21
  Docx = "docx",
21
22
  Xlsx = "xlsx",
@@ -28,6 +29,10 @@ export declare enum OoxmlHighlightKind {
28
29
  DocxTextRange = "docxTextRange",
29
30
  /** A character range inside a single PPTX shape on one slide. */
30
31
  PptxTextRange = "pptxTextRange",
32
+ /** A complete DOCX table row identified by its cell text. */
33
+ DocxTableRow = "docxTableRow",
34
+ /** A complete PPTX table row identified by its cell text on one slide. */
35
+ PptxTableRow = "pptxTableRow",
31
36
  /** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
32
37
  XlsxCellRange = "xlsxCellRange"
33
38
  }
@@ -38,4 +43,21 @@ export declare enum AttachmentErrorType {
38
43
  /** The file request failed with HTTP `403` — the user lacks permission to access it. */
39
44
  Forbidden = "forbidden"
40
45
  }
46
+ /**
47
+ * Outcome of one `OoxmlHighlightSurface.navigate` call.
48
+ *
49
+ * Declared here rather than alongside `OoxmlHighlightSurface` in
50
+ * `utils/ooxml-highlight-surfaces.ts` so `OoxmlContent.tsx` can compare
51
+ * against it as a real value without a static import pulling that
52
+ * dynamically-loaded module into the eager entry closure — see
53
+ * `tests/package-boundary/bundle-budgets.spec.ts`.
54
+ */
55
+ export declare enum OoxmlNavigationOutcome {
56
+ /** A scroll (or page/slide/sheet change) was applied for this location. */
57
+ Navigated = "navigated",
58
+ /** A newer `navigate` call started before this one could apply its scroll, or the surface was disposed meanwhile. */
59
+ Superseded = "superseded",
60
+ /** The location could not be resolved to a page, slide, sheet, or cell at all. */
61
+ Unresolved = "unresolved"
62
+ }
41
63
  //# sourceMappingURL=attachment-canvas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,aAAa,mBAAmB;IAChC,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,mFAAmF;AACnF,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,iGAAiG;AACjG,oBAAY,kBAAkB;IAC5B,2FAA2F;IAC3F,aAAa,kBAAkB;IAC/B,iEAAiE;IACjE,aAAa,kBAAkB;IAC/B,4EAA4E;IAC5E,aAAa,kBAAkB;CAChC;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB"}
1
+ {"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,aAAa,mBAAmB;IAChC,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,iBAAiB,uBAAuB;IACxC,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,qFAAqF;AACrF,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,iGAAiG;AACjG,oBAAY,kBAAkB;IAC5B,2FAA2F;IAC3F,aAAa,kBAAkB;IAC/B,iEAAiE;IACjE,aAAa,kBAAkB;IAC/B,6DAA6D;IAC7D,YAAY,iBAAiB;IAC7B,0EAA0E;IAC1E,YAAY,iBAAiB;IAC7B,4EAA4E;IAC5E,aAAa,kBAAkB;CAChC;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB;AAED;;;;;;;;GAQG;AACH,oBAAY,sBAAsB;IAChC,2EAA2E;IAC3E,SAAS,cAAc;IACvB,qHAAqH;IACrH,UAAU,eAAe;IACzB,kFAAkF;IAClF,UAAU,eAAe;CAC1B"}
@@ -1,6 +1,6 @@
1
- import { ErrorCanvasContent, UnsupportedCanvasContent } from '../models/attachment-canvas';
1
+ import { AttachmentCanvasContent, ErrorCanvasContent, UnsupportedCanvasContent } from '../models/attachment-canvas';
2
2
  import { OoxmlFileType } from '../types/attachment-canvas';
3
- /** Resolves a format supported by the bundled `@silurus/ooxml` renderer from a MIME type or file extension. */
3
+ /** Resolves a format supported by the installed `@silurus/ooxml` renderer from a MIME type or file extension. */
4
4
  export declare const getOoxmlFileType: (name: string, mimeType?: string) => OoxmlFileType | undefined;
5
5
  /** Returns true when a file can be rendered by the built-in `@silurus/ooxml` viewer. */
6
6
  export declare const isOoxmlPreviewable: (name: string, mimeType?: string) => boolean;
@@ -18,4 +18,18 @@ export declare const createUnsupportedCanvasContent: (url?: string) => Unsupport
18
18
  export declare const createLoadErrorCanvasContent: (url?: string) => ErrorCanvasContent;
19
19
  /** Creates a content payload for a file the current user is not permitted to access (HTTP 403). */
20
20
  export declare const createForbiddenCanvasContent: (url?: string) => ErrorCanvasContent;
21
+ /**
22
+ * Returns `content.url` when it is an object URL created by
23
+ * `URL.createObjectURL` (i.e. it should be revoked once no longer displayed),
24
+ * or `undefined` otherwise (a remote/data URL, or a content type with no
25
+ * `url` at all).
26
+ */
27
+ export declare const getRevocableObjectUrl: (content: AttachmentCanvasContent) => string | undefined;
28
+ /**
29
+ * Revokes `content`'s object URL, if it has one. Call this for content that
30
+ * was resolved but never displayed — the canvas revokes only what it actually
31
+ * held, so a payload discarded before it reached the canvas would otherwise
32
+ * leak its blob for the lifetime of the page.
33
+ */
34
+ export declare const releaseCanvasContent: (content: AttachmentCanvasContent) => void;
21
35
  //# sourceMappingURL=content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,aAAa,EACd,MAAM,4BAA4B,CAAC;AAuBpC,+GAA+G;AAC/G,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,aAAa,GAAG,SAUlB,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,OAC3B,CAAC;AAE3C,uJAAuJ;AACvJ,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,MAAM,GAAG,SAGX,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAoDF,+JAA+J;AAC/J,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAC/B,CAAC;AAE7B,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,GACzC,MAAM,MAAM,KACX,wBAGD,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC"}
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AAM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,MAAM,6BAA6B,CAAC;AAoB3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,OA6BjE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,IAAI,CAIhE,CAAC;AAuCF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,GACpC,SAAS,uBAAuB,EAChC,WAAW,MAAM,KAChB,IA8DF,CAAC"}
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAoB3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,OA8BjE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,IAAI,CAIhE,CAAC;AAuCF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,GACpC,SAAS,uBAAuB,EAChC,WAAW,MAAM,KAChB,IA8DF,CAAC"}
@@ -60,13 +60,37 @@ export interface OoxmlDocxPageRuns {
60
60
  pageIndex: number;
61
61
  /** The page's runs, in layout order. */
62
62
  runs: readonly DocxTextRunInfo[];
63
+ /**
64
+ * The page's box in the same reference-width CSS pixel space the runs were
65
+ * collected at — the page's scale-1 size, from `docxPageSizePx`. Used to
66
+ * normalise resolved rectangles into fractions of the page box.
67
+ */
68
+ pageBox: OoxmlSurfaceSize;
63
69
  }
64
- /** Rectangles resolved on one page, in that page's own CSS pixel space. */
70
+ /**
71
+ * A resolved DOCX highlight rectangle, expressed as fractions of its page
72
+ * box rather than CSS pixels — each of `left`, `top`, `width`, and `height`
73
+ * is a ratio (0–1, barring a range that runs off the page) of the page's
74
+ * width or height. Kept distinct from `OoxmlHighlightRect` (the PPTX/XLSX
75
+ * absolute-pixel type) so their scale-free and scale-bound contracts cannot
76
+ * be confused at the type level; see `resolveDocxRects`.
77
+ */
78
+ export interface OoxmlDocxNormalizedRect {
79
+ /** Left edge as a fraction of the page's width. */
80
+ left: number;
81
+ /** Top edge as a fraction of the page's height. */
82
+ top: number;
83
+ /** Width as a fraction of the page's width. */
84
+ width: number;
85
+ /** Height as a fraction of the page's height. */
86
+ height: number;
87
+ }
88
+ /** Rectangles resolved on one page, as fractions of that page's box. */
65
89
  export interface OoxmlDocxPageRects {
66
90
  /** 0-based page index the rectangles belong to. */
67
91
  pageIndex: number;
68
92
  /** Rectangles covering the part of the range that falls on this page. */
69
- rects: OoxmlHighlightRect[];
93
+ rects: OoxmlDocxNormalizedRect[];
70
94
  }
71
95
  /** Inputs `resolveDocxRects` needs to place one DOCX range. */
72
96
  export interface OoxmlDocxResolveOptions {
@@ -119,6 +143,56 @@ export declare const pptxSlideSizePx: (slideWidthEmu: number, slideHeightEmu: nu
119
143
  * here means such an upgrade breaks one function and one test.
120
144
  */
121
145
  export declare const resolveSurfaceOffset: ({ index, sizeAt, hostClientWidth, layout, }: OoxmlSurfaceOffsetOptions) => OoxmlSurfaceOffset;
146
+ /** The scroll host's current geometry, as read directly off the live element. */
147
+ export interface OoxmlScrollHostBox {
148
+ /** Height of the host's visible (scrollable) area, in CSS pixels. */
149
+ clientHeight: number;
150
+ /** Width of the host's visible (scrollable) area, in CSS pixels. */
151
+ clientWidth: number;
152
+ /** Total scrollable height of the host's content, in CSS pixels. */
153
+ scrollHeight: number;
154
+ /** Total scrollable width of the host's content, in CSS pixels. */
155
+ scrollWidth: number;
156
+ /** The host's current horizontal scroll position, in CSS pixels. */
157
+ scrollLeft: number;
158
+ }
159
+ /** Inputs `resolveDocxScrollTarget` needs to place one resolved DOCX rectangle in the scroll host. */
160
+ export interface OoxmlDocxScrollTargetOptions {
161
+ /** 0-based index of the page the rectangle was resolved on. */
162
+ pageIndex: number;
163
+ /** The resolved rectangle, as a fraction of its page's box (see `OoxmlDocxNormalizedRect`). */
164
+ rect: OoxmlDocxNormalizedRect;
165
+ /** Size, in CSS pixels at the current scale, of the page/slide at an index. */
166
+ sizeAt: (index: number) => OoxmlSurfaceSize;
167
+ /** The scroll host's current geometry. */
168
+ host: OoxmlScrollHostBox;
169
+ /** Scroll-layout options passed to the viewer. */
170
+ layout?: OoxmlScrollLayout;
171
+ }
172
+ /**
173
+ * Absolute scroll position, in the scroll host's own coordinate space, that
174
+ * brings a resolved DOCX rectangle into view.
175
+ *
176
+ * Composes `resolveSurfaceOffset` — which already owns the page-stacking
177
+ * arithmetic — with the rectangle's page-box fraction and the page's live
178
+ * pixel size, so a vendor layout change still breaks exactly one function and
179
+ * one test (see the version-coupling note on `resolveSurfaceOffset`).
180
+ *
181
+ * The result is physical canvas-coordinate geometry, the same space
182
+ * `resolveSurfaceOffset` and the overlay already use, and it SHALL NOT be
183
+ * converted to logical (start/end) properties — see the physical-geometry
184
+ * requirement in `office-annotation-highlighting`.
185
+ *
186
+ * `top` places the rectangle's start (its top edge) `DOCX_NAVIGATION_LEAD_FRACTION`
187
+ * of the host's visible height below the visible top, then clamps to
188
+ * `[0, scrollHeight - clientHeight]` so a passage near the document's start or
189
+ * end scrolls as far as it can rather than not at all. `left` is left at the
190
+ * host's current `scrollLeft` when the rectangle already falls inside the
191
+ * host's horizontal viewport — which keeps a fit-width preview at
192
+ * `scrollLeft: 0` — and is otherwise shifted by the smallest amount that
193
+ * brings the rectangle's left edge into view.
194
+ */
195
+ export declare const resolveDocxScrollTarget: ({ pageIndex, rect, sizeAt, host, layout, }: OoxmlDocxScrollTargetOptions) => OoxmlSurfaceOffset;
122
196
  /**
123
197
  * Merges rectangles that sit on one visual line and touch or overlap.
124
198
  *
@@ -127,7 +201,17 @@ export declare const resolveSurfaceOffset: ({ index, sizeAt, hostClientWidth, la
127
201
  */
128
202
  export declare const mergeSameLineRects: (rects: readonly OoxmlHighlightRect[]) => OoxmlHighlightRect[];
129
203
  /**
130
- * Rectangles covering one DOCX range, grouped per page.
204
+ * Rectangles covering one DOCX range, grouped per page, as fractions of each
205
+ * page's box.
206
+ *
207
+ * Runs arrive already measured at a fixed reference width (the page's
208
+ * scale-1 CSS size — see `createDocxHighlightSurface`), so their `x`/`y`/`w`/`h`
209
+ * and the same-line merge tolerances are all in that one reference-width pixel
210
+ * space. Dividing the merged pixel rectangle by the page's reference box turns
211
+ * it into a fraction that is the same number at every render scale — the
212
+ * representation `@silurus/ooxml`'s own `buildDocxHighlightLayer` percent-of-page
213
+ * highlight layer uses, and the only way to avoid re-collecting runs on every
214
+ * zoom (root cause 1 of the drift this resolver used to produce).
131
215
  *
132
216
  * Returns an empty array whenever the range cannot be resolved with confidence —
133
217
  * no matching run, a resolved text that disagrees with the selector's own
@@ -1 +1 @@
1
- {"version":3,"file":"ooxml-highlight-geometry.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvE,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EA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AA+E;IAC/E,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,gBAAgB,CAAC;IAC5C,0CAA0C;IAC1C,IAAI,EAAE,kBAAkB,CAAC;IACzB,kDAAkD;IAClD,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,uBAAuB,GAAI,4CAMrC,4BAA4B,KAAG,kBA6BjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,SAAS,kBAAkB,EAAE,KACnC,kBAAkB,EA8BpB,CAAC;AA0JF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,GAAI,+BAI9B,uBAAuB,KAAG,kBAAkB,EA0E9C,CAAC;AAaF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,8BAI9B,uBAAuB,KAAG,kBAAkB,EA+C9C,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,qBAAqB,GAChC,OAAO,MAAM,EACb,YAAY,SAAS,MAAM,EAAE,KAC5B,MAAM,GAAG,IAMX,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,aAAa,GAAI,cAAc,gBAAgB,KAAG,MAS9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,mDAI9B,uBAAuB,KAAG,kBAAkB,EAuB9C,CAAC"}
@@ -1,8 +1,10 @@
1
- import { DocxDocument } from '@silurus/ooxml/docx';
1
+ import { DocxTextRunInfo } from '@silurus/ooxml/docx';
2
2
  import { PptxPresentation } from '@silurus/ooxml/pptx';
3
3
  import { XlsxViewer } from '@silurus/ooxml/xlsx';
4
4
  import { OoxmlHighlight, OoxmlHighlightLocation } from '../models/attachment-canvas';
5
+ import { OoxmlNavigationOutcome } from '../types/attachment-canvas';
5
6
  import { OoxmlHighlightRect } from './ooxml-highlight-geometry';
7
+ export { OoxmlNavigationOutcome };
6
8
  /**
7
9
  * One rectangle to draw, tagged with the highlight it belongs to. Kept in
8
10
  * this dynamically-loaded module (not `OoxmlContent.tsx`) alongside the
@@ -24,14 +26,39 @@ export interface TaggedHighlightRect extends OoxmlHighlightRect {
24
26
  export interface OoxmlHighlightSurface {
25
27
  /** Rectangles for every highlight that currently resolves. */
26
28
  measure(highlights: readonly OoxmlHighlight[]): Promise<TaggedHighlightRect[]>;
27
- /** Brings one cited location into view, whether or not it resolves to a rectangle. */
28
- navigate(location: OoxmlHighlightLocation): Promise<void>;
29
+ /**
30
+ * Brings one cited location into view, whether or not it resolves to a
31
+ * rectangle. See `OoxmlNavigationOutcome` for what each resolved value means.
32
+ */
33
+ navigate(location: OoxmlHighlightLocation): Promise<OoxmlNavigationOutcome>;
29
34
  }
30
- /** Creates the DOCX highlight surface over an already-loaded document. */
31
- export declare const createDocxHighlightSurface: (container: HTMLElement, docxDocument: DocxDocument, viewer: {
35
+ /**
36
+ * The subset of `DocxDocument` the DOCX highlight surface reads, kept as a
37
+ * narrow structural type rather than the concrete vendor class so a test
38
+ * double only needs to implement what is actually used.
39
+ */
40
+ interface DocxHighlightDocument {
41
+ /** Number of pages in the current layout. Only authoritative once `waitUntilLayoutComplete` resolves. */
42
+ readonly pageCount: number;
43
+ /** Page size in points, at scale 1. */
44
+ pageSize(pageIndex: number): {
45
+ widthPt: number;
46
+ heightPt: number;
47
+ };
48
+ /** Collects one page's text runs at the given reference width. */
49
+ collectPageRuns(pageIndex: number, opts: {
50
+ width: number;
51
+ }): Promise<DocxTextRunInfo[]>;
52
+ /** Resolves once layout has finished publishing pages; rejects if layout failed. */
53
+ waitUntilLayoutComplete(): Promise<void>;
54
+ }
55
+ /** The subset of `DocxScrollViewer` the DOCX highlight surface reads. */
56
+ interface DocxHighlightViewer {
32
57
  getScale(): number;
33
58
  scrollToPage(index: number): void;
34
- }, isDisposed: () => boolean) => OoxmlHighlightSurface;
59
+ }
60
+ /** Creates the DOCX highlight surface over an already-loaded document. */
61
+ export declare const createDocxHighlightSurface: (container: HTMLElement, docxDocument: DocxHighlightDocument, viewer: DocxHighlightViewer, isDisposed: () => boolean) => OoxmlHighlightSurface;
35
62
  /** Creates the PPTX highlight surface over an already-loaded presentation. */
36
63
  export declare const createPptxHighlightSurface: (container: HTMLElement, presentation: PptxPresentation, viewer: {
37
64
  getScale(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"ooxml-highlight-surfaces.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-highlight-surfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAEV,cAAc,EACd,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAIL,KAAK,kBAAkB,EAQxB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,OAAO,CACL,UAAU,EAAE,SAAS,cAAc,EAAE,GACpC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAClC,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;AAsDD,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,cAAc,YAAY,EAC1B,QAAQ;IAAE,QAAQ,IAAI,MAAM,CAAC;IAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACjE,YAAY,MAAM,OAAO,KACxB,qBA0HF,CAAC;AAEF,8EAA8E;AA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AC7B,yGAAyG;IACzG,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,kEAAkE;IAClE,eAAe,CACb,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GACtB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9B,oFAAoF;IACpF,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,yEAAyE;AACzE,UAAU,mBAAmB;IAC3B,QAAQ,IAAI,MAAM,CAAC;IACnB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,cAAc,qBAAqB,EACnC,QAAQ,mBAAmB,EAC3B,YAAY,MAAM,OAAO,KACxB,qBA8PF,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,cAAc,gBAAgB,EAC9B,QAAQ;IAAE,QAAQ,IAAI,MAAM,CAAC;IAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAClE,YAAY,MAAM,OAAO,KACxB,qBAwEF,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,GACrC,WAAW,WAAW,EACtB,QAAQ,UAAU,EAClB,YAAY,MAAM,OAAO,KACxB,qBA0DD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { PptxTextRunInfo } from '@silurus/ooxml/pptx';
2
+ import { OoxmlDocxTableRowLocation, OoxmlPptxTableRowLocation } from '../models/attachment-canvas';
3
+ import { OoxmlDocxPageRects, OoxmlDocxPageRuns, OoxmlHighlightRect } from './ooxml-highlight-geometry';
4
+ /** Resolves a whole DOCX table row to scale-independent text rectangles. */
5
+ export declare const resolveDocxTableRowRects: (location: OoxmlDocxTableRowLocation, pages: readonly OoxmlDocxPageRuns[]) => OoxmlDocxPageRects[];
6
+ /** Resolves a whole table row from the runs of its specified PPTX slide. */
7
+ export declare const resolvePptxTableRowRects: (location: OoxmlPptxTableRowLocation, runs: readonly PptxTextRunInfo[]) => OoxmlHighlightRect[];
8
+ //# sourceMappingURL=ooxml-table-row-highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ooxml-table-row-highlight.d.ts","sourceRoot":"","sources":["../../src/utils/ooxml-table-row-highlight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGxB,MAAM,4BAA4B,CAAC;AAmEpC,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,GACnC,UAAU,yBAAyB,EACnC,OAAO,SAAS,iBAAiB,EAAE,KAClC,kBAAkB,EAuEpB,CAAC;AAcF,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,GACnC,UAAU,yBAAyB,EACnC,MAAM,SAAS,eAAe,EAAE,KAC/B,kBAAkB,EA4CpB,CAAC"}
@@ -1,8 +1,36 @@
1
- import { CustomVisualizer } from '@epam/ai-dial-chat-shared';
1
+ import { ApplicationVisualizer, ApplicationVisualizerRegistry, CustomVisualizer, DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
2
  /**
3
3
  * Returns the first `CustomVisualizer` registry entry whose `contentType` list
4
4
  * (comma-separated, case-insensitive) includes `mimeType`, or `undefined` if
5
5
  * none match. First-match-wins when multiple entries cover the same MIME type.
6
6
  */
7
7
  export declare const findVisualizerForMime: (mimeType: string, visualizers: CustomVisualizer[]) => CustomVisualizer | undefined;
8
+ /**
9
+ * Returns the `ApplicationVisualizer` registered for `applicationId`, or
10
+ * `undefined` when the id is absent, empty, or not a key of the registry.
11
+ * Keys are compared by exact string equality — deployment ids are opaque and
12
+ * are never trimmed or case-folded.
13
+ */
14
+ export declare const findVisualizerForApplication: (applicationId: string | undefined, visualizers: ApplicationVisualizerRegistry) => ApplicationVisualizer | undefined;
15
+ /**
16
+ * Returns the canvas-selection key identifying a message's grouped visualizer,
17
+ * so the host can tell whether that visualizer is the one currently open in
18
+ * the canvas and replace its inline frame with a placeholder.
19
+ */
20
+ export declare const groupedVisualizerCanvasKey: (messageIndex: number) => string;
21
+ /** Attachments split by whether an `ApplicationVisualizer` entry claims them. */
22
+ export interface ApplicationVisualizerPartition {
23
+ /** Attachments the entry claims, to be sent as one grouped payload. In the input's order. */
24
+ claimed: DisplayAttachment[];
25
+ /** Attachments the entry does not claim, to be rendered as ordinary tiles. In the input's order. */
26
+ unclaimed: DisplayAttachment[];
27
+ }
28
+ /**
29
+ * Splits `attachments` into the ones `visualizer` claims and the ones it does
30
+ * not. An entry with a `contentType` claims the attachments whose own
31
+ * `contentType` appears in its comma-separated list (compared
32
+ * case-insensitively); an entry without one claims every attachment that
33
+ * carries a URL. Both sides keep the input order.
34
+ */
35
+ export declare const partitionAttachmentsForApplicationVisualizer: (attachments: DisplayAttachment[], visualizer: ApplicationVisualizer) => ApplicationVisualizerPartition;
8
36
  //# sourceMappingURL=visualizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visualizer.d.ts","sourceRoot":"","sources":["../../src/utils/visualizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,aAAa,gBAAgB,EAAE,KAC9B,gBAAgB,GAAG,SASrB,CAAC"}
1
+ {"version":3,"file":"visualizer.d.ts","sourceRoot":"","sources":["../../src/utils/visualizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,aAAa,gBAAgB,EAAE,KAC9B,gBAAgB,GAAG,SASrB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,eAAe,MAAM,GAAG,SAAS,EACjC,aAAa,6BAA6B,KACzC,qBAAqB,GAAG,SAO1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,cAAc,MAAM,KAAG,MAC5B,CAAC;AAEvC,iFAAiF;AACjF,MAAM,WAAW,8BAA8B;IAC7C,6FAA6F;IAC7F,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,oGAAoG;IACpG,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4CAA4C,GACvD,aAAa,iBAAiB,EAAE,EAChC,YAAY,qBAAqB,KAChC,8BA2BF,CAAC"}
@@ -5,14 +5,14 @@
5
5
  * package), and either way the import stays external so consumers get one
6
6
  * shared copy rather than a second one inlined here.
7
7
  */
8
- export declare const EXTERNAL_PEER_NAMES: readonly ["react", "@epam/ai-dial-chat-shared", "@epam/ai-dial-shared", "@epam/ai-dial-sidebar", "@epam/ai-dial-ui-kit", "@epam/ai-dial-visualizer-connector", "@tabler/icons-react", "react-json-view-lite", "@epam/ai-dial-react-pdf-highlighter", "@epam/pdf-highlighter-kit", "react-syntax-highlighter", "@mcp-ui/client", "@modelcontextprotocol/sdk", "@modelcontextprotocol/ext-apps", "pdfjs-dist"];
8
+ export declare const EXTERNAL_PACKAGE_NAMES: readonly ["react", "@silurus/ooxml", "@epam/ai-dial-chat-shared", "@epam/ai-dial-shared", "@epam/ai-dial-sidebar", "@epam/ai-dial-ui-kit", "@epam/ai-dial-visualizer-connector", "@tabler/icons-react", "react-json-view-lite", "@epam/ai-dial-react-pdf-highlighter", "@epam/pdf-highlighter-kit", "react-syntax-highlighter", "@mcp-ui/client", "@modelcontextprotocol/sdk", "@modelcontextprotocol/ext-apps", "pdfjs-dist"];
9
9
  /**
10
- * Returns true when `id` is a bare peer package name, or is prefixed by
11
- * `<peerName>/` (a deep subpath of that peer), for any name in
12
- * {@link EXTERNAL_PEER_NAMES} — except when `id` ends in `.css`, since a
10
+ * Returns true when `id` is a bare runtime package name, or is prefixed by
11
+ * `<packageName>/` (a deep subpath of that package), for any name in
12
+ * {@link EXTERNAL_PACKAGE_NAMES} — except when `id` ends in `.css`, since a
13
13
  * vendor stylesheet subpath must stay locally resolved (via `resolve.alias`)
14
14
  * so Vite can process and extract it, rather than being left as an
15
15
  * unresolvable raw `import "…css"` statement in the output JS.
16
16
  */
17
- export declare const isExternalPeerImport: (id: string) => boolean;
17
+ export declare const isExternalPackageImport: (id: string) => boolean;
18
18
  //# sourceMappingURL=vite-external-matcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-external-matcher.d.ts","sourceRoot":"","sources":["../../src/utils/vite-external-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,8YAgBtB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,KAAG,OAKjD,CAAC"}
1
+ {"version":3,"file":"vite-external-matcher.d.ts","sourceRoot":"","sources":["../../src/utils/vite-external-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,gaAiBzB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,IAAI,MAAM,KAAG,OAKpD,CAAC"}