@docx-editor.dev/core 2.19.1 → 2.20.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.
Files changed (94) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +10 -9
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +8 -9
  6. package/dist/binding.js +1 -1
  7. package/dist/chunk-2H4ABRMB.cjs +20 -0
  8. package/dist/{chunk-NIVIC7PA.cjs → chunk-2HQXLL5L.cjs} +1 -1
  9. package/dist/chunk-3EZO3O6I.js +4 -0
  10. package/dist/{chunk-GWW5FOLJ.cjs → chunk-44SIVFJT.cjs} +5 -5
  11. package/dist/chunk-6UCDHGXI.js +1 -0
  12. package/dist/chunk-7VMVDRRU.js +2 -0
  13. package/dist/{chunk-2QU7QTM7.js → chunk-CAIWEQLC.js} +1 -1
  14. package/dist/{chunk-3JKOZBQ3.cjs → chunk-CEXC2VHI.cjs} +1 -1
  15. package/dist/chunk-CF3JR35B.js +11 -0
  16. package/dist/chunk-D2V4YBWJ.cjs +2 -0
  17. package/dist/chunk-DGSJZMAE.cjs +11 -0
  18. package/dist/chunk-EHBPYFRE.js +20 -0
  19. package/dist/chunk-GSEUM6AI.cjs +1 -0
  20. package/dist/chunk-H6WDEAOJ.js +18 -0
  21. package/dist/chunk-I6LSEDUL.cjs +18 -0
  22. package/dist/{chunk-3SU7UWCR.js → chunk-IW35GWJN.js} +1 -1
  23. package/dist/{chunk-BJQDNKEX.js → chunk-JRBGCIR2.js} +4 -4
  24. package/dist/chunk-K5HIOS6J.cjs +3 -0
  25. package/dist/chunk-KLQXP27K.js +3 -0
  26. package/dist/{chunk-RDKPMNN6.cjs → chunk-MZFFU66H.cjs} +1 -1
  27. package/dist/{chunk-TSDGKNV7.js → chunk-MZPNLIP3.js} +1 -1
  28. package/dist/{chunk-JWHXOJEU.cjs → chunk-OA6LFCTG.cjs} +2 -2
  29. package/dist/{chunk-BUNY5MRX.js → chunk-OHVJYJOA.js} +1 -1
  30. package/dist/{chunk-UOE4WKL7.js → chunk-P4TGGDK3.js} +1 -1
  31. package/dist/{chunk-7VO6BLKV.cjs → chunk-PIBYJZIH.cjs} +1 -1
  32. package/dist/{chunk-76F73CY6.cjs → chunk-WTILOUPG.cjs} +1 -1
  33. package/dist/collaboration/replication.cjs +1 -1
  34. package/dist/collaboration/replication.d.ts +3 -3
  35. package/dist/collaboration/replication.js +1 -1
  36. package/dist/collaboration.d.ts +3 -3
  37. package/dist/contracts/document.d.ts +2 -2
  38. package/dist/contracts/editor.d.ts +8 -9
  39. package/dist/contracts/modules.d.ts +5 -7
  40. package/dist/contracts/types.d.ts +1 -562
  41. package/dist/{custom-node-writes-BqIv94ei.d.ts → custom-node-writes-piokwVR5.d.ts} +2 -2
  42. package/dist/{document-protection-BL5zp8cU.d.ts → document-protection-C6RvCHx-.d.ts} +1 -1
  43. package/dist/{editor-WXbTSXx1.d.ts → editor-BgtcHulQ.d.ts} +19 -14
  44. package/dist/editor.cjs +1 -1
  45. package/dist/editor.css +1 -1
  46. package/dist/editor.d.ts +25 -27
  47. package/dist/editor.js +1 -1
  48. package/dist/export.cjs +2 -2
  49. package/dist/export.d.ts +12 -13
  50. package/dist/export.js +1 -1
  51. package/dist/{font-resolver-BSrKnTeR.d.ts → font-resolver-Bv2Z25-J.d.ts} +1 -1
  52. package/dist/{headless-document-view-C4ttQJ5H.d.ts → headless-document-view-DHKMN_3Y.d.ts} +2 -2
  53. package/dist/image-resources-C51LuAAu.d.ts +210 -0
  54. package/dist/{index-C3As-Xxp.d.ts → index-3lr8xXF8.d.ts} +14 -15
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.d.ts +17 -18
  57. package/dist/index.js +1 -1
  58. package/dist/{layout-shaping-Dqu3JW3p.d.ts → layout-shaping-CKBUSaS7.d.ts} +1 -1
  59. package/dist/layout.cjs +1 -1
  60. package/dist/layout.d.ts +48 -19
  61. package/dist/layout.js +1 -1
  62. package/dist/{tree-package-fragment-1pdDnhZ_.d.ts → note-lifecycle-D4AOFCAt.d.ts} +142 -141
  63. package/dist/{note-properties-RjYgbmXe.d.ts → note-properties-CcXUgqr8.d.ts} +2 -2
  64. package/dist/{omml-equation-hcP9AUFX.d.ts → omml-equation-C5P6Ym3v.d.ts} +1 -1
  65. package/dist/output.cjs +1 -1
  66. package/dist/output.d.ts +7 -7
  67. package/dist/output.js +1 -1
  68. package/dist/{protocol-OdRd17KZ.d.ts → protocol-CsawNZkt.d.ts} +14 -4
  69. package/dist/{review-paragraph-order--jLHXIcd.d.ts → review-paragraph-order-BCIqjopY.d.ts} +2 -3
  70. package/dist/{revision-projection-BIHO_qvw.d.ts → revision-projection-BcRnC4Yj.d.ts} +1 -1
  71. package/dist/{semantic-cell-selection-lCYAVCCF.d.ts → semantic-cell-selection-R9wrenwR.d.ts} +4 -4
  72. package/dist/{semantic-interaction-0vQXcMZk.d.ts → semantic-interaction-B7beVwH7.d.ts} +1 -1
  73. package/dist/{semantic-paint-BSan4pBk.d.ts → semantic-paint-CLvHwf8y.d.ts} +2 -2
  74. package/dist/{semantic-records-ZcYuB4-H.d.ts → semantic-records-CbXwnS80.d.ts} +5 -4
  75. package/dist/store.cjs +1 -1
  76. package/dist/store.d.ts +13 -14
  77. package/dist/store.js +1 -1
  78. package/dist/{tree-session-contract-Cgn6fQ-M.d.ts → tree-session-contract-DTQxw2zL.d.ts} +5 -5
  79. package/dist/{tree-op-types-DbdM7fJV.d.ts → types-barrel-CEOy-Jv0.d.ts} +961 -210
  80. package/package.json +2 -2
  81. package/dist/chunk-5BI4SIHO.cjs +0 -1
  82. package/dist/chunk-6ESSCMXL.js +0 -2
  83. package/dist/chunk-6W4DIR4X.cjs +0 -2
  84. package/dist/chunk-AKQRKR2H.js +0 -1
  85. package/dist/chunk-FBWBSHC4.cjs +0 -11
  86. package/dist/chunk-IA7WTZHI.js +0 -11
  87. package/dist/chunk-IXGUCLER.js +0 -20
  88. package/dist/chunk-NDPLQG4Y.cjs +0 -18
  89. package/dist/chunk-NLGUL6QL.js +0 -3
  90. package/dist/chunk-OWUSDS3L.cjs +0 -20
  91. package/dist/chunk-TUCDPXBD.js +0 -18
  92. package/dist/chunk-VSCPFHTD.cjs +0 -3
  93. package/dist/chunk-ZUGTEKLM.js +0 -4
  94. package/dist/review-items-CJz-kAW8.d.ts +0 -370
