@extend-ai/react-docx 0.9.1 → 0.10.0
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/README.md +71 -21
- package/dist/{chunk-GRQPIBJJ.js → chunk-YT56QNGH.js} +76 -2
- package/dist/chunk-YT56QNGH.js.map +1 -0
- package/dist/docx-import-worker.cjs.map +1 -1
- package/dist/docx-import-worker.js +1 -1
- package/dist/docx_wasm_bg.wasm +0 -0
- package/dist/index.cjs +6997 -3266
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +285 -3
- package/dist/index.d.ts +285 -3
- package/dist/index.js +6875 -3263
- package/dist/index.js.map +1 -1
- package/dist/{src-D3NRHPLE.js → src-NJTPUK4E.js} +12 -4
- package/package.json +1 -1
- package/dist/chunk-GRQPIBJJ.js.map +0 -1
- /package/dist/{src-D3NRHPLE.js.map → src-NJTPUK4E.js.map} +0 -0
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ React-first DOCX viewing and editing components for rendering `.docx` files in a
|
|
|
4
4
|
|
|
5
5
|
`@extend-ai/react-docx` gives you:
|
|
6
6
|
|
|
7
|
-
- A
|
|
8
|
-
- A
|
|
7
|
+
- A shared viewer for read-only previews and editable documents
|
|
8
|
+
- A controller API for import/export and custom DOCX editing UIs
|
|
9
9
|
- Pagination, page layout, theme, tracked-change, form-field, and thumbnail hooks
|
|
10
10
|
- Configurable page surface and inter-page background colors
|
|
11
11
|
- A dark read-only night-reader mode that inverts document content while preserving image hues
|
|
@@ -51,13 +51,10 @@ You can also call `initWasm()` (optionally with a source) ahead of time to warm
|
|
|
51
51
|
|
|
52
52
|
## Main Entry Points
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
2. `useDocxEditor` + `DocxEditorViewer`
|
|
60
|
-
The full controller/view split for editable or highly customized experiences.
|
|
54
|
+
Use `useDocxEditor` + `DocxEditorViewer` for both read-only and editable
|
|
55
|
+
experiences. The hook manages document state, import/export, and editing
|
|
56
|
+
commands; the component renders the document. Set `mode="read-only"` for
|
|
57
|
+
view-only use or `mode="edit"` for editing.
|
|
61
58
|
|
|
62
59
|
It also re-exports lower-level document/model/layout/serializer APIs, so you can work below the UI layer when needed.
|
|
63
60
|
|
|
@@ -65,36 +62,41 @@ It also re-exports lower-level document/model/layout/serializer APIs, so you can
|
|
|
65
62
|
|
|
66
63
|
### Read-only viewer
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
Starting in v0.10.0, the intended pattern for read-only viewing is
|
|
66
|
+
`useDocxEditor` with `DocxEditorViewer mode="read-only"`. Use the same component
|
|
67
|
+
with `mode="edit"` when editing is needed.
|
|
69
68
|
|
|
70
69
|
```tsx
|
|
71
|
-
import
|
|
72
|
-
import { ReactDocxViewer } from "@extend-ai/react-docx";
|
|
70
|
+
import { DocxEditorViewer, useDocxEditor } from "@extend-ai/react-docx";
|
|
73
71
|
|
|
74
72
|
export function ReadOnlyDocxExample() {
|
|
75
|
-
const
|
|
73
|
+
const editor = useDocxEditor();
|
|
76
74
|
|
|
77
75
|
return (
|
|
78
76
|
<div style={{ display: "grid", gap: 12 }}>
|
|
79
77
|
<input
|
|
80
78
|
type="file"
|
|
81
79
|
accept=".docx"
|
|
82
|
-
onChange={
|
|
83
|
-
const
|
|
84
|
-
|
|
80
|
+
onChange={(event) => {
|
|
81
|
+
const file = event.target.files?.[0];
|
|
82
|
+
if (file) {
|
|
83
|
+
void editor.importDocxFile(file);
|
|
84
|
+
}
|
|
85
85
|
}}
|
|
86
86
|
/>
|
|
87
87
|
|
|
88
|
-
<
|
|
89
|
-
file={file}
|
|
90
|
-
emptyState="Choose a DOCX file to preview."
|
|
91
|
-
/>
|
|
88
|
+
<DocxEditorViewer editor={editor} mode="read-only" />
|
|
92
89
|
</div>
|
|
93
90
|
);
|
|
94
91
|
}
|
|
95
92
|
```
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
For an already parsed document, initialize the controller with
|
|
95
|
+
`useDocxEditor({ document })`. For a prebuilt document model, use
|
|
96
|
+
`useDocxEditor({ starterModel: model })`. To start from a raw buffer, call
|
|
97
|
+
`parseDocxForViewer(buffer)` and pass the resulting `document` to the hook.
|
|
98
|
+
These options set the initial document; use `editor.importDocxFile(file)` to
|
|
99
|
+
load a different document into an existing controller.
|
|
98
100
|
|
|
99
101
|
### Full editor/viewer
|
|
100
102
|
|
|
@@ -190,6 +192,27 @@ function FullEditor() {
|
|
|
190
192
|
}
|
|
191
193
|
```
|
|
192
194
|
|
|
195
|
+
## Responsive zoom
|
|
196
|
+
|
|
197
|
+
`DocxEditorViewer` accepts numeric percentages and responsive zoom modes.
|
|
198
|
+
Responsive modes remain selected while the viewer recalculates their resolved
|
|
199
|
+
percentage as its viewport or page layout changes.
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
<DocxEditorViewer
|
|
203
|
+
editor={editor}
|
|
204
|
+
mode="read-only"
|
|
205
|
+
defaultZoom="fit-width"
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Use `zoom` with `onZoomChange` for a controlled viewer, or `defaultZoom` for an
|
|
210
|
+
uncontrolled viewer. The available modes are `"automatic"`, `"fit-page"`, and
|
|
211
|
+
`"fit-width"`. Custom editor toolbars can use `editor.setZoom(level)`,
|
|
212
|
+
`editor.getZoom()`, and `editor.getResolvedZoom()`. When zooming in or out from
|
|
213
|
+
a responsive mode, calculate the next numeric percentage from
|
|
214
|
+
`editor.getResolvedZoom()` and pass it to `editor.setZoom()`.
|
|
215
|
+
|
|
193
216
|
`renderPage` supports `canvas`, `blob`, and `imageBitmap` output. Pass `canvas`
|
|
194
217
|
to draw into a caller-owned canvas without an encoding round trip. Its timings
|
|
195
218
|
separate pagination, page mounting, rasterization, and encoding; the parsed
|
|
@@ -198,6 +221,33 @@ and embedded-font loading. Use `loadEmbeddedFonts: "defer"` to load fonts later
|
|
|
198
221
|
through `document.loadEmbeddedFonts()`. The renderer also accepts an existing
|
|
199
222
|
`DocModel` directly when the OOXML package is not needed.
|
|
200
223
|
|
|
224
|
+
## Caller fonts
|
|
225
|
+
|
|
226
|
+
Fonts embedded in a DOCX load automatically by default. Caller-provided fonts
|
|
227
|
+
must be available in `document.fonts` before layout uses them. When adding or
|
|
228
|
+
removing fonts after parsing or mounting, call `refreshDocxFontMetrics()` after
|
|
229
|
+
the change to refresh cached text measurements and mounted viewers.
|
|
230
|
+
|
|
231
|
+
```tsx
|
|
232
|
+
import { refreshDocxFontMetrics } from "@extend-ai/react-docx";
|
|
233
|
+
|
|
234
|
+
async function attachViewerFont(face: FontFace) {
|
|
235
|
+
await face.load();
|
|
236
|
+
document.fonts.add(face);
|
|
237
|
+
refreshDocxFontMetrics();
|
|
238
|
+
|
|
239
|
+
return () => {
|
|
240
|
+
document.fonts.delete(face);
|
|
241
|
+
refreshDocxFontMetrics();
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Provide matching font data and descriptors for each required weight and style.
|
|
247
|
+
The caller owns loading and cleanup. Load fonts before creating a standalone
|
|
248
|
+
`createDocxThumbnailRenderer`; after changing fonts, dispose and recreate that
|
|
249
|
+
renderer to refresh its captured pagination.
|
|
250
|
+
|
|
201
251
|
## Thumbnail Hook
|
|
202
252
|
|
|
203
253
|
The library can expose page thumbnails so you can build your own page strip, mini-map, or navigation UI. Thumbnail painting can render from the live page surface when it is mounted, or from an offscreen one-page surface when viewer virtualization has unmounted that page.
|
|
@@ -93,6 +93,25 @@ function normalizeDocModel(model) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
// ../doc-model/src/table-grid.ts
|
|
97
|
+
function tableGridColumnBound(table) {
|
|
98
|
+
if (table.style?.columnWidthsTwips !== void 0) return table.style.columnWidthsTwips.length;
|
|
99
|
+
return Math.max(0, ...table.rows.map((row) => row.cells.reduce((total, cell) => {
|
|
100
|
+
const span = cell.style?.gridSpan;
|
|
101
|
+
return total + (Number.isFinite(span) && span > 0 ? Math.max(1, Math.floor(span)) : 1);
|
|
102
|
+
}, 0)));
|
|
103
|
+
}
|
|
104
|
+
function resolveTableGridSkipCount(count, gridColumnCount) {
|
|
105
|
+
const value = Number.isFinite(count) && count >= 0 ? Math.floor(count) : 0;
|
|
106
|
+
return Number.isFinite(gridColumnCount) && gridColumnCount >= value ? value : 0;
|
|
107
|
+
}
|
|
108
|
+
function tableRowGridSkipCount(table, row, edge) {
|
|
109
|
+
return resolveTableGridSkipCount(
|
|
110
|
+
edge === "before" ? row.style?.gridBefore : row.style?.gridAfter,
|
|
111
|
+
tableGridColumnBound(table)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
96
115
|
// ../doc-model/src/block-id.ts
|
|
97
116
|
var nextBlockIdValue = 1;
|
|
98
117
|
function allocateBlockId() {
|
|
@@ -235,6 +254,7 @@ function cloneParagraphStyle(style) {
|
|
|
235
254
|
spacing: cloneParagraphSpacing(style.spacing),
|
|
236
255
|
indent: cloneParagraphIndent(style.indent),
|
|
237
256
|
borders: cloneParagraphBorderSet(style.borders),
|
|
257
|
+
tabStops: style.tabStops?.map((stop) => ({ ...stop })),
|
|
238
258
|
dropCap: style.dropCap ? {
|
|
239
259
|
...style.dropCap
|
|
240
260
|
} : void 0
|
|
@@ -246,6 +266,13 @@ function cloneTextStyle(style) {
|
|
|
246
266
|
runBorder: style.runBorder ? { ...style.runBorder } : void 0
|
|
247
267
|
} : void 0;
|
|
248
268
|
}
|
|
269
|
+
function cloneParagraphMarkFormatting(formatting) {
|
|
270
|
+
return formatting ? {
|
|
271
|
+
defaultStyle: cloneTextStyle(formatting.defaultStyle),
|
|
272
|
+
characterStyle: cloneTextStyle(formatting.characterStyle),
|
|
273
|
+
directStyle: cloneTextStyle(formatting.directStyle)
|
|
274
|
+
} : void 0;
|
|
275
|
+
}
|
|
249
276
|
function cloneParagraphNode(paragraph) {
|
|
250
277
|
return cloneParagraph(paragraph);
|
|
251
278
|
}
|
|
@@ -257,6 +284,12 @@ function cloneParagraph(paragraph) {
|
|
|
257
284
|
type: "paragraph",
|
|
258
285
|
blockId: paragraph.blockId,
|
|
259
286
|
style: cloneParagraphStyle(paragraph.style),
|
|
287
|
+
paragraphMarkStyle: cloneTextStyle(paragraph.paragraphMarkStyle),
|
|
288
|
+
sourceParagraphMarkStyle: cloneTextStyle(paragraph.sourceParagraphMarkStyle),
|
|
289
|
+
sourceParagraphMarkFormatting: cloneParagraphMarkFormatting(
|
|
290
|
+
paragraph.sourceParagraphMarkFormatting
|
|
291
|
+
),
|
|
292
|
+
sourceParagraphMarkPropertiesXml: paragraph.sourceParagraphMarkPropertiesXml,
|
|
260
293
|
paragraphMarkDeleted: paragraph.paragraphMarkDeleted,
|
|
261
294
|
sourceXml: paragraph.sourceXml,
|
|
262
295
|
sourceTextPatch: paragraph.sourceTextPatch ? {
|
|
@@ -397,6 +430,28 @@ function cloneTableFloatingStyle(floating) {
|
|
|
397
430
|
verticalAlign: floating.verticalAlign
|
|
398
431
|
};
|
|
399
432
|
}
|
|
433
|
+
function cloneTablePreferredWidth(width) {
|
|
434
|
+
return width ? { ...width } : void 0;
|
|
435
|
+
}
|
|
436
|
+
function cloneTableWidthSource(source) {
|
|
437
|
+
return source ? {
|
|
438
|
+
...source,
|
|
439
|
+
preferredWidth: cloneTablePreferredWidth(source.preferredWidth),
|
|
440
|
+
inheritedPreferredWidth: cloneTablePreferredWidth(source.inheritedPreferredWidth)
|
|
441
|
+
} : void 0;
|
|
442
|
+
}
|
|
443
|
+
function cloneTableRowStyle(style) {
|
|
444
|
+
return style ? {
|
|
445
|
+
...style,
|
|
446
|
+
widthBefore: cloneTablePreferredWidth(style.widthBefore),
|
|
447
|
+
widthAfter: cloneTablePreferredWidth(style.widthAfter),
|
|
448
|
+
sourceRowGeometry: style.sourceRowGeometry ? {
|
|
449
|
+
...style.sourceRowGeometry,
|
|
450
|
+
widthBefore: cloneTablePreferredWidth(style.sourceRowGeometry.widthBefore),
|
|
451
|
+
widthAfter: cloneTablePreferredWidth(style.sourceRowGeometry.widthAfter)
|
|
452
|
+
} : void 0
|
|
453
|
+
} : void 0;
|
|
454
|
+
}
|
|
400
455
|
function cloneTable(table) {
|
|
401
456
|
return {
|
|
402
457
|
type: "table",
|
|
@@ -407,7 +462,17 @@ function cloneTable(table) {
|
|
|
407
462
|
paragraph: cloneParagraph(patch.paragraph)
|
|
408
463
|
})),
|
|
409
464
|
style: table.style ? {
|
|
465
|
+
styleId: table.style.styleId,
|
|
466
|
+
sourceStyleId: table.style.sourceStyleId,
|
|
410
467
|
widthTwips: table.style.widthTwips,
|
|
468
|
+
preferredWidth: cloneTablePreferredWidth(table.style.preferredWidth),
|
|
469
|
+
sourceWidth: cloneTableWidthSource(table.style.sourceWidth),
|
|
470
|
+
alignment: table.style.alignment,
|
|
471
|
+
sourceAlignment: table.style.sourceAlignment,
|
|
472
|
+
sourceInheritedAlignment: table.style.sourceInheritedAlignment,
|
|
473
|
+
bidiVisual: table.style.bidiVisual,
|
|
474
|
+
sourceBidiVisual: table.style.sourceBidiVisual,
|
|
475
|
+
sourceInheritedBidiVisual: table.style.sourceInheritedBidiVisual,
|
|
411
476
|
indentTwips: table.style.indentTwips,
|
|
412
477
|
layout: table.style.layout,
|
|
413
478
|
cellSpacingTwips: table.style.cellSpacingTwips,
|
|
@@ -418,11 +483,13 @@ function cloneTable(table) {
|
|
|
418
483
|
} : void 0,
|
|
419
484
|
rows: table.rows.map((row) => ({
|
|
420
485
|
type: "table-row",
|
|
421
|
-
style: row.style
|
|
486
|
+
style: cloneTableRowStyle(row.style),
|
|
422
487
|
cells: row.cells.map((cell) => ({
|
|
423
488
|
type: "table-cell",
|
|
424
489
|
style: cell.style ? {
|
|
425
490
|
...cell.style,
|
|
491
|
+
preferredWidth: cloneTablePreferredWidth(cell.style.preferredWidth),
|
|
492
|
+
sourceWidth: cloneTableWidthSource(cell.style.sourceWidth),
|
|
426
493
|
marginTwips: cloneTableBoxSpacing(cell.style.marginTwips),
|
|
427
494
|
borders: cloneTableBorderSet(cell.style.borders)
|
|
428
495
|
} : void 0,
|
|
@@ -502,6 +569,9 @@ function cloneDocModel(model) {
|
|
|
502
569
|
borders: cloneParagraphBorderSet(style.borders)
|
|
503
570
|
})),
|
|
504
571
|
defaultParagraphStyleId: model.metadata.defaultParagraphStyleId,
|
|
572
|
+
defaultTabStopTwips: model.metadata.defaultTabStopTwips,
|
|
573
|
+
documentSettingsImported: model.metadata.documentSettingsImported,
|
|
574
|
+
lineSpacingCompatibilityImported: model.metadata.lineSpacingCompatibilityImported,
|
|
505
575
|
numberingDefinitions: cloneNumberingDefinitions(
|
|
506
576
|
model.metadata.numberingDefinitions
|
|
507
577
|
),
|
|
@@ -578,9 +648,13 @@ async function buildDocModelFromBytes(bytes) {
|
|
|
578
648
|
|
|
579
649
|
export {
|
|
580
650
|
normalizeDocModel,
|
|
651
|
+
tableGridColumnBound,
|
|
652
|
+
resolveTableGridSkipCount,
|
|
653
|
+
tableRowGridSkipCount,
|
|
581
654
|
allocateBlockId,
|
|
582
655
|
ensureDocModelBlockIds,
|
|
583
656
|
collectDuplicateDocModelBlockIds,
|
|
657
|
+
cloneParagraphMarkFormatting,
|
|
584
658
|
cloneParagraphNode,
|
|
585
659
|
cloneTableNode,
|
|
586
660
|
cloneDocModel,
|
|
@@ -588,4 +662,4 @@ export {
|
|
|
588
662
|
buildDocModel,
|
|
589
663
|
buildDocModelFromBytes
|
|
590
664
|
};
|
|
591
|
-
//# sourceMappingURL=chunk-
|
|
665
|
+
//# sourceMappingURL=chunk-YT56QNGH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../doc-model/src/normalize.ts","../../doc-model/src/table-grid.ts","../../doc-model/src/block-id.ts","../../doc-model/src/clone.ts","../../doc-model/src/freeze.ts","../../doc-model/src/index.ts"],"sourcesContent":["import type {\n DocModel,\n DocNode,\n ImageRunNode,\n ParagraphChildNode,\n TableCellContentNode\n} from \"./types\";\n\nfunction normalizeUint8Array(value: unknown): Uint8Array | undefined {\n if (value instanceof Uint8Array) {\n return value;\n }\n if (Array.isArray(value)) {\n return Uint8Array.from(value as number[]);\n }\n return undefined;\n}\n\nfunction normalizeParagraphChild(child: ParagraphChildNode): ParagraphChildNode {\n if (child.type !== \"image\") {\n return child;\n }\n\n const image = child as ImageRunNode;\n const data = normalizeUint8Array(image.data);\n if (data === image.data) {\n return child;\n }\n\n return {\n ...image,\n data\n };\n}\n\nfunction normalizeTableCellContent(node: TableCellContentNode): TableCellContentNode {\n if (node.type === \"table\") {\n return normalizeDocNode(node) as TableCellContentNode;\n }\n\n return {\n ...node,\n children: node.children.map(normalizeParagraphChild)\n };\n}\n\nfunction normalizeDocNode(node: DocNode): DocNode {\n if (node.type === \"paragraph\") {\n return {\n ...node,\n children: node.children.map(normalizeParagraphChild)\n };\n }\n\n return {\n ...node,\n rows: node.rows.map((row) => ({\n ...row,\n cells: row.cells.map((cell) => ({\n ...cell,\n nodes: cell.nodes.map(normalizeTableCellContent)\n }))\n }))\n };\n}\n\nexport function normalizeDocModel(model: DocModel): DocModel {\n return {\n ...model,\n nodes: model.nodes.map(normalizeDocNode),\n metadata: {\n ...model.metadata,\n headerSections: model.metadata.headerSections.map((section) => ({\n ...section,\n nodes: section.nodes.map(normalizeDocNode)\n })),\n footerSections: model.metadata.footerSections.map((section) => ({\n ...section,\n nodes: section.nodes.map(normalizeDocNode)\n })),\n sections: model.metadata.sections?.map((section) => ({\n ...section,\n headerSections: section.headerSections.map((header) => ({\n ...header,\n nodes: header.nodes.map(normalizeDocNode)\n })),\n footerSections: section.footerSections.map((footer) => ({\n ...footer,\n nodes: footer.nodes.map(normalizeDocNode)\n }))\n })),\n footnotes: model.metadata.footnotes?.map((note) => ({\n ...note,\n nodes: note.nodes?.map(normalizeDocNode)\n })),\n endnotes: model.metadata.endnotes?.map((note) => ({\n ...note,\n nodes: note.nodes?.map(normalizeDocNode)\n }))\n }\n };\n}\n","import type { TableNode, TableRowNode } from \"./types\";\n\n/** The parent grid bounds skipped-column counts without changing their source values. */\nexport function tableGridColumnBound(table: Pick<TableNode, \"style\" | \"rows\">): number {\n if (table.style?.columnWidthsTwips !== undefined) return table.style.columnWidthsTwips.length;\n return Math.max(0, ...table.rows.map((row) => row.cells.reduce((total, cell) => {\n const span = cell.style?.gridSpan;\n return total + (Number.isFinite(span) && (span as number) > 0 ? Math.max(1, Math.floor(span as number)) : 1);\n }, 0)));\n}\n\n/** Ignore skipped-grid counts that exceed the parent grid. */\nexport function resolveTableGridSkipCount(count: number | undefined, gridColumnCount: number): number {\n const value = Number.isFinite(count) && (count as number) >= 0 ? Math.floor(count as number) : 0;\n return Number.isFinite(gridColumnCount) && gridColumnCount >= value ? value : 0;\n}\n\nexport function tableRowGridSkipCount(\n table: Pick<TableNode, \"style\" | \"rows\">,\n row: TableRowNode,\n edge: \"before\" | \"after\"\n): number {\n return resolveTableGridSkipCount(\n edge === \"before\" ? row.style?.gridBefore : row.style?.gridAfter,\n tableGridColumnBound(table)\n );\n}\n","import type { DocModel, DocNode, TableCellContentNode } from \"./types\";\n\nlet nextBlockIdValue = 1;\n\n/** Returns a fresh block id, unique for the lifetime of this module instance. */\nexport function allocateBlockId(): string {\n const value = nextBlockIdValue;\n nextBlockIdValue += 1;\n return `b${value}`;\n}\n\nfunction ensureNodeBlockIds(node: DocNode | TableCellContentNode): void {\n if (!node.blockId) {\n node.blockId = allocateBlockId();\n }\n\n if (node.type !== \"table\") {\n return;\n }\n\n for (const row of node.rows) {\n for (const cell of row.cells) {\n for (const child of cell.nodes) {\n ensureNodeBlockIds(child);\n }\n }\n }\n}\n\n/**\n * Assigns a fresh block id to every paragraph/table node (body, headers,\n * footers, footnotes, endnotes, nested table content) that does not already\n * have one. Mutates the model in place and returns it.\n */\nexport function ensureDocModelBlockIds(model: DocModel): DocModel {\n model.nodes.forEach(ensureNodeBlockIds);\n\n for (const section of model.metadata.headerSections ?? []) {\n section.nodes.forEach(ensureNodeBlockIds);\n }\n for (const section of model.metadata.footerSections ?? []) {\n section.nodes.forEach(ensureNodeBlockIds);\n }\n for (const section of model.metadata.sections ?? []) {\n for (const headerSection of section.headerSections ?? []) {\n headerSection.nodes.forEach(ensureNodeBlockIds);\n }\n for (const footerSection of section.footerSections ?? []) {\n footerSection.nodes.forEach(ensureNodeBlockIds);\n }\n }\n for (const note of model.metadata.footnotes ?? []) {\n note.nodes?.forEach(ensureNodeBlockIds);\n }\n for (const note of model.metadata.endnotes ?? []) {\n note.nodes?.forEach(ensureNodeBlockIds);\n }\n\n return model;\n}\n\nfunction collectNodeBlockIds(\n node: DocNode | TableCellContentNode,\n seen: Set<string>,\n duplicates: Set<string>\n): void {\n if (node.blockId) {\n if (seen.has(node.blockId)) {\n duplicates.add(node.blockId);\n }\n seen.add(node.blockId);\n }\n\n if (node.type !== \"table\") {\n return;\n }\n\n for (const row of node.rows) {\n for (const cell of row.cells) {\n for (const child of cell.nodes) {\n collectNodeBlockIds(child, seen, duplicates);\n }\n }\n }\n}\n\n/**\n * Returns block ids that appear on more than one node within the same\n * container (body, a header/footer part, a note). Nodes without ids are\n * ignored, and the same id may legitimately recur across containers (section\n * views reference the same header/footer parts as the flat metadata lists).\n */\nexport function collectDuplicateDocModelBlockIds(model: DocModel): string[] {\n const duplicates = new Set<string>();\n\n const visitContainer = (nodes: DocNode[] | undefined): void => {\n if (!nodes) {\n return;\n }\n const seen = new Set<string>();\n nodes.forEach((node) => collectNodeBlockIds(node, seen, duplicates));\n };\n\n visitContainer(model.nodes);\n for (const section of model.metadata.headerSections ?? []) {\n visitContainer(section.nodes);\n }\n for (const section of model.metadata.footerSections ?? []) {\n visitContainer(section.nodes);\n }\n for (const note of model.metadata.footnotes ?? []) {\n visitContainer(note.nodes);\n }\n for (const note of model.metadata.endnotes ?? []) {\n visitContainer(note.nodes);\n }\n\n return Array.from(duplicates);\n}\n","import type {\n DocModel,\n DocNode,\n FooterSection,\n HeaderSection,\n NumberingDefinitionSet,\n ParagraphBorderSet,\n ParagraphBorderStyle,\n ParagraphIndent,\n ParagraphMarkFormattingSource,\n ParagraphNode,\n ParagraphNumbering,\n ParagraphSpacing,\n ParagraphStyle,\n ParagraphStyleDefinition,\n TableBorderSet,\n TableBorderStyle,\n TableBoxSpacing,\n TableCellContentNode,\n TableNode,\n TablePreferredWidth,\n TableWidthSource,\n TableRowStyle,\n TableStyle,\n TextStyle,\n} from \"./types\";\n\nfunction isParagraphCellContent(\n node: TableCellContentNode\n): node is ParagraphNode {\n return node.type === \"paragraph\";\n}\n\nfunction isTableCellContentTable(\n node: TableCellContentNode\n): node is TableNode {\n return node.type === \"table\";\n}\n\nfunction cloneTableCellContent(\n nodes: TableCellContentNode[]\n): TableCellContentNode[] {\n return nodes.map((node) => {\n if (isParagraphCellContent(node)) {\n return cloneParagraph(node);\n }\n\n if (isTableCellContentTable(node)) {\n return cloneTable(node);\n }\n\n return node;\n });\n}\n\nfunction cloneParagraphNumbering(\n numbering?: ParagraphNumbering\n): ParagraphNumbering | undefined {\n return numbering ? { ...numbering } : undefined;\n}\n\nfunction cloneParagraphSpacing(\n spacing?: ParagraphSpacing\n): ParagraphSpacing | undefined {\n return spacing ? { ...spacing } : undefined;\n}\n\nfunction cloneParagraphIndent(\n indent?: ParagraphIndent\n): ParagraphIndent | undefined {\n return indent ? { ...indent } : undefined;\n}\n\nfunction cloneParagraphBorderStyle(\n border?: ParagraphBorderStyle\n): ParagraphBorderStyle | undefined {\n return border ? { ...border } : undefined;\n}\n\nfunction cloneParagraphBorderSet(\n borders?: ParagraphBorderSet\n): ParagraphBorderSet | undefined {\n if (!borders) {\n return undefined;\n }\n\n return {\n top: cloneParagraphBorderStyle(borders.top),\n right: cloneParagraphBorderStyle(borders.right),\n bottom: cloneParagraphBorderStyle(borders.bottom),\n left: cloneParagraphBorderStyle(borders.left),\n between: cloneParagraphBorderStyle(borders.between),\n bar: cloneParagraphBorderStyle(borders.bar),\n };\n}\n\nfunction cloneParagraphStyle(\n style?: ParagraphStyle\n): ParagraphStyle | undefined {\n if (!style) {\n return undefined;\n }\n\n return {\n ...style,\n numbering: cloneParagraphNumbering(style.numbering),\n spacing: cloneParagraphSpacing(style.spacing),\n indent: cloneParagraphIndent(style.indent),\n borders: cloneParagraphBorderSet(style.borders),\n tabStops: style.tabStops?.map((stop) => ({ ...stop })),\n dropCap: style.dropCap\n ? {\n ...style.dropCap,\n }\n : undefined,\n };\n}\n\nfunction cloneTextStyle(style?: TextStyle): TextStyle | undefined {\n return style\n ? {\n ...style,\n runBorder: style.runBorder ? { ...style.runBorder } : undefined,\n }\n : undefined;\n}\n\nexport function cloneParagraphMarkFormatting(\n formatting?: ParagraphMarkFormattingSource\n): ParagraphMarkFormattingSource | undefined {\n return formatting\n ? {\n defaultStyle: cloneTextStyle(formatting.defaultStyle),\n characterStyle: cloneTextStyle(formatting.characterStyle),\n directStyle: cloneTextStyle(formatting.directStyle),\n }\n : undefined;\n}\n\nexport function cloneParagraphNode(paragraph: ParagraphNode): ParagraphNode {\n return cloneParagraph(paragraph);\n}\n\nexport function cloneTableNode(table: TableNode): TableNode {\n return cloneTable(table);\n}\n\nfunction cloneParagraph(paragraph: ParagraphNode): ParagraphNode {\n return {\n type: \"paragraph\",\n blockId: paragraph.blockId,\n style: cloneParagraphStyle(paragraph.style),\n paragraphMarkStyle: cloneTextStyle(paragraph.paragraphMarkStyle),\n sourceParagraphMarkStyle: cloneTextStyle(paragraph.sourceParagraphMarkStyle),\n sourceParagraphMarkFormatting: cloneParagraphMarkFormatting(\n paragraph.sourceParagraphMarkFormatting\n ),\n sourceParagraphMarkPropertiesXml: paragraph.sourceParagraphMarkPropertiesXml,\n paragraphMarkDeleted: paragraph.paragraphMarkDeleted,\n sourceXml: paragraph.sourceXml,\n sourceTextPatch: paragraph.sourceTextPatch\n ? {\n runs: paragraph.sourceTextPatch.runs.map((run) => ({\n style: cloneTextStyle(run.style),\n link: run.link,\n noteReference: run.noteReference\n ? { ...run.noteReference }\n : undefined,\n })),\n }\n : undefined,\n sourceRunProvenance: paragraph.sourceRunProvenance\n ? {\n runs: paragraph.sourceRunProvenance.runs.map((run) => ({\n style: cloneTextStyle(run.style),\n link: run.link,\n noteReference: run.noteReference\n ? { ...run.noteReference }\n : undefined,\n })),\n }\n : undefined,\n children: paragraph.children.map((child) => {\n if (child.type === \"text\") {\n return {\n type: \"text\" as const,\n text: child.text,\n style: cloneTextStyle(child.style),\n link: child.link,\n noteReference: child.noteReference\n ? { ...child.noteReference }\n : undefined,\n };\n }\n\n if (child.type === \"form-field\") {\n return {\n type: \"form-field\" as const,\n fieldType: child.fieldType,\n sourceKind: child.sourceKind,\n id: child.id,\n tag: child.tag,\n title: child.title,\n placeholder: child.placeholder,\n checked: child.checked,\n value: child.value,\n options: child.options?.map((option) => ({\n displayText: option.displayText,\n value: option.value,\n })),\n widget: child.widget\n ? {\n name: child.widget.name,\n enabled: child.widget.enabled,\n calcOnExit: child.widget.calcOnExit,\n text: child.widget.text\n ? {\n inputType: child.widget.text.inputType,\n defaultText: child.widget.text.defaultText,\n maxLength: child.widget.text.maxLength,\n textFormat: child.widget.text.textFormat,\n }\n : undefined,\n checkbox: child.widget.checkbox\n ? {\n defaultChecked: child.widget.checkbox.defaultChecked,\n sizeMode: child.widget.checkbox.sizeMode,\n sizePt: child.widget.checkbox.sizePt,\n }\n : undefined,\n dropdown: child.widget.dropdown\n ? {\n defaultValue: child.widget.dropdown.defaultValue,\n }\n : undefined,\n }\n : undefined,\n checkedSymbol: child.checkedSymbol,\n uncheckedSymbol: child.uncheckedSymbol,\n style: child.style ? { ...child.style } : undefined,\n link: child.link,\n sourceXml: child.sourceXml,\n };\n }\n\n return {\n type: \"image\" as const,\n src: child.src,\n alt: child.alt,\n widthPx: child.widthPx,\n heightPx: child.heightPx,\n partName: child.partName,\n contentType: child.contentType,\n data: child.data ? new Uint8Array(child.data) : undefined,\n sourceXml: child.sourceXml,\n crop: child.crop ? { ...child.crop } : undefined,\n cssFilter: child.cssFilter,\n cssOpacity: child.cssOpacity,\n floating: child.floating ? { ...child.floating } : undefined,\n syntheticTextBox: child.syntheticTextBox,\n textBoxText: child.textBoxText,\n };\n }),\n };\n}\n\nfunction cloneTableBoxSpacing(\n spacing?: TableBoxSpacing\n): TableBoxSpacing | undefined {\n if (!spacing) {\n return undefined;\n }\n\n return {\n topTwips: spacing.topTwips,\n rightTwips: spacing.rightTwips,\n bottomTwips: spacing.bottomTwips,\n leftTwips: spacing.leftTwips,\n };\n}\n\nfunction cloneTableBorderStyle(\n border?: TableBorderStyle\n): TableBorderStyle | undefined {\n if (!border) {\n return undefined;\n }\n\n return {\n type: border.type,\n color: border.color,\n sizeEighthPt: border.sizeEighthPt,\n };\n}\n\nfunction cloneTableBorderSet(\n borders?: TableBorderSet\n): TableBorderSet | undefined {\n if (!borders) {\n return undefined;\n }\n\n return {\n top: cloneTableBorderStyle(borders.top),\n right: cloneTableBorderStyle(borders.right),\n bottom: cloneTableBorderStyle(borders.bottom),\n left: cloneTableBorderStyle(borders.left),\n insideH: cloneTableBorderStyle(borders.insideH),\n insideV: cloneTableBorderStyle(borders.insideV),\n tl2br: cloneTableBorderStyle(borders.tl2br),\n tr2bl: cloneTableBorderStyle(borders.tr2bl),\n };\n}\n\nfunction cloneTableFloatingStyle(\n floating?: NonNullable<TableStyle[\"floating\"]>\n): NonNullable<TableStyle[\"floating\"]> | undefined {\n if (!floating) {\n return undefined;\n }\n\n return {\n xTwips: floating.xTwips,\n yTwips: floating.yTwips,\n leftFromTextTwips: floating.leftFromTextTwips,\n rightFromTextTwips: floating.rightFromTextTwips,\n topFromTextTwips: floating.topFromTextTwips,\n bottomFromTextTwips: floating.bottomFromTextTwips,\n horizontalAnchor: floating.horizontalAnchor,\n verticalAnchor: floating.verticalAnchor,\n horizontalAlign: floating.horizontalAlign,\n verticalAlign: floating.verticalAlign,\n };\n}\n\nfunction cloneTablePreferredWidth(\n width?: TablePreferredWidth\n): TablePreferredWidth | undefined {\n return width ? { ...width } : undefined;\n}\n\nfunction cloneTableWidthSource(\n source?: TableWidthSource\n): TableWidthSource | undefined {\n return source ? {\n ...source,\n preferredWidth: cloneTablePreferredWidth(source.preferredWidth),\n inheritedPreferredWidth: cloneTablePreferredWidth(source.inheritedPreferredWidth),\n } : undefined;\n}\n\nfunction cloneTableRowStyle(style?: TableRowStyle): TableRowStyle | undefined {\n return style ? {\n ...style,\n widthBefore: cloneTablePreferredWidth(style.widthBefore),\n widthAfter: cloneTablePreferredWidth(style.widthAfter),\n sourceRowGeometry: style.sourceRowGeometry ? {\n ...style.sourceRowGeometry,\n widthBefore: cloneTablePreferredWidth(style.sourceRowGeometry.widthBefore),\n widthAfter: cloneTablePreferredWidth(style.sourceRowGeometry.widthAfter),\n } : undefined,\n } : undefined;\n}\n\nfunction cloneTable(table: TableNode): TableNode {\n return {\n type: \"table\",\n blockId: table.blockId,\n sourceXml: table.sourceXml,\n sourceTextPatches: table.sourceTextPatches?.map((patch) => ({\n sourceParagraphXml: patch.sourceParagraphXml,\n paragraph: cloneParagraph(patch.paragraph),\n })),\n style: table.style\n ? {\n styleId: table.style.styleId,\n sourceStyleId: table.style.sourceStyleId,\n widthTwips: table.style.widthTwips,\n preferredWidth: cloneTablePreferredWidth(table.style.preferredWidth),\n sourceWidth: cloneTableWidthSource(table.style.sourceWidth),\n alignment: table.style.alignment,\n sourceAlignment: table.style.sourceAlignment,\n sourceInheritedAlignment: table.style.sourceInheritedAlignment,\n bidiVisual: table.style.bidiVisual,\n sourceBidiVisual: table.style.sourceBidiVisual,\n sourceInheritedBidiVisual: table.style.sourceInheritedBidiVisual,\n indentTwips: table.style.indentTwips,\n layout: table.style.layout,\n cellSpacingTwips: table.style.cellSpacingTwips,\n floating: cloneTableFloatingStyle(table.style.floating),\n cellMarginTwips: cloneTableBoxSpacing(table.style.cellMarginTwips),\n columnWidthsTwips: table.style.columnWidthsTwips\n ? [...table.style.columnWidthsTwips]\n : undefined,\n borders: cloneTableBorderSet(table.style.borders),\n }\n : undefined,\n rows: table.rows.map((row) => ({\n type: \"table-row\",\n style: cloneTableRowStyle(row.style),\n cells: row.cells.map((cell) => ({\n type: \"table-cell\",\n style: cell.style\n ? {\n ...cell.style,\n preferredWidth: cloneTablePreferredWidth(cell.style.preferredWidth),\n sourceWidth: cloneTableWidthSource(cell.style.sourceWidth),\n marginTwips: cloneTableBoxSpacing(cell.style.marginTwips),\n borders: cloneTableBorderSet(cell.style.borders),\n }\n : undefined,\n nodes: cloneTableCellContent(cell.nodes),\n })),\n })),\n };\n}\n\nfunction cloneDocNode(node: DocNode): DocNode {\n return node.type === \"paragraph\" ? cloneParagraph(node) : cloneTable(node);\n}\n\nfunction cloneNumberingDefinitions(\n numberingDefinitions?: NumberingDefinitionSet\n): NumberingDefinitionSet | undefined {\n if (!numberingDefinitions) {\n return undefined;\n }\n\n return {\n abstracts: numberingDefinitions.abstracts.map((abstractDefinition) => ({\n abstractNumId: abstractDefinition.abstractNumId,\n levels: abstractDefinition.levels.map((level) => ({\n ...level,\n runStyle: level.runStyle ? { ...level.runStyle } : undefined,\n pictureBullet: level.pictureBullet\n ? { ...level.pictureBullet }\n : undefined,\n })),\n })),\n instances: numberingDefinitions.instances.map((instanceDefinition) => ({\n numId: instanceDefinition.numId,\n abstractNumId: instanceDefinition.abstractNumId,\n levelStartOverrides: instanceDefinition.levelStartOverrides\n ? { ...instanceDefinition.levelStartOverrides }\n : undefined,\n levelOverrides: instanceDefinition.levelOverrides\n ? instanceDefinition.levelOverrides.map((level) => ({\n ...level,\n runStyle: level.runStyle ? { ...level.runStyle } : undefined,\n pictureBullet: level.pictureBullet\n ? { ...level.pictureBullet }\n : undefined,\n }))\n : undefined,\n })),\n };\n}\n\nexport function cloneDocModel(model: DocModel): DocModel {\n return {\n nodes: model.nodes.map(cloneDocNode),\n metadata: {\n sourceParts: model.metadata.sourceParts,\n warnings: [...model.metadata.warnings],\n documentPageCount: model.metadata.documentPageCount,\n documentOpenTag: model.metadata.documentOpenTag,\n documentBackgroundColor: model.metadata.documentBackgroundColor,\n sectionPropertiesXml: model.metadata.sectionPropertiesXml,\n sections: model.metadata.sections?.map((section) => ({\n startNodeIndex: section.startNodeIndex,\n sectionPropertiesXml: section.sectionPropertiesXml,\n headerSections: (section.headerSections ?? []).map((headerSection) => ({\n partName: headerSection.partName,\n referenceType: headerSection.referenceType,\n nodes: headerSection.nodes.map(cloneDocNode),\n })),\n footerSections: (section.footerSections ?? []).map((footerSection) => ({\n partName: footerSection.partName,\n referenceType: footerSection.referenceType,\n nodes: footerSection.nodes.map(cloneDocNode),\n })),\n })),\n headerSections: (model.metadata.headerSections ?? []).map((section) => ({\n partName: section.partName,\n referenceType: section.referenceType,\n nodes: section.nodes.map(cloneDocNode),\n })),\n footerSections: (model.metadata.footerSections ?? []).map((section) => ({\n partName: section.partName,\n referenceType: section.referenceType,\n nodes: section.nodes.map(cloneDocNode),\n })),\n paragraphStyles: (model.metadata.paragraphStyles ?? []).map((style) => ({\n ...style,\n runStyle: style.runStyle ? { ...style.runStyle } : undefined,\n numbering: cloneParagraphNumbering(style.numbering),\n spacing: cloneParagraphSpacing(style.spacing),\n indent: cloneParagraphIndent(style.indent),\n borders: cloneParagraphBorderSet(style.borders),\n })),\n defaultParagraphStyleId: model.metadata.defaultParagraphStyleId,\n defaultTabStopTwips: model.metadata.defaultTabStopTwips,\n documentSettingsImported: model.metadata.documentSettingsImported,\n lineSpacingCompatibilityImported: model.metadata.lineSpacingCompatibilityImported,\n numberingDefinitions: cloneNumberingDefinitions(\n model.metadata.numberingDefinitions\n ),\n compatibility: model.metadata.compatibility\n ? { ...model.metadata.compatibility }\n : undefined,\n footnotes: model.metadata.footnotes?.map((note) => ({\n ...note,\n nodes: note.nodes?.map(cloneDocNode),\n })),\n endnotes: model.metadata.endnotes?.map((note) => ({\n ...note,\n nodes: note.nodes?.map(cloneDocNode),\n })),\n comments: model.metadata.comments?.map((comment) => ({ ...comment })),\n },\n };\n}\n","import type { DocModel } from \"./types\";\n\nfunction deepFreezeValue(value: unknown): void {\n if (typeof value !== \"object\" || value === null) {\n return;\n }\n // Freezing a typed array throws; image byte payloads stay unfrozen.\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {\n return;\n }\n if (Object.isFrozen(value)) {\n return;\n }\n\n Object.freeze(value);\n if (Array.isArray(value)) {\n for (const entry of value) {\n deepFreezeValue(entry);\n }\n return;\n }\n\n for (const key of Object.keys(value)) {\n deepFreezeValue((value as Record<string, unknown>)[key]);\n }\n}\n\n/**\n * Dev-only commit guard: freezes a committed model so in-place mutation of\n * structure shared with history snapshots throws instead of corrupting them.\n * Already-frozen subtrees are skipped, so once a model is frozen, freezing a\n * structurally shared successor only pays for the changed nodes.\n */\nexport function deepFreezeDocModel(model: DocModel): DocModel {\n deepFreezeValue(model);\n return model;\n}\n","import type { OoxmlPackage } from \"@extend-ai/react-docx-ooxml-core\";\nimport {\n mapsToWasmPackage,\n wasmBuildDocModelFromBytes,\n wasmBuildDocModelFromPackage,\n wasmPackageToMaps\n} from \"@extend-ai/react-docx-wasm\";\n\nimport { normalizeDocModel } from \"./normalize\";\nimport type { DocModel } from \"./types\";\n\nexport * from \"./types\";\nexport { resolveTableGridSkipCount, tableGridColumnBound, tableRowGridSkipCount } from \"./table-grid\";\nexport {\n allocateBlockId,\n collectDuplicateDocModelBlockIds,\n ensureDocModelBlockIds\n} from \"./block-id\";\nexport { cloneDocModel, cloneParagraphMarkFormatting, cloneParagraphNode, cloneTableNode } from \"./clone\";\nexport { deepFreezeDocModel } from \"./freeze\";\nexport { normalizeDocModel } from \"./normalize\";\n\nexport async function buildDocModel(pkg: OoxmlPackage): Promise<DocModel> {\n const wasmPackage = mapsToWasmPackage({\n parts: pkg.parts,\n binaryAssets: pkg.binaryAssets,\n warnings: pkg.warnings\n });\n const model = (await wasmBuildDocModelFromPackage(wasmPackage)) as DocModel;\n return normalizeDocModel(model);\n}\n\nexport async function buildDocModelFromBytes(bytes: ArrayBuffer | Uint8Array): Promise<{\n package: OoxmlPackage;\n model: DocModel;\n timings: { parseMs: number; buildModelMs: number; totalMs: number };\n}> {\n const startedAt = performance.now();\n const result = await wasmBuildDocModelFromBytes(bytes);\n const builtAt = performance.now();\n const { parts, binaryAssets, warnings } = wasmPackageToMaps(result.package);\n const pkg = { parts, binaryAssets, ...(warnings.length > 0 ? { warnings } : {}) };\n const model = normalizeDocModel(result.model as DocModel);\n const finishedAt = performance.now();\n const buildModelMs = result.timings.buildModelMs + finishedAt - builtAt;\n return {\n package: pkg,\n model,\n timings: {\n parseMs: Math.max(0, builtAt - startedAt - result.timings.buildModelMs),\n buildModelMs,\n totalMs: finishedAt - startedAt,\n },\n };\n}\n"],"mappings":";;;;;;;;AAQA,SAAS,oBAAoB,OAAwC;AACnE,MAAI,iBAAiB,YAAY;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,WAAW,KAAK,KAAiB;AAAA,EAC1C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,OAA+C;AAC9E,MAAI,MAAM,SAAS,SAAS;AAC1B,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ;AACd,QAAM,OAAO,oBAAoB,MAAM,IAAI;AAC3C,MAAI,SAAS,MAAM,MAAM;AACvB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,EACF;AACF;AAEA,SAAS,0BAA0B,MAAkD;AACnF,MAAI,KAAK,SAAS,SAAS;AACzB,WAAO,iBAAiB,IAAI;AAAA,EAC9B;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,UAAU,KAAK,SAAS,IAAI,uBAAuB;AAAA,EACrD;AACF;AAEA,SAAS,iBAAiB,MAAwB;AAChD,MAAI,KAAK,SAAS,aAAa;AAC7B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,UAAU,KAAK,SAAS,IAAI,uBAAuB;AAAA,IACrD;AAAA,EACF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM,KAAK,KAAK,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