@docx-editor.dev/core 2.15.0 → 2.16.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 +9 -15
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +11 -9
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +12 -16
- package/dist/binding.js +1 -1
- package/dist/{chunk-Q4AB7E4O.cjs → chunk-4MIFIUEV.cjs} +1 -1
- package/dist/chunk-66DTF4TD.cjs +2 -0
- package/dist/chunk-67U2OZS7.cjs +2 -0
- package/dist/chunk-6EGMDUL7.js +21 -0
- package/dist/chunk-ABXCIZVW.js +2 -0
- package/dist/chunk-AEIAYDCG.js +1 -0
- package/dist/{chunk-YL4Q5LZP.cjs → chunk-BPSGGVP5.cjs} +1 -1
- package/dist/chunk-CMV2MTDE.js +5 -0
- package/dist/chunk-DYPT6YDY.js +1 -0
- package/dist/chunk-EWV5JMJY.cjs +21 -0
- package/dist/chunk-FAD7DH6Q.cjs +1 -0
- package/dist/chunk-GHNTGVKG.cjs +11 -0
- package/dist/chunk-GQVKCK33.js +2 -0
- package/dist/chunk-I4ENGOOZ.js +1 -0
- package/dist/chunk-IZHDCQUC.js +20 -0
- package/dist/chunk-KEXMDQ2Z.js +1 -0
- package/dist/chunk-KQEUFAAG.cjs +20 -0
- package/dist/chunk-QVJO5FUR.js +11 -0
- package/dist/chunk-SIUUTE5M.js +2 -0
- package/dist/chunk-TDHR2QLH.cjs +1 -0
- package/dist/{chunk-PXKZUTHX.cjs → chunk-WGHVIB6B.cjs} +2 -2
- package/dist/chunk-XKQTITOJ.cjs +5 -0
- package/dist/{chunk-KXPVOPR5.js → chunk-YKDRBDI2.js} +1 -1
- package/dist/chunk-YRTRPSSA.cjs +1 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -4
- package/dist/contracts/editor.d.ts +9 -7
- package/dist/contracts/interaction.d.ts +73 -10
- package/dist/contracts/modules.d.ts +8 -8
- package/dist/{custom-node-writes-C9ArIlJh.d.ts → custom-node-writes-4WOL8JB_.d.ts} +2 -2
- package/dist/{editor-sRxrFJd8.d.ts → editor-PDx0fqSo.d.ts} +26 -125
- package/dist/editor-scope-DZJT4ukT.d.ts +53 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +32 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +24 -12
- package/dist/export.js +2 -2
- package/dist/{font-resolver-BYEHQGTw.d.ts → font-resolver-CdqOugwZ.d.ts} +2 -2
- package/dist/{headless-document-view-DELC4E5v.d.ts → headless-document-view-C9ONlGtf.d.ts} +2 -2
- package/dist/{hf-references-DTrHkktY.d.ts → hf-references-BZVHctVD.d.ts} +1 -1
- package/dist/{index-C3Gvq4jN.d.ts → index-BVb4a6O3.d.ts} +74 -28
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DoGR5cf8.d.ts → layout-shaping-D_U5z-Qh.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +270 -459
- package/dist/layout.js +1 -1
- package/dist/{note-properties-DSe8igrz.d.ts → note-properties-BosjbkGC.d.ts} +1 -1
- package/dist/{omml-equation-BpRmfDAf.d.ts → omml-equation-oLlbPpVy.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +6 -6
- package/dist/output.js +1 -1
- package/dist/{protocol-DZzKxH5r.d.ts → protocol-CUsqt13U.d.ts} +28 -6
- package/dist/{review-items-DYRx187i.d.ts → review-items-kC-YI70C.d.ts} +1 -1
- package/dist/{review-reads-LbGUdNzn.d.ts → review-reads-DdvADsmp.d.ts} +8 -7
- package/dist/{revision-projection-DHRJH48u.d.ts → revision-projection-CN_DiOl_.d.ts} +1 -1
- package/dist/{semantic-cell-selection-BXVWCBYm.d.ts → semantic-cell-selection-BMrXDniV.d.ts} +4 -4
- package/dist/{semantic-interaction-DZsDmPg5.d.ts → semantic-interaction-NGeYzYCN.d.ts} +1 -1
- package/dist/{semantic-paint-f7SqN4oW.d.ts → semantic-paint-CM8F-8pH.d.ts} +2 -2
- package/dist/{semantic-records-EIdwId-a.d.ts → semantic-records-BreR44Ki.d.ts} +1231 -947
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +80 -20
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-egdarvH_.d.ts → tree-op-types-C5rZzoAz.d.ts} +131 -53
- package/dist/{tree-package-fragment-DjkH4ESI.d.ts → tree-package-fragment-DDQHk8sv.d.ts} +3 -3
- package/dist/{tree-session-contract-CGOOgPjW.d.ts → tree-session-contract-dKgbKH9A.d.ts} +18 -8
- package/dist/{tree-store-DKJB0IcA.d.ts → tree-store-DU192chS.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-24APKZAN.cjs +0 -11
- package/dist/chunk-2YH4MSHX.cjs +0 -2
- package/dist/chunk-5Y7AADI6.js +0 -1
- package/dist/chunk-AREFLNUP.js +0 -11
- package/dist/chunk-AS7YZNQE.cjs +0 -2
- package/dist/chunk-AVGCKH6A.cjs +0 -20
- package/dist/chunk-CDYVDQRI.cjs +0 -5
- package/dist/chunk-HOEWFH5U.cjs +0 -1
- package/dist/chunk-KFELX7CN.js +0 -2
- package/dist/chunk-LGFKIF4M.cjs +0 -1
- package/dist/chunk-M52QXFKI.js +0 -1
- package/dist/chunk-MNUKSXRO.js +0 -1
- package/dist/chunk-PBOIGBDO.js +0 -2
- package/dist/chunk-PMHGONET.cjs +0 -1
- package/dist/chunk-QJYH6AYD.js +0 -1
- package/dist/chunk-QRC37MWG.cjs +0 -20
- package/dist/chunk-RJSB6RJ7.js +0 -20
- package/dist/chunk-SB54HLFJ.js +0 -20
- package/dist/chunk-XCESLTJL.js +0 -2
- package/dist/chunk-Z4527AXR.js +0 -5
package/dist/editor.d.ts
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import { O as OoxmlPart, H as TreeDocColorValue, v as DrawingPositionInput } from './tree-op-types-
|
|
2
|
-
export { J as DEFAULT_IMAGE_RESOURCE_LIMITS, K as IMAGE_WRAP_TARGETS, E as ImageDecodePort, G as ImageResourceLimits, u as ImageWrapTarget, t as RenderableImageMime, y as SupportedImageMime, B as VectorImageMime, L as resolveImageResourceLimits, M as resolveSvgIntrinsicSize, N as sniffImageMime, Q as validateRasterHeader } from './tree-op-types-
|
|
1
|
+
import { O as OoxmlPart, H as TreeDocColorValue, v as DrawingPositionInput } from './tree-op-types-C5rZzoAz.js';
|
|
2
|
+
export { J as DEFAULT_IMAGE_RESOURCE_LIMITS, K as IMAGE_WRAP_TARGETS, E as ImageDecodePort, G as ImageResourceLimits, u as ImageWrapTarget, t as RenderableImageMime, y as SupportedImageMime, B as VectorImageMime, L as resolveImageResourceLimits, M as resolveSvgIntrinsicSize, N as sniffImageMime, Q as validateRasterHeader } from './tree-op-types-C5rZzoAz.js';
|
|
3
3
|
import { ColorValue } from './contracts/types.js';
|
|
4
4
|
export { ParagraphFlags, ParagraphTabStop } from './contracts/types.js';
|
|
5
|
-
export { R as ReviewModelInput } from './review-items-
|
|
5
|
+
export { R as ReviewModelInput } from './review-items-kC-YI70C.js';
|
|
6
6
|
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.js';
|
|
7
|
-
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-
|
|
8
|
-
export { a as TreeApplyResult } from './tree-session-contract-
|
|
9
|
-
import { c as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-
|
|
10
|
-
export { I as ImageContext, f as ImageCropPercent, g as ImageCropPermille, S as SelectedImageState, T as TrackedChangeFilterMode, h as TrackedChangePredicate, i as cropPercentFromCropPermille, j as cropPercentFromPermille, k as cropPercentFromSourceCrop, l as cropPermilleFromCropPercent, m as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-
|
|
11
|
-
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-
|
|
12
|
-
export { d as disposeLayoutShaping } from './layout-shaping-
|
|
13
|
-
export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, M as MAX_RESOLVER_FAMILIES, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-
|
|
14
|
-
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-
|
|
15
|
-
export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeGroup, h as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, p as DEFAULT_TABLE_CHROME_DRAFT, q as DocxEditorConfig, r as DrawingSelectionIntent, E as EMU_PER_POINT, s as EquationActivation, t as EquationChromeHandlers, u as EquationOps, F as FinalizedImageOverlayInteraction, v as FontLoadFailure, w as FontLoadFailureReason, x as FontMeasurementState, y as FontUrlSource, H as HyperlinkActivation, z as HyperlinkChromeHandlers, B as HyperlinkOps, I as IMAGE_OVERLAY_NUDGE_PT, G as IMAGE_OVERLAY_NUDGE_SHIFT_PT, J as ImageInteractionSession, K as ImageOverlayScrollPort, L as ImageResizeHandle, M as ImageResizeResult, N as LoadFontsRequest, Q as LoadFontsResult, R as OverlayFrameRect, S as PaginatedSurfaceState, U as ParagraphPropertyEdit, V as RemoteCaretLabelAnchor, W as RemoteCaretLabelHost, X as ReviewWriteIntent, Y as RunTableChromeCommandResult, Z as SectionAnchor, _ as SectionBreakInsertType, $ as SelectedDrawingOverlayTarget, a0 as SurfaceEquation, a1 as SurfaceFormatting, a2 as SurfaceHyperlink, a3 as SurfaceInsertImageInput, a4 as SurfaceNavigation, a5 as SurfaceOverlayCoordinates, a6 as SurfaceParagraphFormat, a7 as TABLE_BORDER_STYLE_OPTIONS, a8 as TABLE_BORDER_TARGET_OPTIONS, a9 as TABLE_BORDER_WIDTH_OPTIONS, aa as TABLE_CHROME_SLOT_IDS, ab as TableBorderStyleOption, ac as TableBorderTargetOption, ad as TableBorderTargetValue, ae as TableBorderWidthOption, af as TableChromeDraft, ag as TableChromePick, ah as TableChromeSlotId, ai as TableInteractionLabelKey, aj as ToolbarCommandState, ak as applyTableChromePick, al as blankDocumentBytes, am as canExecuteImageCommand, an as captureImageMutationPreconditions, ao as chromeControlCount, ap as chromeMenuSlots, aq as chromeProbeForSlot, ar as chromeSlotId, as as chromeSlotIsToggle, at as commandForSlot, au as commandForSlotValue, av as commandForTableChromeSlotValue, aw as computeImageResizeResult, ax as computeMovedImagePosition, ay as computeResizedImageExtentEmu, az as createDocxEditor, aA as createFontSource, aB as createImageOverlayScrollPort, aC as cssPixelsToLayoutPoints, aD as defaultChromeGroups, aE as defaultTableLabel, aF as emuToOverlayPoints, aG as equationAtPosition, aH as executeImageCommand, aI as finalizeImageOverlayInteraction, aJ as formattingBarChromeGroups, aK as isStaleImageInteractionCommit, aL as isTableChromeSlot, aM as layoutPointsToCssPixels, aN as loadFonts, aO as overlayFrameToSheetCssPixels, aP as overlayHostOrigin, aQ as pointsToEmu, aR as probeTableChromeCommand, aS as resizePreservesAspect, aT as runSave, aU as runTableChromeCommand, aV as runTableCommand, aW as runToolbarCommand, aX as selectedDrawingOverlayTargetOf, aY as selectedImageStateOf, aZ as surfacePaintScale, a_ as tableChromeIconPaths, a$ as tableChromeLabelKeyForTarget, b0 as tableChromeToolbarState, b1 as tableChromeVisible, b2 as tableCommandToolbarState, b3 as toolbarCommandState, b4 as toolbarCommandStates } from './index-
|
|
16
|
-
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-
|
|
17
|
-
import { S as SemanticLayout } from './semantic-records-
|
|
18
|
-
export { T as TextMeasurer } from './semantic-records-
|
|
19
|
-
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-
|
|
20
|
-
export { S as SectionProperties } from './semantic-cell-selection-
|
|
21
|
-
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-
|
|
7
|
+
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-dKgbKH9A.js';
|
|
8
|
+
export { a as TreeApplyResult } from './tree-session-contract-dKgbKH9A.js';
|
|
9
|
+
import { c as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-PDx0fqSo.js';
|
|
10
|
+
export { I as ImageContext, f as ImageCropPercent, g as ImageCropPermille, S as SelectedImageState, T as TrackedChangeFilterMode, h as TrackedChangePredicate, i as cropPercentFromCropPermille, j as cropPercentFromPermille, k as cropPercentFromSourceCrop, l as cropPermilleFromCropPercent, m as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-PDx0fqSo.js';
|
|
11
|
+
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-D_U5z-Qh.js';
|
|
12
|
+
export { d as disposeLayoutShaping } from './layout-shaping-D_U5z-Qh.js';
|
|
13
|
+
export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, M as MAX_RESOLVER_FAMILIES, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-CdqOugwZ.js';
|
|
14
|
+
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-BVb4a6O3.js';
|
|
15
|
+
export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeGroup, h as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, p as DEFAULT_TABLE_CHROME_DRAFT, q as DocxEditorConfig, r as DrawingSelectionIntent, E as EMU_PER_POINT, s as EquationActivation, t as EquationChromeHandlers, u as EquationOps, F as FinalizedImageOverlayInteraction, v as FontLoadFailure, w as FontLoadFailureReason, x as FontMeasurementState, y as FontUrlSource, H as HyperlinkActivation, z as HyperlinkChromeHandlers, B as HyperlinkOps, I as IMAGE_OVERLAY_NUDGE_PT, G as IMAGE_OVERLAY_NUDGE_SHIFT_PT, J as ImageInteractionSession, K as ImageOverlayScrollPort, L as ImageResizeHandle, M as ImageResizeResult, N as LoadFontsRequest, Q as LoadFontsResult, R as OverlayFrameRect, S as PaginatedSurfaceState, U as ParagraphPropertyEdit, V as RemoteCaretLabelAnchor, W as RemoteCaretLabelHost, X as ReviewWriteIntent, Y as RunTableChromeCommandResult, Z as SectionAnchor, _ as SectionBreakInsertType, $ as SelectedDrawingOverlayTarget, a0 as SurfaceEquation, a1 as SurfaceFormatting, a2 as SurfaceHyperlink, a3 as SurfaceInsertImageInput, a4 as SurfaceNavigation, a5 as SurfaceOverlayCoordinates, a6 as SurfaceParagraphFormat, a7 as TABLE_BORDER_STYLE_OPTIONS, a8 as TABLE_BORDER_TARGET_OPTIONS, a9 as TABLE_BORDER_WIDTH_OPTIONS, aa as TABLE_CHROME_SLOT_IDS, ab as TableBorderStyleOption, ac as TableBorderTargetOption, ad as TableBorderTargetValue, ae as TableBorderWidthOption, af as TableChromeDraft, ag as TableChromePick, ah as TableChromeSlotId, ai as TableInteractionLabelKey, aj as ToolbarCommandState, ak as applyTableChromePick, al as blankDocumentBytes, am as canExecuteImageCommand, an as captureImageMutationPreconditions, ao as chromeControlCount, ap as chromeMenuSlots, aq as chromeProbeForSlot, ar as chromeSlotId, as as chromeSlotIsToggle, at as commandForSlot, au as commandForSlotValue, av as commandForTableChromeSlotValue, aw as computeImageResizeResult, ax as computeMovedImagePosition, ay as computeResizedImageExtentEmu, az as createDocxEditor, aA as createFontSource, aB as createImageOverlayScrollPort, aC as cssPixelsToLayoutPoints, aD as defaultChromeGroups, aE as defaultTableLabel, aF as emuToOverlayPoints, aG as equationAtPosition, aH as executeImageCommand, aI as finalizeImageOverlayInteraction, aJ as formattingBarChromeGroups, aK as isStaleImageInteractionCommit, aL as isTableChromeSlot, aM as layoutPointsToCssPixels, aN as loadFonts, aO as overlayFrameToSheetCssPixels, aP as overlayHostOrigin, aQ as pointsToEmu, aR as probeTableChromeCommand, aS as resizePreservesAspect, aT as runSave, aU as runTableChromeCommand, aV as runTableCommand, aW as runToolbarCommand, aX as selectedDrawingOverlayTargetOf, aY as selectedImageStateOf, aZ as surfacePaintScale, a_ as tableChromeIconPaths, a$ as tableChromeLabelKeyForTarget, b0 as tableChromeToolbarState, b1 as tableChromeVisible, b2 as tableCommandToolbarState, b3 as toolbarCommandState, b4 as toolbarCommandStates } from './index-BVb4a6O3.js';
|
|
16
|
+
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-CUsqt13U.js';
|
|
17
|
+
import { S as SemanticLayout } from './semantic-records-BreR44Ki.js';
|
|
18
|
+
export { T as TextMeasurer } from './semantic-records-BreR44Ki.js';
|
|
19
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-NGeYzYCN.js';
|
|
20
|
+
export { S as SectionProperties } from './semantic-cell-selection-BMrXDniV.js';
|
|
21
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-CM8F-8pH.js';
|
|
22
22
|
export { CollaborationModuleContribution } from './collaboration.js';
|
|
23
|
-
import './revision-projection-
|
|
24
|
-
import './tree-package-fragment-
|
|
25
|
-
import './hf-references-
|
|
26
|
-
import './tree-store-
|
|
23
|
+
import './revision-projection-CN_DiOl_.js';
|
|
24
|
+
import './tree-package-fragment-DDQHk8sv.js';
|
|
25
|
+
import './hf-references-BZVHctVD.js';
|
|
26
|
+
import './tree-store-DU192chS.js';
|
|
27
27
|
import './collaboration/replication.js';
|
|
28
28
|
import './failure-BnGjoXf0.js';
|
|
29
|
-
import './custom-node-writes-
|
|
30
|
-
import './headless-document-view-
|
|
29
|
+
import './custom-node-writes-4WOL8JB_.js';
|
|
30
|
+
import './headless-document-view-C9ONlGtf.js';
|
|
31
31
|
import 'prosemirror-model';
|
|
32
|
+
import './editor-scope-DZJT4ukT.js';
|
|
32
33
|
import './contracts/document.js';
|
|
33
|
-
import './
|
|
34
|
-
import './
|
|
34
|
+
import './contracts/interaction.js';
|
|
35
|
+
import './note-properties-BosjbkGC.js';
|
|
36
|
+
import './omml-equation-oLlbPpVy.js';
|
|
35
37
|
|
|
36
38
|
declare function toEditorFontError(error: unknown): EditorFontError;
|
|
37
39
|
declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<LayoutShapingOptions>;
|
|
@@ -234,6 +236,10 @@ declare const BROWSER_AUTOMATION_CAPABILITIES: AutomationCapabilities;
|
|
|
234
236
|
*
|
|
235
237
|
* The editor keeps its own lifetime: `dispose()` on the returned host releases the change
|
|
236
238
|
* subscription this adapter took and leaves the editor mounted and editable.
|
|
239
|
+
*
|
|
240
|
+
* `save()` validates pending form input. Invalid values and saves during an active edit
|
|
241
|
+
* return `transaction-refused`. For autosaving from change callbacks, use the asynchronous
|
|
242
|
+
* `editor.save()`, which waits for the active edit to finish.
|
|
237
243
|
*/
|
|
238
244
|
declare function createBrowserAutomationHost(editor: DocxEditorInstance): AutomationHost;
|
|
239
245
|
|
package/dist/editor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Ha as AUTO_ZOOM_MODE,Ma as BROWSER_AUTOMATION_CAPABILITIES,ua as CHROME_GROUPS,ya as CHROME_MENUS,Ba as CHROME_UNAVAILABLE_KEY,W as DEFAULT_TABLE_CHROME_DRAFT,O as EMU_PER_POINT,Ia as FIT_WIDTH_ZOOM_MODE,M as IMAGE_OVERLAY_NUDGE_PT,N as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,k as PX_PER_CM,j as PX_PER_INCH,q as SNAP_TWIPS_CM,p as SNAP_TWIPS_INCH,aa as TABLE_BORDER_STYLE_OPTIONS,$ as TABLE_BORDER_TARGET_OPTIONS,ba as TABLE_BORDER_WIDTH_OPTIONS,X as TABLE_CHROME_SLOT_IDS,o as TWIPS_PER_CM,n as TWIPS_PER_INCH,Ga as ZOOM_MAX,Fa as ZOOM_MIN,ca as applyTableChromePick,w as applyThemeShade,v as applyThemeTint,d as blankDocumentBytes,K as canExecuteImageCommand,J as captureImageMutationPreconditions,Aa as chromeControlCount,za as chromeMenuSlots,ga as chromeProbeForSlot,va as chromeSlotId,ma as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ha as commandForSlot,ja as commandForSlotValue,ia as commandForTableChromeSlotValue,Ua as computeImageResizeResult,T as computeMovedImagePosition,S as computeResizedImageExtentEmu,Na as createBrowserAutomationHost,La as createDocxEditor,i as createFontSource,Va as createImageOverlayScrollPort,b as createLayoutShaping,G as cropPercentFromCropPermille,E as cropPercentFromPermille,B as cropPercentFromSourceCrop,F as cropPermilleFromCropPercent,D as cropPermilleFromPercent,Qa as cssPixelsToLayoutPoints,wa as defaultChromeGroups,Y as defaultTableLabel,t as dragIndent,ta as editorCommandKey,R as emuToOverlayPoints,Da as equationAtPosition,L as executeImageCommand,Wa as finalizeImageOverlayInteraction,xa as formattingBarChromeGroups,l as generateRulerTicks,r as handlePosition,U as isStaleImageInteractionCommit,Z as isTableChromeSlot,Pa as layoutPointsToCssPixels,h as loadFonts,y as lowerColorValueForBorder,z as lowerColorValueForFill,Ea as mountPaginatedSurface,Ra as overlayFrameToSheetCssPixels,Sa as overlayHostOrigin,g as partOfNodeId,Q as pointsToEmu,da as probeTableChromeCommand,Ta as resizePreservesAspect,A as resolveColorValueToCss,x as resolveThemeColorHex,Ja as resolveZoomMode,m as rulerPageBox,qa as runSave,oa as runTableChromeCommand,sa as runTableCommand,pa as runToolbarCommand,Ka as sameZoomMode,P as selectedDrawingOverlayTargetOf,I as selectedImageStateOf,s as snapTwips,C as sourceCropFromCropPercent,Ca as surfaceExtent,Oa as surfacePaintScale,fa as tableChromeIconPaths,ea as tableChromeLabelKeyForTarget,ka as tableChromeToolbarState,_ as tableChromeVisible,V as tableCommandState,ra as tableCommandToolbarState,a as toEditorFontError,la as toolbarCommandState,na as toolbarCommandStates,H as validateImageCropPercent,u as validateThemeModifier}from'./chunk-
|
|
1
|
+
export{Ha as AUTO_ZOOM_MODE,Ma as BROWSER_AUTOMATION_CAPABILITIES,ua as CHROME_GROUPS,ya as CHROME_MENUS,Ba as CHROME_UNAVAILABLE_KEY,W as DEFAULT_TABLE_CHROME_DRAFT,O as EMU_PER_POINT,Ia as FIT_WIDTH_ZOOM_MODE,M as IMAGE_OVERLAY_NUDGE_PT,N as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,k as PX_PER_CM,j as PX_PER_INCH,q as SNAP_TWIPS_CM,p as SNAP_TWIPS_INCH,aa as TABLE_BORDER_STYLE_OPTIONS,$ as TABLE_BORDER_TARGET_OPTIONS,ba as TABLE_BORDER_WIDTH_OPTIONS,X as TABLE_CHROME_SLOT_IDS,o as TWIPS_PER_CM,n as TWIPS_PER_INCH,Ga as ZOOM_MAX,Fa as ZOOM_MIN,ca as applyTableChromePick,w as applyThemeShade,v as applyThemeTint,d as blankDocumentBytes,K as canExecuteImageCommand,J as captureImageMutationPreconditions,Aa as chromeControlCount,za as chromeMenuSlots,ga as chromeProbeForSlot,va as chromeSlotId,ma as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ha as commandForSlot,ja as commandForSlotValue,ia as commandForTableChromeSlotValue,Ua as computeImageResizeResult,T as computeMovedImagePosition,S as computeResizedImageExtentEmu,Na as createBrowserAutomationHost,La as createDocxEditor,i as createFontSource,Va as createImageOverlayScrollPort,b as createLayoutShaping,G as cropPercentFromCropPermille,E as cropPercentFromPermille,B as cropPercentFromSourceCrop,F as cropPermilleFromCropPercent,D as cropPermilleFromPercent,Qa as cssPixelsToLayoutPoints,wa as defaultChromeGroups,Y as defaultTableLabel,t as dragIndent,ta as editorCommandKey,R as emuToOverlayPoints,Da as equationAtPosition,L as executeImageCommand,Wa as finalizeImageOverlayInteraction,xa as formattingBarChromeGroups,l as generateRulerTicks,r as handlePosition,U as isStaleImageInteractionCommit,Z as isTableChromeSlot,Pa as layoutPointsToCssPixels,h as loadFonts,y as lowerColorValueForBorder,z as lowerColorValueForFill,Ea as mountPaginatedSurface,Ra as overlayFrameToSheetCssPixels,Sa as overlayHostOrigin,g as partOfNodeId,Q as pointsToEmu,da as probeTableChromeCommand,Ta as resizePreservesAspect,A as resolveColorValueToCss,x as resolveThemeColorHex,Ja as resolveZoomMode,m as rulerPageBox,qa as runSave,oa as runTableChromeCommand,sa as runTableCommand,pa as runToolbarCommand,Ka as sameZoomMode,P as selectedDrawingOverlayTargetOf,I as selectedImageStateOf,s as snapTwips,C as sourceCropFromCropPercent,Ca as surfaceExtent,Oa as surfacePaintScale,fa as tableChromeIconPaths,ea as tableChromeLabelKeyForTarget,ka as tableChromeToolbarState,_ as tableChromeVisible,V as tableCommandState,ra as tableCommandToolbarState,a as toEditorFontError,la as toolbarCommandState,na as toolbarCommandStates,H as validateImageCropPercent,u as validateThemeModifier}from'./chunk-IZHDCQUC.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-SIUUTE5M.js';export{g as FONT_RESOLVER_BRAND,f as FONT_RESOLVER_MARK_KEY,b as MAX_RESOLVER_FAMILIES,c as WORD_DEFAULT_FONT,d as composeFontConfiguration,j as composeFontOrigins,h as defineFontResolver,i as isFontResolver}from'./chunk-DYPT6YDY.js';export{J as disposeLayoutShaping}from'./chunk-6EGMDUL7.js';import'./chunk-RIYSCEFQ.js';import'./chunk-KEXMDQ2Z.js';import'./chunk-CMV2MTDE.js';import'./chunk-AEIAYDCG.js';import'./chunk-VP7SDFCM.js';import'./chunk-ABXCIZVW.js';import'./chunk-I4ENGOOZ.js';import'./chunk-GQVKCK33.js';import'./chunk-6JIJOZDW.js';import'./chunk-YKDRBDI2.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,zh as DRAWING_REL_FROM_H,Ah as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,Ch as positionInputFromPropertiesCommand,Bh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,yh as validateDrawingPositionInput,yb as validateRasterHeader,Dh as validateSetImagePositionCommand}from'./chunk-QVJO5FUR.js';import'./chunk-GOEBQ26R.js';
|
package/dist/export.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkHOEWFH5U_cjs=require('./chunk-HOEWFH5U.cjs'),chunkAVGCKH6A_cjs=require('./chunk-AVGCKH6A.cjs'),chunkPMHGONET_cjs=require('./chunk-PMHGONET.cjs');require('./chunk-FGBADUSK.cjs');var chunkPXKZUTHX_cjs=require('./chunk-PXKZUTHX.cjs'),chunk2YH4MSHX_cjs=require('./chunk-2YH4MSHX.cjs'),chunk24APKZAN_cjs=require('./chunk-24APKZAN.cjs');var Qn=Object.freeze({}),Zn=Object.freeze([]);function Jn(e){let t=Object.keys(e);if(t.length===0)return Qn;let n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=o);}return Object.freeze(n)}function er(e){let t=new Map(chunk24APKZAN_cjs.md(e.part())),n=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!n.has(i)){n.add(i);for(let[s,u]of chunk24APKZAN_cjs.md(i))t.has(s)||t.set(s,u);}let r=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunk24APKZAN_cjs.Xe(r,o);if(!(!a||n.has(a))){n.add(a);for(let[i,s]of chunk24APKZAN_cjs.md(a))t.has(i)||t.set(i,s);}}return t}function tr(e,t){let n=chunkAVGCKH6A_cjs.kf(e,t);if(!n)return null;let r=e.pages[n.pageIndex];if(!r)return null;let o=chunkAVGCKH6A_cjs.bf(r),a=chunkAVGCKH6A_cjs.df(e,t.paragraphId,n.pageIndex),i=Object.freeze({x:n.x+a.x,y:n.y+a.y,height:n.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:n.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function nr(e,t){let n=[];for(let r of t.values()){let o=tr(e,r);o&&n.push(o);}return n.length===0?Zn:Object.freeze(n)}function cn(e,t){return {documentMetadata:Jn(e.documentProperties()),destinations:nr(t,er(e))}}function rr(e,t){let n=e.destinations;if(n){for(let r of n)if(r.anchor.name===t)return r}}function Me(e={}){return Object.freeze({async decode(t,n,r){let o=chunk24APKZAN_cjs.qb(t,n);if(!o)throw new Error(`Unsupported or malformed ${n} image`);if(o.pixelWidth>r.maxDimension||o.pixelHeight>r.maxDimension||o.pixelWidth>r.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var or=65536;function un(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function ar(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function ir(e,t,n){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===n:true}function sr(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let n=null;return chunkAVGCKH6A_cjs.Da(e,r=>{if(n||!ir(t,r.story,r.noteScopeId))return;let o=r.story==="header"||r.story==="footer"?a=>chunkAVGCKH6A_cjs.ya(a,r.origin,{x:e.box.x,y:e.box.y}):void 0;chunkAVGCKH6A_cjs.Ha(r.host,(a,i)=>{if(n||i.textboxDepth===0)return;let s=i.textboxPath.map(u=>u.drawingNodeId);ar(s,t.textboxPath)&&(n=un(e,i.storyOrigin));},r.origin,o);}),n}function cr(e,t){if(t.story==="textbox")return sr(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunkAVGCKH6A_cjs.cf(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunkAVGCKH6A_cjs.cf(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let r=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return r?chunkAVGCKH6A_cjs.cf(e,r.box):{x:0,y:0}}case "note-separator":{let n=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes;return n?.separator?chunkAVGCKH6A_cjs.cf(e,n.separator.box):{x:0,y:0}}default:return {x:0,y:0}}}function pn(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function fn(e,t){let n=chunkAVGCKH6A_cjs.bf(e);return Object.freeze({x:n.x+t.x,y:n.y+t.y,width:t.width,height:t.height})}function dr(e,t){let n=chunkAVGCKH6A_cjs.kf(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!n||n.pageIndex!==t.pageIndex)return;let r=e.pages[n.pageIndex];if(!r)return;let o=cr(r,t),a=Object.freeze([pn({x:n.x+o.x,y:n.y+o.y,width:0,height:n.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>fn(r,i)))})}function lr(e,t,n){let r=n.filter(i=>i.pageIndex===t.pageIndex);if(r.length===0)return mn(t)?dr(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(r.map(i=>pn(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>fn(o,i)))})}function mn(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function ln(e,t){return `${e}\0${t}`}function ur(e,t,n){let r=Math.max(e.start,t.offset),o=Math.min(e.end,n.offset);return o>r?{start:r,end:o}:null}function pr(e,t){let n=new Map,r=new Map,o=new Set,a=0;let i=(s,u)=>{if(a>=or)return false;a+=1;let m=ln(s.pageIndex,u),l=r.get(m);return l?l.push(s):r.set(m,[s]),true};for(let[s,u]of t.entries())for(let[m,l]of u.occurrences.entries()){if(mn(l)||l.source.start.paragraphId!==l.source.end.paragraphId)continue;o.add(l.pageIndex);let c=`${s}\0${m}`,d={paragraphId:l.source.start.paragraphId,offset:l.source.start.offset},f={paragraphId:l.source.end.paragraphId,offset:l.source.end.offset},y=d.offset<=f.offset?{from:d,to:f}:{from:f,to:d};i({key:c,from:y.from,to:y.to,pageIndex:l.pageIndex},y.from.paragraphId);}if(r.size===0)return n;for(let s of e.pages)o.has(s.index)&&chunkAVGCKH6A_cjs.Da(s,u=>{let m=u.story==="header"||u.story==="footer"?l=>chunkAVGCKH6A_cjs.ya(l,u.origin,{x:s.box.x,y:s.box.y}):void 0;chunkAVGCKH6A_cjs.Ha(u.host,(l,c)=>{let d=un(s,c.storyOrigin);for(let f of l.lines)for(let y of chunkAVGCKH6A_cjs.Oa(f)){let p=r.get(ln(s.index,y.paragraphId));if(p)for(let g of p){let b=ur(y,g.from,g.to);if(!b)continue;let h=chunkAVGCKH6A_cjs.Ze(f,b.start,void 0,y),E=chunkAVGCKH6A_cjs.Ze(f,b.end,void 0,y),P=n.get(g.key)??[];P.push({pageIndex:s.index,x:Math.min(h,E)+d.x,y:f.box.y+d.y,width:Math.abs(E-h),height:f.box.height}),n.set(g.key,P);}}},u.origin,m);});return n}function yn(e,t){let n=false;for(let o of t)if(o.occurrences.length!==0){n=true;break}if(!n)return t;let r=pr(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,u)=>{let m=`${a}\0${u}`,l=lr(e,s,r.get(m)??[]);return l?{...s,geometry:l}:s});return {...o,occurrences:Object.freeze(i)}})}function fr(e){let t=new Map,n=[{node:e.root,depth:0}];for(;n.length>0;){let{node:r,depth:o}=n.pop();if(!(r.kind==="textValue"||o>64)){r.kind==="paragraph"&&!t.has(r.id)&&t.set(r.id,t.size);for(let a=r.children.length-1;a>=0;a-=1)n.push({node:r.children[a],depth:o+1});}}return t}function gn(){let e=new Map,t=r=>{let o=e.get(r.root);if(o)return o;let a=fr(r);return e.set(r.root,a),a},n={retainRevisionItems:false,revisionSites:chunk24APKZAN_cjs.Kg,locations:chunk2YH4MSHX_cjs.va,commentAnchors:chunk24APKZAN_cjs.vf,deepOrder:t};return Object.freeze({collectReviewItems:r=>chunk2YH4MSHX_cjs.La(r,n),deepParagraphOrderOfPart:t})}function mr(e,t){if(t)return true;let n=e.map(r=>r.root);for(;n.length>0;){let r=n.pop();if(chunk24APKZAN_cjs.Ig(r))return true;if(r.kind!=="textValue")for(let o of r.children)n.push(o);}return false}function yr(e,t){let n=[],r=new Set([t.name]),o=a=>{!a||r.has(a.name)||(r.add(a.name),n.push(a));};for(let a of chunk24APKZAN_cjs.Ac(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunk24APKZAN_cjs.Xe(e,"footnote")),o(chunk24APKZAN_cjs.Xe(e,"endnote")),n}function gr(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunk24APKZAN_cjs.Xe(e,"footnote")?.name??null;case "endnote":return chunk24APKZAN_cjs.Xe(e,"endnote")?.name??null;case "note-separator":return chunk24APKZAN_cjs.Xe(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function hr(e,t){let n=new Map;for(let r of e){let o=t.get(r.partName),a=o?.get(r.start.paragraphId),i=o?.get(r.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),u=Math.max(a,i),m=n.get(r.partName);n.set(r.partName,{lower:Math.min(m?.lower??s,s),upper:Math.max(m?.upper??u,u)});}return n}function xr(e,t,n,r,o){let a=new Map(n.map(c=>[c.name,o(c)])),i=hr(r,a),s=new Map,u=new Map,m=(c,d,f,y,p,g,b)=>{let h=a.get(c)?.get(p),E=i.get(c);if(h===void 0||!E||h<E.lower||h>E.upper)return;let P=s.get(c)??new Map;s.set(c,P);let q=u.get(c)??new Map;u.set(c,q);let z=JSON.stringify([d.story,d.noteScopeId,d.noteAreaKind]),re=f==="textbox"?JSON.stringify([z,"textbox",y]):z,$=P.get(p)??[],G=`${p}\0${d.page.index}\0${re}`,B=q.get(G);B||(B={pageIndex:d.page.index,story:f,rootStory:d.story,textboxPath:y,noteScopeId:d.noteScopeId,noteAreaKind:d.noteAreaKind,laneKey:re,intervals:[],intervalKeys:new Set},q.set(G,B),$.push(B),P.set(p,$));let R=`${g}\0${b}`;B.intervalKeys?.has(R)||(B.intervalKeys?.add(R),B.intervals.push({start:g,end:b}));};chunkAVGCKH6A_cjs.Ea(e,c=>{let d=gr(t,c);!d||!i.has(d)||chunkAVGCKH6A_cjs.Ha(c.host,(f,y)=>{let p=y.textboxDepth>0?"textbox":c.story,g=y.textboxPath.map(h=>h.drawingNodeId),b=[];for(let h of f.lines){for(let E of h.spans)b.push(E.range);for(let E of h.drawings??[])b.push({paragraphId:E.paragraphId,start:E.start,end:E.start+1});}b.length===0&&b.push({paragraphId:f.range.paragraphId,start:f.range.start,end:f.range.end});for(let{paragraphId:h,start:E,end:P}of b)m(d,c,p,g,h,E,P);});}),chunkAVGCKH6A_cjs.Ga(e,c=>{let d=c.drawing.ownerPartName;i.has(d)&&m(d,c.root,c.story,c.textboxPath.map(f=>f.drawingNodeId),c.drawing.paragraphId,c.drawing.start,c.drawing.start+1);});for(let c of s.values())for(let d of c.values())for(let f of d){f.intervals.sort((p,g)=>p.start-g.start||p.end-g.end);let y=[];for(let p of f.intervals){let g=y.at(-1);g&&p.start<=g.end?g.end=Math.max(g.end,p.end):y.push({...p});}f.intervals.splice(0,f.intervals.length,...y),f.intervalKeys=void 0;}let l=new Map;for(let[c,d]of s){let f=a.get(c);if(!f)continue;let y=[];for(let[p,g]of d){let b=f.get(p);b!==void 0&&y.push({paragraphId:p,position:b,laneKeys:new Set(g.map(({laneKey:h})=>h))});}y.sort((p,g)=>p.position-g.position),l.set(c,y);}return {byPart:s,orderByPart:a,visibleByPart:l}}function hn(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>>1;e[o].position<t?n=o+1:r=o;}return n}function br(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let n=t.orderByPart.get(e.partName),r=t.visibleByPart.get(e.partName),o=n?.get(e.start.paragraphId),a=n?.get(e.end.paragraphId);if(!n||!r||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),u=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:c})=>c)??[]),m=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:c})=>c)??[]),l=new Set([...u].filter(c=>m.has(c)));return l.size===0?[e.start.paragraphId,e.end.paragraphId]:r.slice(hn(r,i),hn(r,s+1)).filter(c=>[...c.laneKeys].some(d=>l.has(d))).map(c=>c.paragraphId)}function Rr(e,t,n,r){return r?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,n)};return a.end>a.start?[a]:[]})}function Er(e,t){let n=Number.NEGATIVE_INFINITY;for(let r of e)for(let o of r.intervals)n=Math.max(n,o.end);return t!==n?new Set:new Set(e.filter(r=>r.intervals.some(o=>o.end===n)))}function xn(e,t,n){let r=[],o=new Set;for(let[a,i]of e.entries()){let s=n===void 0?void 0:n===null?"neutral":a<n?"replaced":"replacement";for(let u of br(i,t)){let m=t.byPart.get(i.partName)?.get(u)??[],c=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,d=u===i.start.paragraphId?i.start.offset:0,f=u===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,y=c?Er(m,d):new Set;for(let p of m){let g=Rr(p,d,f,c);c&&g.length===0&&y.has(p)&&(g=[{start:d,end:d}]);for(let b of g){let h=`${p.pageIndex}\0${p.story}\0${p.noteScopeId??""}\0${p.noteAreaKind??""}\0${p.textboxPath.join("\0")}\0${i.partName}\0${u}\0${b.start}\0${b.end}\0${s??""}`;o.has(h)||(o.add(h),r.push({pageIndex:p.pageIndex,physicalPageNumber:p.pageIndex+1,story:p.story,rootStory:p.rootStory,textboxPath:p.textboxPath,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:u,offset:b.start},end:{paragraphId:u,offset:b.end}}}));}}}}return r}function Rn(e,t){let n=2166136261,r=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);n=Math.imul(n^a,16777619)>>>0,r=Math.imul(r^a+o,2246822507)>>>0,r^=r>>>13;}return `${e}_${t.length.toString(36)}_${n.toString(36)}_${r.toString(36)}`}function bn(e,t,n=Rn){let r=new Map;for(let a of t){let i=n(e,a),s=r.get(i)??new Set;s.add(a),r.set(i,s);}let o=new Map;for(let[a,i]of r){let s=[...i].sort();for(let[u,m]of s.entries())o.set(m,s.length===1?a:`${a}_${u.toString(36)}`);}return o}function wr(e){let t=new Set,n=new Set;for(let r of e){if(r.kind==="comment"){t.add(r.id),r.parentId!==void 0&&t.add(r.parentId),r.parentRevisionId!==void 0&&n.add(r.parentRevisionId);for(let o of r.replyIds)t.add(o);}if(r.kind==="revision"){n.add(r.id),r.pairedWith!==void 0&&n.add(r.pairedWith);for(let o of r.replyIds)t.add(o);}}return {comment:bn("comment",t),revision:bn("change",n)}}function V(e,t,n){return e.get(n)??Rn(t,n)}function Fr(e,t,n){return e.kind==="revision"?{kind:"tracked-change",id:V(n.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:e.text,replacedText:e.replacedText,nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:V(n.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),occurrences:t?xn(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:V(n.comment,"comment",e.id),author:e.comment.author,initials:chunk2YH4MSHX_cjs.Ha(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunk2YH4MSHX_cjs.Ga(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:V(n.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:V(n.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),orphaned:e.orphaned,occurrences:t&&e.range?xn([e.range],t):[]}}function En(e,t){let n=t.parts.get(t.mainDocumentPart);if(!n)return [];let r=yr(t,n),o=[n,...r],a=t.parts.get(chunk2YH4MSHX_cjs.P(t,n.name));if(!mr(o,a))return [];let i=gn(),s=i.collectReviewItems({storyPart:n,furnitureParts:r,commentsPart:a,commentsExtendedPart:t.parts.get(chunk2YH4MSHX_cjs.Q(t,n.name))});if(s.length===0)return [];let u=s.flatMap(c=>chunk2YH4MSHX_cjs.Aa(c)),m=u.length>0?xr(e,t,o,u,i.deepParagraphOrderOfPart):null,l=wr(s);return s.map(c=>Fr(c,m,l)).filter(c=>c!==null)}var Sr=new Set(["part","validatedHandle"]);function wn(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function J(e,t,n,r,o){if(!(r!==void 0&&Sr.has(r))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(n.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),n.add(e);try{if(Array.isArray(e)){for(let a of e)J(a,t,n,void 0,o);Object.freeze(e);return}if(!wn(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");J(i.value,t,n,a,o);}}Object.freeze(e);}finally{n.delete(e);}}}}}function Fn(e){if(!wn(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let r of e.pages)if(!(r===null||typeof r!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(r,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),J(i,new Set,s,o),t.add(i);}let n=(r,o)=>{let a=new Set;for(let i of r){let s=new Set;s.add(e),J(i,a,s,void 0,o);}Object.freeze(r);};for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(r==="pages"&&Array.isArray(o.value)){n(o.value,t);continue}if(r==="reviewArtifacts"&&Array.isArray(o.value)){n(o.value);continue}let a=new Set;a.add(e),J(o.value,new Set,a,r);}return Object.freeze(e),e}var Or=Object.freeze([]),w=class extends Error{constructor(n,r,o){super(r,o);this.code=n;this.name="ExportResourceError";}code};function vr(e){try{return e instanceof w}catch{return false}}function Pr(e){try{return e instanceof chunkAVGCKH6A_cjs.Wd}catch{return false}}function Ir(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function Ar(e){if(vr(e))return e;let t=Pr(e),n=Ir(e),r=n?`: ${n}`:"",o=new w(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${r}`:`Export layout failed${r}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function Dr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function Sn(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var Lr=50,Ne=64;function Tr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function kr(e){let t=false;return chunkAVGCKH6A_cjs.Ga(e,({drawing:n})=>{Tr(n.resource)&&(t=true);}),t}function On(e){return !ArrayBuffer.isView(e)}function Be(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=Sn(t.displayMode??chunkAVGCKH6A_cjs.nb),r=On(e),o=On(e)?{ok:true,view:e}:chunkPXKZUTHX_cjs.I(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??r,s=Dr(t.resourceTimeoutMs),u=t.measurer??chunkAVGCKH6A_cjs.z(),m=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),l=chunkAVGCKH6A_cjs.Wc({retainAcrossPasses:i}),c=0,d=new Set,f=()=>{c+=1;for(let R of d)R();d.clear();},y=chunkAVGCKH6A_cjs.Ed({session:a,decodePort:t.imageDecodePort??Me(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:f}),p={view:a,measurer:u,paragraphCache:l,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunkAVGCKH6A_cjs.Dd(a),fieldLinks:new Map,links:chunkAVGCKH6A_cjs.be(a),drawingBundle:y,furniture:new Map},g=new AbortController,b=t.signal,h=false,E=()=>h?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),P=()=>{h=true,q();};function q(){let R=p;if(R){p=null,b?.removeEventListener("abort",P),g.abort(b?.reason),R.drawingBundle.dispose(),R.paragraphCache.clear();for(let F of R.completed.values())chunkAVGCKH6A_cjs.Sc(F.internal),chunkAVGCKH6A_cjs.he(F.internal);for(let F of R.fieldLinks.values())F.registry.clear();R.fieldLinks.clear(),R.completed.clear(),R.inFlight.clear(),R.furniture.clear(),R.sessions.clear(),f();}}b?.addEventListener("abort",P,{once:true}),b?.aborted&&P();let z=()=>{if(!p)throw E();if(g.signal.aborted)throw new w("aborted","Export resource settlement was aborted")},re=(R,F,A,x)=>c!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==A?Promise.resolve():(z(),new Promise((U,I)=>{let D=false,C,L=k=>{D||(D=true,C!==void 0&&clearTimeout(C),d.delete(T),g.signal.removeEventListener("abort",K),k?I(k):U());},T=()=>L(),K=()=>L(new w("aborted","Export resource settlement was aborted")),W=()=>{if(p?.view.packageRevision()!==F||p?.view.currentPackage()!==A){L();return}let k=x-Date.now();if(k<=0){L(new w("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(W,Math.min(Lr,k));};if(d.add(T),g.signal.addEventListener("abort",K,{once:true}),c!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==A){L();return}W();})),$=async(R,F=0,A=Date.now()+s)=>{if(z(),Date.now()>=A)throw new w("timedOut",`Export layout did not stabilize within ${s}ms`);let x=p,U=A,I=x.view.packageRevision(),D=x.view.currentPackage(),C=x.completed.get(R);if(C&&C.revision===I&&C.pkg===D)return C.published;let L=()=>{if(x.view.packageRevision()===I&&x.view.currentPackage()===D)return null;if(F>=Ne-1)throw new w("nonConvergent","Document revision did not stabilize during export layout");return $(R,F+1,U)},T=x.fieldLinks.get(R);if(!T||T.revision!==I||T.pkg!==D){let v=T?.registry??chunkAVGCKH6A_cjs.ce();v.clear(),T={revision:I,pkg:D,registry:v},x.fieldLinks.set(R,T),x.furniture.delete(R);}let K=T.registry,W=x.sessions.get(R)??chunkAVGCKH6A_cjs.Fe();x.sessions.set(R,W);let k=x.furniture.get(R);k||(k=chunkAVGCKH6A_cjs._d({view:x.view,measurer:x.measurer,producer:m,cache:x.paragraphCache,styleCascade:x.styles.styleCascade,numberingIndex:x.styles.numberingIndex,defaultTabStopPt:x.styles.defaultTabStopPt,displayMode:R,revisionAuthorFilter:void 0,inlineDrawingLayoutForPart:v=>x.drawingBundle.contextForPart(v),drawingLayoutTokenForPart:v=>x.drawingBundle.cacheTokenForPart(v),drawingTokenForParagraphForPart:(v,xe)=>x.drawingBundle.drawingTokenForParagraph(xe,v),linkProjectors:x.links,projectFieldLink:v=>K.project(v)}),x.furniture.set(R,k));for(let v=0;v<Ne;v+=1){let xe=c;x.drawingBundle.sync(x.view);let Qe=L();if(Qe)return Qe;let _=chunkHOEWFH5U_cjs.l({view:x.view,revision:x.view.packageRevision(),measurer:x.measurer,cache:x.paragraphCache,session:W,producer:m,styleCascade:x.styles.styleCascade,defaultTabStopPt:x.styles.defaultTabStopPt,numberingIndex:x.styles.numberingIndex,furniture:k,linkProjectors:x.links,projectFieldLink:O=>K.project(O),inlineDrawingLayout:x.drawingBundle.bodyContext,inlineDrawingLayoutForPart:O=>x.drawingBundle.contextForPart(O),drawingTokenForParagraph:O=>x.drawingBundle.drawingTokenForParagraph(O,x.view.part().name),drawingTokenForParagraphForPart:(O,oe)=>x.drawingBundle.drawingTokenForParagraph(oe,O),drawingLayoutEpoch:x.drawingBundle.cacheTokenForPart(x.view.part().name),drawingLayoutEpochForPart:O=>x.drawingBundle.cacheTokenForPart(O),displayMode:R,revisionAuthorFilter:void 0});if(!kr(_)){let O=L();if(O)return O;i||(chunkAVGCKH6A_cjs.Sc(_),chunkAVGCKH6A_cjs.he(_),x.paragraphCache.clear(),x.sessions.delete(R),x.furniture.delete(R));let oe=En(_,D),Wn=oe.length===0?Or:Object.freeze(yn(_,oe)),Xn=cn(x.view,_),Yn={..._,...Xn,reviewArtifacts:Wn},et=Fn(Yn);return x.completed.set(R,{revision:I,pkg:D,internal:_,published:et}),et}let Ze=xe;for(;x.drawingBundle.pendingResourceCount()>0;){await re(Ze,I,D,U),Ze=c,z();let O=L();if(O)return O}z();let Je=L();if(Je)return Je}throw new w("nonConvergent",`Image resources did not reach quiescence after ${Ne} layout passes`)},G=R=>{let F;try{F=Sn(R);}catch(I){return Promise.reject(I)}if(!p)return Promise.reject(E());let A=p,x=A.inFlight.get(F);if(x)return x;let U=$(F).catch(I=>{throw Ar(I)}).finally(()=>A.inFlight.delete(F));return A.inFlight.set(F,U),U};return {ok:true,session:{layout:()=>G(n),layoutFor:G,validatedImageBytes(R){let F=p;return !F||R.resource.kind!=="ready"?null:F.drawingBundle.mintValidatedBytes(R.resource.validatedHandle,R.resource.contentId)?.slice()??null},dispose:q}}}var Ce=chunkAVGCKH6A_cjs.b;function _e(e){return typeof e.admittedFontFace=="function"}var Mr=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function ye(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function je(e){let t=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:ye(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:t?Object.freeze({requested:ye(t.requested),resolved:ye(t.resolved),...t.lineMetrics?{lineMetrics:Object.freeze({...t.lineMetrics})}:{}}):null})}function Nr(e){return Object.freeze({...je(e),bytes:chunkAVGCKH6A_cjs.h(e)})}function Br(e,t){if(!e)return null;try{let n=e(t);return !n||n instanceof chunkAVGCKH6A_cjs.d?null:Nr(n)}catch{return null}}function vn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return Br(e.resolve(),t)}}function Cr(e){return Object.freeze(e.slice(0,Ce).map(t=>Object.freeze({request:ye(t.request),partName:t.partName,reason:t.reason})))}function ze(e,t,n,r,o=[]){let a=new Map;for(let s of [...e,t]){let u=s.toLowerCase();a.has(u)||a.set(u,s);}let i=[...a.values()].map(s=>{let u=[];for(let m of Mr){let l=r?.({family:s,...m});!l||l instanceof chunkAVGCKH6A_cjs.d||u.push(Object.freeze({...m,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:s,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:t,families:Object.freeze(i),originFailures:Object.freeze([...n]),droppedEmbeddedFonts:Cr(o)})}function Ue(e,t){if(t.onFontResolution){try{let n=t.onFontResolution(e);Promise.resolve(n).catch(r=>{console.warn("[fonts] font-resolution diagnostics callback failed",r);});}catch(n){console.warn("[fonts] font-resolution diagnostics callback failed",n);}return}for(let n of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",n);for(let n of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",n);}function Ve(e,t){if(t.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(r=>r.coverage==="complete"))return;let n=e.families.filter(r=>r.coverage!=="complete").map(r=>r.family).join(", ");throw new w("layoutFailed",`Strict font policy refused export${n?`; incomplete families: ${n}`:"; a font origin failed"}`)}function ge(){return new Map}function He(e,t,n,r){if(n.trim().length===0)return null;let o={family:n,weight:r.bold?700:400,style:r.italic?"italic":"normal"},a=chunkAVGCKH6A_cjs.g(o),i=t.get(a);if(!i){try{i=e.fonts.resolve(o);}catch{return null}t.set(a,i);}return i instanceof chunkAVGCKH6A_cjs.d?null:i}function Pn(e,t,n){let r=n.fontFamily??e.defaultFont.family;return He(e,t,r,n)}function qe(e){return typeof e.shapeLaidOutText=="function"}function $e(e){let t=ge(),n=new WeakMap;return r=>{let o=chunkAVGCKH6A_cjs.Y(r.style,r.fontSlot),a=chunkAVGCKH6A_cjs.S(r.text,o);if(a.length===0)return null;let i=o.fontFamily??e.defaultFont.family,s=He(e,t,i,o);if(!s)return null;try{if(o.smallCaps&&!chunkAVGCKH6A_cjs.Ue(e.shaper,e.environment,s,o,n))return null;let u=chunkAVGCKH6A_cjs.Te(e.shaper,e.environment,s,o,a);return Object.freeze({run:u,font:je(s),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function In(e){return t=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(t)??null}}var ee=new Map,he=new WeakMap,Ge=0,te,Ke=32,An=chunkAVGCKH6A_cjs.c;function Dn(){if(te)return te;let e=(async()=>(await chunkAVGCKH6A_cjs.s(),chunkAVGCKH6A_cjs.x(chunkAVGCKH6A_cjs.A)))();return te=e,e.catch(()=>{te===e&&(te=void 0);}),e}function Ln(e){let t=ge();return chunkAVGCKH6A_cjs.We(e,{resolveFont(n){return Pn(e,t,n)},fallback:chunkAVGCKH6A_cjs.z()})}async function Tn(e,t){if(!chunkAVGCKH6A_cjs.C(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let n=await Dn(),r=await chunkAVGCKH6A_cjs.J(e,n,chunkAVGCKH6A_cjs.A,t);return Object.freeze({createMeasurer:()=>Ln(r),resolveFont:o=>r.fonts.resolve(o),shapeLaidOutText:$e(r),producer:["node-export-session",e.fingerprint,r.operation.shapingHash,`producer:${r.operation.producerVersion}`,`fallback:${chunkAVGCKH6A_cjs.y}`].join("|"),extensionFingerprint:e.fingerprint})}function _r(e,t){if(!chunkAVGCKH6A_cjs.C(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n=he.get(e);if(n)return n;let r=chunkAVGCKH6A_cjs.E(e),o=ee.get(r);if(!o){if(ee.size>=Ke)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Ke} process-wide configurations`));o=(async()=>{let u=chunkAVGCKH6A_cjs.D(e).sources.reduce((l,c)=>l+(c.availability==="forbidden"?0:c.bytes.byteLength),0);if(Ge+u>An)throw new RangeError(`Shared exporter shaping font bytes are limited to ${An} process-wide`);Ge+=u;let m;try{let l=await Dn();m=await chunkAVGCKH6A_cjs.J(e,l,chunkAVGCKH6A_cjs.A,t);}catch(l){throw Ge-=u,l}return Object.freeze({createMeasurer:()=>Ln(m),shapeLaidOutText:$e(m),shapingHash:m.operation.shapingHash,producerVersion:m.operation.producerVersion})})(),ee.set(r,o),o.catch(()=>{ee.get(r)===o&&ee.delete(r);});}let a=e.fingerprint,i=o.then(s=>Object.freeze({createMeasurer:s.createMeasurer,shapeLaidOutText:s.shapeLaidOutText,producer:["node-export",a,s.shapingHash,`producer:${s.producerVersion}`,`fallback:${chunkAVGCKH6A_cjs.y}`].join("|"),extensionFingerprint:a}));return he.set(e,i),i.catch(()=>{he.get(e)===i&&he.delete(e);}),i}var jr="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function zr(e){let t=e.currentPackage(),n=(t.relationships.get(t.mainDocumentPart)??[]).find(o=>o.type===jr),r;if(n){let o=chunk24APKZAN_cjs.E(n);o.mode==="Internal"&&o.target.ok&&(r=t.parts.get(o.target.partName));}return r??=t.parts.get("/word/fontTable.xml"),chunk24APKZAN_cjs.Dc(t,r)}function kn(e,t){let n=zr(e);if(n.length!==0)return chunkHOEWFH5U_cjs.h(r=>{let o=new Set((r.resolvedFaces??[]).map(i=>chunkAVGCKH6A_cjs.g(i))),a=chunkHOEWFH5U_cjs.o(n,{maxFontBytes:chunkAVGCKH6A_cjs.a,aggregateBudget:Ur(r),shadowedRequests:o});if(t)for(let i of a.dropped){if(t.dropped.length>=Ce)break;t.dropped.push(i);}return {sources:a.sources}})}function Ur(e){let t=e.committedSourceBytes;return t===void 0||!Number.isSafeInteger(t)||t<=0?chunkAVGCKH6A_cjs.c:Math.max(0,chunkAVGCKH6A_cjs.c-t)}function Vr(e){return _e(e)&&qe(e)}var N=0,Nn=Symbol("font-resolution-timeout");function Hr(e){let t=0,n=false;return e?.(N),{reserve:o=>{if(n)throw new Error("Document font-byte lease is already released");if(N+o>chunkAVGCKH6A_cjs.c)throw new w("layoutFailed",`Active document export font bytes are limited to ${chunkAVGCKH6A_cjs.c}; requested ${o} bytes with ${N} bytes already active`);N+=o,t+=o,e?.(N);let a=false;return ()=>{a||n||(a=true,N-=o,t-=o,e?.(N));}},release:()=>{n||(n=true,N-=t,t=0,e?.(N));}}}function ne(e,t){return e.attributes.find(n=>n.localName===t)?.value}async function qr(e,t){if(t.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=chunkPXKZUTHX_cjs.I(e);if(!n.ok)return n;let{fonts:r,fontResolutionTimeoutMs:o,fontPolicy:a,onFontResolution:i,...s}=t,u=Array.isArray(r)?r:[r],m,l;try{l=await $r(n.view,u,{signal:t.signal,timeoutMs:o??t.resourceTimeoutMs,fontPolicy:a,onFontResolution:h=>(m=h,i?.(h))});}catch(h){if(h instanceof w&&h.code==="aborted")return {ok:false,reason:"aborted"};throw h}if(!m)throw l?.dispose(),new w("layoutFailed","Document font resolution completed without publishing its evidence");let c;try{c=Be(n.view,{...s,reuseAcrossRevisions:!1,...l?{measurer:l.createMeasurer(),producer:t.producer??l.producer}:t.producer?{producer:t.producer}:{}});}catch(h){throw l?.dispose(),h}if(!c.ok)return l?.dispose(),c;let d=c.session,f=l,y="active",p=()=>y==="aborted"?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),g=h=>{if(y==="active"){y=h,t.signal?.removeEventListener("abort",b);try{d.dispose();}finally{f?.dispose(),f=void 0;}}},b=()=>g("aborted");return t.signal?.addEventListener("abort",b,{once:true}),t.signal?.aborted&&b(),{ok:true,session:Object.freeze({fontResolution:m,layout:()=>y==="active"?d.layout():Promise.reject(p()),layoutFor:h=>y==="active"?d.layoutFor(h):Promise.reject(p()),validatedImageBytes:h=>y==="active"?d.validatedImageBytes(h):null,admittedFontFace:vn({status:()=>y,unavailable:p,resolve:()=>f?.resolveFont}),shapeLaidOutText:In({status:()=>y,unavailable:p,shaping:()=>f}),dispose:()=>g("disposed")})}}async function $r(e,t,n={}){let r=Gr(n.timeoutMs),o=new AbortController,a=()=>o.abort(n.signal?.reason);n.signal?.addEventListener("abort",a,{once:true}),n.signal?.aborted&&a();let i=setTimeout(()=>o.abort(Nn),r);try{We(o.signal);let s=(async()=>{let u=Hr(n.onActiveFontBytesChange),m=!1;try{let l=Wr(e).slice(0,chunkHOEWFH5U_cjs.b),c=[],d={dropped:[]},f=kn(e,d),y=f?[...t,f]:t,p=await chunkHOEWFH5U_cjs.k(y,{families:l,defaultFamily:chunkHOEWFH5U_cjs.c.family,signal:o.signal},{onOriginFailure:E=>c.push(E),reserveOwnedBytes:u.reserve});We(o.signal);let g=chunkHOEWFH5U_cjs.d(p??{});if(g.sources.length===0){let E=ze(l,g.defaultFont.family,c,void 0,d.dropped);Ue(E,n),Ve(E,n);return}let b=await Tn(chunkAVGCKH6A_cjs.G(g));We(o.signal);let h=ze(l,g.defaultFont.family,c,b.resolveFont,d.dropped);return Ue(h,n),Ve(h,n),m=!0,Object.freeze({...b,dispose:u.release})}finally{m||u.release();}})();return await Promise.race([s,Kr(o.signal)])}finally{clearTimeout(i),n.signal?.removeEventListener("abort",a);}}function Gr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Kr(e){return new Promise((t,n)=>{let r=()=>{n(Bn(e));};e.aborted?r():e.addEventListener("abort",r,{once:true});})}function Bn(e){let t=e.reason===Nn;return new w(t?"timedOut":"aborted",t?"Font resolution timed out":"Font resolution was aborted",t?void 0:{cause:e.reason})}function We(e){if(e.aborted)throw Bn(e)}function Wr(e){let t=[e.part().root],n=[],r=[],o=new Set([e.part().name]),a=(l,c)=>{!c||o.has(c.name)||(o.add(c.name),l.push(c.root));};for(let l of e.headerFooterPartsBySection()){for(let c of l.headers.values())a(n,c);for(let c of l.footers.values())a(n,c);}for(let l of ["footnote","endnote"])r.push(...Xr(e,l));let i=e.documentThemeFonts(),s={major:i.major,minor:i.minor,majorEastAsia:i.majorEastAsia??null,minorEastAsia:i.minorEastAsia??null},u=new Map,m=(l,c)=>{let d=chunkPMHGONET_cjs.c(l,e.stylesRoot(),s,Qr(l,c)),f=no(l,e.numberingRoot(),e.stylesRoot(),s);for(let y of [...d.direct,...eo(l),...f,...d.inherited]){let p=y.toLowerCase();u.has(p)||u.set(p,y);}};return m(t,"body"),m(n,"furniture"),m(r,"note"),[...u.values()]}function Xr(e,t){let n=chunk24APKZAN_cjs.Xe(e.currentPackage(),t);if(!n)return [];let r=new Set(chunk24APKZAN_cjs.Ye(e.part()).filter(a=>a.noteKind===t).map(a=>a.noteId)),o=[];for(let a of n.root.children){if(a.kind==="textValue")continue;let i=chunk24APKZAN_cjs.de(a),s=chunk24APKZAN_cjs.ce(a);(i==="separator"||i==="continuationSeparator"||s!==null&&r.has(s))&&o.push(a);}return o}var Yr="http://schemas.openxmlformats.org/officeDocument/2006/math";function Qr(e,t){let n=new Set;for(let r of e){let o=[],a=[{node:r,context:t}];for(;a.length>0;){let{node:i,context:s}=a.pop();i.namespaceUri===chunk24APKZAN_cjs.ca&&i.localName==="p"&&o.push({paragraph:i,context:s});let u=i.namespaceUri===chunk24APKZAN_cjs.ca&&i.localName==="txbxContent"&&(s==="body"||s==="note")?"detached":s;for(let m=i.children.length-1;m>=0;m-=1){let l=i.children[m];l.kind!=="textValue"&&a.push({node:l,context:u});}}for(let i of o)Zr(i.paragraph,n,i.context);}return n}function Zr(e,t,n){let r=chunkAVGCKH6A_cjs.Wa(),o=null,a=null,i="",s=false,u=false,m=false,l=0,c=[];for(let d=e.children.length-1;d>=0;d-=1){let f=e.children[d];f.kind!=="textValue"&&c.push({node:f,runId:null,visibility:H});}for(;c.length>0;){let{node:d,runId:f,visibility:y}=c.pop();if(d.namespaceUri===chunk24APKZAN_cjs.ca&&d.localName==="p")continue;let p=d.namespaceUri===chunk24APKZAN_cjs.ca&&d.localName==="r"?d.id:f;if(d.namespaceUri===chunk24APKZAN_cjs.ca&&d.localName==="fldSimple"){let g=ne(d,"instr")??"";chunkAVGCKH6A_cjs.vd(g,{allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&Jr(d)!==H&&t.add(d.id);}if(d.namespaceUri===chunk24APKZAN_cjs.ca&&d.localName==="fldChar"){let g=ne(d,"fldCharType");if(g==="begin")chunkAVGCKH6A_cjs.Za(r),r.nesting===1&&(o=p,a=null,i="",s=false,u=false,m=chunk24APKZAN_cjs.Xc(d),l=0);else if(g==="separate"){let b=r.nesting===1;if(chunkAVGCKH6A_cjs.$a(r),b){let h=chunkAVGCKH6A_cjs.Ya(r);i=h.instruction,s=h.overflow||r.nestingOverflow,a=p,u=true;}}else if(g==="end"){if(r.nesting===1){if(r.phase==="instruction"){let h=chunkAVGCKH6A_cjs.Ya(r);i=h.instruction,s=h.overflow||r.nestingOverflow;}if(!s&&chunkAVGCKH6A_cjs.ud(i,{hasSeparate:u,hasLegacyFormData:m,allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&l!==H){let h=a??o;h&&t.add(h);}}chunkAVGCKH6A_cjs.ab(r);}continue}if(d.namespaceUri===chunk24APKZAN_cjs.ca&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkAVGCKH6A_cjs._a(r,Ye(d),d.localName==="delInstrText");continue}r.nesting>0&&chunkAVGCKH6A_cjs.bb(r)&&d.namespaceUri===chunk24APKZAN_cjs.ca&&Cn(d)&&(l|=y);for(let g=d.children.length-1;g>=0;g-=1){let b=d.children[g];b.kind!=="textValue"&&c.push({node:b,runId:p,visibility:y&zn(d)});}}chunkAVGCKH6A_cjs.Xa(r);}function Cn(e){return e.localName==="t"||e.localName==="delText"?Ye(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Xe=1,_n=2,jn=4,H=Xe|_n|jn;function Jr(e){let t=[];for(let r of e.children)r.kind!=="textValue"&&t.push({node:r,visibility:H});let n=0;for(;t.length>0;){let{node:r,visibility:o}=t.pop();if(!(r.namespaceUri===chunk24APKZAN_cjs.ca&&r.localName==="p")){if(r.namespaceUri===chunk24APKZAN_cjs.ca&&Cn(r)&&(n|=o,n===H))return n;for(let a of r.children)a.kind!=="textValue"&&t.push({node:a,visibility:o&zn(r)});}}return n}function zn(e){return e.namespaceUri!==chunk24APKZAN_cjs.ca?H:e.localName==="ins"||e.localName==="moveTo"?Xe|_n:e.localName==="del"||e.localName==="moveFrom"?Xe|jn:H}function eo(e){let t=new Map,n=r=>{let o=chunkPMHGONET_cjs.a(r??void 0);if(o===null)return;let a=o.toLowerCase();t.has(a)||t.set(a,o);};for(let r of e){let o=[r];for(;o.length>0;){let a=o.pop();if(a.namespaceUri===Yr&&n(chunkAVGCKH6A_cjs.oc),a.namespaceUri===chunk24APKZAN_cjs.ca&&a.localName==="fldSimple"){let i=ne(a,"instr");n(chunkAVGCKH6A_cjs.td(i??"")?.font??null);}if(a.namespaceUri===chunk24APKZAN_cjs.ca&&a.localName==="p")for(let i of to(a))n(i);for(let i=a.children.length-1;i>=0;i-=1){let s=a.children[i];s.kind!=="textValue"&&o.push(s);}}}return [...t.values()]}function to(e){let t=[],n=chunkAVGCKH6A_cjs.Wa(),r=[];for(let o=e.children.length-1;o>=0;o-=1){let a=e.children[o];a.kind!=="textValue"&&r.push(a);}for(;r.length>0;){let o=r.pop();if(!(o.namespaceUri===chunk24APKZAN_cjs.ca&&o.localName==="p")){if(o.namespaceUri===chunk24APKZAN_cjs.ca&&o.localName==="fldChar"){let a=ne(o,"fldCharType");a==="begin"?chunkAVGCKH6A_cjs.Za(n):a==="separate"?(n.nesting===1&&Mn(n,t),chunkAVGCKH6A_cjs.$a(n)):a==="end"&&(n.nesting===1&&Mn(n,t),chunkAVGCKH6A_cjs.ab(n));continue}if(o.namespaceUri===chunk24APKZAN_cjs.ca&&(o.localName==="instrText"||o.localName==="delInstrText")){chunkAVGCKH6A_cjs._a(n,Ye(o),o.localName==="delInstrText");continue}if(o.namespaceUri===chunk24APKZAN_cjs.ca&&o.localName==="fldSimple"){let a=chunkAVGCKH6A_cjs.td(ne(o,"instr")??"");a?.font&&t.push(a.font);}for(let a=o.children.length-1;a>=0;a-=1){let i=o.children[a];i.kind!=="textValue"&&r.push(i);}}}return chunkAVGCKH6A_cjs.Xa(n),t}function Mn(e,t){let n=chunkAVGCKH6A_cjs.Ya(e);if(n.overflow)return;let r=chunkAVGCKH6A_cjs.td(n.instruction);r?.font&&t.push(r.font);}function Ye(e){let t="",n=[...e.children].reverse();for(;n.length>0&&t.length<=256;){let r=n.pop();if(r.kind==="textValue")t+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}return t}function no(e,t,n,r){if(!t)return [];let o=chunkAVGCKH6A_cjs.Ad(t),a=chunkAVGCKH6A_cjs.vc(n,r),i=new Map;for(let s of e)for(let u of ro(s)){let m=chunk24APKZAN_cjs.sc(u.children),l=c=>{if(c)for(let d of c.values())for(let f of [d.markerStyle.fontFamily,d.markerStyle.fontFamilyEastAsia]){let y=chunkPMHGONET_cjs.a(f??void 0);if(y===null)continue;let p=y.toLowerCase();i.has(p)||i.set(p,y);}};l(chunkAVGCKH6A_cjs.bd(m,o,a));for(let c of m){let d=chunkAVGCKH6A_cjs.Yd(c);for(let f of d.contents)l(chunkAVGCKH6A_cjs.Xd(f,o,a));}}return [...i.values()].sort((s,u)=>s.localeCompare(u))}function ro(e){if(e.localName==="document"){for(let t of e.children)if(t.kind!=="textValue"&&t.localName==="body")return [t];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let t=[];for(let n of e.children)n.kind!=="textValue"&&(n.localName==="footnote"||n.localName==="endnote")&&t.push(n);return t}return [e]}var Hn="FILE_TOO_LARGE",Un=8;function oo(e){return typeof e=="object"&&e!==null}function qn(e){if(!(!oo(e)||typeof e.code!="string"))return e.code}function $n(e){return e===""||e.toLowerCase()==="localhost"}function ao(e){try{let t=decodeURIComponent(e);return t.includes("\0")?null:t}catch{return null}}function Gn(e){let t=ao(e);if(t===null)return null;let n=[];for(let r of t.split(/[/\\]/))if(!(r===""||r===".")){if(r===".."){if(n.length===0)return null;n.pop();continue}n.push(r);}return `/${n.join("/")}`}function Kn(e){let t=Gn(e);return t===null?null:t.endsWith("/")?t:`${t}/`}function io(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function so(e){let t;try{t=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(t.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(t.username!==""||t.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!$n(t.host))throw new TypeError("trustedRoot must be a local file: URL");let n=Kn(t.pathname);if(n===null||io(n))throw new TypeError("trustedRoot must be a directory inside the filesystem");let r=new URL("file:///");return r.pathname=n,r}function co(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function lo(e){let t=co(e);if(t.length===0)throw new TypeError("trustedRoot must name at least one directory");if(t.length>Un)throw new TypeError(`trustedRoot must not exceed ${Un} directories`);return t.map(so)}function uo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkAVGCKH6A_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkAVGCKH6A_cjs.a}`);return e}function po(e,t){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!$n(e.host))return null;let n=Gn(e.pathname);if(n===null)return null;for(let r of t){let o=Kn(r.pathname);if(o===null||!n.startsWith(o)||n.length<=o.length)continue;let a=new URL("file:///");return a.pathname=n,a}return null}function fo(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function mo(e,t,n){let r=n.relative(n.resolve(e),n.resolve(t));return r!==""&&!r.startsWith("..")&&!n.isAbsolute(r)}function Vn(e,t,n){return e.some(r=>mo(r,t,n))}async function yo(e,t){let n=[];for(let r of e)try{n.push(await t(r));}catch(o){if(qn(o)==="ENOENT")continue;throw o}return n}function go(e){return async(t,{signal:n,maxBytes:r})=>{if(n?.aborted)throw n.reason;let[{open:o,realpath:a},{constants:i},{fileURLToPath:s},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),m=e.map(y=>u.resolve(s(y.href))),l=u.resolve(s(typeof t=="string"?t:t.href));if(!Vn(m,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let c=typeof i.O_NOFOLLOW=="number"?i.O_RDONLY|i.O_NOFOLLOW:"r",d=await o(l,c),f=()=>{d.close();};n?.addEventListener("abort",f,{once:true});try{if(n?.aborted)throw n.reason;let y=await a(l);if(!Vn(await yo(m,a),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=(await d.stat()).size;if(!Number.isSafeInteger(p)||p<0||p>r)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Hn});let g=new Uint8Array(p),b=0;for(;b<g.byteLength;){if(n?.aborted)throw n.reason;let{bytesRead:h}=await d.read(g,b,g.byteLength-b,b);if(h===0)break;b+=h;}if(n?.aborted)throw n.reason;return b===g.byteLength?g:g.slice(0,b)}catch(y){throw n?.aborted?n.reason:y}finally{n?.removeEventListener("abort",f),await d.close().catch(()=>{});}}}function ho(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let t=lo(e.trustedRoot),n=uo(e.maxBytes),r=e.read??go(t),o=e.networkFetch??fetch;return(async(a,i)=>{let s=i?.signal;if(s?.aborted)throw s.reason;let u=fo(a);if(u.protocol!=="file:")return o(u,i);let m=po(u,t);if(!m)return new Response(null,{status:404});let l=s?new AbortController:void 0,c=()=>l?.abort(s?.reason);s?.addEventListener("abort",c,{once:true});let d;try{if(d=await r(m,{maxBytes:n,...l?{signal:l.signal}:{}}),s?.aborted)throw s.reason;if(d.byteLength>n)return new Response(null,{status:413})}catch(f){if(s?.aborted)throw s.reason;if(l?.signal.aborted)throw l.signal.reason??f;if(f instanceof DOMException&&f.name==="AbortError"||f instanceof Error&&f.name==="AbortError")throw f;let y=qn(f);if(y===Hn)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw f}finally{s?.removeEventListener("abort",c);}return new Response(d,{status:200})})}
|
|
2
|
-
exports.ExportResourceError=w;exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=
|
|
1
|
+
'use strict';var chunkFAD7DH6Q_cjs=require('./chunk-FAD7DH6Q.cjs'),chunkEWV5JMJY_cjs=require('./chunk-EWV5JMJY.cjs'),chunkYRTRPSSA_cjs=require('./chunk-YRTRPSSA.cjs');require('./chunk-FGBADUSK.cjs');var chunkWGHVIB6B_cjs=require('./chunk-WGHVIB6B.cjs'),chunk67U2OZS7_cjs=require('./chunk-67U2OZS7.cjs'),chunkGHNTGVKG_cjs=require('./chunk-GHNTGVKG.cjs');var mn=new WeakMap,ar=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function ir(e){let t=mn.get(e.root);if(t)return t;let n=new Set,r=[{node:e.root,scope:chunkGHNTGVKG_cjs.Va(),depth:0,mcSelected:false}],o=0;for(;r.length;){let{node:i,scope:s,depth:u,mcSelected:f}=r.pop();if(++o>chunkGHNTGVKG_cjs.fb||u>chunkGHNTGVKG_cjs.W){n.add("scan-limit");break}if(i.kind==="textValue")continue;if(o+r.length+i.children.length>chunkGHNTGVKG_cjs.fb){n.add("scan-limit");break}let l=chunkGHNTGVKG_cjs.Ua(s,i),d=chunkGHNTGVKG_cjs.Ta(i)?i:void 0;if(d){if(chunkGHNTGVKG_cjs.jb(d,l).drawing)continue;let c=chunkGHNTGVKG_cjs.ib(d,l);c.refused&&n.add("scan-limit"),c.branch&&r.push({node:c.branch,scope:l,depth:u+1,mcSelected:true});continue}if(!(!f&&chunkGHNTGVKG_cjs.Sa(i))){if(i.namespaceUri==="urn:schemas-microsoft-com:vml"&&i.localName==="textbox"){n.add("legacy-textbox");continue}i.namespaceUri==="urn:schemas-microsoft-com:vml"&&ar.has(i.localName)&&!i.children.some(c=>c.kind!=="textValue"&&c.namespaceUri==="urn:schemas-microsoft-com:vml"&&c.localName==="textbox")&&n.add("legacy-drawing");for(let c of i.children)r.push({node:c,scope:l,depth:u+1,mcSelected:f});}}let a=Object.freeze([...n]);return mn.set(e.root,a),a}function yn(e){let t=new Set([e.part()]);for(let n of e.headerFooterPartsBySection())for(let r of [n.headers,n.footers])for(let o of r.values())t.add(o);for(let n of ["footnote","endnote"]){let r=chunkGHNTGVKG_cjs.If(e.currentPackage(),n);r&&t.add(r);}return Object.freeze([...t].flatMap(n=>ir(n).map(r=>Object.freeze({code:r,partName:n.name}))))}var sr=Object.freeze({}),cr=Object.freeze([]);function dr(e){let t=Object.keys(e);if(t.length===0)return sr;let n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=o);}return Object.freeze(n)}function lr(e){let t=new Map(chunkGHNTGVKG_cjs.Se(e.part())),n=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!n.has(i)){n.add(i);for(let[s,u]of chunkGHNTGVKG_cjs.Se(i))t.has(s)||t.set(s,u);}let r=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunkGHNTGVKG_cjs.If(r,o);if(!(!a||n.has(a))){n.add(a);for(let[i,s]of chunkGHNTGVKG_cjs.Se(a))t.has(i)||t.set(i,s);}}return t}function ur(e,t){let n=chunkEWV5JMJY_cjs.kf(e,t);if(!n)return null;let r=e.pages[n.pageIndex];if(!r)return null;let o=chunkEWV5JMJY_cjs.bf(r),a=chunkEWV5JMJY_cjs.df(e,t.paragraphId,n.pageIndex),i=Object.freeze({x:n.x+a.x,y:n.y+a.y,height:n.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:n.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function pr(e,t){let n=[];for(let r of t.values()){let o=ur(e,r);o&&n.push(o);}return n.length===0?cr:Object.freeze(n)}function gn(e,t){return {documentMetadata:dr(e.documentProperties()),destinations:pr(t,lr(e))}}function fr(e,t){let n=e.destinations;if(n){for(let r of n)if(r.anchor.name===t)return r}}function Oe(e={}){return Object.freeze({async decode(t,n,r){let o=chunkGHNTGVKG_cjs.yb(t,n);if(!o)throw new Error(`Unsupported or malformed ${n} image`);if(o.pixelWidth>r.maxDimension||o.pixelHeight>r.maxDimension||o.pixelWidth>r.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var mr=65536;function bn(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function yr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function gr(e,t,n){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===n:true}function hr(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let n=null;return chunkEWV5JMJY_cjs.Da(e,r=>{if(n||!gr(t,r.story,r.noteScopeId))return;let o=r.story==="header"||r.story==="footer"?a=>chunkEWV5JMJY_cjs.ya(a,r.origin,{x:e.box.x,y:e.box.y}):void 0;chunkEWV5JMJY_cjs.Ha(r.host,(a,i)=>{if(n||i.textboxDepth===0)return;let s=i.textboxPath.map(u=>u.drawingNodeId);yr(s,t.textboxPath)&&(n=bn(e,i.storyOrigin));},r.origin,o);}),n}function xr(e,t){if(t.story==="textbox")return hr(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunkEWV5JMJY_cjs.cf(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunkEWV5JMJY_cjs.cf(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let r=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return r?chunkEWV5JMJY_cjs.cf(e,r.box):{x:0,y:0}}case "note-separator":{let n=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes;return n?.separator?chunkEWV5JMJY_cjs.cf(e,n.separator.box):{x:0,y:0}}default:return {x:0,y:0}}}function Rn(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function En(e,t){let n=chunkEWV5JMJY_cjs.bf(e);return Object.freeze({x:n.x+t.x,y:n.y+t.y,width:t.width,height:t.height})}function br(e,t){let n=chunkEWV5JMJY_cjs.kf(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!n||n.pageIndex!==t.pageIndex)return;let r=e.pages[n.pageIndex];if(!r)return;let o=xr(r,t),a=Object.freeze([Rn({x:n.x+o.x,y:n.y+o.y,width:0,height:n.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>En(r,i)))})}function Rr(e,t,n){let r=n.filter(i=>i.pageIndex===t.pageIndex);if(r.length===0)return wn(t)?br(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(r.map(i=>Rn(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>En(o,i)))})}function wn(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function xn(e,t){return `${e}\0${t}`}function Er(e,t,n){let r=Math.max(e.start,t.offset),o=Math.min(e.end,n.offset);return o>r?{start:r,end:o}:null}function wr(e,t){let n=new Map,r=new Map,o=new Set,a=0;let i=(s,u)=>{if(a>=mr)return false;a+=1;let f=xn(s.pageIndex,u),l=r.get(f);return l?l.push(s):r.set(f,[s]),true};for(let[s,u]of t.entries())for(let[f,l]of u.occurrences.entries()){if(wn(l)||l.source.start.paragraphId!==l.source.end.paragraphId)continue;o.add(l.pageIndex);let d=`${s}\0${f}`,c={paragraphId:l.source.start.paragraphId,offset:l.source.start.offset},m={paragraphId:l.source.end.paragraphId,offset:l.source.end.offset},y=c.offset<=m.offset?{from:c,to:m}:{from:m,to:c};i({key:d,from:y.from,to:y.to,pageIndex:l.pageIndex},y.from.paragraphId);}if(r.size===0)return n;for(let s of e.pages)o.has(s.index)&&chunkEWV5JMJY_cjs.Da(s,u=>{let f=u.story==="header"||u.story==="footer"?l=>chunkEWV5JMJY_cjs.ya(l,u.origin,{x:s.box.x,y:s.box.y}):void 0;chunkEWV5JMJY_cjs.Ha(u.host,(l,d)=>{let c=bn(s,d.storyOrigin);for(let m of l.lines)for(let y of chunkEWV5JMJY_cjs.Oa(m)){let p=r.get(xn(s.index,y.paragraphId));if(p)for(let x of p){let h=Er(y,x.from,x.to);if(!h)continue;let b=chunkEWV5JMJY_cjs.Ze(m,h.start,void 0,y),E=chunkEWV5JMJY_cjs.Ze(m,h.end,void 0,y),P=n.get(x.key)??[];P.push({pageIndex:s.index,x:Math.min(b,E)+c.x,y:m.box.y+c.y,width:Math.abs(E-b),height:m.box.height}),n.set(x.key,P);}}},u.origin,f);});return n}function Fn(e,t){let n=false;for(let o of t)if(o.occurrences.length!==0){n=true;break}if(!n)return t;let r=wr(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,u)=>{let f=`${a}\0${u}`,l=Rr(e,s,r.get(f)??[]);return l?{...s,geometry:l}:s});return {...o,occurrences:Object.freeze(i)}})}function Fr(e){let t=new Map,n=[{node:e.root,depth:0}];for(;n.length>0;){let{node:r,depth:o}=n.pop();if(!(r.kind==="textValue"||o>64)){r.kind==="paragraph"&&!t.has(r.id)&&t.set(r.id,t.size);for(let a=r.children.length-1;a>=0;a-=1)n.push({node:r.children[a],depth:o+1});}}return t}function Sn(){let e=new Map,t=r=>{let o=e.get(r.root);if(o)return o;let a=Fr(r);return e.set(r.root,a),a},n={retainRevisionItems:false,revisionSites:chunkGHNTGVKG_cjs.kh,locations:chunk67U2OZS7_cjs.va,commentAnchors:chunkGHNTGVKG_cjs.ig,deepOrder:t};return Object.freeze({collectReviewItems:r=>chunk67U2OZS7_cjs.La(r,n),deepParagraphOrderOfPart:t})}function Sr(e,t){if(t)return true;let n=e.map(r=>r.root);for(;n.length>0;){let r=n.pop();if(chunkGHNTGVKG_cjs.ih(r))return true;if(r.kind!=="textValue")for(let o of r.children)n.push(o);}return false}function vr(e,t){let n=[],r=new Set([t.name]),o=a=>{!a||r.has(a.name)||(r.add(a.name),n.push(a));};for(let a of chunkGHNTGVKG_cjs.Od(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunkGHNTGVKG_cjs.If(e,"footnote")),o(chunkGHNTGVKG_cjs.If(e,"endnote")),n}function Or(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunkGHNTGVKG_cjs.If(e,"footnote")?.name??null;case "endnote":return chunkGHNTGVKG_cjs.If(e,"endnote")?.name??null;case "note-separator":return chunkGHNTGVKG_cjs.If(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function Pr(e,t){let n=new Map;for(let r of e){let o=t.get(r.partName),a=o?.get(r.start.paragraphId),i=o?.get(r.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),u=Math.max(a,i),f=n.get(r.partName);n.set(r.partName,{lower:Math.min(f?.lower??s,s),upper:Math.max(f?.upper??u,u)});}return n}function Ir(e,t,n,r,o){let a=new Map(n.map(d=>[d.name,o(d)])),i=Pr(r,a),s=new Map,u=new Map,f=(d,c,m,y,p,x,h)=>{let b=a.get(d)?.get(p),E=i.get(d);if(b===void 0||!E||b<E.lower||b>E.upper)return;let P=s.get(d)??new Map;s.set(d,P);let q=u.get(d)??new Map;u.set(d,q);let z=JSON.stringify([c.story,c.noteScopeId,c.noteAreaKind]),ne=m==="textbox"?JSON.stringify([z,"textbox",y]):z,$=P.get(p)??[],G=`${p}\0${c.page.index}\0${ne}`,B=q.get(G);B||(B={pageIndex:c.page.index,story:m,rootStory:c.story,textboxPath:y,noteScopeId:c.noteScopeId,noteAreaKind:c.noteAreaKind,laneKey:ne,intervals:[],intervalKeys:new Set},q.set(G,B),$.push(B),P.set(p,$));let R=`${x}\0${h}`;B.intervalKeys?.has(R)||(B.intervalKeys?.add(R),B.intervals.push({start:x,end:h}));};chunkEWV5JMJY_cjs.Ea(e,d=>{let c=Or(t,d);!c||!i.has(c)||chunkEWV5JMJY_cjs.Ha(d.host,(m,y)=>{let p=y.textboxDepth>0?"textbox":d.story,x=y.textboxPath.map(b=>b.drawingNodeId),h=[];for(let b of m.lines){for(let E of b.spans)h.push(E.range);for(let E of b.drawings??[])h.push({paragraphId:E.paragraphId,start:E.start,end:E.start+1});}h.length===0&&h.push({paragraphId:m.range.paragraphId,start:m.range.start,end:m.range.end});for(let{paragraphId:b,start:E,end:P}of h)f(c,d,p,x,b,E,P);});}),chunkEWV5JMJY_cjs.Ga(e,d=>{let c=d.drawing.ownerPartName;i.has(c)&&f(c,d.root,d.story,d.textboxPath.map(m=>m.drawingNodeId),d.drawing.paragraphId,d.drawing.start,d.drawing.start+1);});for(let d of s.values())for(let c of d.values())for(let m of c){m.intervals.sort((p,x)=>p.start-x.start||p.end-x.end);let y=[];for(let p of m.intervals){let x=y.at(-1);x&&p.start<=x.end?x.end=Math.max(x.end,p.end):y.push({...p});}m.intervals.splice(0,m.intervals.length,...y),m.intervalKeys=void 0;}let l=new Map;for(let[d,c]of s){let m=a.get(d);if(!m)continue;let y=[];for(let[p,x]of c){let h=m.get(p);h!==void 0&&y.push({paragraphId:p,position:h,laneKeys:new Set(x.map(({laneKey:b})=>b))});}y.sort((p,x)=>p.position-x.position),l.set(d,y);}return {byPart:s,orderByPart:a,visibleByPart:l}}function vn(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>>1;e[o].position<t?n=o+1:r=o;}return n}function Ar(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let n=t.orderByPart.get(e.partName),r=t.visibleByPart.get(e.partName),o=n?.get(e.start.paragraphId),a=n?.get(e.end.paragraphId);if(!n||!r||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),u=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:d})=>d)??[]),f=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:d})=>d)??[]),l=new Set([...u].filter(d=>f.has(d)));return l.size===0?[e.start.paragraphId,e.end.paragraphId]:r.slice(vn(r,i),vn(r,s+1)).filter(d=>[...d.laneKeys].some(c=>l.has(c))).map(d=>d.paragraphId)}function Dr(e,t,n,r){return r?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,n)};return a.end>a.start?[a]:[]})}function Lr(e,t){let n=Number.NEGATIVE_INFINITY;for(let r of e)for(let o of r.intervals)n=Math.max(n,o.end);return t!==n?new Set:new Set(e.filter(r=>r.intervals.some(o=>o.end===n)))}function On(e,t,n){let r=[],o=new Set;for(let[a,i]of e.entries()){let s=n===void 0?void 0:n===null?"neutral":a<n?"replaced":"replacement";for(let u of Ar(i,t)){let f=t.byPart.get(i.partName)?.get(u)??[],d=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,c=u===i.start.paragraphId?i.start.offset:0,m=u===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,y=d?Lr(f,c):new Set;for(let p of f){let x=Dr(p,c,m,d);d&&x.length===0&&y.has(p)&&(x=[{start:c,end:c}]);for(let h of x){let b=`${p.pageIndex}\0${p.story}\0${p.noteScopeId??""}\0${p.noteAreaKind??""}\0${p.textboxPath.join("\0")}\0${i.partName}\0${u}\0${h.start}\0${h.end}\0${s??""}`;o.has(b)||(o.add(b),r.push({pageIndex:p.pageIndex,physicalPageNumber:p.pageIndex+1,story:p.story,rootStory:p.rootStory,textboxPath:p.textboxPath,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:u,offset:h.start},end:{paragraphId:u,offset:h.end}}}));}}}}return r}function In(e,t){let n=2166136261,r=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);n=Math.imul(n^a,16777619)>>>0,r=Math.imul(r^a+o,2246822507)>>>0,r^=r>>>13;}return `${e}_${t.length.toString(36)}_${n.toString(36)}_${r.toString(36)}`}function Pn(e,t,n=In){let r=new Map;for(let a of t){let i=n(e,a),s=r.get(i)??new Set;s.add(a),r.set(i,s);}let o=new Map;for(let[a,i]of r){let s=[...i].sort();for(let[u,f]of s.entries())o.set(f,s.length===1?a:`${a}_${u.toString(36)}`);}return o}function Tr(e){let t=new Set,n=new Set;for(let r of e){if(r.kind==="comment"){t.add(r.id),r.parentId!==void 0&&t.add(r.parentId),r.parentRevisionId!==void 0&&n.add(r.parentRevisionId);for(let o of r.replyIds)t.add(o);}if(r.kind==="revision"){n.add(r.id),r.pairedWith!==void 0&&n.add(r.pairedWith);for(let o of r.replyIds)t.add(o);}}return {comment:Pn("comment",t),revision:Pn("change",n)}}function V(e,t,n){return e.get(n)??In(t,n)}function Mr(e,t,n){return e.kind==="revision"?{kind:"tracked-change",id:V(n.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:e.text,replacedText:e.replacedText,nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:V(n.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),occurrences:t?On(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:V(n.comment,"comment",e.id),author:e.comment.author,initials:chunk67U2OZS7_cjs.Ha(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunk67U2OZS7_cjs.Ga(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:V(n.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:V(n.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),orphaned:e.orphaned,occurrences:t&&e.range?On([e.range],t):[]}}function An(e,t){let n=t.parts.get(t.mainDocumentPart);if(!n)return [];let r=vr(t,n),o=[n,...r],a=t.parts.get(chunk67U2OZS7_cjs.P(t,n.name));if(!Sr(o,a))return [];let i=Sn(),s=i.collectReviewItems({storyPart:n,furnitureParts:r,commentsPart:a,commentsExtendedPart:t.parts.get(chunk67U2OZS7_cjs.Q(t,n.name))});if(s.length===0)return [];let u=s.flatMap(d=>chunk67U2OZS7_cjs.Aa(d)),f=u.length>0?Ir(e,t,o,u,i.deepParagraphOrderOfPart):null,l=Tr(s);return s.map(d=>Mr(d,f,l)).filter(d=>d!==null)}var kr=new Set(["part","validatedHandle"]);function Dn(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function J(e,t,n,r,o){if(!(r!==void 0&&kr.has(r))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(n.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),n.add(e);try{if(Array.isArray(e)){for(let a of e)J(a,t,n,void 0,o);Object.freeze(e);return}if(!Dn(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");J(i.value,t,n,a,o);}}Object.freeze(e);}finally{n.delete(e);}}}}}function Ln(e){if(!Dn(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let r of e.pages)if(!(r===null||typeof r!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(r,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),J(i,new Set,s,o),t.add(i);}let n=(r,o)=>{let a=new Set;for(let i of r){let s=new Set;s.add(e),J(i,a,s,void 0,o);}Object.freeze(r);};for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(r==="pages"&&Array.isArray(o.value)){n(o.value,t);continue}if(r==="reviewArtifacts"&&Array.isArray(o.value)){n(o.value);continue}let a=new Set;a.add(e),J(o.value,new Set,a,r);}return Object.freeze(e),e}var Nr=Object.freeze([]),w=class extends Error{constructor(n,r,o){super(r,o);this.code=n;this.name="ExportResourceError";}code};function Br(e){try{return e instanceof w}catch{return false}}function Cr(e){try{return e instanceof chunkEWV5JMJY_cjs.Wd}catch{return false}}function _r(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function jr(e){if(Br(e))return e;let t=Cr(e),n=_r(e),r=n?`: ${n}`:"",o=new w(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${r}`:`Export layout failed${r}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function zr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function Tn(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var Ur=50,Pe=64;function Vr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function Hr(e){let t=false;return chunkEWV5JMJY_cjs.Ga(e,({drawing:n})=>{Vr(n.resource)&&(t=true);}),t}function Mn(e){return !ArrayBuffer.isView(e)}function Ie(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=Tn(t.displayMode??chunkEWV5JMJY_cjs.rb),r=Mn(e),o=Mn(e)?{ok:true,view:e}:chunkWGHVIB6B_cjs.I(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??r,s=zr(t.resourceTimeoutMs),u=t.measurer??chunkEWV5JMJY_cjs.z(),f=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),l=chunkEWV5JMJY_cjs.Jb({retainAcrossPasses:i}),d=0,c=new Set,m=()=>{d+=1;for(let R of c)R();c.clear();},y=chunkEWV5JMJY_cjs.nd({session:a,decodePort:t.imageDecodePort??Oe(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:m}),p={view:a,measurer:u,paragraphCache:l,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunkEWV5JMJY_cjs.md(a),fieldLinks:new Map,links:chunkEWV5JMJY_cjs.be(a),drawingBundle:y,furniture:new Map},x=new AbortController,h=t.signal,b=false,E=()=>b?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),P=()=>{b=true,q();};function q(){let R=p;if(R){p=null,h?.removeEventListener("abort",P),x.abort(h?.reason),R.drawingBundle.dispose(),R.paragraphCache.clear();for(let F of R.completed.values())chunkEWV5JMJY_cjs.ob(F.internal),chunkEWV5JMJY_cjs.he(F.internal);for(let F of R.fieldLinks.values())F.registry.clear();R.fieldLinks.clear(),R.completed.clear(),R.inFlight.clear(),R.furniture.clear(),R.sessions.clear(),m();}}h?.addEventListener("abort",P,{once:true}),h?.aborted&&P();let z=()=>{if(!p)throw E();if(x.signal.aborted)throw new w("aborted","Export resource settlement was aborted")},ne=(R,F,D,g)=>d!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==D?Promise.resolve():(z(),new Promise((U,I)=>{let L=false,C,T=k=>{L||(L=true,C!==void 0&&clearTimeout(C),c.delete(M),x.signal.removeEventListener("abort",W),k?I(k):U());},M=()=>T(),W=()=>T(new w("aborted","Export resource settlement was aborted")),K=()=>{if(p?.view.packageRevision()!==F||p?.view.currentPackage()!==D){T();return}let k=g-Date.now();if(k<=0){T(new w("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(K,Math.min(Ur,k));};if(c.add(M),x.signal.addEventListener("abort",W,{once:true}),d!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==D){T();return}K();})),$=async(R,F=0,D=Date.now()+s)=>{if(z(),Date.now()>=D)throw new w("timedOut",`Export layout did not stabilize within ${s}ms`);let g=p,U=D,I=g.view.packageRevision(),L=g.view.currentPackage(),C=g.completed.get(R);if(C&&C.revision===I&&C.pkg===L)return C.published;let T=()=>{if(g.view.packageRevision()===I&&g.view.currentPackage()===L)return null;if(F>=Pe-1)throw new w("nonConvergent","Document revision did not stabilize during export layout");return $(R,F+1,U)},M=g.fieldLinks.get(R);if(!M||M.revision!==I||M.pkg!==L){let O=M?.registry??chunkEWV5JMJY_cjs.ce();O.clear(),M={revision:I,pkg:L,registry:O},g.fieldLinks.set(R,M),g.furniture.delete(R);}let W=M.registry,K=g.sessions.get(R)??chunkEWV5JMJY_cjs.Fe();g.sessions.set(R,K);let k=g.furniture.get(R);k||(k=chunkEWV5JMJY_cjs._d({view:g.view,measurer:g.measurer,producer:f,cache:g.paragraphCache,styleCascade:g.styles.styleCascade,numberingIndex:g.styles.numberingIndex,defaultTabStopPt:g.styles.defaultTabStopPt,compatibilityMode:g.styles.compatibilityMode,displayMode:R,revisionAuthorFilter:void 0,inlineDrawingLayoutForPart:O=>g.drawingBundle.contextForPart(O),drawingLayoutTokenForPart:O=>g.drawingBundle.cacheTokenForPart(O),drawingTokenForParagraphForPart:(O,ye)=>g.drawingBundle.drawingTokenForParagraph(ye,O),linkProjectors:g.links,projectFieldLink:O=>W.project(O)}),g.furniture.set(R,k));for(let O=0;O<Pe;O+=1){let ye=d;g.drawingBundle.sync(g.view);let He=T();if(He)return He;let _=chunkFAD7DH6Q_cjs.l({view:g.view,revision:g.view.packageRevision(),measurer:g.measurer,cache:g.paragraphCache,session:K,producer:f,styleCascade:g.styles.styleCascade,defaultTabStopPt:g.styles.defaultTabStopPt,numberingIndex:g.styles.numberingIndex,furniture:k,compatibilityMode:g.styles.compatibilityMode,linkProjectors:g.links,projectFieldLink:v=>W.project(v),inlineDrawingLayout:g.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>g.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>g.drawingBundle.drawingTokenForParagraph(v,g.view.part().name),drawingTokenForParagraphForPart:(v,re)=>g.drawingBundle.drawingTokenForParagraph(re,v),drawingLayoutEpoch:g.drawingBundle.cacheTokenForPart(g.view.part().name),drawingLayoutEpochForPart:v=>g.drawingBundle.cacheTokenForPart(v),displayMode:R,revisionAuthorFilter:void 0});if(!Hr(_)){let v=T();if(v)return v;i||(chunkEWV5JMJY_cjs.ob(_),chunkEWV5JMJY_cjs.he(_),g.paragraphCache.clear(),g.sessions.delete(R),g.furniture.delete(R));let re=An(_,L),nr=re.length===0?Nr:Object.freeze(Fn(_,re)),rr=gn(g.view,_),or={..._,...rr,contentWarnings:yn(g.view),reviewArtifacts:nr},Ge=Ln(or);return g.completed.set(R,{revision:I,pkg:L,internal:_,published:Ge}),Ge}let qe=ye;for(;g.drawingBundle.pendingResourceCount()>0;){await ne(qe,I,L,U),qe=d,z();let v=T();if(v)return v}z();let $e=T();if($e)return $e}throw new w("nonConvergent",`Image resources did not reach quiescence after ${Pe} layout passes`)},G=R=>{let F;try{F=Tn(R);}catch(I){return Promise.reject(I)}if(!p)return Promise.reject(E());let D=p,g=D.inFlight.get(F);if(g)return g;let U=$(F).catch(I=>{throw jr(I)}).finally(()=>D.inFlight.delete(F));return D.inFlight.set(F,U),U};return {ok:true,session:{layout:()=>G(n),layoutFor:G,validatedImageBytes(R){let F=p;return !F||R.resource.kind!=="ready"?null:F.drawingBundle.mintValidatedBytes(R.resource.validatedHandle,R.resource.contentId)?.slice()??null},dispose:q}}}var Ae=chunkEWV5JMJY_cjs.b;function De(e){return typeof e.admittedFontFace=="function"}var qr=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function pe(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function Le(e){let t=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:pe(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:t?Object.freeze({requested:pe(t.requested),resolved:pe(t.resolved),...t.lineMetrics?{lineMetrics:Object.freeze({...t.lineMetrics})}:{}}):null})}function $r(e){return Object.freeze({...Le(e),bytes:chunkEWV5JMJY_cjs.h(e)})}function Gr(e,t){if(!e)return null;try{let n=e(t);return !n||n instanceof chunkEWV5JMJY_cjs.d?null:$r(n)}catch{return null}}function kn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return Gr(e.resolve(),t)}}function Wr(e){return Object.freeze(e.slice(0,Ae).map(t=>Object.freeze({request:pe(t.request),partName:t.partName,reason:t.reason})))}function Te(e,t,n,r,o=[]){let a=new Map;for(let s of [...e,t]){let u=s.toLowerCase();a.has(u)||a.set(u,s);}let i=[...a.values()].map(s=>{let u=[];for(let f of qr){let l=r?.({family:s,...f});!l||l instanceof chunkEWV5JMJY_cjs.d||u.push(Object.freeze({...f,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:s,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:t,families:Object.freeze(i),originFailures:Object.freeze([...n]),droppedEmbeddedFonts:Wr(o)})}function Me(e,t){if(t.onFontResolution){try{let n=t.onFontResolution(e);Promise.resolve(n).catch(r=>{console.warn("[fonts] font-resolution diagnostics callback failed",r);});}catch(n){console.warn("[fonts] font-resolution diagnostics callback failed",n);}return}for(let n of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",n);for(let n of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",n);}function ke(e,t){if(t.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(r=>r.coverage==="complete"))return;let n=e.families.filter(r=>r.coverage!=="complete").map(r=>r.family).join(", ");throw new w("layoutFailed",`Strict font policy refused export${n?`; incomplete families: ${n}`:"; a font origin failed"}`)}function fe(){return new Map}function Ne(e,t,n,r){if(n.trim().length===0)return null;let o={family:n,weight:r.bold?700:400,style:r.italic?"italic":"normal"},a=chunkEWV5JMJY_cjs.g(o),i=t.get(a);if(!i){try{i=e.fonts.resolve(o);}catch{return null}t.set(a,i);}return i instanceof chunkEWV5JMJY_cjs.d?null:i}function Nn(e,t,n){let r=n.fontFamily??e.defaultFont.family;return Ne(e,t,r,n)}function Be(e){return typeof e.shapeLaidOutText=="function"}function Ce(e){let t=fe(),n=new WeakMap;return r=>{let o=chunkEWV5JMJY_cjs.ga(r.style,r.fontSlot),a=chunkEWV5JMJY_cjs.S(r.text,o);if(a.length===0)return null;let i=o.fontFamily??e.defaultFont.family,s=Ne(e,t,i,o);if(!s)return null;try{if(o.smallCaps&&!chunkEWV5JMJY_cjs.Ue(e.shaper,e.environment,s,o,n))return null;let u=chunkEWV5JMJY_cjs.Te(e.shaper,e.environment,s,o,a);return Object.freeze({run:u,font:Le(s),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Bn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(t)??null}}var ee=new Map,me=new WeakMap,_e=0,te,je=32,Cn=chunkEWV5JMJY_cjs.c;function _n(){if(te)return te;let e=(async()=>(await chunkEWV5JMJY_cjs.s(),chunkEWV5JMJY_cjs.x(chunkEWV5JMJY_cjs.A)))();return te=e,e.catch(()=>{te===e&&(te=void 0);}),e}function jn(e){let t=fe();return chunkEWV5JMJY_cjs.We(e,{resolveFont(n){return Nn(e,t,n)},fallback:chunkEWV5JMJY_cjs.z()})}async function zn(e,t){if(!chunkEWV5JMJY_cjs.C(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let n=await _n(),r=await chunkEWV5JMJY_cjs.J(e,n,chunkEWV5JMJY_cjs.A,t);return Object.freeze({createMeasurer:()=>jn(r),resolveFont:o=>r.fonts.resolve(o),shapeLaidOutText:Ce(r),producer:["node-export-session",e.fingerprint,r.operation.shapingHash,`producer:${r.operation.producerVersion}`,`fallback:${chunkEWV5JMJY_cjs.y}`].join("|"),extensionFingerprint:e.fingerprint})}function Kr(e,t){if(!chunkEWV5JMJY_cjs.C(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n=me.get(e);if(n)return n;let r=chunkEWV5JMJY_cjs.E(e),o=ee.get(r);if(!o){if(ee.size>=je)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${je} process-wide configurations`));o=(async()=>{let u=chunkEWV5JMJY_cjs.D(e).sources.reduce((l,d)=>l+(d.availability==="forbidden"?0:d.bytes.byteLength),0);if(_e+u>Cn)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Cn} process-wide`);_e+=u;let f;try{let l=await _n();f=await chunkEWV5JMJY_cjs.J(e,l,chunkEWV5JMJY_cjs.A,t);}catch(l){throw _e-=u,l}return Object.freeze({createMeasurer:()=>jn(f),shapeLaidOutText:Ce(f),shapingHash:f.operation.shapingHash,producerVersion:f.operation.producerVersion})})(),ee.set(r,o),o.catch(()=>{ee.get(r)===o&&ee.delete(r);});}let a=e.fingerprint,i=o.then(s=>Object.freeze({createMeasurer:s.createMeasurer,shapeLaidOutText:s.shapeLaidOutText,producer:["node-export",a,s.shapingHash,`producer:${s.producerVersion}`,`fallback:${chunkEWV5JMJY_cjs.y}`].join("|"),extensionFingerprint:a}));return me.set(e,i),i.catch(()=>{me.get(e)===i&&me.delete(e);}),i}var Xr="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Yr(e){let t=e.currentPackage(),n=(t.relationships.get(t.mainDocumentPart)??[]).find(o=>o.type===Xr),r;if(n){let o=chunkGHNTGVKG_cjs.E(n);o.mode==="Internal"&&o.target.ok&&(r=t.parts.get(o.target.partName));}return r??=t.parts.get("/word/fontTable.xml"),chunkGHNTGVKG_cjs.Rd(t,r)}function Un(e,t){let n=Yr(e);if(n.length!==0)return chunkFAD7DH6Q_cjs.h(r=>{let o=new Set((r.resolvedFaces??[]).map(i=>chunkEWV5JMJY_cjs.g(i))),a=chunkFAD7DH6Q_cjs.o(n,{maxFontBytes:chunkEWV5JMJY_cjs.a,aggregateBudget:Qr(r),shadowedRequests:o});if(t)for(let i of a.dropped){if(t.dropped.length>=Ae)break;t.dropped.push(i);}return {sources:a.sources}})}function Qr(e){let t=e.committedSourceBytes;return t===void 0||!Number.isSafeInteger(t)||t<=0?chunkEWV5JMJY_cjs.c:Math.max(0,chunkEWV5JMJY_cjs.c-t)}function Zr(e){return De(e)&&Be(e)}var N=0,Vn=Symbol("font-resolution-timeout");function Jr(e){let t=0,n=false;return e?.(N),{reserve:o=>{if(n)throw new Error("Document font-byte lease is already released");if(N+o>chunkEWV5JMJY_cjs.c)throw new w("layoutFailed",`Active document export font bytes are limited to ${chunkEWV5JMJY_cjs.c}; requested ${o} bytes with ${N} bytes already active`);N+=o,t+=o,e?.(N);let a=false;return ()=>{a||n||(a=true,N-=o,t-=o,e?.(N));}},release:()=>{n||(n=true,N-=t,t=0,e?.(N));}}}function Ue(e,t){return e.attributes.find(n=>n.localName===t)?.value}function eo(e,t){return e.attributes.find(n=>n.localName===t&&(n.namespaceUri===chunkGHNTGVKG_cjs.da||n.namespaceUri===""))?.value}async function to(e,t){if(t.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=chunkWGHVIB6B_cjs.I(e);if(!n.ok)return n;let{fonts:r,fontResolutionTimeoutMs:o,fontPolicy:a,onFontResolution:i,...s}=t,u=Array.isArray(r)?r:[r],f,l;try{l=await no(n.view,u,{signal:t.signal,timeoutMs:o??t.resourceTimeoutMs,fontPolicy:a,onFontResolution:b=>(f=b,i?.(b))});}catch(b){if(b instanceof w&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!f)throw l?.dispose(),new w("layoutFailed","Document font resolution completed without publishing its evidence");let d;try{d=Ie(n.view,{...s,reuseAcrossRevisions:!1,...l?{measurer:l.createMeasurer(),producer:t.producer??l.producer}:t.producer?{producer:t.producer}:{}});}catch(b){throw l?.dispose(),b}if(!d.ok)return l?.dispose(),d;let c=d.session,m=l,y="active",p=()=>y==="aborted"?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),x=b=>{if(y==="active"){y=b,t.signal?.removeEventListener("abort",h);try{c.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>x("aborted");return t.signal?.addEventListener("abort",h,{once:true}),t.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:f,layout:()=>y==="active"?c.layout():Promise.reject(p()),layoutFor:b=>y==="active"?c.layoutFor(b):Promise.reject(p()),validatedImageBytes:b=>y==="active"?c.validatedImageBytes(b):null,admittedFontFace:kn({status:()=>y,unavailable:p,resolve:()=>m?.resolveFont}),shapeLaidOutText:Bn({status:()=>y,unavailable:p,shaping:()=>m}),dispose:()=>x("disposed")})}}async function no(e,t,n={}){let r=ro(n.timeoutMs),o=new AbortController,a=()=>o.abort(n.signal?.reason);n.signal?.addEventListener("abort",a,{once:true}),n.signal?.aborted&&a();let i=setTimeout(()=>o.abort(Vn),r);try{ze(o.signal);let s=(async()=>{let u=Jr(n.onActiveFontBytesChange),f=!1;try{let l=ao(e).slice(0,chunkFAD7DH6Q_cjs.b),d=[],c={dropped:[]},m=Un(e,c),y=m?[...t,m]:t,p=await chunkFAD7DH6Q_cjs.k(y,{families:l,defaultFamily:chunkFAD7DH6Q_cjs.c.family,signal:o.signal},{onOriginFailure:E=>d.push(E),reserveOwnedBytes:u.reserve});ze(o.signal);let x=chunkFAD7DH6Q_cjs.d(p??{});if(x.sources.length===0){let E=Te(l,x.defaultFont.family,d,void 0,c.dropped);Me(E,n),ke(E,n);return}let h=await zn(chunkEWV5JMJY_cjs.G(x));ze(o.signal);let b=Te(l,x.defaultFont.family,d,h.resolveFont,c.dropped);return Me(b,n),ke(b,n),f=!0,Object.freeze({...h,dispose:u.release})}finally{f||u.release();}})();return await Promise.race([s,oo(o.signal)])}finally{clearTimeout(i),n.signal?.removeEventListener("abort",a);}}function ro(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function oo(e){return new Promise((t,n)=>{let r=()=>{n(Hn(e));};e.aborted?r():e.addEventListener("abort",r,{once:true});})}function Hn(e){let t=e.reason===Vn;return new w(t?"timedOut":"aborted",t?"Font resolution timed out":"Font resolution was aborted",t?void 0:{cause:e.reason})}function ze(e){if(e.aborted)throw Hn(e)}function ao(e){let t=[e.part().root],n=[],r=[],o=new Set([e.part().name]),a=(l,d)=>{!d||o.has(d.name)||(o.add(d.name),l.push(d.root));};for(let l of e.headerFooterPartsBySection()){for(let d of l.headers.values())a(n,d);for(let d of l.footers.values())a(n,d);}for(let l of ["footnote","endnote"])r.push(...io(e,l));let i=e.documentThemeFonts(),s={major:i.major,minor:i.minor,majorEastAsia:i.majorEastAsia??null,minorEastAsia:i.minorEastAsia??null},u=new Map,f=(l,d)=>{let c=chunkYRTRPSSA_cjs.d(l,e.stylesRoot(),s,co(l,d)),m=chunkFAD7DH6Q_cjs.r(l,e.numberingRoot(),e.stylesRoot(),s);for(let y of [...c.direct,...po(l),...m,...c.inherited]){let p=y.toLowerCase();u.has(p)||u.set(p,y);}};return f(t,"body"),f(n,"furniture"),f(r,"note"),[...u.values()]}function io(e,t){let n=chunkGHNTGVKG_cjs.If(e.currentPackage(),t);if(!n)return [];let r=new Set(chunkGHNTGVKG_cjs.Jf(e.part()).filter(a=>a.noteKind===t).map(a=>a.noteId)),o=[];for(let a of n.root.children){if(a.kind==="textValue")continue;let i=chunkGHNTGVKG_cjs.hd(a),s=chunkGHNTGVKG_cjs.gd(a);(i==="separator"||i==="continuationSeparator"||s!==null&&r.has(s))&&o.push(a);}return o}var so="http://schemas.openxmlformats.org/officeDocument/2006/math";function co(e,t){let n=new Set;for(let r of e){let o=[],a=[{node:r,context:t}];for(;a.length>0;){let{node:i,context:s}=a.pop();i.namespaceUri===chunkGHNTGVKG_cjs.da&&i.localName==="p"&&o.push({paragraph:i,context:s});let u=i.namespaceUri===chunkGHNTGVKG_cjs.da&&i.localName==="txbxContent"&&(s==="body"||s==="note")?"detached":s;for(let f=i.children.length-1;f>=0;f-=1){let l=i.children[f];l.kind!=="textValue"&&a.push({node:l,context:u});}}for(let i of o)lo(i.paragraph,n,i.context);}return n}function lo(e,t,n){let r=chunkEWV5JMJY_cjs.Wa(),o=null,a=null,i="",s=false,u=false,f=false,l=0,d=[];for(let c=e.children.length-1;c>=0;c-=1){let m=e.children[c];m.kind!=="textValue"&&d.push({node:m,runId:null,visibility:H,containerDepth:0});}for(;d.length>0;){let{node:c,runId:m,visibility:y,containerDepth:p}=d.pop();if(p>=chunkGHNTGVKG_cjs.la||c.namespaceUri===chunkGHNTGVKG_cjs.da&&c.localName==="p")continue;let x=c.namespaceUri===chunkGHNTGVKG_cjs.da&&c.localName==="r"?c.id:m;if(c.namespaceUri===chunkGHNTGVKG_cjs.da&&c.localName==="fldSimple"){let h=Ue(c,"instr")??"";chunkEWV5JMJY_cjs.ed(h,{allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&uo(c)!==H&&t.add(c.id);}if(c.namespaceUri===chunkGHNTGVKG_cjs.da&&c.localName==="fldChar"){let h=Ue(c,"fldCharType");if(h==="begin")chunkEWV5JMJY_cjs.Za(r),r.nesting===1&&(o=x,a=null,i="",s=false,u=false,f=chunkGHNTGVKG_cjs.je(c),l=0);else if(h==="separate"){let b=r.nesting===1;if(chunkEWV5JMJY_cjs.$a(r),b){let E=chunkEWV5JMJY_cjs.Ya(r);i=E.instruction,s=E.overflow||r.nestingOverflow,a=x,u=true;}}else if(h==="end"){if(r.nesting===1){if(r.phase==="instruction"){let E=chunkEWV5JMJY_cjs.Ya(r);i=E.instruction,s=E.overflow||r.nestingOverflow;}if(!s&&chunkEWV5JMJY_cjs.dd(i,{hasSeparate:u,hasLegacyFormData:f,allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&l!==H){let E=a??o;E&&t.add(E);}}chunkEWV5JMJY_cjs.ab(r);}continue}if(c.namespaceUri===chunkGHNTGVKG_cjs.da&&(c.localName==="instrText"||c.localName==="delInstrText")){chunkEWV5JMJY_cjs._a(r,Kn(c),c.localName==="delInstrText");continue}r.nesting>0&&chunkEWV5JMJY_cjs.bb(r)&&c.namespaceUri===chunkGHNTGVKG_cjs.da&&qn(c)&&(l|=y);for(let h=c.children.length-1;h>=0;h-=1){let b=c.children[h];b.kind!=="textValue"&&d.push({node:b,runId:x,visibility:y&Wn(c),containerDepth:chunkGHNTGVKG_cjs.ma(c,p)});}}chunkEWV5JMJY_cjs.Xa(r);}function qn(e){return e.localName==="t"||e.localName==="delText"?Kn(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Ve=1,$n=2,Gn=4,H=Ve|$n|Gn;function uo(e){let t=[];for(let r of e.children)r.kind!=="textValue"&&t.push({node:r,visibility:H});let n=0;for(;t.length>0;){let{node:r,visibility:o}=t.pop();if(!(r.namespaceUri===chunkGHNTGVKG_cjs.da&&r.localName==="p")){if(r.namespaceUri===chunkGHNTGVKG_cjs.da&&qn(r)&&(n|=o,n===H))return n;for(let a of r.children)a.kind!=="textValue"&&t.push({node:a,visibility:o&Wn(r)});}}return n}function Wn(e){return e.namespaceUri!==chunkGHNTGVKG_cjs.da?H:e.localName==="ins"||e.localName==="moveTo"?Ve|$n:e.localName==="del"||e.localName==="moveFrom"?Ve|Gn:H}function po(e){let t=new Map,n=r=>{let o=chunkYRTRPSSA_cjs.a(r??void 0);if(o===null)return;let a=o.toLowerCase();t.has(a)||t.set(a,o);};for(let r of e){let o=[r];for(;o.length>0;){let a=o.pop();if(a.namespaceUri===so&&n(chunkEWV5JMJY_cjs.vc),a.namespaceUri===chunkGHNTGVKG_cjs.da&&a.localName==="sym"&&n(chunkYRTRPSSA_cjs.b(eo(a,"font"))),a.namespaceUri===chunkGHNTGVKG_cjs.da&&a.localName==="fldSimple"){let i=Ue(a,"instr");n(chunkEWV5JMJY_cjs.cd(i??"")?.font??null);}if(a.namespaceUri===chunkGHNTGVKG_cjs.da&&a.localName==="p")for(let i of chunkFAD7DH6Q_cjs.q(a))n(i);for(let i=a.children.length-1;i>=0;i-=1){let s=a.children[i];s.kind!=="textValue"&&o.push(s);}}}return [...t.values()]}function Kn(e){let t="",n=[...e.children].reverse();for(;n.length>0&&t.length<=256;){let r=n.pop();if(r.kind==="textValue")t+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}return t}var Qn="FILE_TOO_LARGE",Xn=8;function fo(e){return typeof e=="object"&&e!==null}function Zn(e){if(!(!fo(e)||typeof e.code!="string"))return e.code}function Jn(e){return e===""||e.toLowerCase()==="localhost"}function mo(e){try{let t=decodeURIComponent(e);return t.includes("\0")?null:t}catch{return null}}function er(e){let t=mo(e);if(t===null)return null;let n=[];for(let r of t.split(/[/\\]/))if(!(r===""||r===".")){if(r===".."){if(n.length===0)return null;n.pop();continue}n.push(r);}return `/${n.join("/")}`}function tr(e){let t=er(e);return t===null?null:t.endsWith("/")?t:`${t}/`}function yo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function go(e){let t;try{t=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(t.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(t.username!==""||t.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!Jn(t.host))throw new TypeError("trustedRoot must be a local file: URL");let n=tr(t.pathname);if(n===null||yo(n))throw new TypeError("trustedRoot must be a directory inside the filesystem");let r=new URL("file:///");return r.pathname=n,r}function ho(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function xo(e){let t=ho(e);if(t.length===0)throw new TypeError("trustedRoot must name at least one directory");if(t.length>Xn)throw new TypeError(`trustedRoot must not exceed ${Xn} directories`);return t.map(go)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkEWV5JMJY_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkEWV5JMJY_cjs.a}`);return e}function Ro(e,t){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Jn(e.host))return null;let n=er(e.pathname);if(n===null)return null;for(let r of t){let o=tr(r.pathname);if(o===null||!n.startsWith(o)||n.length<=o.length)continue;let a=new URL("file:///");return a.pathname=n,a}return null}function Eo(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function wo(e,t,n){let r=n.relative(n.resolve(e),n.resolve(t));return r!==""&&!r.startsWith("..")&&!n.isAbsolute(r)}function Yn(e,t,n){return e.some(r=>wo(r,t,n))}async function Fo(e,t){let n=[];for(let r of e)try{n.push(await t(r));}catch(o){if(Zn(o)==="ENOENT")continue;throw o}return n}function So(e){return async(t,{signal:n,maxBytes:r})=>{if(n?.aborted)throw n.reason;let[{open:o,realpath:a},{constants:i},{fileURLToPath:s},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),f=e.map(y=>u.resolve(s(y.href))),l=u.resolve(s(typeof t=="string"?t:t.href));if(!Yn(f,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let d=typeof i.O_NOFOLLOW=="number"?i.O_RDONLY|i.O_NOFOLLOW:"r",c=await o(l,d),m=()=>{c.close();};n?.addEventListener("abort",m,{once:true});try{if(n?.aborted)throw n.reason;let y=await a(l);if(!Yn(await Fo(f,a),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=(await c.stat()).size;if(!Number.isSafeInteger(p)||p<0||p>r)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Qn});let x=new Uint8Array(p),h=0;for(;h<x.byteLength;){if(n?.aborted)throw n.reason;let{bytesRead:b}=await c.read(x,h,x.byteLength-h,h);if(b===0)break;h+=b;}if(n?.aborted)throw n.reason;return h===x.byteLength?x:x.slice(0,h)}catch(y){throw n?.aborted?n.reason:y}finally{n?.removeEventListener("abort",m),await c.close().catch(()=>{});}}}function vo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let t=xo(e.trustedRoot),n=bo(e.maxBytes),r=e.read??So(t),o=e.networkFetch??fetch;return(async(a,i)=>{let s=i?.signal;if(s?.aborted)throw s.reason;let u=Eo(a);if(u.protocol!=="file:")return o(u,i);let f=Ro(u,t);if(!f)return new Response(null,{status:404});let l=s?new AbortController:void 0,d=()=>l?.abort(s?.reason);s?.addEventListener("abort",d,{once:true});let c;try{if(c=await r(f,{maxBytes:n,...l?{signal:l.signal}:{}}),s?.aborted)throw s.reason;if(c.byteLength>n)return new Response(null,{status:413})}catch(m){if(s?.aborted)throw s.reason;if(l?.signal.aborted)throw l.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let y=Zn(m);if(y===Qn)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw m}finally{s?.removeEventListener("abort",d);}return new Response(c,{status:200})})}
|
|
2
|
+
exports.ExportResourceError=w;exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=je;exports.acquireSharedExportShaping=Kr;exports.createNodeImageDecodePort=Oe;exports.createPackagedFileFetch=vo;exports.exportDestinationNamed=fr;exports.hasExportAdmittedFont=De;exports.hasExportLaidOutText=Be;exports.hasFontBackedExportCapabilities=Zr;exports.openDocumentForExport=Ie;exports.openFontBackedDocumentForExport=to;
|
package/dist/export.d.ts
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { P as PreservedImageMime, G as ImageResourceLimits, y as SupportedImageMime, E as ImageDecodePort } from './tree-op-types-
|
|
2
|
-
import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-
|
|
3
|
-
import { S as SemanticLayout, i as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, h as FontRequest, j as FontSubstitution, k as ShapedRun, a as StyleSpanRecord } from './semantic-records-
|
|
4
|
-
import { R as RevisionDisplayMode } from './revision-projection-
|
|
5
|
-
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-
|
|
6
|
-
import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-
|
|
1
|
+
import { P as PreservedImageMime, G as ImageResourceLimits, y as SupportedImageMime, E as ImageDecodePort } from './tree-op-types-C5rZzoAz.js';
|
|
2
|
+
import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-C9ONlGtf.js';
|
|
3
|
+
import { S as SemanticLayout, i as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, h as FontRequest, j as FontSubstitution, k as ShapedRun, a as StyleSpanRecord } from './semantic-records-BreR44Ki.js';
|
|
4
|
+
import { R as RevisionDisplayMode } from './revision-projection-CN_DiOl_.js';
|
|
5
|
+
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-D_U5z-Qh.js';
|
|
6
|
+
import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-CdqOugwZ.js';
|
|
7
7
|
import './contracts/types.js';
|
|
8
|
-
import './hf-references-
|
|
9
|
-
import './omml-equation-
|
|
10
|
-
import './editor-
|
|
8
|
+
import './hf-references-BZVHctVD.js';
|
|
9
|
+
import './omml-equation-oLlbPpVy.js';
|
|
10
|
+
import './editor-PDx0fqSo.js';
|
|
11
11
|
import './contracts/document.js';
|
|
12
|
-
import './
|
|
13
|
-
import './
|
|
12
|
+
import './editor-scope-DZJT4ukT.js';
|
|
13
|
+
import './review-items-kC-YI70C.js';
|
|
14
|
+
import './contracts/interaction.js';
|
|
15
|
+
import './semantic-interaction-NGeYzYCN.js';
|
|
14
16
|
import './failure-BnGjoXf0.js';
|
|
15
17
|
|
|
18
|
+
/** Source content that cannot be certified by the layout snapshot. @public */
|
|
19
|
+
interface ExportContentWarning {
|
|
20
|
+
/** Legacy content is preserved in the DOCX but not laid out. */
|
|
21
|
+
readonly code: 'legacy-textbox' | 'legacy-drawing' | 'scan-limit';
|
|
22
|
+
/** Package part containing the content, or where the bounded scan stopped. */
|
|
23
|
+
readonly partName: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
/** Bounded package metadata for exporter output dictionaries. @public */
|
|
17
27
|
type ExportDocumentMetadata = Readonly<DocumentProperties>;
|
|
18
28
|
/** Model address shared by bookmarks and internal hyperlinks. @public */
|
|
@@ -107,6 +117,8 @@ interface OpenDocumentForExportOptions {
|
|
|
107
117
|
* @public
|
|
108
118
|
*/
|
|
109
119
|
interface ExportSemanticLayout extends SemanticLayout {
|
|
120
|
+
/** Source omissions that cannot be detected by walking laid-out records. */
|
|
121
|
+
readonly contentWarnings?: readonly ExportContentWarning[];
|
|
110
122
|
readonly reviewArtifacts: readonly SemanticReviewArtifactRecord[];
|
|
111
123
|
readonly documentMetadata?: ExportDocumentMetadata;
|
|
112
124
|
readonly destinations?: readonly ExportDestinationGeometry[];
|
|
@@ -334,4 +346,4 @@ interface PackagedFileFetchOptions {
|
|
|
334
346
|
*/
|
|
335
347
|
declare function createPackagedFileFetch(options: PackagedFileFetchOptions): typeof fetch;
|
|
336
348
|
|
|
337
|
-
export { type ExportAdmittedFontApi, type ExportAdmittedFontFace, type ExportAdmittedFontIdentity, type ExportDestinationAnchor, type ExportDestinationGeometry, type ExportDocumentMetadata, type ExportDocumentSource, type ExportDroppedEmbeddedFont, type ExportFontFaceResolution, type ExportFontFamilyResolution, type ExportFontResolutionReport, type ExportLaidOutText, type ExportLaidOutTextApi, ExportResourceError, type ExportSemanticLayout, type ExportSession, type FontBackedExportCapabilities, type FontBackedExportSession, FontOrigin, FontOriginFailure, FontRequest, FontSubstitution, MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS, type OpenDocumentForExportOptions, type OpenDocumentForExportResult, type OpenFontBackedDocumentForExportOptions, type OpenFontBackedDocumentForExportResult, type PackagedFileFetchOptions, type PackagedFileRead, type PreservedImageConverter, type SharedExportShaping, type SharedExportShapingCapabilities, acquireSharedExportShaping, createNodeImageDecodePort, createPackagedFileFetch, exportDestinationNamed, hasExportAdmittedFont, hasExportLaidOutText, hasFontBackedExportCapabilities, openDocumentForExport, openFontBackedDocumentForExport };
|
|
349
|
+
export { type ExportAdmittedFontApi, type ExportAdmittedFontFace, type ExportAdmittedFontIdentity, type ExportContentWarning, type ExportDestinationAnchor, type ExportDestinationGeometry, type ExportDocumentMetadata, type ExportDocumentSource, type ExportDroppedEmbeddedFont, type ExportFontFaceResolution, type ExportFontFamilyResolution, type ExportFontResolutionReport, type ExportLaidOutText, type ExportLaidOutTextApi, ExportResourceError, type ExportSemanticLayout, type ExportSession, type FontBackedExportCapabilities, type FontBackedExportSession, FontOrigin, FontOriginFailure, FontRequest, FontSubstitution, MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS, type OpenDocumentForExportOptions, type OpenDocumentForExportResult, type OpenFontBackedDocumentForExportOptions, type OpenFontBackedDocumentForExportResult, type PackagedFileFetchOptions, type PackagedFileRead, type PreservedImageConverter, type SharedExportShaping, type SharedExportShapingCapabilities, acquireSharedExportShaping, createNodeImageDecodePort, createPackagedFileFetch, exportDestinationNamed, hasExportAdmittedFont, hasExportLaidOutText, hasFontBackedExportCapabilities, openDocumentForExport, openFontBackedDocumentForExport };
|