package/dist/editor.d.ts CHANGED
@@ -1,38 +1,36 @@
1
- import { O as OoxmlPart, J as TreeDocColorValue, m as DrawingPositionInput } from './tree-op-types-DbdM7fJV.js';
2
- export { K as DEFAULT_IMAGE_RESOURCE_LIMITS, L as IMAGE_WRAP_TARGETS, t as ImageDecodePort, v as ImageResourceLimits, I as ImageWrapTarget, k as RenderableImageMime, p as SupportedImageMime, M as TEXT_FORM_FORMATS, s as VectorImageMime, N as resolveImageResourceLimits, Q as resolveSvgIntrinsicSize, U as sniffImageMime, W as validateRasterHeader } from './tree-op-types-DbdM7fJV.js';
3
- import { ColorValue, ParagraphTabStop } from './contracts/types.js';
4
- export { ParagraphFlags } from './contracts/types.js';
5
- export { R as ReviewModelInput } from './review-items-CJz-kAW8.js';
1
+ export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, b as ImageDecodePort, c as ImageResourceLimits, R as RenderableImageMime, S as SupportedImageMime, a as VectorImageMime, r as resolveImageResourceLimits, d as resolveSvgIntrinsicSize, s as sniffImageMime, v as validateRasterHeader } from './image-resources-C51LuAAu.js';
2
+ import { O as OoxmlPart, aD as TreeDocColorValue, t as ColorValue, aa as DrawingPositionInput, G as ParagraphTabStop } from './types-barrel-CEOy-Jv0.js';
3
+ export { aE as IMAGE_WRAP_TARGETS, a9 as ImageWrapTarget, F as ParagraphFlags, R as ReviewModelInput, aF as TEXT_FORM_FORMATS } from './types-barrel-CEOy-Jv0.js';
6
4
  export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.js';
7
- import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-Cgn6fQ-M.js';
8
- export { a as TreeApplyResult } from './tree-session-contract-Cgn6fQ-M.js';
9
- import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-WXbTSXx1.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-WXbTSXx1.js';
11
- import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-Dqu3JW3p.js';
12
- export { d as disposeLayoutShaping } from './layout-shaping-Dqu3JW3p.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-BSrKnTeR.js';
14
- import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-C3As-Xxp.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 ContentControlWidgetChromeHandlers, q as ContentControlWidgetSession, r as CustomFontsOptions, s as CustomFontsResolver, t as DEFAULT_TABLE_CHROME_DRAFT, u as DocxEditorConfig, v as DrawingSelectionIntent, E as EMU_PER_POINT, w as EquationActivation, x as EquationChromeHandlers, y as EquationOps, F as FinalizedImageOverlayInteraction, z as FontLoadFailure, B as FontLoadFailureReason, G as FontMeasurementState, H as FontUrlSource, I as HyperlinkActivation, J as HyperlinkChromeHandlers, K as HyperlinkOps, L as IMAGE_OVERLAY_NUDGE_PT, M as IMAGE_OVERLAY_NUDGE_SHIFT_PT, N as ImageInteractionSession, Q as ImageOverlayScrollPort, R as ImageResizeHandle, S as ImageResizeResult, U as InvalidTextFormFieldChromeHandlers, V as InvalidTextFormFieldSession, W as LoadFontsRequest, X as LoadFontsResult, Y as OverlayFrameRect, Z as PaginatedSurfaceState, _ as ParagraphPropertyEdit, $ as PopupChromeRegistrationOptions, a0 as RemoteCaretLabelAnchor, a1 as RemoteCaretLabelHost, a2 as ReviewWriteIntent, a3 as RunTableChromeCommandResult, a4 as SectionAnchor, a5 as SectionBreakInsertType, a6 as SelectedDrawingOverlayTarget, a7 as SurfaceEquation, a8 as SurfaceFormatting, a9 as SurfaceHyperlink, aa as SurfaceInsertImageInput, ab as SurfaceNavigation, ac as SurfaceOverlayCoordinates, ad as SurfaceParagraphFormat, ae as TABLE_BORDER_STYLE_OPTIONS, af as TABLE_BORDER_TARGET_OPTIONS, ag as TABLE_BORDER_WIDTH_OPTIONS, ah as TABLE_CHROME_SLOT_IDS, ai as TableBorderStyleOption, aj as TableBorderTargetOption, ak as TableBorderTargetValue, al as TableBorderWidthOption, am as TableChromeDraft, an as TableChromePick, ao as TableChromeSlotId, ap as TableInteractionLabelKey, aq as TextFormFieldChromeHandlers, ar as TextFormFieldDialogSession, as as ToolbarCommandState, at as applyTableChromePick, au as blankDocumentBytes, av as canExecuteImageCommand, aw as captureImageMutationPreconditions, ax as chromeControlCount, ay as chromeMenuSlots, az as chromeProbeForSlot, aA as chromeSlotId, aB as chromeSlotIsToggle, aC as commandForSlot, aD as commandForSlotValue, aE as commandForTableChromeSlotValue, aF as computeImageResizeResult, aG as computeMovedImagePosition, aH as computeResizedImageExtentEmu, aI as createDocxEditor, aJ as createFontSource, aK as createImageOverlayScrollPort, aL as cssPixelsToLayoutPoints, aM as customFonts, aN as defaultChromeGroups, aO as defaultTableLabel, aP as emuToOverlayPoints, aQ as equationAtPosition, aR as executeImageCommand, aS as finalizeImageOverlayInteraction, aT as formattingBarChromeGroups, aU as isStaleImageInteractionCommit, aV as isTableChromeSlot, aW as layoutPointsToCssPixels, aX as loadFonts, aY as overlayFrameToSheetCssPixels, aZ as overlayHostOrigin, a_ as pointsToEmu, a$ as probeTableChromeCommand, b0 as resizePreservesAspect, b1 as runSave, b2 as runTableChromeCommand, b3 as runTableCommand, b4 as runToolbarCommand, b5 as selectedDrawingOverlayTargetOf, b6 as selectedImageStateOf, b7 as surfacePaintScale, b8 as tableChromeIconPaths, b9 as tableChromeLabelKeyForTarget, ba as tableChromeToolbarState, bb as tableChromeVisible, bc as tableCommandToolbarState, bd as toolbarCommandState, be as toolbarCommandStates } from './index-C3As-Xxp.js';
16
- import { A as AutomationCapabilities, a as AutomationHost } from './protocol-OdRd17KZ.js';
17
- import { S as SemanticLayout } from './semantic-records-ZcYuB4-H.js';
18
- export { T as TextMeasurer } from './semantic-records-ZcYuB4-H.js';
19
- export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-0vQXcMZk.js';
20
- export { S as SectionProperties } from './semantic-cell-selection-lCYAVCCF.js';
21
- export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-BSan4pBk.js';
5
+ import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-DTQxw2zL.js';
6
+ export { a as TreeApplyResult } from './tree-session-contract-DTQxw2zL.js';
7
+ import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-BgtcHulQ.js';
8
+ 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-BgtcHulQ.js';
9
+ import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-CKBUSaS7.js';
10
+ export { d as disposeLayoutShaping } from './layout-shaping-CKBUSaS7.js';
11
+ 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-Bv2Z25-J.js';
12
+ import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-3lr8xXF8.js';
13
+ 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 ContentControlWidgetChromeHandlers, q as ContentControlWidgetSession, r as CustomFontsOptions, s as CustomFontsResolver, t as DEFAULT_TABLE_CHROME_DRAFT, u as DocxEditorConfig, v as DrawingSelectionIntent, E as EMU_PER_POINT, w as EquationActivation, x as EquationChromeHandlers, y as EquationOps, F as FinalizedImageOverlayInteraction, z as FontLoadFailure, B as FontLoadFailureReason, G as FontMeasurementState, H as FontUrlSource, I as HyperlinkActivation, J as HyperlinkChromeHandlers, K as HyperlinkOps, L as IMAGE_OVERLAY_NUDGE_PT, M as IMAGE_OVERLAY_NUDGE_SHIFT_PT, N as ImageInteractionSession, Q as ImageOverlayScrollPort, R as ImageResizeHandle, S as ImageResizeResult, U as InvalidTextFormFieldChromeHandlers, V as InvalidTextFormFieldSession, W as LoadFontsRequest, X as LoadFontsResult, Y as OverlayFrameRect, Z as PaginatedSurfaceState, _ as ParagraphPropertyEdit, $ as PopupChromeRegistrationOptions, a0 as RemoteCaretLabelAnchor, a1 as RemoteCaretLabelHost, a2 as ReviewWriteIntent, a3 as RunTableChromeCommandResult, a4 as SectionAnchor, a5 as SectionBreakInsertType, a6 as SelectedDrawingOverlayTarget, a7 as SurfaceEquation, a8 as SurfaceFormatting, a9 as SurfaceHyperlink, aa as SurfaceInsertImageInput, ab as SurfaceNavigation, ac as SurfaceOverlayCoordinates, ad as SurfaceParagraphFormat, ae as TABLE_BORDER_STYLE_OPTIONS, af as TABLE_BORDER_TARGET_OPTIONS, ag as TABLE_BORDER_WIDTH_OPTIONS, ah as TABLE_CHROME_SLOT_IDS, ai as TableBorderStyleOption, aj as TableBorderTargetOption, ak as TableBorderTargetValue, al as TableBorderWidthOption, am as TableChromeDraft, an as TableChromePick, ao as TableChromeSlotId, ap as TableInteractionLabelKey, aq as TextFormFieldChromeHandlers, ar as TextFormFieldDialogSession, as as ToolbarCommandState, at as applyTableChromePick, au as blankDocumentBytes, av as canExecuteImageCommand, aw as captureImageMutationPreconditions, ax as chromeControlCount, ay as chromeMenuSlots, az as chromeProbeForSlot, aA as chromeSlotId, aB as chromeSlotIsToggle, aC as commandForSlot, aD as commandForSlotValue, aE as commandForTableChromeSlotValue, aF as computeImageResizeResult, aG as computeMovedImagePosition, aH as computeResizedImageExtentEmu, aI as createDocxEditor, aJ as createFontSource, aK as createImageOverlayScrollPort, aL as cssPixelsToLayoutPoints, aM as customFonts, aN as defaultChromeGroups, aO as defaultTableLabel, aP as emuToOverlayPoints, aQ as equationAtPosition, aR as executeImageCommand, aS as finalizeImageOverlayInteraction, aT as formattingBarChromeGroups, aU as isStaleImageInteractionCommit, aV as isTableChromeSlot, aW as layoutPointsToCssPixels, aX as loadFonts, aY as overlayFrameToSheetCssPixels, aZ as overlayHostOrigin, a_ as pointsToEmu, a$ as probeTableChromeCommand, b0 as resizePreservesAspect, b1 as runSave, b2 as runTableChromeCommand, b3 as runTableCommand, b4 as runToolbarCommand, b5 as selectedDrawingOverlayTargetOf, b6 as selectedImageStateOf, b7 as surfacePaintScale, b8 as tableChromeIconPaths, b9 as tableChromeLabelKeyForTarget, ba as tableChromeToolbarState, bb as tableChromeVisible, bc as tableCommandToolbarState, bd as toolbarCommandState, be as toolbarCommandStates } from './index-3lr8xXF8.js';
14
+ import { A as AutomationCapabilities, a as AutomationHost } from './protocol-CsawNZkt.js';
15
+ import { S as SemanticLayout } from './semantic-records-CbXwnS80.js';
16
+ export { T as TextMeasurer } from './semantic-records-CbXwnS80.js';
17
+ export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-B7beVwH7.js';
18
+ export { S as SectionProperties } from './semantic-cell-selection-R9wrenwR.js';
19
+ export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-CLvHwf8y.js';
22
20
  export { CollaborationModuleContribution } from './collaboration.js';
