@json-to-office/core-docx 0.34.0 → 0.36.1
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/dist/components/visual.d.ts +15 -2
- package/dist/components/visual.d.ts.map +1 -1
- package/dist/core/flattenVisuals.d.ts +8 -1
- package/dist/core/flattenVisuals.d.ts.map +1 -1
- package/dist/core/fontResolution.d.ts +15 -1
- package/dist/core/fontResolution.d.ts.map +1 -1
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/prerasterizeVisuals.d.ts +8 -1
- package/dist/core/prerasterizeVisuals.d.ts.map +1 -1
- package/dist/core/render.d.ts +14 -1
- package/dist/core/render.d.ts.map +1 -1
- package/dist/index.js +213 -59
- package/dist/index.js.map +1 -1
- package/dist/plugin/createDocumentGenerator.d.ts.map +1 -1
- package/dist/plugin/example/index.js +3353 -3218
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/templates/themes/index.d.ts +156 -8
- package/dist/templates/themes/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +8 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/generationContext.d.ts +9 -0
- package/dist/utils/generationContext.d.ts.map +1 -1
- package/dist/utils/imageUtils.d.ts +7 -3
- package/dist/utils/imageUtils.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -12,7 +12,7 @@ import { ComponentDefinition, RenderContext } from '../types';
|
|
|
12
12
|
import { ThemeConfig } from '../styles';
|
|
13
13
|
import { type ImageOptions } from '../core/content';
|
|
14
14
|
import type { VisualProps } from '@json-to-office/shared-docx';
|
|
15
|
-
import { type PptxServiceConfig, type PptxRasterizeResult } from '@json-to-office/shared';
|
|
15
|
+
import { type PptxServiceConfig, type PptxRasterizeResult, type RasterizeFontFace } from '@json-to-office/shared';
|
|
16
16
|
export declare const DEFAULT_RASTERIZE_SERVER_URL = "http://localhost:7802";
|
|
17
17
|
/**
|
|
18
18
|
* Build a single-slide pptx presentation component definition from visual props.
|
|
@@ -42,6 +42,13 @@ export declare function visualToImageProps(props: VisualProps, base64DataUri: st
|
|
|
42
42
|
* services) the target server. Keys the per-document pre-rasterization map
|
|
43
43
|
* (#153); the pre-pass and the render-time lookup MUST use this one function
|
|
44
44
|
* so the two sides cannot drift.
|
|
45
|
+
*
|
|
46
|
+
* FONTS ARE DELIBERATELY NOT PART OF THIS KEY. The map is built and consumed
|
|
47
|
+
* inside a single `renderDocument` call, which has exactly one font set, so
|
|
48
|
+
* the pre-pass and the render-time lookup can never disagree about fonts.
|
|
49
|
+
* The load-bearing font key is the RASTERIZER's on-disk cache key, which is
|
|
50
|
+
* process-wide and shared across documents and users — see `fontsDigest` in
|
|
51
|
+
* jto-cli's pptx-rasterizer.ts.
|
|
45
52
|
*/
|
|
46
53
|
export declare function visualRasterKey(presentation: unknown, dpi: number, serverUrl?: string): string;
|
|
47
54
|
/**
|
|
@@ -61,7 +68,13 @@ export declare function effectiveVisualServerUrl(props: VisualProps, serviceConf
|
|
|
61
68
|
* Exported for the pre-rasterization pass, whose per-visual fallback must
|
|
62
69
|
* behave exactly like render-time rasterization.
|
|
63
70
|
*/
|
|
64
|
-
export declare function rasterizeVisualSlide(presentation: Record<string, unknown>, dpi: number, propsServerUrl: string | undefined, serviceConfig: PptxServiceConfig | undefined, baseDir: string | undefined
|
|
71
|
+
export declare function rasterizeVisualSlide(presentation: Record<string, unknown>, dpi: number, propsServerUrl: string | undefined, serviceConfig: PptxServiceConfig | undefined, baseDir: string | undefined,
|
|
72
|
+
/**
|
|
73
|
+
* Document fonts staged for the rasterizer's LibreOffice launch. Added
|
|
74
|
+
* conditionally below so a fontless document's request body stays exactly
|
|
75
|
+
* what it was before fonts existed.
|
|
76
|
+
*/
|
|
77
|
+
fonts?: readonly RasterizeFontFace[]): Promise<PptxRasterizeResult>;
|
|
65
78
|
/**
|
|
66
79
|
* Render visual component
|
|
67
80
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual.d.ts","sourceRoot":"","sources":["../../src/components/visual.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"visual.d.ts","sourceRoot":"","sources":["../../src/components/visual.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAIpE;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,WAAW,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBzB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAWrE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,OAAO,EACrB,GAAG,EAAE,MAAM,EACX,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAIR;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,iBAAiB,GAAG,SAAS,GAC3C,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,aAAa,EAAE,iBAAiB,GAAG,SAAS,EAC5C,OAAO,EAAE,MAAM,GAAG,SAAS;AAC3B;;;;GAIG;AACH,KAAK,CAAC,EAAE,SAAS,iBAAiB,EAAE,GACnC,OAAO,CAAC,mBAAmB,CAAC,CAuD9B;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CAmDhC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* just `children`: section `props.header`/`props.footer`, and table
|
|
14
14
|
* `props.columns[].cells[].content` / `props.columns[].header.content`.
|
|
15
15
|
*/
|
|
16
|
-
import { type PptxRasterizer, type PptxBatchRasterizer } from '@json-to-office/shared';
|
|
16
|
+
import { type PptxRasterizer, type PptxBatchRasterizer, type RasterizeFontFace } from '@json-to-office/shared';
|
|
17
17
|
export interface FlattenVisualsOptions {
|
|
18
18
|
/** Rasterizer that turns a single-slide pptx presentation into a PNG. */
|
|
19
19
|
rasterize: PptxRasterizer;
|
|
@@ -32,6 +32,13 @@ export interface FlattenVisualsOptions {
|
|
|
32
32
|
* the document's own directory. Absent → the rasterizer's cwd (#142).
|
|
33
33
|
*/
|
|
34
34
|
baseDir?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Font faces staged for each visual's LibreOffice render. Without these a
|
|
37
|
+
* flattened document bakes in fontless PNGs permanently — the flatten
|
|
38
|
+
* output is a portable, service-free `.docx.json`, so there is no second
|
|
39
|
+
* chance to re-rasterize with the right fonts.
|
|
40
|
+
*/
|
|
41
|
+
fonts?: readonly RasterizeFontFace[];
|
|
35
42
|
}
|
|
36
43
|
/**
|
|
37
44
|
* Return a deep copy of `doc` with every `visual` node replaced by the `image`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flattenVisuals.d.ts","sourceRoot":"","sources":["../../src/core/flattenVisuals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"flattenVisuals.d.ts","sourceRoot":"","sources":["../../src/core/flattenVisuals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAYhC,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACtC;AAUD;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,CAAC,CAAC,CA+CZ"}
|
|
@@ -7,9 +7,23 @@
|
|
|
7
7
|
* Keeping it in one place ensures the two paths behave identically around
|
|
8
8
|
* validation, SAFE_FONTS awareness, Google Fonts materialization, and the
|
|
9
9
|
* `onResolved` side-channel consumed by the LibreOffice preview font stager.
|
|
10
|
+
*
|
|
11
|
+
* Materialization has two triggers: an `onResolved` listener, or the
|
|
12
|
+
* caller's `forceMaterialize` flag (set when the document contains a
|
|
13
|
+
* `visual`, whose PNG is produced by an out-of-process LibreOffice that
|
|
14
|
+
* needs real font files). Both entry paths return the resolved fonts so the
|
|
15
|
+
* caller can forward them to the rasterizer.
|
|
10
16
|
*/
|
|
11
17
|
import type { FontRuntimeOpts, ResolvedFont, GenerationWarning } from '@json-to-office/shared';
|
|
12
18
|
import type { ThemeConfig } from '../styles';
|
|
13
19
|
import type { ReportComponentDefinition } from '../types';
|
|
14
|
-
export declare function resolveDocumentFonts(document: ReportComponentDefinition, theme: ThemeConfig, fonts?: FontRuntimeOpts, warnings?: GenerationWarning[]
|
|
20
|
+
export declare function resolveDocumentFonts(document: ReportComponentDefinition, theme: ThemeConfig, fonts?: FontRuntimeOpts, warnings?: GenerationWarning[],
|
|
21
|
+
/**
|
|
22
|
+
* Materialize font bytes even when no `onResolved` listener is registered.
|
|
23
|
+
* Set by the callers when the document contains at least one `visual`,
|
|
24
|
+
* whose PNG is rendered by an out-of-process LibreOffice that needs the
|
|
25
|
+
* actual font files — there is no listener on the plain CLI path, so
|
|
26
|
+
* without this a visual-bearing build silently renders with fallbacks.
|
|
27
|
+
*/
|
|
28
|
+
forceMaterialize?: boolean): Promise<ResolvedFont[]>;
|
|
15
29
|
//# sourceMappingURL=fontResolution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fontResolution.d.ts","sourceRoot":"","sources":["../../src/core/fontResolution.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fontResolution.d.ts","sourceRoot":"","sources":["../../src/core/fontResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAchC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,yBAAyB,EACnC,KAAK,EAAE,WAAW,EAClB,KAAK,CAAC,EAAE,eAAe,EACvB,QAAQ,CAAC,EAAE,iBAAiB,EAAE;AAC9B;;;;;;GAMG;AACH,gBAAgB,UAAQ,GACvB,OAAO,CAAC,YAAY,EAAE,CAAC,CAkFzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/core/generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EAE1B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/core/generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EAE1B,MAAM,UAAU,CAAC;AA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C,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAErE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAa7B,CAAC"}
|
|
@@ -15,13 +15,20 @@
|
|
|
15
15
|
* wastes a little work, under-collection and every failure mode degrade to
|
|
16
16
|
* the sequential status quo, never to a broken render.
|
|
17
17
|
*/
|
|
18
|
-
import { type PptxServiceConfig, type PptxRasterizeBatchSlideResult } from '@json-to-office/shared';
|
|
18
|
+
import { type PptxServiceConfig, type PptxRasterizeBatchSlideResult, type RasterizeFontFace } from '@json-to-office/shared';
|
|
19
19
|
import type { VisualProps } from '@json-to-office/shared-docx';
|
|
20
20
|
export interface PrerasterizeOptions {
|
|
21
21
|
/** Directory relative asset paths resolve against (#142). */
|
|
22
22
|
baseDir?: string;
|
|
23
23
|
/** Max concurrent per-visual fallback rasterizations (default 4). */
|
|
24
24
|
concurrency?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Font faces staged for every slide's LibreOffice render. Request-level,
|
|
27
|
+
* like `baseDir` — never per-slide: the batch schema validates each slide
|
|
28
|
+
* object with `additionalProperties: false`, and a uniform slide shape is
|
|
29
|
+
* what lets the server share one disk-cache key with the single path.
|
|
30
|
+
*/
|
|
31
|
+
fonts?: readonly RasterizeFontFace[];
|
|
25
32
|
}
|
|
26
33
|
/** Cumulative pre-pass counters for cache observability (#156). */
|
|
27
34
|
export interface VisualPrepassStats {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerasterizeVisuals.d.ts","sourceRoot":"","sources":["../../src/core/prerasterizeVisuals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAIL,KAAK,iBAAiB,EAEtB,KAAK,6BAA6B,
|
|
1
|
+
{"version":3,"file":"prerasterizeVisuals.d.ts","sourceRoot":"","sources":["../../src/core/prerasterizeVisuals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAIL,KAAK,iBAAiB,EAEtB,KAAK,6BAA6B,EAClC,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAkB/D,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACtC;AAED,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;CAChB;AAQD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAE1D;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,EAAE,CA4B/D;AA6ED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,iBAAiB,GAAG,SAAS,EAC5C,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC,CAiOrD"}
|
package/dist/core/render.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import { ThemeConfig } from '../styles';
|
|
|
8
8
|
import { ProcessedDocument } from './structure';
|
|
9
9
|
import { LayoutPlan, SectionLayout } from './layout';
|
|
10
10
|
import { MemoryCache } from '../cache';
|
|
11
|
-
import type { ServicesConfig } from '@json-to-office/shared';
|
|
11
|
+
import type { ServicesConfig, RasterizeFontFace } from '@json-to-office/shared';
|
|
12
|
+
import type { GenerationWarning } from '@json-to-office/shared';
|
|
12
13
|
interface RenderDocumentOptions {
|
|
13
14
|
cache?: MemoryCache;
|
|
14
15
|
bypassCache?: boolean;
|
|
@@ -18,6 +19,18 @@ interface RenderDocumentOptions {
|
|
|
18
19
|
* against. Defaults to `process.cwd()` when absent (#142).
|
|
19
20
|
*/
|
|
20
21
|
baseDir?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Font faces (base64) shipped with every `visual` rasterization so the
|
|
24
|
+
* out-of-process LibreOffice renders the slide with the document's real
|
|
25
|
+
* fonts instead of a system fallback. Produced by the caller from
|
|
26
|
+
* `resolveDocumentFonts` via `toRasterizeFontFaces`.
|
|
27
|
+
*/
|
|
28
|
+
visualFonts?: RasterizeFontFace[];
|
|
29
|
+
/**
|
|
30
|
+
* Collector for warnings raised while rendering, such as an inline SVG the
|
|
31
|
+
* rasterizer could not turn into a fallback. Absent → `console.warn`.
|
|
32
|
+
*/
|
|
33
|
+
warnings?: GenerationWarning[];
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
36
|
* Render a complete document from structure and layout
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/core/render.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EAEf,eAAe,EAKf,OAAO,EACR,MAAM,MAAM,CAAC;AAcd,OAAO,EACL,mBAAmB,EACnB,aAAa,EAed,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,EAEL,iBAAiB,EAElB,MAAM,aA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