23
- import './revision-projection-BIHO_qvw.js';
24
- import './tree-package-fragment-1pdDnhZ_.js';
21
+ import './revision-projection-BcRnC4Yj.js';
22
+ import './note-lifecycle-D4AOFCAt.js';
25
23
  import './collaboration/replication.js';
26
24
  import './failure-DNNmwsgD.js';
27
- import './custom-node-writes-BqIv94ei.js';
28
- import './headless-document-view-C4ttQJ5H.js';
25
+ import './custom-node-writes-piokwVR5.js';
26
+ import './headless-document-view-DHKMN_3Y.js';
29
27
  import 'prosemirror-model';
30
28
  import './editor-scope-DZJT4ukT.js';
31
29
  import './contracts/document.js';
32
30
  import './contracts/interaction.js';
33
- import './document-protection-BL5zp8cU.js';
34
- import './note-properties-RjYgbmXe.js';
35
- import './omml-equation-hcP9AUFX.js';
31
+ import './document-protection-C6RvCHx-.js';
32
+ import './note-properties-CcXUgqr8.js';
33
+ import './omml-equation-C5P6Ym3v.js';
36
34
 
37
35
  declare function toEditorFontError(error: unknown): EditorFontError;
38
36
  declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<LayoutShapingOptions>;
package/dist/editor.js CHANGED
@@ -1 +1 @@
1
- export{Ia as AUTO_ZOOM_MODE,Na as BROWSER_AUTOMATION_CAPABILITIES,va as CHROME_GROUPS,za as CHROME_MENUS,Ca as CHROME_UNAVAILABLE_KEY,X as DEFAULT_TABLE_CHROME_DRAFT,P as EMU_PER_POINT,Ja as FIT_WIDTH_ZOOM_MODE,N as IMAGE_OVERLAY_NUDGE_PT,O as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,db as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ba as TABLE_BORDER_STYLE_OPTIONS,aa as TABLE_BORDER_TARGET_OPTIONS,ca as TABLE_BORDER_WIDTH_OPTIONS,Y as TABLE_CHROME_SLOT_IDS,$a as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Ha as ZOOM_MAX,Ga as ZOOM_MIN,da as applyTableChromePick,x as applyThemeShade,w as applyThemeTint,d as blankDocumentBytes,L as canExecuteImageCommand,K as captureImageMutationPreconditions,gb as changedFields,Ba as chromeControlCount,Aa as chromeMenuSlots,ha as chromeProbeForSlot,wa as chromeSlotId,na as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ia as commandForSlot,ka as commandForSlotValue,ja as commandForTableChromeSlotValue,Va as computeImageResizeResult,U as computeMovedImagePosition,T as computeResizedImageExtentEmu,Oa as createBrowserAutomationHost,Ma as createDocxEditor,i as createFontSource,Wa as createImageOverlayScrollPort,b as createLayoutShaping,H as cropPercentFromCropPermille,F as cropPercentFromPermille,C as cropPercentFromSourceCrop,G as cropPermilleFromCropPercent,E as cropPermilleFromPercent,Ra as cssPixelsToLayoutPoints,j as customFonts,xa as defaultChromeGroups,Z as defaultTableLabel,u as dragIndent,ua as editorCommandKey,S as emuToOverlayPoints,Ea as equationAtPosition,M as executeImageCommand,Xa as finalizeImageOverlayInteraction,Za as formatInches,ya as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,_a as inchesToTwips,V as isStaleImageInteractionCommit,_ as isTableChromeSlot,Qa as layoutPointsToCssPixels,h as loadFonts,z as lowerColorValueForBorder,A as lowerColorValueForFill,eb as mixedFieldsOf,Fa as mountPaginatedSurface,Sa as overlayFrameToSheetCssPixels,Ta as overlayHostOrigin,g as partOfNodeId,R as pointsToEmu,ea as probeTableChromeCommand,Ua as resizePreservesAspect,B as resolveColorValueToCss,y as resolveThemeColorHex,Ka as resolveZoomMode,n as rulerPageBox,ra as runSave,pa as runTableChromeCommand,ta as runTableCommand,qa as runToolbarCommand,fb as sameTabStops,La as sameZoomMode,cb as seedFields,Q as selectedDrawingOverlayTargetOf,J as selectedImageStateOf,bb as signedFirstLineOf,t as snapTwips,D as sourceCropFromCropPercent,ab as specialOf,Da as surfaceExtent,Pa as surfacePaintScale,ga as tableChromeIconPaths,fa as tableChromeLabelKeyForTarget,la as tableChromeToolbarState,$ as tableChromeVisible,W as tableCommandState,sa as tableCommandToolbarState,a as toEditorFontError,ma as toolbarCommandState,oa as toolbarCommandStates,ib as trapTabWithin,Ya as twipsToInches,I as validateImageCropPercent,v as validateThemeModifier,hb as withTabStop}from'./chunk-IXGUCLER.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-TSDGKNV7.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-BUNY5MRX.js';export{H as disposeLayoutShaping}from'./chunk-ZUGTEKLM.js';import'./chunk-RIYSCEFQ.js';import'./chunk-6ESSCMXL.js';import'./chunk-AKQRKR2H.js';import'./chunk-TUCDPXBD.js';import'./chunk-BJQDNKEX.js';import'./chunk-2QU7QTM7.js';import'./chunk-UOE4WKL7.js';import'./chunk-VP7SDFCM.js';import'./chunk-NLGUL6QL.js';import'./chunk-6JIJOZDW.js';import'./chunk-3SU7UWCR.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Th as DRAWING_REL_FROM_H,Uh as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,bh as TEXT_FORM_FORMATS,Wh as positionInputFromPropertiesCommand,Vh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,Sh as validateDrawingPositionInput,yb as validateRasterHeader,Xh as validateSetImagePositionCommand}from'./chunk-IA7WTZHI.js';import'./chunk-GOEBQ26R.js';
1
+ export{Ia as AUTO_ZOOM_MODE,Na as BROWSER_AUTOMATION_CAPABILITIES,va as CHROME_GROUPS,za as CHROME_MENUS,Ca as CHROME_UNAVAILABLE_KEY,X as DEFAULT_TABLE_CHROME_DRAFT,P as EMU_PER_POINT,Ja as FIT_WIDTH_ZOOM_MODE,N as IMAGE_OVERLAY_NUDGE_PT,O as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,db as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ba as TABLE_BORDER_STYLE_OPTIONS,aa as TABLE_BORDER_TARGET_OPTIONS,ca as TABLE_BORDER_WIDTH_OPTIONS,Y as TABLE_CHROME_SLOT_IDS,$a as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Ha as ZOOM_MAX,Ga as ZOOM_MIN,da as applyTableChromePick,x as applyThemeShade,w as applyThemeTint,d as blankDocumentBytes,L as canExecuteImageCommand,K as captureImageMutationPreconditions,gb as changedFields,Ba as chromeControlCount,Aa as chromeMenuSlots,ha as chromeProbeForSlot,wa as chromeSlotId,na as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ia as commandForSlot,ka as commandForSlotValue,ja as commandForTableChromeSlotValue,Va as computeImageResizeResult,U as computeMovedImagePosition,T as computeResizedImageExtentEmu,Oa as createBrowserAutomationHost,Ma as createDocxEditor,i as createFontSource,Wa as createImageOverlayScrollPort,b as createLayoutShaping,H as cropPercentFromCropPermille,F as cropPercentFromPermille,C as cropPercentFromSourceCrop,G as cropPermilleFromCropPercent,E as cropPermilleFromPercent,Ra as cssPixelsToLayoutPoints,j as customFonts,xa as defaultChromeGroups,Z as defaultTableLabel,u as dragIndent,ua as editorCommandKey,S as emuToOverlayPoints,Ea as equationAtPosition,M as executeImageCommand,Xa as finalizeImageOverlayInteraction,Za as formatInches,ya as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,_a as inchesToTwips,V as isStaleImageInteractionCommit,_ as isTableChromeSlot,Qa as layoutPointsToCssPixels,h as loadFonts,z as lowerColorValueForBorder,A as lowerColorValueForFill,eb as mixedFieldsOf,Fa as mountPaginatedSurface,Sa as overlayFrameToSheetCssPixels,Ta as overlayHostOrigin,g as partOfNodeId,R as pointsToEmu,ea as probeTableChromeCommand,Ua as resizePreservesAspect,B as resolveColorValueToCss,y as resolveThemeColorHex,Ka as resolveZoomMode,n as rulerPageBox,ra as runSave,pa as runTableChromeCommand,ta as runTableCommand,qa as runToolbarCommand,fb as sameTabStops,La as sameZoomMode,cb as seedFields,Q as selectedDrawingOverlayTargetOf,J as selectedImageStateOf,bb as signedFirstLineOf,t as snapTwips,D as sourceCropFromCropPercent,ab as specialOf,Da as surfaceExtent,Pa as surfacePaintScale,ga as tableChromeIconPaths,fa as tableChromeLabelKeyForTarget,la as tableChromeToolbarState,$ as tableChromeVisible,W as tableCommandState,sa as tableCommandToolbarState,a as toEditorFontError,ma as toolbarCommandState,oa as toolbarCommandStates,ib as trapTabWithin,Ya as twipsToInches,I as validateImageCropPercent,v as validateThemeModifier,hb as withTabStop}from'./chunk-EHBPYFRE.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-MZPNLIP3.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-OHVJYJOA.js';export{H as disposeLayoutShaping}from'./chunk-3EZO3O6I.js';import'./chunk-RIYSCEFQ.js';import'./chunk-7VMVDRRU.js';import'./chunk-6UCDHGXI.js';import'./chunk-H6WDEAOJ.js';import'./chunk-JRBGCIR2.js';import'./chunk-CAIWEQLC.js';import'./chunk-P4TGGDK3.js';import'./chunk-VP7SDFCM.js';import'./chunk-KLQXP27K.js';import'./chunk-6JIJOZDW.js';import'./chunk-IW35GWJN.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Wh as DRAWING_REL_FROM_H,Xh as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,ch as TEXT_FORM_FORMATS,Zh as positionInputFromPropertiesCommand,Yh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,Vh as validateDrawingPositionInput,yb as validateRasterHeader,_h as validateSetImagePositionCommand}from'./chunk-CF3JR35B.js';import'./chunk-GOEBQ26R.js';
package/dist/export.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk7VO6BLKV_cjs=require('./chunk-7VO6BLKV.cjs'),chunkJWHXOJEU_cjs=require('./chunk-JWHXOJEU.cjs'),chunk5BI4SIHO_cjs=require('./chunk-5BI4SIHO.cjs'),chunkNDPLQG4Y_cjs=require('./chunk-NDPLQG4Y.cjs'),chunk76F73CY6_cjs=require('./chunk-76F73CY6.cjs');require('./chunk-FGBADUSK.cjs');var chunkVSCPFHTD_cjs=require('./chunk-VSCPFHTD.cjs'),chunkFBWBSHC4_cjs=require('./chunk-FBWBSHC4.cjs');var B=chunkJWHXOJEU_cjs.b;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:chunkJWHXOJEU_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkJWHXOJEU_cjs.d?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof chunkJWHXOJEU_cjs.d||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunk5BI4SIHO_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkJWHXOJEU_cjs.g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof chunkJWHXOJEU_cjs.d?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=chunkNDPLQG4Y_cjs.z(n.style,n.fontSlot),i=chunkNDPLQG4Y_cjs.j(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!chunkJWHXOJEU_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkJWHXOJEU_cjs.ma(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=chunkJWHXOJEU_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkJWHXOJEU_cjs.s(),chunkJWHXOJEU_cjs.x(chunkJWHXOJEU_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkJWHXOJEU_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkNDPLQG4Y_cjs.b()})}async function Ze(e,o){if(!chunkJWHXOJEU_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkJWHXOJEU_cjs.H(e,t,chunkJWHXOJEU_cjs.y,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${chunkNDPLQG4Y_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkJWHXOJEU_cjs.A(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=chunkJWHXOJEU_cjs.C(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=chunkJWHXOJEU_cjs.B(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await chunkJWHXOJEU_cjs.H(e,s,chunkJWHXOJEU_cjs.y,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${chunkNDPLQG4Y_cjs.a}`].join("|"),extensionFingerprint:i}));return I.set(e,a),a.catch(()=>{I.get(e)===a&&I.delete(e);}),a}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=chunkFBWBSHC4_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkFBWBSHC4_cjs.Sd(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunk7VO6BLKV_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkJWHXOJEU_cjs.g(a))),i=chunk7VO6BLKV_cjs.o(t,{maxFontBytes:chunkJWHXOJEU_cjs.a,aggregateBudget:Rt(n),shadowedRequests:r});if(o)for(let a of i.dropped){if(o.dropped.length>=B)break;o.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkJWHXOJEU_cjs.c:Math.max(0,chunkJWHXOJEU_cjs.c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>chunkJWHXOJEU_cjs.c)throw new chunk5BI4SIHO_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkJWHXOJEU_cjs.c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkFBWBSHC4_cjs.da||t.namespaceUri===""))?.value}async function vt(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunkVSCPFHTD_cjs.Za(e);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof chunk5BI4SIHO_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunk5BI4SIHO_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunk5BI4SIHO_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d=p.session,m=s,f="active",x=()=>f==="aborted"?new chunk5BI4SIHO_cjs.d("aborted","Export resource settlement was aborted"):new chunk5BI4SIHO_cjs.d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,chunk7VO6BLKV_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunk7VO6BLKV_cjs.l(f,{families:s,defaultFamily:chunk7VO6BLKV_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunk7VO6BLKV_cjs.e(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(chunkJWHXOJEU_cjs.E(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(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 Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new chunk5BI4SIHO_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s,p)=>{let d=chunk76F73CY6_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunk7VO6BLKV_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunk7VO6BLKV_cjs.s(s,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=chunkFBWBSHC4_cjs.Of(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkFBWBSHC4_cjs.Pf(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=chunkFBWBSHC4_cjs.id(i),l=chunkFBWBSHC4_cjs.hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===chunkFBWBSHC4_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunkFBWBSHC4_cjs.da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=chunkNDPLQG4Y_cjs.X(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=chunkFBWBSHC4_cjs.la||d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkNDPLQG4Y_cjs.lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkNDPLQG4Y_cjs._(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunkFBWBSHC4_cjs.ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkNDPLQG4Y_cjs.aa(n),y){let E=chunkNDPLQG4Y_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=chunkNDPLQG4Y_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkNDPLQG4Y_cjs.kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}chunkNDPLQG4Y_cjs.ba(n);}continue}if(d.namespaceUri===chunkFBWBSHC4_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkNDPLQG4Y_cjs.$(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkNDPLQG4Y_cjs.ca(n)&&d.namespaceUri===chunkFBWBSHC4_cjs.da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:chunkFBWBSHC4_cjs.ma(d,x)});}}chunkNDPLQG4Y_cjs.Y(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunkFBWBSHC4_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunkFBWBSHC4_cjs.da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==chunkFBWBSHC4_cjs.da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=chunk76F73CY6_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(chunkNDPLQG4Y_cjs.Ab),i.namespaceUri===chunkFBWBSHC4_cjs.da&&i.localName==="sym"&&t(chunk76F73CY6_cjs.b(wt(i,"font"))),i.namespaceUri===chunkFBWBSHC4_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkNDPLQG4Y_cjs.jc(a??"")?.font??null);}if(i.namespaceUri===chunkFBWBSHC4_cjs.da&&i.localName==="p")for(let a of chunk7VO6BLKV_cjs.u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=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(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(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 zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkJWHXOJEU_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkJWHXOJEU_cjs.a}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(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 Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(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 o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
2
- Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=Y;exports.acquireSharedExportShaping=gt;exports.createPackagedFileFetch=Yt;exports.hasExportAdmittedFont=q;exports.hasExportLaidOutText=X;exports.hasFontBackedExportCapabilities=Ot;exports.openFontBackedDocumentForExport=vt;
1
+ 'use strict';var chunkPIBYJZIH_cjs=require('./chunk-PIBYJZIH.cjs'),chunkOA6LFCTG_cjs=require('./chunk-OA6LFCTG.cjs'),chunkGSEUM6AI_cjs=require('./chunk-GSEUM6AI.cjs'),chunkI6LSEDUL_cjs=require('./chunk-I6LSEDUL.cjs'),chunkWTILOUPG_cjs=require('./chunk-WTILOUPG.cjs');require('./chunk-FGBADUSK.cjs');var chunkK5HIOS6J_cjs=require('./chunk-K5HIOS6J.cjs'),chunkDGSJZMAE_cjs=require('./chunk-DGSJZMAE.cjs');var B=chunkOA6LFCTG_cjs.b;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:chunkOA6LFCTG_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkOA6LFCTG_cjs.d?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof chunkOA6LFCTG_cjs.d||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunkGSEUM6AI_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkOA6LFCTG_cjs.g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof chunkOA6LFCTG_cjs.d?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=chunkI6LSEDUL_cjs.z(n.style,n.fontSlot),i=chunkI6LSEDUL_cjs.j(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!chunkOA6LFCTG_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkOA6LFCTG_cjs.ma(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=chunkOA6LFCTG_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkOA6LFCTG_cjs.s(),chunkOA6LFCTG_cjs.x(chunkOA6LFCTG_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkOA6LFCTG_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkI6LSEDUL_cjs.b()})}async function Ze(e,o){if(!chunkOA6LFCTG_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkOA6LFCTG_cjs.H(e,t,chunkOA6LFCTG_cjs.y,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${chunkI6LSEDUL_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkOA6LFCTG_cjs.A(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=chunkOA6LFCTG_cjs.C(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=chunkOA6LFCTG_cjs.B(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await chunkOA6LFCTG_cjs.H(e,s,chunkOA6LFCTG_cjs.y,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${chunkI6LSEDUL_cjs.a}`].join("|"),extensionFingerprint:i}));return I.set(e,a),a.catch(()=>{I.get(e)===a&&I.delete(e);}),a}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=chunkDGSJZMAE_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkDGSJZMAE_cjs.Sd(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunkPIBYJZIH_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkOA6LFCTG_cjs.g(a))),i=chunkPIBYJZIH_cjs.o(t,{maxFontBytes:chunkOA6LFCTG_cjs.a,aggregateBudget:Rt(n),shadowedRequests:r});if(o)for(let a of i.dropped){if(o.dropped.length>=B)break;o.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkOA6LFCTG_cjs.c:Math.max(0,chunkOA6LFCTG_cjs.c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>chunkOA6LFCTG_cjs.c)throw new chunkGSEUM6AI_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkOA6LFCTG_cjs.c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkDGSJZMAE_cjs.da||t.namespaceUri===""))?.value}async function vt(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunkK5HIOS6J_cjs._a(e);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof chunkGSEUM6AI_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunkGSEUM6AI_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunkGSEUM6AI_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d=p.session,m=s,f="active",x=()=>f==="aborted"?new chunkGSEUM6AI_cjs.d("aborted","Export resource settlement was aborted"):new chunkGSEUM6AI_cjs.d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,chunkPIBYJZIH_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunkPIBYJZIH_cjs.l(f,{families:s,defaultFamily:chunkPIBYJZIH_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunkPIBYJZIH_cjs.e(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(chunkOA6LFCTG_cjs.E(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(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 Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new chunkGSEUM6AI_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s,p)=>{let d=chunkWTILOUPG_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunkPIBYJZIH_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunkPIBYJZIH_cjs.s(s,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=chunkDGSJZMAE_cjs.Pf(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkDGSJZMAE_cjs.Qf(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=chunkDGSJZMAE_cjs.id(i),l=chunkDGSJZMAE_cjs.hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===chunkDGSJZMAE_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunkDGSJZMAE_cjs.da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=chunkI6LSEDUL_cjs.ga(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=chunkDGSJZMAE_cjs.la||d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkI6LSEDUL_cjs.lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkI6LSEDUL_cjs.ja(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunkDGSJZMAE_cjs.ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkI6LSEDUL_cjs.la(n),y){let E=chunkI6LSEDUL_cjs.ia(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=chunkI6LSEDUL_cjs.ia(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkI6LSEDUL_cjs.kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}chunkI6LSEDUL_cjs.ma(n);}continue}if(d.namespaceUri===chunkDGSJZMAE_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkI6LSEDUL_cjs.ka(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkI6LSEDUL_cjs.na(n)&&d.namespaceUri===chunkDGSJZMAE_cjs.da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:chunkDGSJZMAE_cjs.ma(d,x)});}}chunkI6LSEDUL_cjs.ha(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunkDGSJZMAE_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunkDGSJZMAE_cjs.da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==chunkDGSJZMAE_cjs.da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=chunkWTILOUPG_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(chunkI6LSEDUL_cjs.wb),i.namespaceUri===chunkDGSJZMAE_cjs.da&&i.localName==="sym"&&t(chunkWTILOUPG_cjs.b(wt(i,"font"))),i.namespaceUri===chunkDGSJZMAE_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkI6LSEDUL_cjs.fc(a??"")?.font??null);}if(i.namespaceUri===chunkDGSJZMAE_cjs.da&&i.localName==="p")for(let a of chunkPIBYJZIH_cjs.u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=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(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(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 zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkOA6LFCTG_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkOA6LFCTG_cjs.a}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(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 Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(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 o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
2
+ Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkGSEUM6AI_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkGSEUM6AI_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkGSEUM6AI_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkGSEUM6AI_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=Y;exports.acquireSharedExportShaping=gt;exports.createPackagedFileFetch=Yt;exports.hasExportAdmittedFont=q;exports.hasExportLaidOutText=X;exports.hasFontBackedExportCapabilities=Ot;exports.openFontBackedDocumentForExport=vt;
package/dist/export.d.ts CHANGED
@@ -1,19 +1,18 @@
1
- import { P as PreservedImageMime, v as ImageResourceLimits, p as SupportedImageMime, t as ImageDecodePort } from './tree-op-types-DbdM7fJV.js';
2
- import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-C4ttQJ5H.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-ZcYuB4-H.js';
4
- import { R as RevisionDisplayMode } from './revision-projection-BIHO_qvw.js';
5
- import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-Dqu3JW3p.js';
6
- import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-BSrKnTeR.js';
7
- import './contracts/types.js';
8
- import './tree-package-fragment-1pdDnhZ_.js';
9
- import './omml-equation-hcP9AUFX.js';
10
- import './editor-WXbTSXx1.js';
1
+ import { P as PreservedImageMime, c as ImageResourceLimits, S as SupportedImageMime, b as ImageDecodePort } from './image-resources-C51LuAAu.js';
2
+ 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-CbXwnS80.js';
3
+ import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-DHKMN_3Y.js';
4
+ import { R as RevisionDisplayMode } from './revision-projection-BcRnC4Yj.js';
5
+ import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-CKBUSaS7.js';
6
+ import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-Bv2Z25-J.js';
7
+ import './types-barrel-CEOy-Jv0.js';
8
+ import './omml-equation-C5P6Ym3v.js';
9
+ import './note-lifecycle-D4AOFCAt.js';
10
+ import './editor-BgtcHulQ.js';
11
11
  import './contracts/document.js';
12
12
  import './editor-scope-DZJT4ukT.js';
13
- import './review-items-CJz-kAW8.js';
14
13
  import './contracts/interaction.js';
15
- import './semantic-interaction-0vQXcMZk.js';
16
- import './document-protection-BL5zp8cU.js';
14
+ import './semantic-interaction-B7beVwH7.js';
15
+ import './document-protection-C6RvCHx-.js';
17
16
  import './failure-DNNmwsgD.js';
18
17
 
19
18
  /** Source content that cannot be certified by the layout snapshot. @public */
package/dist/export.js CHANGED
@@ -1,2 +1,2 @@
1
- import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-BUNY5MRX.js';import {z as z$1,B as B$1,A as A$1,c,G as G$1,x,D,r,w,ma,la,oa,g,a as a$1,d as d$3,b as b$2,h}from'./chunk-ZUGTEKLM.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-AKQRKR2H.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-AKQRKR2H.js';import {a,z as z$2,j as j$1,b,jc,X as X$1,lc,_,aa,Z as Z$1,kc,ba,$ as $$1,ca,Y as Y$1,Ab}from'./chunk-TUCDPXBD.js';import {d as d$2,b as b$1,a as a$2}from'./chunk-2QU7QTM7.js';import'./chunk-VP7SDFCM.js';import {Za}from'./chunk-NLGUL6QL.js';import {Of,Pf,id,hd,da,E,Sd,la as la$1,ke,ma as ma$1}from'./chunk-IA7WTZHI.js';var B=b$2;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof d$3||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof d$3?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=z$2(n.style,n.fontSlot),i=j$1(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!ma(e.shaper,e.environment,l,r,t))return null;let u=la(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=c;function Ye(){if(T)return T;let e=(async()=>(await r(),w(x)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return oa(e,{resolveFont(t){return Xe(e,o,t)},fallback:b()})}async function Ze(e,o){if(!z$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await G$1(e,t,x,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!z$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=B$1(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=A$1(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await G$1(e,s,x,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a$1=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:i}));return I.set(e,a$1),a$1.catch(()=>{I.get(e)===a$1&&I.delete(e);}),a$1}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),Sd(o,n)}function Qe(e,o$1){let t=bt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>g(a))),i=o(t,{maxFontBytes:a$1,aggregateBudget:Rt(n),shadowedRequests:r});if(o$1)for(let a of i.dropped){if(o$1.dropped.length>=B)break;o$1.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===da||t.namespaceUri===""))?.value}async function vt(e$1,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=Za(e$1);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d$1=p.session,m=s,f="active",x=()=>f==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d$1.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d$1.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d$1.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d$1.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l$1=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,c$1),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await l(f,{families:s,defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=e$1(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(D(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l$1,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(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 Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s$1,p)=>{let d=d$2(s$1,e.stylesRoot(),l,It(s$1,p)),m=v(s$1,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s$1),...m,...s(s$1,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=Of(e.currentPackage(),o);if(!t)return [];let n=new Set(Pf(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=id(i),l=hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=X$1(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=la$1||d.namespaceUri===da&&d.localName==="p")continue;let F=d.namespaceUri===da&&d.localName==="r"?d.id:m;if(d.namespaceUri===da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")_(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(aa(n),y){let E=Z$1(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=Z$1(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}ba(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){$$1(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&ca(n)&&d.namespaceUri===da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:ma$1(d,x)});}}Y$1(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===da&&n.localName==="p")){if(n.namespaceUri===da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=a$2(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(Ab),i.namespaceUri===da&&i.localName==="sym"&&t(b$1(wt(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(jc(a??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let a of u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=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(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(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 zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a$1)throw new TypeError(`maxBytes must not exceed ${a$1}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(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 Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(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 o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
1
+ import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-OHVJYJOA.js';import {z as z$1,B as B$1,A as A$1,c,G as G$1,x,D,r,w,ma,la,oa,g,a as a$1,d as d$3,b as b$2,h}from'./chunk-3EZO3O6I.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-6UCDHGXI.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-6UCDHGXI.js';import {a,z as z$2,j as j$1,b,fc,ga,lc,ja,la as la$2,ia,kc,ma as ma$1,ka,na,ha,wb}from'./chunk-H6WDEAOJ.js';import {d as d$2,b as b$1,a as a$2}from'./chunk-CAIWEQLC.js';import'./chunk-VP7SDFCM.js';import {_a}from'./chunk-KLQXP27K.js';import {Pf,Qf,id,hd,da,E,Sd,la as la$1,ke,ma as ma$2}from'./chunk-CF3JR35B.js';var B=b$2;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof d$3||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof d$3?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=z$2(n.style,n.fontSlot),i=j$1(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!ma(e.shaper,e.environment,l,r,t))return null;let u=la(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=c;function Ye(){if(T)return T;let e=(async()=>(await r(),w(x)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return oa(e,{resolveFont(t){return Xe(e,o,t)},fallback:b()})}async function Ze(e,o){if(!z$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await G$1(e,t,x,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!z$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=B$1(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=A$1(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await G$1(e,s,x,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a$1=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:i}));return I.set(e,a$1),a$1.catch(()=>{I.get(e)===a$1&&I.delete(e);}),a$1}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),Sd(o,n)}function Qe(e,o$1){let t=bt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>g(a))),i=o(t,{maxFontBytes:a$1,aggregateBudget:Rt(n),shadowedRequests:r});if(o$1)for(let a of i.dropped){if(o$1.dropped.length>=B)break;o$1.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===da||t.namespaceUri===""))?.value}async function vt(e$1,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=_a(e$1);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d$1=p.session,m=s,f="active",x=()=>f==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d$1.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d$1.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d$1.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d$1.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l$1=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,c$1),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await l(f,{families:s,defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=e$1(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(D(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l$1,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(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 Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s$1,p)=>{let d=d$2(s$1,e.stylesRoot(),l,It(s$1,p)),m=v(s$1,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s$1),...m,...s(s$1,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=Pf(e.currentPackage(),o);if(!t)return [];let n=new Set(Qf(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=id(i),l=hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=ga(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=la$1||d.namespaceUri===da&&d.localName==="p")continue;let F=d.namespaceUri===da&&d.localName==="r"?d.id:m;if(d.namespaceUri===da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")ja(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(la$2(n),y){let E=ia(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=ia(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}ma$1(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){ka(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&na(n)&&d.namespaceUri===da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:ma$2(d,x)});}}ha(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===da&&n.localName==="p")){if(n.namespaceUri===da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=a$2(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(wb),i.namespaceUri===da&&i.localName==="sym"&&t(b$1(wt(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(fc(a??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let a of u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=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(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(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 zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a$1)throw new TypeError(`maxBytes must not exceed ${a$1}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(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 Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(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 o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
2
2
  export{Y as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,gt as acquireSharedExportShaping,Yt as createPackagedFileFetch,q as hasExportAdmittedFont,X as hasExportLaidOutText,Ot as hasFontBackedExportCapabilities,vt as openFontBackedDocumentForExport};
@@ -1,4 +1,4 @@
1
- import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-WXbTSXx1.js';
1
+ import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-BgtcHulQ.js';
2
2
 
3
3
  /**
4
4
  * A partial font configuration one origin contributes: sources, substitutions, or both.
@@ -1,5 +1,5 @@
1
- import { c as HeaderFooterParts, d as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-1pdDnhZ_.js';
2
- import { b as OoxmlPackage, O as OoxmlPart, e as OoxmlElement, g as OoxmlPackageRejection } from './tree-op-types-DbdM7fJV.js';
1
+ import { c as HeaderFooterParts, d as HeaderFooterSectionResolution, T as TreePackageStore } from './note-lifecycle-D4AOFCAt.js';
2
+ import { j as OoxmlPackage, O as OoxmlPart, a1 as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-CEOy-Jv0.js';
3
3
 
4
4
  /** The package with a hyperlink relationship guaranteed present, and that relationship's id. */
5
5
  interface EnsuredHyperlinkRelationship {
@@ -0,0 +1,210 @@
1
+ import { a4 as DrawingProjection, j as OoxmlPackage } from './types-barrel-CEOy-Jv0.js';
2
+
3
+ /**
4
+ * The engine's trust-boundary caps: recursion depth, element counts, and the rest.
5
+ *
6
+ * A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
7
+ * zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
8
+ * are security ceilings, not performance budgets.
9
+ */
10
+ interface ResourceLimits {
11
+ /** Max nested-structure recursion (tables/shapes/SDT/groups). */
12
+ readonly maxRecursionDepth: number;
13
+ /** Max total parsed element count. */
14
+ readonly maxElementCount: number;
15
+ /** Max package part count. */
16
+ readonly maxPartCount: number;
17
+ /** Max total decompressed bytes (zip-bomb guard). */
18
+ readonly maxDecompressedBytes: number;
19
+ /** Max total compressed input bytes. */
20
+ readonly maxCompressedBytes: number;
21
+ /** Max decompressed:compressed ratio per entry. */
22
+ readonly maxCompressionRatio: number;
23
+ /** In-memory chunk budget for streaming/spooling. */
24
+ readonly maxChunkBytes: number;
25
+ /** Max pagination passes before non-convergence is declared. */
26
+ readonly maxPaginationPasses: number;
27
+ /** Max queued items in any bounded work queue. */
28
+ readonly maxQueueDepth: number;
29
+ }
30
+ /** Non-disableable hard ceilings: no resolved limit may exceed these. */
31
+ declare const HARD_CEILINGS: ResourceLimits;
32
+ /** Finite defaults, all <= their hard ceiling. */
33
+ declare const DEFAULT_LIMITS: ResourceLimits;
34
+ /**
35
+ * Resolve caller overrides into a frozen, always-finite limit set. Each value is
36
+ * `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
37
+ * never disable a limit — the hard ceiling always wins.
38
+ */
39
+ declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
40
+ /** Bounded image decode limits (typed-drawings-and-images task 4). */
41
+ /** Trust-boundary caps specific to image decoding and embedding. */
42
+ interface ImageResourceLimits {
43
+ readonly maxEncodedBytes: number;
44
+ readonly maxDecodedBytes: number;
45
+ readonly maxPixels: number;
46
+ readonly maxDimension: number;
47
+ readonly maxPolygonPoints: number;
48
+ readonly maxExternalRedirects: number;
49
+ }
50
+ /** Image caps nothing can raise past. A caller's override clamps into these. */
51
+ declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
52
+ /** The image caps in force when a host configures none. Conservative and finite. */
53
+ declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
54
+ /** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
55
+ declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
56
+
57
+ /** Opaque handle — bytes are reachable only through {@link mintValidatedImageBytes}. */
58
+ interface ValidatedImageBytesHandle {
59
+ readonly registryId: number;
60
+ readonly resourceKey: string;
61
+ readonly contentId: string;
62
+ readonly generation: number;
63
+ }
64
+
65
+ /**
66
+ * Raster media the decode port measures and any authoring path may write.
67
+ *
68
+ * BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
69
+ * natively, so they need a signature and a structural header and nothing else. BMP is what
70
+ * older documents carry; WebP is what current Word writes.
71
+ */
72
+ type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
73
+ /**
74
+ * Vector media painted straight from validated bytes. An `<img>` renders SVG in the
75
+ * browser's secure static mode — no script, no external subresource loads — so there is
76
+ * no decode step and no raster buffer sized by a file-supplied number.
77
+ */
78
+ type VectorImageMime = 'image/svg+xml';
79
+ /** Every mime the painter can hand to an `<img>`. */
80
+ type RenderableImageMime = SupportedImageMime | VectorImageMime;
81
+ /**
82
+ * Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
83
+ * A decode port may rasterize it; without one it paints as a labelled placeholder.
84
+ */
85
+ type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
86
+ /**
87
+ * What is known about one embedded image: validated, refused, or still decoding.
88
+ *
89
+ * Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
90
+ * are authoritative, and bytes that fail them never enter public state.
91
+ */
92
+ type ImageResourceState = {
93
+ readonly kind: 'ready';
94
+ readonly partName: string;
95
+ readonly contentId: string;
96
+ readonly resourceKey: string;
97
+ readonly validatedHandle: ValidatedImageBytesHandle;
98
+ readonly mime: RenderableImageMime;
99
+ readonly pixelWidth: number;
100
+ readonly pixelHeight: number;
101
+ readonly dpiX: number;
102
+ readonly dpiY: number;
103
+ } | {
104
+ readonly kind: 'unrenderable';
105
+ readonly partName: string | null;
106
+ readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
107
+ readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
108
+ } | {
109
+ readonly kind: 'external';
110
+ readonly relationshipId: string;
111
+ readonly sinkSafe: boolean;
112
+ } | {
113
+ readonly kind: 'missing';
114
+ readonly relationshipId: string;
115
+ } | {
116
+ readonly kind: 'pending';
117
+ readonly resourceKey: string;
118
+ };
119
+ /**
120
+ * The injected image decoder.
121
+ *
122
+ * A port rather than a direct `Image`/`createImageBitmap` call, so a worker or server runtime
123
+ * supplies its own and the engine never reaches for a browser global.
124
+ */
125
+ interface ImageDecodePort {
126
+ decode(bytes: Uint8Array, mime: SupportedImageMime, limits: ImageResourceLimits,
127
+ /** Aborted when the owning lookup/session is disposed. */
128
+ signal?: AbortSignal): Promise<Readonly<{
129
+ pixelWidth: number;
130
+ pixelHeight: number;
131
+ dpiX: number;
132
+ dpiY: number;
133
+ }>>;
134
+ /**
135
+ * Optional conversion of media an `<img>` cannot render (EMF/WMF metafiles, TIFF) into a
136
+ * renderable raster. The returned bytes are untrusted and re-enter the full raster
137
+ * validation path (sniff, header, pixel caps, decode) before they can become a ready
138
+ * resource. A null return declines the format and keeps the labelled placeholder; so does
139
+ * a throw, as `decode-failed`.
140
+ */
141
+ convertPreserved?(bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits,
142
+ /** Aborted when the owning lookup/session is disposed. */
143
+ signal?: AbortSignal): Promise<Readonly<{
144
+ bytes: Uint8Array;
145
+ mime: SupportedImageMime;
146
+ }> | null>;
147
+ }
148
+ /** Resolves a relationship id to a validated image resource, or reports why it could not. */
149
+ interface ImageResourceLookup {
150
+ readonly resolveEmbedded: (ownerPartName: string, relationshipId: string) => Promise<ImageResourceState>;
151
+ readonly resolveLinked: (ownerPartName: string, relationshipId: string) => ImageResourceState;
152
+ readonly resolveForProjection: (projection: DrawingProjection) => Promise<ImageResourceState>;
153
+ readonly liveReferenceCount: (partName: string) => number;
154
+ readonly dispose: () => void;
155
+ }
156
+ /** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
157
+ declare const MAX_SVG_SNIFF_BYTES = 512;
158
+ /** A raster header that passed structural validation: its real MIME type and pixel extent. */
159
+ interface ValidatedRasterHeader {
160
+ readonly pixelWidth: number;
161
+ readonly pixelHeight: number;
162
+ /** Horizontal physical density when bounded header metadata supplies it. */
163
+ readonly dpiX?: number;
164
+ /** Vertical physical density when bounded header metadata supplies it. */
165
+ readonly dpiY?: number;
166
+ }
167
+ /** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
168
+ declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
169
+ /** Signature sniffing — authoritative over declared content type. */
170
+ declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
171
+ /** Structural PNG IHDR validation before decode. */
172
+ declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
173
+ /** Structural GIF logical screen descriptor validation before decode. */
174
+ declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
175
+ /** Bounded JPEG marker scan through the first supported SOF marker. */
176
+ declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
177
+ /**
178
+ * Intrinsic size of an SVG, resolved the way a browser sizes one: absolute `width`/`height`
179
+ * first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
180
+ *
181
+ * This is metadata for insert and reset-to-natural-size only. Layout uses the authored
182
+ * `wp:extent` and the browser rasterizes into that box, so nothing here sizes an allocation
183
+ * and an out-of-range value is clamped rather than refused.
184
+ */
185
+ declare function resolveSvgIntrinsicSize(bytes: Uint8Array, limits: ImageResourceLimits): ValidatedRasterHeader | null;
186
+ /**
187
+ * Validate a raster image's header structurally and report its real MIME type and extent.
188
+ *
189
+ * Content type is a CLAIM; this is what makes it a fact. A file declaring `image/png` over JPEG
190
+ * bytes is caught here rather than at decode.
191
+ */
192
+ declare function validateRasterHeader(bytes: Uint8Array, mime: SupportedImageMime): ValidatedRasterHeader | null;
193
+ /** Package-wide live drawing references to a media part name. */
194
+ declare function liveDrawingReferenceCount(pkg: OoxmlPackage, partName: string): number;
195
+ /** How the image cache decodes, and what it will spend doing so. */
196
+ interface CreateImageResourceCacheOptions {
197
+ readonly limits?: Partial<ImageResourceLimits>;
198
+ readonly decodePort: ImageDecodePort;
199
+ }
200
+ /**
201
+ * Derived cache for one immutable package snapshot. Registry identity is
202
+ * `(package snapshot, decodePort object, normalized limits)` — the first caller
203
+ * never imposes its decoder or limits on later callers with different options.
204
+ */
205
+ declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
206
+ /** @deprecated Prefer {@link imageResourceLookupFor} — registry binds cache to package identity. */
207
+ /** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
208
+ declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
209
+
210
+ export { type CreateImageResourceCacheOptions as C, DEFAULT_IMAGE_RESOURCE_LIMITS as D, HARD_CEILINGS as H, type ImageResourceState as I, MAX_SVG_SNIFF_BYTES as M, type PreservedImageMime as P, type RenderableImageMime as R, type SupportedImageMime as S, type ValidatedImageBytesHandle as V, type VectorImageMime as a, type ImageDecodePort as b, type ImageResourceLimits as c, resolveSvgIntrinsicSize as d, type ResourceLimits as e, DEFAULT_LIMITS as f, IMAGE_RESOURCE_HARD_CEILINGS as g, type ImageResourceLookup as h, type ValidatedRasterHeader as i, createImageResourceCache as j, hasBoundedSvgRoot as k, imageResourceLookupFor as l, liveDrawingReferenceCount as m, resolveLimits as n, validateGifHeader as o, validateJpegHeader as p, validatePngHeader as q, resolveImageResourceLimits as r, sniffImageMime as s, validateRasterHeader as v };