@arbidocs/blocks 0.4.101 → 0.4.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/chunk-6MG62I5B.cjs +272 -0
  2. package/dist/chunk-6MG62I5B.cjs.map +1 -0
  3. package/dist/chunk-EQB3WELX.js +269 -0
  4. package/dist/chunk-EQB3WELX.js.map +1 -0
  5. package/dist/document-tools/AdoptSignatureDialog.d.ts +25 -0
  6. package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
  7. package/dist/document-tools/SignatureRequestBanner.d.ts +18 -0
  8. package/dist/document-tools/index.cjs +175 -0
  9. package/dist/document-tools/index.cjs.map +1 -1
  10. package/dist/document-tools/index.d.ts +3 -1
  11. package/dist/document-tools/index.js +168 -3
  12. package/dist/document-tools/index.js.map +1 -1
  13. package/dist/document-tools/viewer/GuidedSigningViewer.d.ts +26 -0
  14. package/dist/document-tools/viewer/SignatureFieldsOverlay.d.ts +41 -0
  15. package/dist/document-tools/viewer/SignatureRequestEditor.d.ts +26 -0
  16. package/dist/document-tools/viewer/index.cjs +983 -0
  17. package/dist/document-tools/viewer/index.cjs.map +1 -1
  18. package/dist/document-tools/viewer/index.d.ts +3 -0
  19. package/dist/document-tools/viewer/index.js +983 -5
  20. package/dist/document-tools/viewer/index.js.map +1 -1
  21. package/node_modules/@arbidocs/coedit/LICENSE +21 -0
  22. package/node_modules/@arbidocs/coedit/dist/encoding.cjs +751 -0
  23. package/node_modules/@arbidocs/coedit/dist/encoding.cjs.map +1 -0
  24. package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +192 -0
  25. package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +192 -0
  26. package/node_modules/@arbidocs/coedit/dist/encoding.js +716 -0
  27. package/node_modules/@arbidocs/coedit/dist/encoding.js.map +1 -0
  28. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +1759 -0
  29. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -0
  30. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +39 -0
  31. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +39 -0
  32. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +1736 -0
  33. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -0
  34. package/node_modules/@arbidocs/coedit/dist/index.cjs +1692 -0
  35. package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -0
  36. package/node_modules/@arbidocs/coedit/dist/index.d.cts +16 -0
  37. package/node_modules/@arbidocs/coedit/dist/index.d.ts +16 -0
  38. package/node_modules/@arbidocs/coedit/dist/index.js +1664 -0
  39. package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -0
  40. package/node_modules/@arbidocs/coedit/dist/server.cjs +1852 -0
  41. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -0
  42. package/node_modules/@arbidocs/coedit/dist/server.d.cts +43 -0
  43. package/node_modules/@arbidocs/coedit/dist/server.d.ts +43 -0
  44. package/node_modules/@arbidocs/coedit/dist/server.js +1822 -0
  45. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -0
  46. package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.cts +82 -0
  47. package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.ts +82 -0
  48. package/node_modules/@arbidocs/coedit/dist/template.cjs +1627 -0
  49. package/node_modules/@arbidocs/coedit/dist/template.cjs.map +1 -0
  50. package/node_modules/@arbidocs/coedit/dist/template.d.cts +125 -0
  51. package/node_modules/@arbidocs/coedit/dist/template.d.ts +125 -0
  52. package/node_modules/@arbidocs/coedit/dist/template.js +1612 -0
  53. package/node_modules/@arbidocs/coedit/dist/template.js.map +1 -0
  54. package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.cts +8 -0
  55. package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.ts +8 -0
  56. package/node_modules/@arbidocs/coedit/package.json +68 -0
  57. package/node_modules/@docx-editor.dev/core/LICENSE +201 -0
  58. package/node_modules/@docx-editor.dev/core/README.md +125 -0
  59. package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +56 -0
  60. package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -0
  61. package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +162 -0
  62. package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -0
  63. package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -0
  64. package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +164 -0
  65. package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -0
  66. package/node_modules/@docx-editor.dev/core/dist/chunk-2GO5T2JU.cjs +1 -0
  67. package/node_modules/@docx-editor.dev/core/dist/chunk-2RC2EPND.js +3 -0
  68. package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +28 -0
  69. package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +18 -0
  70. package/node_modules/@docx-editor.dev/core/dist/chunk-5CSUYANV.js +1 -0
  71. package/node_modules/@docx-editor.dev/core/dist/chunk-6APGXLBB.cjs +3 -0
  72. package/node_modules/@docx-editor.dev/core/dist/chunk-6AWEKBLB.cjs +1 -0
  73. package/node_modules/@docx-editor.dev/core/dist/chunk-6EYYL7FL.js +1 -0
  74. package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +1 -0
  75. package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +1 -0
  76. package/node_modules/@docx-editor.dev/core/dist/chunk-E7BQA6UP.js +2 -0
  77. package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +2 -0
  78. package/node_modules/@docx-editor.dev/core/dist/chunk-ETTO6GK3.js +1 -0
  79. package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +18 -0
  80. package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +28 -0
  81. package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +2 -0
  82. package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +2 -0
  83. package/node_modules/@docx-editor.dev/core/dist/chunk-K5U2PLDP.cjs +2 -0
  84. package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +2 -0
  85. package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +27 -0
  86. package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +1 -0
  87. package/node_modules/@docx-editor.dev/core/dist/chunk-O2AL2HSJ.cjs +1 -0
  88. package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +1 -0
  89. package/node_modules/@docx-editor.dev/core/dist/chunk-QMLCVPCD.cjs +1 -0
  90. package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +27 -0
  91. package/node_modules/@docx-editor.dev/core/dist/chunk-RIYSCEFQ.js +2 -0
  92. package/node_modules/@docx-editor.dev/core/dist/chunk-S6J4O5XP.js +1 -0
  93. package/node_modules/@docx-editor.dev/core/dist/chunk-SRPILEWV.cjs +5 -0
  94. package/node_modules/@docx-editor.dev/core/dist/chunk-TSLBZ26X.js +1 -0
  95. package/node_modules/@docx-editor.dev/core/dist/chunk-UKVVUHZL.cjs +1 -0
  96. package/node_modules/@docx-editor.dev/core/dist/chunk-VDNNLG6X.js +2 -0
  97. package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +7 -0
  98. package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +7 -0
  99. package/node_modules/@docx-editor.dev/core/dist/chunk-Z6WBFXJU.js +5 -0
  100. package/node_modules/@docx-editor.dev/core/dist/chunk-ZUHOMK52.cjs +2 -0
  101. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -0
  102. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +270 -0
  103. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -0
  104. package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -0
  105. package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +269 -0
  106. package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -0
  107. package/node_modules/@docx-editor.dev/core/dist/contracts/document.cjs +1 -0
  108. package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +290 -0
  109. package/node_modules/@docx-editor.dev/core/dist/contracts/document.js +0 -0
  110. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.cjs +1 -0
  111. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +22 -0
  112. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.js +1 -0
  113. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.cjs +1 -0
  114. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +103 -0
  115. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.js +0 -0
  116. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -0
  117. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +143 -0
  118. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -0
  119. package/node_modules/@docx-editor.dev/core/dist/contracts/types.cjs +1 -0
  120. package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +11 -0
  121. package/node_modules/@docx-editor.dev/core/dist/contracts/types.js +0 -0
  122. package/node_modules/@docx-editor.dev/core/dist/custom-node-writes-cvL5rhcD.d.ts +323 -0
  123. package/node_modules/@docx-editor.dev/core/dist/dist-PKZR6RSH.js +2 -0
  124. package/node_modules/@docx-editor.dev/core/dist/document-protection-BAGVGqaP.d.ts +20 -0
  125. package/node_modules/@docx-editor.dev/core/dist/editor-Ci7IZGmG.d.ts +2448 -0
  126. package/node_modules/@docx-editor.dev/core/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
  127. package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -0
  128. package/node_modules/@docx-editor.dev/core/dist/editor.css +15 -0
  129. package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +1394 -0
  130. package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -0
  131. package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -0
  132. package/node_modules/@docx-editor.dev/core/dist/export.d.ts +391 -0
  133. package/node_modules/@docx-editor.dev/core/dist/export.js +2 -0
  134. package/node_modules/@docx-editor.dev/core/dist/failure-NS2lsya4.d.ts +115 -0
  135. package/node_modules/@docx-editor.dev/core/dist/font-resolver-BVQB14qT.d.ts +256 -0
  136. package/node_modules/@docx-editor.dev/core/dist/harfbuzz.wasm +0 -0
  137. package/node_modules/@docx-editor.dev/core/dist/headless-document-view-qH331moE.d.ts +143 -0
  138. package/node_modules/@docx-editor.dev/core/dist/image-resources-BN-hUgCn.d.ts +211 -0
  139. package/node_modules/@docx-editor.dev/core/dist/index-Bsg7oIKP.d.ts +3869 -0
  140. package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -0
  141. package/node_modules/@docx-editor.dev/core/dist/index.d.ts +53 -0
  142. package/node_modules/@docx-editor.dev/core/dist/index.js +1 -0
  143. package/node_modules/@docx-editor.dev/core/dist/layout-shaping-BEyuiQOk.d.ts +246 -0
  144. package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -0
  145. package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +3151 -0
  146. package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -0
  147. package/node_modules/@docx-editor.dev/core/dist/node-module-shim-TTKTT66I.js +1 -0
  148. package/node_modules/@docx-editor.dev/core/dist/note-properties-4Y9o6Gyk.d.ts +68 -0
  149. package/node_modules/@docx-editor.dev/core/dist/omml-equation-CuzBL5DD.d.ts +85 -0
  150. package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -0
  151. package/node_modules/@docx-editor.dev/core/dist/output.d.ts +97 -0
  152. package/node_modules/@docx-editor.dev/core/dist/output.js +1 -0
  153. package/node_modules/@docx-editor.dev/core/dist/protocol-Bqk4Izjc.d.ts +1651 -0
  154. package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +128 -0
  155. package/node_modules/@docx-editor.dev/core/dist/review-paragraph-order-DT-n6ouC.d.ts +85 -0
  156. package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +242 -0
  157. package/node_modules/@docx-editor.dev/core/dist/semantic-cell-selection-D9D1KSXq.d.ts +464 -0
  158. package/node_modules/@docx-editor.dev/core/dist/semantic-interaction-CIC-PooQ.d.ts +135 -0
  159. package/node_modules/@docx-editor.dev/core/dist/semantic-paint-BME37OMv.d.ts +326 -0
  160. package/node_modules/@docx-editor.dev/core/dist/semantic-record-queries-CBlZqZNa.d.ts +177 -0
  161. package/node_modules/@docx-editor.dev/core/dist/semantic-records-4B3WwFAi.d.ts +3532 -0
  162. package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -0
  163. package/node_modules/@docx-editor.dev/core/dist/store.d.ts +2706 -0
  164. package/node_modules/@docx-editor.dev/core/dist/store.js +1 -0
  165. package/node_modules/@docx-editor.dev/core/dist/tree-package-fragment-BeeKxDw8.d.ts +1201 -0
  166. package/node_modules/@docx-editor.dev/core/dist/tree-session-contract-CVbmlMlq.d.ts +664 -0
  167. package/node_modules/@docx-editor.dev/core/dist/types-barrel-D3xCgQX6.d.ts +4269 -0
  168. package/node_modules/@docx-editor.dev/core/licenses/HarfBuzz-COPYING.txt +42 -0
  169. package/node_modules/@docx-editor.dev/core/package.json +140 -0
  170. package/node_modules/@docx-editor.dev/react/LICENSE +201 -0
  171. package/node_modules/@docx-editor.dev/react/README.md +141 -0
  172. package/node_modules/@docx-editor.dev/react/THIRD_PARTY_NOTICES.md +18 -0
  173. package/node_modules/@docx-editor.dev/react/dist/index.d.mts +4928 -0
  174. package/node_modules/@docx-editor.dev/react/dist/index.d.ts +4928 -0
  175. package/node_modules/@docx-editor.dev/react/dist/index.js +4 -0
  176. package/node_modules/@docx-editor.dev/react/dist/index.mjs +4 -0
  177. package/node_modules/@docx-editor.dev/react/package.json +74 -0
  178. package/node_modules/@docx-editor.dev/react/src/styles/editor.css +6 -0
  179. package/node_modules/@docx-editor.dev/react/src/styles/zIndex.ts +28 -0
  180. package/package.json +26 -15
@@ -0,0 +1 @@
1
+ export{wb as AUTO_ZOOM_MODE,Cb as BROWSER_AUTOMATION_CAPABILITIES,Ta as CHROME_GROUPS,Xa as CHROME_MENUS,_a as CHROME_UNAVAILABLE_KEY,db as CONTENT_CONTROL_PICTURE_ACCEPT,nc as ChromeExportError,pc as ChromePrintError,c as DEFAULT_REVIEW_PANE,$ as DEFAULT_TABLE_CHROME_DRAFT,ec as DocumentRefreshError,N as EMU_PER_POINT,xb as FIT_WIDTH_ZOOM_MODE,gc as HIGHLIGHT_REFRESH_MS,W as IMAGE_OVERLAY_NUDGE_PT,X as IMAGE_OVERLAY_NUDGE_SHIFT_PT,f as LOADING_SNAPSHOT,Yb as NO_MIXED_FIELDS,o as PX_PER_CM,n as PX_PER_INCH,tb as REVIEW_MARKERS_GUTTER_PX,ic as SEARCH_DEBOUNCE_MS,lc as SEARCH_HIGHLIGHT_PRIORITY,kc as SEARCH_HIGHLIGHT_SET,jc as SEARCH_MATCH_LIMIT,u as SNAP_TWIPS_CM,t as SNAP_TWIPS_INCH,fa as TABLE_BORDER_STYLE_OPTIONS,ea as TABLE_BORDER_TARGET_OPTIONS,ga as TABLE_BORDER_WIDTH_OPTIONS,aa as TABLE_CHROME_SLOT_IDS,Ub as TAB_ALIGNMENT_LABELS,za as TOOLBAR_COLLAPSE_ORDER,Ba as TOOLBAR_OVERFLOW_HYSTERESIS,Fa as TOOLBAR_PANEL_EDGE_MARGIN,Aa as TOOLBAR_PINNED_GROUPS,s as TWIPS_PER_CM,r as TWIPS_PER_INCH,vb as ZOOM_MAX,ub as ZOOM_MIN,ac as alignmentAfterDirectionChange,ha as applyTableChromePick,B as applyThemeShade,A as applyThemeTint,Ea as arrangeToolbarGroups,Pa as barRoomWidth,dc as bindHistoryGroup,g as blankDocumentBytes,lb as calendarDateForKey,nb as calendarDateFromText,mb as calendarDateText,jb as calendarMonth,ob as calendarMonthNames,hb as calendarMonthTitle,ib as calendarWeekdays,U as canExecuteImageCommand,T as captureImageMutationPreconditions,$b as changedFields,Sa as chordLetter,Za as chromeControlCount,Ya as chromeMenuSlots,la as chromeProbeForSlot,Ua as chromeSlotId,ra as chromeSlotIsToggle,i as clipboardDropLandsText,h as clipboardPasteLandsContent,Da as collapseOrder,La as collapsibleGroupCost,y as commandExecOptions,ma as commandForSlot,oa as commandForSlotValue,na as commandForTableChromeSlotValue,Ob as computeImageResizeResult,R as computeMovedImagePosition,Q as computeResizedImageExtentEmu,bb as contentControlPopupKeyDown,cb as contentControlPopupOpener,Qa as controlsOverflow,Db as createBrowserAutomationHost,pb as createContentControlListNavigation,fc as createDocumentRefresh,mc as createDocumentSearch,Bb as createDocxEditor,l as createFontSource,Pb as createImageOverlayScrollPort,b as createLayoutShaping,L as cropPercentFromCropPermille,J as cropPercentFromPermille,G as cropPercentFromSourceCrop,K as cropPermilleFromCropPercent,I as cropPermilleFromPercent,Kb as cssPixelsToLayoutPoints,m as customFonts,Va as defaultChromeGroups,ba as defaultTableLabel,x as dragIndent,ya as editorCommandKey,Eb as editorInstanceScope,P as emuToOverlayPoints,qb as equationAtPosition,V as executeImageCommand,Qb as finalizeImageOverlayInteraction,gb as firstDayOfWeek,Sb as formatInches,Wa as formattingBarChromeGroups,p as generateRulerTicks,v as handlePosition,Gb as hasOpenNestedPopup,Tb as inchesToTwips,qc as isChromePrintShortcut,Z as isStaleImageInteractionCommit,ca as isTableChromeSlot,eb as isoDateOf,Jb as layoutPointsToCssPixels,Fb as listenForPopupEscape,Hb as listenForPopupFocusLeave,k as loadFonts,D as lowerColorValueForBorder,E as lowerColorValueForFill,Zb as mixedFieldsOf,sb as mountPaginatedSurface,ab as observeContentControlPopup,Lb as overlayFrameToSheetCssPixels,Mb as overlayHostOrigin,fb as parseIsoDate,j as partOfNodeId,O as pointsToEmu,$a as positionContentControlPopup,ia as probeTableChromeCommand,Ra as readAvailableWidth,Oa as readColumnGap,Na as readInlineMargins,Nb as resizePreservesAspect,F as resolveColorValueToCss,d as resolveReviewPane,C as resolveThemeColorHex,yb as resolveZoomMode,Ab as reviewPaneEntitledZoom,e as reviewPaneListsItem,q as rulerPageBox,oc as runChromeExport,rc as runChromePrint,va as runSave,ta as runTableChromeCommand,xa as runTableCommand,ua as runToolbarCommand,Ha as sameOverflow,_b as sameTabStops,zb as sameZoomMode,Xb as seedFields,Y as selectedDrawingOverlayTargetOf,S as selectedImageStateOf,Ka as separatorLeadingCost,kb as shiftMonth,Wb as signedFirstLineOf,w as snapTwips,H as sourceCropFromCropPercent,Vb as specialOf,rb as surfaceExtent,Ib as surfacePaintScale,ka as tableChromeIconPaths,ja as tableChromeLabelKeyForTarget,pa as tableChromeToolbarState,da as tableChromeVisible,_ as tableCommandState,wa as tableCommandToolbarState,a as toEditorFontError,qa as toolbarCommandState,sa as toolbarCommandStates,Ca as toolbarGroupPriority,Ia as toolbarOverflowGroups,Ga as toolbarPanelPlacement,Ja as toolbarPopupLeft,Ma as trailingGapCost,cc as trapTabWithin,Rb as twipsToInches,M as validateImageCropPercent,z as validateThemeModifier,hc as watchHighlights,bc as withTabStop}from'./chunk-LWDSDCMO.js';export{a as resolveEditorModules}from'./chunk-O5INAWZQ.js';import'./chunk-KKIJG3C6.js';export{d as DEFAULT_FONT,i as FONT_RESOLVER_BRAND,h as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,e as WORD_DEFAULT_FONT,f as composeFontConfiguration,n as composeFontOrigins,j as defineFontResolver,k as isFontResolver}from'./chunk-VDNNLG6X.js';export{r as disposeLayoutShaping}from'./chunk-2RC2EPND.js';import'./chunk-RIYSCEFQ.js';import'./chunk-VHAVHCQY.js';import'./chunk-6EYYL7FL.js';export{Ua as DEFAULT_REVISION_MARKUP,Ta as REVISION_MARKUP_COLORS,Va as resolveRevisionMarkup}from'./chunk-FRXAOVTB.js';import'./chunk-Z6WBFXJU.js';import'./chunk-5CSUYANV.js';import'./chunk-E7BQA6UP.js';import'./chunk-TSLBZ26X.js';import'./chunk-J6BVWIDB.js';import'./chunk-6JIJOZDW.js';import'./chunk-ETTO6GK3.js';export{r as DEFAULT_IMAGE_RESOURCE_LIMITS,Lk as DRAWING_REL_FROM_H,Mk as DRAWING_REL_FROM_V,Ed as IMAGE_WRAP_TARGETS,Qi as TEXT_FORM_FORMATS,Ok as positionInputFromPropertiesCommand,Nk as propertiesCommandHasPositionFields,s as resolveImageResourceLimits,he as resolveSvgIntrinsicSize,de as sniffImageMime,Kk as validateDrawingPositionInput,ie as validateRasterHeader,Pk as validateSetImagePositionCommand}from'./chunk-4R3TEXMN.js';import'./chunk-S6J4O5XP.js';
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkK5U2PLDP_cjs=require('./chunk-K5U2PLDP.cjs'),chunk6APGXLBB_cjs=require('./chunk-6APGXLBB.cjs'),chunk6AWEKBLB_cjs=require('./chunk-6AWEKBLB.cjs'),chunk4GBTELJV_cjs=require('./chunk-4GBTELJV.cjs'),chunkQMLCVPCD_cjs=require('./chunk-QMLCVPCD.cjs');require('./chunk-O2AL2HSJ.cjs');var chunkJGNVNT2A_cjs=require('./chunk-JGNVNT2A.cjs'),chunkFIJZIQXA_cjs=require('./chunk-FIJZIQXA.cjs');function _(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((u,c)=>u.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let u of o.text){let c=u.toUpperCase()!==u,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(u))?y.text+=u:i.push({text:u,start:s,lower:c}),s+=u.length;}let a=[],p=[],l=[],d=true,g=0;for(let u of o.environment.direction==="rtl"?i.reverse():i){let c=u.lower?.8:1,y=[],b=[],R="",f=u.start;for(let x of u.text){let m=u.lower?x.toUpperCase():x;for(let E=0;E<m.length;E++)y.push(f),b.push(f+x.length);R+=m,f+=x.length;}let h=e.shape({...n,text:R}),F=a.length;for(let[x,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[x];E===void 0?d=false:l.push(E*c),a.push({...m,cluster:y[m.cluster]??u.start,originX:chunk4GBTELJV_cjs.n(g+Math.round(m.originX*c)),originY:chunk4GBTELJV_cjs.n(Math.round(m.originY*c)),offsetX:chunk4GBTELJV_cjs.n(Math.round(m.offsetX*c)),offsetY:chunk4GBTELJV_cjs.n(Math.round(m.offsetY*c)),advanceX:chunk4GBTELJV_cjs.n(Math.round(m.advanceX*c)),advanceY:chunk4GBTELJV_cjs.n(Math.round(m.advanceY*c)),drawScale:c});}for(let x of h.clusters){let m=y[x.textStart]??u.start,E=b[x.textEnd-1]??f,L=chunk4GBTELJV_cjs.n(Math.round(x.advance*c)),A=p.at(-1);A&&A.textStart===m&&A.textEnd===E?p[p.length-1]={...A,glyphEnd:F+x.glyphEnd,advance:chunk4GBTELJV_cjs.n(A.advance+L),caretEdges:[chunk4GBTELJV_cjs.n(0),chunk4GBTELJV_cjs.n(A.advance+L)]}:p.push({...x,textStart:m,textEnd:E,glyphStart:F+x.glyphStart,glyphEnd:F+x.glyphEnd,advance:L,caretEdges:x.caretEdges.map(V=>chunk4GBTELJV_cjs.n(Math.round(V*c))),fontSpan:0});}g+=h.glyphs.reduce((x,m)=>x+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:d&&l.length===a.length?l:void 0}}var ut=new WeakMap;function zt(e){let o=ut.get(e);return o===void 0&&(o=Xt(e.bytes,e.faceIndex),ut.set(e,o)),o}var jt=new Set(["COLR","CBDT","sbix"]),Ht=512;function Xt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(ct(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Ht);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(jt.has(ct(e,s)))return true}return false}function ct(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Gt=/\p{Emoji_Presentation}|️/u;function Vt(e){return Gt.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(zt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Vt(o)?[...t,...n]:[...n,...t]}var Wt=2048;function pt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Wt)return null;let r=(f,h)=>{let{context:F,...x}=o,m={...x,text:h,environment:chunk4GBTELJV_cjs.p({...o.environment,font:f})};return _(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t.clusters].sort((h,F)=>h.textStart-F.textStart)){let h=o.environment.font,F=o.text.slice(f.textStart,f.textEnd),x=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(F)&&x&&x.end===f.textStart){x.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(F)&&x&&x.font!==o.environment.font&&x.end===f.textStart){x.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(F)??q(n,E).find(A=>{try{return !r(A,F).glyphs.some(V=>V.id===0)}catch{return false}});if(!L)return null;s.set(F,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],p=[],l=[],d=[],g=true,u=0,c=0,y=0,b=0,R=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let F=a.length,x=l.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:chunk4GBTELJV_cjs.n(u+m.originX),originY:chunk4GBTELJV_cjs.n(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)d.push(m);for(let m of h.clusters)p.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:F+m.glyphStart,glyphEnd:F+m.glyphEnd,fontSpan:x});h.glyphs.length&&l.push({font:f.font,glyphStart:F,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),u+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),b=Math.max(b,h.metrics.descent),R=Math.max(R,h.metrics.lineGap);}return chunk4GBTELJV_cjs.s({...t,glyphs:a,clusters:p,fontSpans:l,exactAdvancesX:g&&d.length===a.length?d:void 0,metrics:{ascent:chunk4GBTELJV_cjs.n(y),descent:chunk4GBTELJV_cjs.n(b),lineGap:chunk4GBTELJV_cjs.n(R)}},{...o.environment,fallbackOrder:n})}var Yt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),$t=512,ft=new WeakMap;function Kt(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let p=r(a+4);if(p<0||p>1024)return t;let l=-1;for(let c=0;c<p;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){l=i(y+8);break}}if(l<0)return t;let d=r(l+4);if(d<=0)return t;let g=l+d,u=r(g);if(u<0)return t;for(let c=0;c<Math.min(u,$t);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Zt(e,o){let t=ft.get(e);return t||(t=Kt(e.bytes,e.faceIndex),ft.set(e,t)),(Yt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function mt(e,o){let t=e.filter(n=>Zt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function Q(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return chunk4GBTELJV_cjs.s({...i,text:o.text},o.environment)}catch{return t}}function yt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof chunk4GBTELJV_cjs.d)),n={shape(a){return Q(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let p=e.shaper.shape(a),l=r.get(p);if(l&&l.input.text===a.text&&l.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&l.input.bidiLevel===a.bidiLevel&&l.input.context?.before===a.context?.before&&l.input.context?.after===a.context?.after&&l.input.environment===a.environment)return l.run;let d=s(a,Q(e.shaper,a,p));return r.set(p,{input:a,run:d}),d}},s=(a,p)=>{let l=_(n,a,p);if(!l.glyphs.some(d=>d.id===0)||/^[\t\n\r\f]*$/.test(a.text))return l;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let d=pt(n,a,l,t);if(d)return d}for(let d of mt(q(t,a.text),a.environment.script))if(!(d.hash===a.environment.font.hash&&d.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:chunk4GBTELJV_cjs.p({...a.environment,font:d})},u=_(n,g,n.shape(g));if(!u.glyphs.some(c=>c.id===0))return u}catch{}return l};return {...e,shaper:i}}var ee=chunk4GBTELJV_cjs.b;function te(e){return typeof e.admittedFontFace=="function"}var Jt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var ht=new WeakMap;function j(e){let o=ht.get(e);return o||ht.set(e,o=Qt(e)),o}function Qt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:z(o.requested),resolved:z(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function eo(e){return Object.freeze({...j(e),bytes:chunk4GBTELJV_cjs.i(e)})}function to(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunk4GBTELJV_cjs.d?null:eo(t)}catch{return null}}function gt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return to(e.resolve(),o)}}function oo(e){return Object.freeze(e.slice(0,ee).map(o=>Object.freeze({request:z(o.request),partName:o.partName,reason:o.reason})))}function oe(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let p=a.toLowerCase();i.has(p)||i.set(p,a);}let s=[...i.values()].map(a=>{let p=[];for(let l of Jt){let d=n?.({family:a,...l});!d||d instanceof chunk4GBTELJV_cjs.d||p.push(Object.freeze({...l,sourceFamily:d.family,via:d.substitution?"substitution":"direct",identity:d.identity,id:d.id,hash:d.hash,faceIndex:d.faceIndex,substitution:d.substitution}));}return Object.freeze({family:a,coverage:p.length===4?"complete":p.length>0?"partial":"none",faces:Object.freeze(p)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:oo(r)})}function ne(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 re(e,o,t=[]){let n=l=>l.trim().toLowerCase(),r=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),i=new Set(t.map(l=>n(l.family))),s=l=>{if(!(l instanceof chunkK5U2PLDP_cjs.l))return true;let d=n(l.request.family);return r.has(d)||!i.has(d)},a=e.originFailures.some(({cause:l})=>l instanceof chunkK5U2PLDP_cjs.m?l.causes.length===0||l.causes.some(s):s(l));if(o.fontPolicy!=="strict"||!a&&e.families.every(l=>l.coverage==="complete"))return;let p=e.families.filter(l=>l.coverage!=="complete").map(l=>l.family).join(", ");throw new chunk6AWEKBLB_cjs.d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function H(){return new Map}function X(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=chunk4GBTELJV_cjs.h(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof chunk4GBTELJV_cjs.d?null:s}function xt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return X(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function no(e){for(let o of e){let t=o.codePointAt(0);if(t!==32&&(t<=255||t>=61440&&t<=61695))return false}return true}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=chunk4GBTELJV_cjs.ua(n.style,n.fontSlot),i=chunk4GBTELJV_cjs.dd(n)?chunk4GBTELJV_cjs.ed(n):chunk4GBTELJV_cjs.ba(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=X(e,o,s,r)??(chunkFIJZIQXA_cjs.b(s)&&no(i)?X(e,o,e.defaultFont.family,r):null);if(!a)return null;try{if(r.smallCaps&&!chunk6APGXLBB_cjs.$(e.shaper,e.environment,a,r,t))return null;let p=chunk6APGXLBB_cjs._(e.shaper,e.environment,a,r,i);return Object.freeze({run:p,font:j(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(l=>j(l.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Ft(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,G=new WeakMap,se=0,M,le=32,Et=chunk4GBTELJV_cjs.c;function bt(){if(M)return M;let e=(async()=>(await chunk6APGXLBB_cjs.d(),chunk6APGXLBB_cjs.h(chunk6APGXLBB_cjs.i)))();return M=e,e.catch(()=>{M===e&&(M=void 0);}),e}function Rt(e){let o=H();return chunk6APGXLBB_cjs.ba(e,{resolveFont(t){return xt(e,o,t)},fallback:chunk4GBTELJV_cjs.ha()})}async function St(e,o,t=[],n=false){if(!chunk6APGXLBB_cjs.k(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await bt(),i=yt(await chunk6APGXLBB_cjs.r(e,r,chunk6APGXLBB_cjs.i,o,n),t);return Object.freeze({createMeasurer:()=>Rt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${chunk4GBTELJV_cjs.ga}`].join("|"),extensionFingerprint:e.fingerprint})}function ro(e,o){if(!chunk6APGXLBB_cjs.k(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=G.get(e);if(t)return t;let n=chunk6APGXLBB_cjs.m(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let p=chunk6APGXLBB_cjs.l(e).sources.reduce((d,g)=>d+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+p>Et)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Et} process-wide`);se+=p;let l;try{let d=await bt();l=await chunk6APGXLBB_cjs.r(e,d,chunk6APGXLBB_cjs.i,o);}catch(d){throw se-=p,d}return Object.freeze({createMeasurer:()=>Rt(l),shapeLaidOutText:ae(l),shapingHash:l.operation.shapingHash,producerVersion:l.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${chunk4GBTELJV_cjs.ga}`].join("|"),extensionFingerprint:i}));return G.set(e,s),s.catch(()=>{G.get(e)===s&&G.delete(e);}),s}var io="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function ao(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===io),n;if(t){let r=chunkFIJZIQXA_cjs.J(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkFIJZIQXA_cjs.if(o,n)}function Ot(e,o){let t=ao(e);if(t.length!==0)return chunkK5U2PLDP_cjs.j(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>chunk4GBTELJV_cjs.h(s))),i=chunkK5U2PLDP_cjs.C(t,{maxFontBytes:chunk4GBTELJV_cjs.a,aggregateBudget:so(n),shadowedRequests:r});if(o)for(let s of i.dropped){if(o.dropped.length>=ee)break;o.dropped.push(s);}return {sources:i.sources}})}function so(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunk4GBTELJV_cjs.c:Math.max(0,chunk4GBTELJV_cjs.c-o)}function lo(e){return te(e)&&ie(e)}var w=0,vt=Symbol("font-resolution-timeout");function uo(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>chunk4GBTELJV_cjs.c)throw new chunk6AWEKBLB_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunk4GBTELJV_cjs.c}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ue(e,o){return e.attributes.find(t=>t.localName===o)?.value}function co(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkFIJZIQXA_cjs.la||t.namespaceUri===""))?.value}async function po(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=chunkJGNVNT2A_cjs.Ba(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:l,...d}=o,g=Array.isArray(n)?n:[n],u=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await fo(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:l,lastResortFonts:u,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof chunk6AWEKBLB_cjs.d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new chunk6AWEKBLB_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let b;try{b=chunk6AWEKBLB_cjs.e(t.view,{...d,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!b.ok)return y?.dispose(),b;let R=b.session,f=y,h="active",F=()=>h==="aborted"?new chunk6AWEKBLB_cjs.d("aborted","Export resource settlement was aborted"):new chunk6AWEKBLB_cjs.d("disposed","Export session has been disposed"),x=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{R.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>x("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?R.layout():Promise.reject(F()),layoutFor:E=>h==="active"?R.layoutFor(E):Promise.reject(F()),validatedImageBytes:E=>h==="active"?R.validatedImageBytes(E):null,admittedFontFace:gt({status:()=>h,unavailable:F,resolve:()=>f?.resolveFont}),shapeLaidOutText:Ft({status:()=>h,unavailable:F,shaping:()=>f}),dispose:()=>x("disposed")})}}async function fo(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n=mo(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(vt),n);try{de(r.signal);let a=(async()=>{let p=uo(t.onActiveFontBytesChange),l=!1;try{let d=ho(e).slice(0,chunkK5U2PLDP_cjs.c),g=chunkK5U2PLDP_cjs.x(e,d),u=[],c={dropped:[]},y=Ot(e,c),b=[...o,...y?[y]:[],...t.lastResortFonts??[]],R=await chunkK5U2PLDP_cjs.o(b,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...g.families])].slice(0,chunkK5U2PLDP_cjs.c),defaultFamily:chunkK5U2PLDP_cjs.d.family,signal:r.signal},{onOriginFailure:x=>u.push(x),reserveOwnedBytes:p.reserve,maxExecutionFontBytes:chunk6APGXLBB_cjs.i.maxFontBytes});de(r.signal);let f=chunkK5U2PLDP_cjs.z(chunkK5U2PLDP_cjs.f(R??{}),g);if(f.sources.length===0){let x=oe(d,f.defaultFont.family,u,void 0,c.dropped);ne(x,t),re(x,t,t.glyphFallbacks);return}let h=await St(chunk6APGXLBB_cjs.o(f),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let F=oe(d,f.defaultFont.family,u,h.resolveFont,c.dropped);return ne(F,t),re(F,t,t.glyphFallbacks),l=!0,Object.freeze({...h,dispose:p.release})}finally{l||p.release();}})();return await Promise.race([a,yo(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function mo(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 yo(e){return new Promise((o,t)=>{let n=()=>{t(wt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function wt(e){let o=e.reason===vt;return new chunk6AWEKBLB_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw wt(e)}function ho(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(d,g)=>{!g||r.has(g.name)||(r.add(g.name),d.push(g.root));};for(let d of e.headerFooterPartsBySection()){for(let g of d.headers.values())i(t,g);for(let g of d.footers.values())i(t,g);}for(let d of ["footnote","endnote"])n.push(...go(e,d));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,l=(d,g)=>{let u=chunkQMLCVPCD_cjs.e(d,e.stylesRoot(),a,Fo(d,g)),c=chunkK5U2PLDP_cjs.v(d,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...u.direct,...Ro(d),...c,...chunkK5U2PLDP_cjs.s(d,e.stylesRoot(),a),...u.inherited]){let b=y.toLowerCase();p.has(b)||p.set(b,y);}};return l(o,"body"),l(t,"furniture"),l(n,"note"),[...p.values()]}function go(e,o){let t=chunkFIJZIQXA_cjs.ch(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkFIJZIQXA_cjs.dh(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 s=chunkFIJZIQXA_cjs.zc(i),a=chunkFIJZIQXA_cjs.yc(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var xo="http://schemas.openxmlformats.org/officeDocument/2006/math";function Fo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===chunkFIJZIQXA_cjs.la&&s.localName==="p"&&r.push({paragraph:s,context:a});let p=s.namespaceUri===chunkFIJZIQXA_cjs.la&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let l=s.children.length-1;l>=0;l-=1){let d=s.children[l];d.kind!=="textValue"&&i.push({node:d,context:p});}}for(let s of r)Eo(s.paragraph,t,s.context);}return t}function Eo(e,o,t){let n=chunk4GBTELJV_cjs.Vb(),r=null,i=null,s="",a=false,p=false,l=false,d=0,g=[];for(let u=e.children.length-1;u>=0;u-=1){let c=e.children[u];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:u,runId:c,visibility:y,containerDepth:b}=g.pop();if(b>=chunkFIJZIQXA_cjs.wa||u.namespaceUri===chunkFIJZIQXA_cjs.la&&u.localName==="p")continue;let R=u.namespaceUri===chunkFIJZIQXA_cjs.la&&u.localName==="r"?u.id:c;if(u.namespaceUri===chunkFIJZIQXA_cjs.la&&u.localName==="fldSimple"){let f=ue(u,"instr")??"";chunk4GBTELJV_cjs.Yc(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&bo(u)!==D&&o.add(u.id);}if(u.namespaceUri===chunkFIJZIQXA_cjs.la&&u.localName==="fldChar"){let f=ue(u,"fldCharType");if(f==="begin")chunk4GBTELJV_cjs.Yb(n),n.nesting===1&&(r=R,i=null,s="",a=false,p=false,l=chunkFIJZIQXA_cjs.Bf(u),d=0);else if(f==="separate"){let h=n.nesting===1;if(chunk4GBTELJV_cjs._b(n),h){let F=chunk4GBTELJV_cjs.Xb(n);s=F.instruction,a=F.overflow||n.nestingOverflow,i=R,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let F=chunk4GBTELJV_cjs.Xb(n);s=F.instruction,a=F.overflow||n.nestingOverflow;}if(!a&&chunk4GBTELJV_cjs.Xc(s,{hasSeparate:p,hasLegacyFormData:l,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&d!==D){let F=i??r;F&&o.add(F);}}chunk4GBTELJV_cjs.$b(n);}continue}if(u.namespaceUri===chunkFIJZIQXA_cjs.la&&(u.localName==="instrText"||u.localName==="delInstrText")){chunk4GBTELJV_cjs.Zb(n,Dt(u),u.localName==="delInstrText");continue}n.nesting>0&&chunk4GBTELJV_cjs.ac(n)&&u.namespaceUri===chunkFIJZIQXA_cjs.la&&At(u)&&(d|=y);for(let f=u.children.length-1;f>=0;f-=1){let h=u.children[f];h.kind!=="textValue"&&g.push({node:h,runId:R,visibility:y&Pt(u),containerDepth:chunkFIJZIQXA_cjs.xa(u,b)});}}chunk4GBTELJV_cjs.Wb(n);}function At(e){return e.localName==="t"||e.localName==="delText"?Dt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,Tt=2,Lt=4,D=ce|Tt|Lt;function bo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunkFIJZIQXA_cjs.la&&n.localName==="p")){if(n.namespaceUri===chunkFIJZIQXA_cjs.la&&At(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&Pt(n)});}}return t}function Pt(e){return e.namespaceUri!==chunkFIJZIQXA_cjs.la?D:e.localName==="ins"||e.localName==="moveTo"?ce|Tt:e.localName==="del"||e.localName==="moveFrom"?ce|Lt:D}function Ro(e){let o=new Map,t=n=>{let r=chunkQMLCVPCD_cjs.b(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===xo&&t(chunk4GBTELJV_cjs.$c),i.namespaceUri===chunkFIJZIQXA_cjs.la&&i.localName==="sym"&&t(chunkQMLCVPCD_cjs.c(co(i,"font"))),i.namespaceUri===chunkFIJZIQXA_cjs.la&&i.localName==="fldSimple"){let s=ue(i,"instr");t(chunk4GBTELJV_cjs.Wc(s??"")?.font??null);}if(i.namespaceUri===chunkFIJZIQXA_cjs.la&&i.localName==="p")for(let s of chunkK5U2PLDP_cjs.u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Dt(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 _t="FILE_TOO_LARGE",kt=8;function So(e){return typeof e=="object"&&e!==null}function Nt(e){if(!(!So(e)||typeof e.code!="string"))return e.code}function Mt(e){return e===""||e.toLowerCase()==="localhost"}function Oo(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Ct(e){let o=Oo(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 Ut(e){let o=Ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function vo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function wo(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(!Mt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Ut(o.pathname);if(t===null||vo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Ao(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 To(e){let o=Ao(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>kt)throw new TypeError(`trustedRoot must not exceed ${kt} directories`);return o.map(wo)}function Lo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunk4GBTELJV_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunk4GBTELJV_cjs.a}`);return e}function Po(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Mt(e.host))return null;let t=Ct(e.pathname);if(t===null)return null;for(let n of o){let r=Ut(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 Do(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 ko(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function It(e,o,t){return e.some(n=>ko(n,o,t))}async function Io(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Nt(r)==="ENOENT")continue;throw r}return t}function _o(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),l=e.map(y=>p.resolve(a(y.href))),d=p.resolve(a(typeof o=="string"?o:o.href));if(!It(l,d,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",u=await r(d,g),c=()=>{u.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(d);if(!It(await Io(l,i),y,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let b=(await u.stat()).size;if(!Number.isSafeInteger(b)||b<0||b>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:_t});let R=new Uint8Array(b),f=0;for(;f<R.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await u.read(R,f,R.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===R.byteLength?R:R.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await u.close().catch(()=>{});}}}function No(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=To(e.trustedRoot),t=Lo(e.maxBytes),n=e.read??_o(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=Do(i);if(p.protocol!=="file:")return r(p,s);let l=Po(p,o);if(!l)return new Response(null,{status:404});let d=a?new AbortController:void 0,g=()=>d?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let u;try{if(u=await n(l,{maxBytes:t,...d?{signal:d.signal}:{}}),a?.aborted)throw a.reason;if(u.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(d?.signal.aborted)throw d.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Nt(c);if(y===_t)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(u,{status:200})})}
2
+ Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunk6AWEKBLB_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunk6AWEKBLB_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunk6AWEKBLB_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunk6AWEKBLB_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=le;exports.acquireSharedExportShaping=ro;exports.createPackagedFileFetch=No;exports.hasExportAdmittedFont=te;exports.hasExportLaidOutText=ie;exports.hasFontBackedExportCapabilities=lo;exports.openFontBackedDocumentForExport=po;
@@ -0,0 +1,391 @@
1
+ /**
2
+ * `@docx-editor.dev/core/export` — DOM-free semantic export sessions and shared resources.
3
+ *
4
+ * Exporters consume the same published `SemanticLayout` records as the browser painter.
5
+ * They do not parse OOXML or independently derive document semantics.
6
+ *
7
+ * @packageDocumentation
8
+ * @public
9
+ */
10
+ import { a as ReviewDisplayMode, d as ResolvedRevisionMarkup, e as RevisionMarkupOptions } from './revision-projection-DZ4kKVev.js';
11
+ import { P as PreservedImageMime, I as ImageResourceLimits, S as SupportedImageMime, a as ImageDecodePort } from './image-resources-BN-hUgCn.js';
12
+ import { S as SemanticLayout, o as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, p as ListMarkerPictureRecord, T as TextMeasurer, n as FontRequest, q as FontSubstitution, r as ShapedRun, e as StyleSpanRecord } from './semantic-records-4B3WwFAi.js';
13
+ import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-qH331moE.js';
14
+ import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-BEyuiQOk.js';
15
+ import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-BVQB14qT.js';
16
+ import './types-barrel-D3xCgQX6.js';
17
+ import './editor-scope-OHPwVQ5l.js';
18
+ import './omml-equation-CuzBL5DD.js';
19
+ import './tree-package-fragment-BeeKxDw8.js';
20
+ import './editor-Ci7IZGmG.js';
21
+ import './review-pane-D9jm8DcY.js';
22
+ import './contracts/document.js';
23
+ import './contracts/interaction.js';
24
+ import './semantic-interaction-CIC-PooQ.js';
25
+ import './document-protection-BAGVGqaP.js';
26
+ import './failure-NS2lsya4.js';
27
+
28
+ /** Source content that cannot be certified by the layout snapshot. @public */
29
+ interface ExportContentWarning {
30
+ /** Content outside a supported layout subset stays preserved in the DOCX. */
31
+ readonly code: 'legacy-textbox' | 'legacy-drawing' | 'scan-limit' | 'unsupported-style-separator';
32
+ /** Package part containing the content, or where the bounded scan stopped. */
33
+ readonly partName: string;
34
+ }
35
+
36
+ /** Bounded package metadata for exporter output dictionaries. @public */
37
+ type ExportDocumentMetadata = Readonly<DocumentProperties>;
38
+ /** Model address shared by bookmarks and internal hyperlinks. @public */
39
+ interface ExportDestinationAnchor {
40
+ readonly name: string;
41
+ readonly paragraphId: string;
42
+ readonly offset: number;
43
+ }
44
+ /** Laid-out jump target in the coordinate spaces export traversal uses. @public */
45
+ interface ExportDestinationGeometry {
46
+ readonly anchor: ExportDestinationAnchor;
47
+ readonly pageIndex: number;
48
+ /** Caret geometry in page-content coordinates (same space as line boxes). */
49
+ readonly pageContent: Readonly<{
50
+ readonly x: number;
51
+ readonly y: number;
52
+ readonly height: number;
53
+ }>;
54
+ /** Top-left of the caret in stacked page coordinates. */
55
+ readonly pageStack: Readonly<{
56
+ readonly x: number;
57
+ readonly y: number;
58
+ }>;
59
+ }
60
+ /**
61
+ * Resolve one internal destination name from a Core-produced export layout.
62
+ * @public
63
+ */
64
+ declare function exportDestinationNamed(layout: {
65
+ readonly destinations?: readonly ExportDestinationGeometry[];
66
+ }, name: string): ExportDestinationGeometry | undefined;
67
+
68
+ /** Optional caller conversion for preserved formats such as EMF/WMF/TIFF. @public */
69
+ type PreservedImageConverter = (bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits,
70
+ /** Aborted when the owning export session is disposed. */
71
+ signal?: AbortSignal) => Promise<Readonly<{
72
+ bytes: Uint8Array;
73
+ mime: SupportedImageMime;
74
+ }> | null>;
75
+ /**
76
+ * Decode raster dimensions from validated headers, with no native image dependency or DOM.
77
+ * SVG sizing is handled by the resource registry; preserved formats stay placeholders unless
78
+ * the caller supplies `convertPreserved`.
79
+ * @public
80
+ */
81
+ declare function createNodeImageDecodePort(options?: {
82
+ readonly convertPreserved?: PreservedImageConverter;
83
+ }): ImageDecodePort;
84
+
85
+ /** Source accepted by every exporter: untrusted bytes or an already-open live view. @public */
86
+ type ExportDocumentSource = Uint8Array | HeadlessDocumentView;
87
+ /** Shared session options; translators add their own format-specific options. @public */
88
+ interface OpenDocumentForExportOptions {
89
+ /** Viewer markup applied before layout and export. */
90
+ readonly revisionMarkup?: RevisionMarkupOptions;
91
+ /** Stable author color slots captured from the editor session. */
92
+ readonly revisionAuthorSlots?: Readonly<Record<string, number>>;
93
+ /**
94
+ * Revision projection applied before records reach an exporter. Default: `all-markup`.
95
+ *
96
+ * The safe reader default keeps every pending insertion and deletion visible. Choose
97
+ * `proposed` or `original` explicitly only when a resolved view is intended.
98
+ */
99
+ readonly displayMode?: ReviewDisplayMode;
100
+ /**
101
+ * Text measurement used for line wrapping and pagination. Omit only when deterministic
102
+ * approximate pagination is acceptable. Core then uses a fixed-width fallback that neither
103
+ * resolves nor shapes the document's fonts, so line and page breaks can differ from Word.
104
+ * Exporters promising physical-page fidelity must supply a font-backed measurer. For immutable
105
+ * DOCX bytes with document-aware font origins, use {@link openFontBackedDocumentForExport};
106
+ * {@link acquireSharedExportShaping} is for process-static prepared configurations or a live
107
+ * host that already owns revision-stable shaping.
108
+ */
109
+ readonly measurer?: TextMeasurer;
110
+ /**
111
+ * Stable measurement implementation identity used by layout caches and diagnostics. Pair it
112
+ * with the exact shaping policy behind `measurer`; it is not a substitute for matching metrics.
113
+ */
114
+ readonly producer?: string;
115
+ /** Host image metadata decoder; omit for the bounded DOM-free Node decoder. */
116
+ readonly imageDecodePort?: ImageDecodePort;
117
+ /** Optional converter for preserved image formats the default decoder cannot inspect. */
118
+ readonly convertPreservedImage?: PreservedImageConverter;
119
+ /** Cancels resource waits and subsequent layouts. */
120
+ readonly signal?: AbortSignal;
121
+ /** Maximum time spent waiting for image resources in one layout call. Default: 60 seconds. */
122
+ readonly resourceTimeoutMs?: number;
123
+ /** Retain incremental state for a live view. Defaults to true for views and false for bytes. */
124
+ readonly reuseAcrossRevisions?: boolean;
125
+ }
126
+ /**
127
+ * Export-ready semantic snapshot. Core guarantees normalized review artifacts for every session,
128
+ * including an empty immutable array when the source has none. A resolved snapshot is recursively
129
+ * immutable and remains traversable after its producer session is disposed; disposal only revokes
130
+ * session-owned work and capabilities such as {@link ExportSession.validatedImageBytes}.
131
+ * @public
132
+ */
133
+ interface ExportSemanticLayout extends SemanticLayout {
134
+ /** Requested review view; Simple Markup uses the proposed text projection. */
135
+ readonly reviewDisplayMode?: ReviewDisplayMode;
136
+ /** Viewer preferences used for this layout. */
137
+ readonly revisionMarkup?: ResolvedRevisionMarkup;
138
+ /** Stable author color slots captured from the editor session. */
139
+ readonly revisionAuthorSlots?: Readonly<Record<string, number>>;
140
+ /** Whether outside change bars alternate page margins. */
141
+ readonly facingPages?: boolean;
142
+ /** Source omissions that cannot be detected by walking laid-out records. */
143
+ readonly contentWarnings?: readonly ExportContentWarning[];
144
+ readonly reviewArtifacts: readonly SemanticReviewArtifactRecord[];
145
+ readonly documentMetadata?: ExportDocumentMetadata;
146
+ readonly destinations?: readonly ExportDestinationGeometry[];
147
+ }
148
+ /** Bounded failure from a headless export session. @public */
149
+ declare class ExportResourceError extends Error {
150
+ readonly code: 'aborted' | 'timedOut' | 'nonConvergent' | 'disposed' | 'layoutInvariant' | 'layoutFailed';
151
+ constructor(code: 'aborted' | 'timedOut' | 'nonConvergent' | 'disposed' | 'layoutInvariant' | 'layoutFailed', message: string, options?: ErrorOptions);
152
+ }
153
+ /**
154
+ * A single semantic-layout substrate reusable by Markdown and later exporters. Pagination
155
+ * fidelity is determined by the session's measurer; core's default is deterministic, not
156
+ * font-accurate.
157
+ * @public
158
+ */
159
+ interface ExportSession {
160
+ /** Settle resources and return the default revision projection. */
161
+ layout(): Promise<ExportSemanticLayout>;
162
+ /** Settle resources and cache one explicit revision projection. */
163
+ layoutFor(displayMode: ReviewDisplayMode): Promise<ExportSemanticLayout>;
164
+ /**
165
+ * Mint a defensive copy only for a ready image published by this session.
166
+ *
167
+ * Takes any record that carries a validated `resource`: an inline or anchored drawing, or
168
+ * a list marker's picture bullet. A resource that is not `ready` answers null.
169
+ */
170
+ validatedImageBytes(source: InlineDrawingRecord | AnchoredDrawingRecord | ListMarkerPictureRecord): Uint8Array | null;
171
+ /**
172
+ * Release per-document caches, pending resource work, and image-byte capabilities. Idempotent.
173
+ * Previously resolved layout snapshots remain immutable and traversable after disposal.
174
+ */
175
+ dispose(): void;
176
+ }
177
+ /** Typed refusal for bytes that cannot become a document view, or an already-aborted open. @public */
178
+ type OpenDocumentForExportResult = {
179
+ readonly ok: true;
180
+ readonly session: ExportSession;
181
+ } | {
182
+ readonly ok: false;
183
+ readonly reason: HeadlessDocumentRejection | 'aborted';
184
+ readonly detail?: string;
185
+ };
186
+ /** Open bytes or a live neutral view into one reusable layout session. @public */
187
+ declare function openDocumentForExport(source: ExportDocumentSource, options?: OpenDocumentForExportOptions): OpenDocumentForExportResult;
188
+
189
+ /** One paintable face in an export font-resolution report. @public */
190
+ interface ExportFontFaceResolution {
191
+ readonly weight: 400 | 700;
192
+ readonly style: 'normal' | 'italic';
193
+ readonly sourceFamily: string;
194
+ readonly via: 'direct' | 'substitution';
195
+ /** Admitted face identity (`hash#faceIndex`); remains after session disposal. */
196
+ readonly identity?: string;
197
+ readonly id?: string;
198
+ readonly hash?: string;
199
+ readonly faceIndex?: number;
200
+ /** Full substitution evidence; `null` when the admitted face answers the request directly. */
201
+ readonly substitution?: FontSubstitution | null;
202
+ }
203
+ /** Coverage of one family Core layout may request. @public */
204
+ interface ExportFontFamilyResolution {
205
+ readonly family: string;
206
+ readonly coverage: 'complete' | 'partial' | 'none';
207
+ readonly faces: readonly ExportFontFaceResolution[];
208
+ }
209
+ /** One document-embedded face the export mapper refused before composition. @public */
210
+ interface ExportDroppedEmbeddedFont {
211
+ readonly request: FontRequest;
212
+ readonly partName: string;
213
+ readonly reason: 'overLimit' | 'malformed';
214
+ }
215
+ /** Exporter-neutral evidence for the font policy behind one layout session. @public */
216
+ interface ExportFontResolutionReport {
217
+ readonly requestedFamilies: readonly string[];
218
+ readonly defaultFamily: string;
219
+ readonly families: readonly ExportFontFamilyResolution[];
220
+ readonly originFailures: readonly FontOriginFailure[];
221
+ /** Bounded drop evidence from the document-embedded font origin; omitted on legacy mocks. */
222
+ readonly droppedEmbeddedFonts?: readonly ExportDroppedEmbeddedFont[];
223
+ }
224
+ /** Byte-free admitted face identity for laid-out text and evidence. @public */
225
+ interface ExportAdmittedFontIdentity {
226
+ readonly id: string;
227
+ readonly identity: string;
228
+ readonly family: string;
229
+ readonly request: FontRequest;
230
+ readonly byteLength: number;
231
+ readonly hash: string;
232
+ readonly faceIndex: number;
233
+ readonly substitution: FontSubstitution | null;
234
+ }
235
+ /**
236
+ * Session-visible admitted face whose bytes are shared with the session shaper and
237
+ * content-hashed shaping cache. Treat {@link ExportAdmittedFontFace.bytes} as
238
+ * strictly read-only; in-place mutation can corrupt later shaping after cache
239
+ * eviction or before the first shape for that face.
240
+ * @public
241
+ */
242
+ interface ExportAdmittedFontFace extends ExportAdmittedFontIdentity {
243
+ /**
244
+ * Shared font bytes owned by the session shaper and shaping cache. Not a copy.
245
+ * Must be treated as read-only.
246
+ */
247
+ readonly bytes: Uint8Array;
248
+ }
249
+ /** Session capability that yields admitted face bytes on demand. @public */
250
+ interface ExportAdmittedFontApi {
251
+ /**
252
+ * Exact admitted face bytes and identity used by this session's measurer.
253
+ * Stops after disposal or abort; resolution evidence on `fontResolution` remains.
254
+ */
255
+ admittedFontFace(request: FontRequest): ExportAdmittedFontFace | null;
256
+ }
257
+ /** Whether a value publishes {@link ExportAdmittedFontApi}. @public */
258
+ declare function hasExportAdmittedFont<T extends object>(value: T): value is T & ExportAdmittedFontApi;
259
+
260
+ /**
261
+ * Exact shaped glyph run and admitted font identity for one published span.
262
+ *
263
+ * The run is shaped at the base size measurement uses. Callers apply the span's drawn-size
264
+ * factor, horizontal scale, and character spacing from {@link StyleSpanRecord.style}.
265
+ * The glyph origin is `span.box.x + (span.glyphOffsetPt ?? 0)`; the offset is
266
+ * already in layout points and must not be scaled a second time by horizontal scale.
267
+ * `font` is a frozen byte-free descriptor; obtain bytes from the session font capability.
268
+ * @public
269
+ */
270
+ interface ExportLaidOutText {
271
+ readonly run: ShapedRun;
272
+ readonly font: ExportAdmittedFontIdentity;
273
+ /** Face descriptors indexed by run.fontSpans when a run needs multiple faces. */
274
+ readonly fonts?: readonly ExportAdmittedFontIdentity[];
275
+ readonly fixedPointScale: number;
276
+ }
277
+ /** Additive laid-out text shaping for font-backed export sessions and shared shaping. @public */
278
+ interface ExportLaidOutTextApi {
279
+ /**
280
+ * Shape one published span with the same configuration and policy as measurement.
281
+ * Returns null when measurement used the bounded fallback.
282
+ */
283
+ shapeLaidOutText(span: StyleSpanRecord): ExportLaidOutText | null;
284
+ }
285
+ /** Whether a value publishes {@link ExportLaidOutTextApi}. @public */
286
+ declare function hasExportLaidOutText<T extends object>(value: T): value is T & ExportLaidOutTextApi;
287
+
288
+ /** Immutable handle over process-wide measurement state reusable by every exporter. @public */
289
+ interface SharedExportShaping {
290
+ /** Create one document-scoped measurement cache over the process-wide immutable substrate. */
291
+ createMeasurer(): TextMeasurer;
292
+ /** Stable cache/diagnostic producer identity for export layout sessions. */
293
+ readonly producer: string;
294
+ /** Font and substitution identity shared with browser layout caches. */
295
+ readonly extensionFingerprint: string;
296
+ }
297
+ /** Core-produced shared shaping with exact laid-out text. @public */
298
+ type SharedExportShapingCapabilities = SharedExportShaping & ExportLaidOutTextApi;
299
+ /** Process-wide ceiling preventing host-derived cache keys from retaining unbounded font sets. @public */
300
+ declare const MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS = 32;
301
+ /**
302
+ * Acquire one process-wide shaped measurement substrate for a host configuration.
303
+ *
304
+ * Failed initialization is evicted so a corrected transient resource can retry. Successful
305
+ * native shaping and admitted font bytes intentionally live for the process lifetime; export
306
+ * sessions retain only their own layout caches and remain independently disposable.
307
+ * @public
308
+ */
309
+ declare function acquireSharedExportShaping(prepared: PreparedLayoutFontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<SharedExportShapingCapabilities>;
310
+
311
+ /** Export session retaining the exact font evidence used to construct its measurer. @public */
312
+ interface FontBackedExportSession extends ExportSession {
313
+ /** Immutable font-resolution evidence; remains readable after session disposal. */
314
+ readonly fontResolution: ExportFontResolutionReport;
315
+ }
316
+ /** Core-produced font-backed session with admitted-face and laid-out-text capabilities. @public */
317
+ interface FontBackedExportCapabilities extends FontBackedExportSession, ExportAdmittedFontApi, ExportLaidOutTextApi {
318
+ }
319
+ /** Whether a value publishes both font-backed session capabilities. @public */
320
+ declare function hasFontBackedExportCapabilities<T extends object>(value: T): value is T & ExportAdmittedFontApi & ExportLaidOutTextApi;
321
+ /** Result of opening immutable bytes through Core's document-aware font composition root. @public */
322
+ type OpenFontBackedDocumentForExportResult = {
323
+ readonly ok: true;
324
+ readonly session: FontBackedExportCapabilities;
325
+ } | Exclude<OpenDocumentForExportResult, {
326
+ readonly ok: true;
327
+ }>;
328
+ /** Font-backed one-shot session options shared by Markdown and future exporters. @public */
329
+ interface OpenFontBackedDocumentForExportOptions extends Omit<OpenDocumentForExportOptions, 'measurer' | 'reuseAcrossRevisions'> {
330
+ /** Apply document optional ligatures to both layout measurement and exported glyphs. */
331
+ readonly documentLigatures?: boolean;
332
+ /** Immutable font-backed byte sessions reject incremental revision reuse. */
333
+ readonly reuseAcrossRevisions?: false;
334
+ /** Ordered first-wins font origins resolved against this immutable DOCX. */
335
+ readonly fonts: FontOrigin | readonly FontOrigin[];
336
+ /**
337
+ * Origins composed AFTER the document's own embedded fonts, for faces nothing else covers.
338
+ * An origin here sees every face the explicit origins and the embedded fonts can paint in
339
+ * `resolvedFaces`, so a stand-in it offers cannot shadow a face the document carries.
340
+ */
341
+ readonly lastResortFonts?: FontOrigin | readonly FontOrigin[];
342
+ /** Font provisioning deadline; defaults to `resourceTimeoutMs`, then 60 seconds. */
343
+ readonly fontResolutionTimeoutMs?: number;
344
+ /** Ordered admitted faces used when a complete text span lacks glyph coverage. Maximum 16. */
345
+ readonly glyphFallbacks?: readonly FontRequest[];
346
+ /** `strict` refuses incomplete face coverage or any failed origin. Default: `best-effort`. */
347
+ readonly fontPolicy?: 'best-effort' | 'strict';
348
+ /** Fire-and-forget diagnostics; returned promises are observed but do not delay export. */
349
+ readonly onFontResolution?: (report: ExportFontResolutionReport) => void;
350
+ }
351
+ /**
352
+ * Open immutable DOCX bytes with document-aware, session-owned font shaping.
353
+ *
354
+ * This is the composition root exporters should use. It parses before requesting fonts, applies
355
+ * cancellation/deadlines to provisioning, atomically binds the resulting measurer to that parsed
356
+ * view, and releases the document-specific font lease with the returned session. When best-effort
357
+ * resolution admits no source, the session retains Core's deterministic fixed measurer; strict
358
+ * policy already refuses that incomplete coverage. Mutable views are intentionally excluded: a
359
+ * live editor host must supply its own revision-stable measurer.
360
+ *
361
+ * @public
362
+ */
363
+ declare function openFontBackedDocumentForExport(source: Uint8Array, options: OpenFontBackedDocumentForExportOptions): Promise<OpenFontBackedDocumentForExportResult>;
364
+
365
+ /** Read packaged bytes from a confined local `file:` URL. Kept injectable for tests. @public */
366
+ type PackagedFileRead = (path: string | URL, options: {
367
+ readonly signal?: AbortSignal;
368
+ readonly maxBytes: number;
369
+ }) => Promise<Uint8Array>;
370
+ /**
371
+ * Bounds for {@link createPackagedFileFetch}. `trustedRoot` is one directory or a short
372
+ * host-chosen list of directories of allowed `file:` URLs. `maxBytes` is the per-file
373
+ * allocation ceiling and cannot exceed the engine font-byte ceiling.
374
+ * @public
375
+ */
376
+ interface PackagedFileFetchOptions {
377
+ readonly trustedRoot: string | URL | readonly (string | URL)[];
378
+ readonly maxBytes: number;
379
+ readonly read?: PackagedFileRead;
380
+ readonly networkFetch?: typeof fetch;
381
+ }
382
+ /**
383
+ * Build the packaged-asset fetch adapter shared by headless exporters.
384
+ * File reads stay inside the host-chosen `trustedRoot` list and never allocate more than `maxBytes`.
385
+ * Kept injectable for lifecycle and host-fetch tests.
386
+ * @public
387
+ */
388
+ declare function createPackagedFileFetch(options: PackagedFileFetchOptions): typeof fetch;
389
+
390
+ export { ExportResourceError, FontOrigin, FontOriginFailure, FontRequest, FontSubstitution, MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS, acquireSharedExportShaping, createNodeImageDecodePort, createPackagedFileFetch, exportDestinationNamed, hasExportAdmittedFont, hasExportLaidOutText, hasFontBackedExportCapabilities, openDocumentForExport, openFontBackedDocumentForExport };
391
+ export type { ExportAdmittedFontApi, ExportAdmittedFontFace, ExportAdmittedFontIdentity, ExportContentWarning, ExportDestinationAnchor, ExportDestinationGeometry, ExportDocumentMetadata, ExportDocumentSource, ExportDroppedEmbeddedFont, ExportFontFaceResolution, ExportFontFamilyResolution, ExportFontResolutionReport, ExportLaidOutText, ExportLaidOutTextApi, ExportSemanticLayout, ExportSession, FontBackedExportCapabilities, FontBackedExportSession, OpenDocumentForExportOptions, OpenDocumentForExportResult, OpenFontBackedDocumentForExportOptions, OpenFontBackedDocumentForExportResult, PackagedFileFetchOptions, PackagedFileRead, PreservedImageConverter, SharedExportShaping, SharedExportShapingCapabilities };
@@ -0,0 +1,2 @@
1
+ import {c as c$1,x,o,d as d$1,z as z$1,f,v,s,j as j$2,C,m,u,l as l$1}from'./chunk-VDNNLG6X.js';import {j as j$1,l,k,q as q$1,h,n,c as c$2,g,_ as _$1,Z,aa}from'./chunk-2RC2EPND.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-6EYYL7FL.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-6EYYL7FL.js';import {c,ga,ua,dd,ed,ba,ha,h as h$1,a,d as d$2,Wc,b as b$1,i,Vb,Yc,Yb,_b,Xb,Xc,$b,Zb,ac,Wb,p,s as s$1,n as n$1,$c}from'./chunk-FRXAOVTB.js';import {e as e$1,c as c$3,b as b$2}from'./chunk-5CSUYANV.js';import'./chunk-TSLBZ26X.js';import {Ba}from'./chunk-J6BVWIDB.js';import {ch,dh,zc,yc,b,la,J,if as _if,wa,Bf,xa}from'./chunk-4R3TEXMN.js';function _(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((u,c)=>u.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let u of o.text){let c=u.toUpperCase()!==u,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(u))?y.text+=u:i.push({text:u,start:s,lower:c}),s+=u.length;}let a=[],p=[],l=[],d=true,g=0;for(let u of o.environment.direction==="rtl"?i.reverse():i){let c=u.lower?.8:1,y=[],b=[],R="",f=u.start;for(let x of u.text){let m=u.lower?x.toUpperCase():x;for(let E=0;E<m.length;E++)y.push(f),b.push(f+x.length);R+=m,f+=x.length;}let h=e.shape({...n,text:R}),F=a.length;for(let[x,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[x];E===void 0?d=false:l.push(E*c),a.push({...m,cluster:y[m.cluster]??u.start,originX:n$1(g+Math.round(m.originX*c)),originY:n$1(Math.round(m.originY*c)),offsetX:n$1(Math.round(m.offsetX*c)),offsetY:n$1(Math.round(m.offsetY*c)),advanceX:n$1(Math.round(m.advanceX*c)),advanceY:n$1(Math.round(m.advanceY*c)),drawScale:c});}for(let x of h.clusters){let m=y[x.textStart]??u.start,E=b[x.textEnd-1]??f,L=n$1(Math.round(x.advance*c)),A=p.at(-1);A&&A.textStart===m&&A.textEnd===E?p[p.length-1]={...A,glyphEnd:F+x.glyphEnd,advance:n$1(A.advance+L),caretEdges:[n$1(0),n$1(A.advance+L)]}:p.push({...x,textStart:m,textEnd:E,glyphStart:F+x.glyphStart,glyphEnd:F+x.glyphEnd,advance:L,caretEdges:x.caretEdges.map(V=>n$1(Math.round(V*c))),fontSpan:0});}g+=h.glyphs.reduce((x,m)=>x+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:d&&l.length===a.length?l:void 0}}var ut=new WeakMap;function zt(e){let o=ut.get(e);return o===void 0&&(o=Xt(e.bytes,e.faceIndex),ut.set(e,o)),o}var jt=new Set(["COLR","CBDT","sbix"]),Ht=512;function Xt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(ct(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Ht);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(jt.has(ct(e,s)))return true}return false}function ct(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Gt=/\p{Emoji_Presentation}|️/u;function Vt(e){return Gt.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(zt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Vt(o)?[...t,...n]:[...n,...t]}var Wt=2048;function pt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Wt)return null;let r=(f,h)=>{let{context:F,...x}=o,m={...x,text:h,environment:p({...o.environment,font:f})};return _(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t.clusters].sort((h,F)=>h.textStart-F.textStart)){let h=o.environment.font,F=o.text.slice(f.textStart,f.textEnd),x=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(F)&&x&&x.end===f.textStart){x.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(F)&&x&&x.font!==o.environment.font&&x.end===f.textStart){x.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(F)??q(n,E).find(A=>{try{return !r(A,F).glyphs.some(V=>V.id===0)}catch{return false}});if(!L)return null;s.set(F,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],p$1=[],l=[],d=[],g=true,u=0,c=0,y=0,b=0,R=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let F=a.length,x=l.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:n$1(u+m.originX),originY:n$1(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)d.push(m);for(let m of h.clusters)p$1.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:F+m.glyphStart,glyphEnd:F+m.glyphEnd,fontSpan:x});h.glyphs.length&&l.push({font:f.font,glyphStart:F,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),u+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),b=Math.max(b,h.metrics.descent),R=Math.max(R,h.metrics.lineGap);}return s$1({...t,glyphs:a,clusters:p$1,fontSpans:l,exactAdvancesX:g&&d.length===a.length?d:void 0,metrics:{ascent:n$1(y),descent:n$1(b),lineGap:n$1(R)}},{...o.environment,fallbackOrder:n})}var Yt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),$t=512,ft=new WeakMap;function Kt(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let p=r(a+4);if(p<0||p>1024)return t;let l=-1;for(let c=0;c<p;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){l=i(y+8);break}}if(l<0)return t;let d=r(l+4);if(d<=0)return t;let g=l+d,u=r(g);if(u<0)return t;for(let c=0;c<Math.min(u,$t);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Zt(e,o){let t=ft.get(e);return t||(t=Kt(e.bytes,e.faceIndex),ft.set(e,t)),(Yt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function mt(e,o){let t=e.filter(n=>Zt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function Q(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return s$1({...i,text:o.text},o.environment)}catch{return t}}function yt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof d$2)),n={shape(a){return Q(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let p=e.shaper.shape(a),l=r.get(p);if(l&&l.input.text===a.text&&l.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&l.input.bidiLevel===a.bidiLevel&&l.input.context?.before===a.context?.before&&l.input.context?.after===a.context?.after&&l.input.environment===a.environment)return l.run;let d=s(a,Q(e.shaper,a,p));return r.set(p,{input:a,run:d}),d}},s=(a,p$1)=>{let l=_(n,a,p$1);if(!l.glyphs.some(d=>d.id===0)||/^[\t\n\r\f]*$/.test(a.text))return l;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let d=pt(n,a,l,t);if(d)return d}for(let d of mt(q(t,a.text),a.environment.script))if(!(d.hash===a.environment.font.hash&&d.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:p({...a.environment,font:d})},u=_(n,g,n.shape(g));if(!u.glyphs.some(c=>c.id===0))return u}catch{}return l};return {...e,shaper:i}}var ee=b$1;function te(e){return typeof e.admittedFontFace=="function"}var Jt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var ht=new WeakMap;function j(e){let o=ht.get(e);return o||ht.set(e,o=Qt(e)),o}function Qt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:z(o.requested),resolved:z(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function eo(e){return Object.freeze({...j(e),bytes:i(e)})}function to(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$2?null:eo(t)}catch{return null}}function gt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return to(e.resolve(),o)}}function oo(e){return Object.freeze(e.slice(0,ee).map(o=>Object.freeze({request:z(o.request),partName:o.partName,reason:o.reason})))}function oe(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let p=a.toLowerCase();i.has(p)||i.set(p,a);}let s=[...i.values()].map(a=>{let p=[];for(let l of Jt){let d=n?.({family:a,...l});!d||d instanceof d$2||p.push(Object.freeze({...l,sourceFamily:d.family,via:d.substitution?"substitution":"direct",identity:d.identity,id:d.id,hash:d.hash,faceIndex:d.faceIndex,substitution:d.substitution}));}return Object.freeze({family:a,coverage:p.length===4?"complete":p.length>0?"partial":"none",faces:Object.freeze(p)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:oo(r)})}function ne(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 re(e,o,t=[]){let n=l=>l.trim().toLowerCase(),r=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),i=new Set(t.map(l=>n(l.family))),s=l=>{if(!(l instanceof l$1))return true;let d=n(l.request.family);return r.has(d)||!i.has(d)},a=e.originFailures.some(({cause:l})=>l instanceof m?l.causes.length===0||l.causes.some(s):s(l));if(o.fontPolicy!=="strict"||!a&&e.families.every(l=>l.coverage==="complete"))return;let p=e.families.filter(l=>l.coverage!=="complete").map(l=>l.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function H(){return new Map}function X(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=h$1(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof d$2?null:s}function xt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return X(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function no(e){for(let o of e){let t=o.codePointAt(0);if(t!==32&&(t<=255||t>=61440&&t<=61695))return false}return true}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=ua(n.style,n.fontSlot),i=dd(n)?ed(n):ba(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=X(e,o,s,r)??(b(s)&&no(i)?X(e,o,e.defaultFont.family,r):null);if(!a)return null;try{if(r.smallCaps&&!_$1(e.shaper,e.environment,a,r,t))return null;let p=Z(e.shaper,e.environment,a,r,i);return Object.freeze({run:p,font:j(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(l=>j(l.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Ft(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,G=new WeakMap,se=0,M,le=32,Et=c;function bt(){if(M)return M;let e=(async()=>(await c$2(),g(h)))();return M=e,e.catch(()=>{M===e&&(M=void 0);}),e}function Rt(e){let o=H();return aa(e,{resolveFont(t){return xt(e,o,t)},fallback:ha()})}async function St(e,o,t=[],n=false){if(!j$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await bt(),i=yt(await q$1(e,r,h,o,n),t);return Object.freeze({createMeasurer:()=>Rt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${ga}`].join("|"),extensionFingerprint:e.fingerprint})}function ro(e,o){if(!j$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=G.get(e);if(t)return t;let n=l(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let p=k(e).sources.reduce((d,g)=>d+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+p>Et)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Et} process-wide`);se+=p;let l;try{let d=await bt();l=await q$1(e,d,h,o);}catch(d){throw se-=p,d}return Object.freeze({createMeasurer:()=>Rt(l),shapeLaidOutText:ae(l),shapingHash:l.operation.shapingHash,producerVersion:l.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${ga}`].join("|"),extensionFingerprint:i}));return G.set(e,s),s.catch(()=>{G.get(e)===s&&G.delete(e);}),s}var io="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function ao(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===io),n;if(t){let r=J(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),_if(o,n)}function Ot(e,o){let t=ao(e);if(t.length!==0)return j$2(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>h$1(s))),i=C(t,{maxFontBytes:a,aggregateBudget:so(n),shadowedRequests:r});if(o)for(let s of i.dropped){if(o.dropped.length>=ee)break;o.dropped.push(s);}return {sources:i.sources}})}function so(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function lo(e){return te(e)&&ie(e)}var w=0,vt=Symbol("font-resolution-timeout");function uo(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ue(e,o){return e.attributes.find(t=>t.localName===o)?.value}function co(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===la||t.namespaceUri===""))?.value}async function po(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=Ba(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:l,...d$1}=o,g=Array.isArray(n)?n:[n],u=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await fo(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:l,lastResortFonts:u,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let b;try{b=e(t.view,{...d$1,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!b.ok)return y?.dispose(),b;let R=b.session,f=y,h="active",F=()=>h==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),x=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{R.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>x("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?R.layout():Promise.reject(F()),layoutFor:E=>h==="active"?R.layoutFor(E):Promise.reject(F()),validatedImageBytes:E=>h==="active"?R.validatedImageBytes(E):null,admittedFontFace:gt({status:()=>h,unavailable:F,resolve:()=>f?.resolveFont}),shapeLaidOutText:Ft({status:()=>h,unavailable:F,shaping:()=>f}),dispose:()=>x("disposed")})}}async function fo(e,o$1,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n$1=mo(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(vt),n$1);try{de(r.signal);let a=(async()=>{let p=uo(t.onActiveFontBytesChange),l=!1;try{let d=ho(e).slice(0,c$1),g=x(e,d),u=[],c={dropped:[]},y=Ot(e,c),b=[...o$1,...y?[y]:[],...t.lastResortFonts??[]],R=await o(b,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...g.families])].slice(0,c$1),defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:x=>u.push(x),reserveOwnedBytes:p.reserve,maxExecutionFontBytes:h.maxFontBytes});de(r.signal);let f$1=z$1(f(R??{}),g);if(f$1.sources.length===0){let x=oe(d,f$1.defaultFont.family,u,void 0,c.dropped);ne(x,t),re(x,t,t.glyphFallbacks);return}let h$1=await St(n(f$1),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let F=oe(d,f$1.defaultFont.family,u,h$1.resolveFont,c.dropped);return ne(F,t),re(F,t,t.glyphFallbacks),l=!0,Object.freeze({...h$1,dispose:p.release})}finally{l||p.release();}})();return await Promise.race([a,yo(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function mo(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 yo(e){return new Promise((o,t)=>{let n=()=>{t(wt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function wt(e){let o=e.reason===vt;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw wt(e)}function ho(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(d,g)=>{!g||r.has(g.name)||(r.add(g.name),d.push(g.root));};for(let d of e.headerFooterPartsBySection()){for(let g of d.headers.values())i(t,g);for(let g of d.footers.values())i(t,g);}for(let d of ["footnote","endnote"])n.push(...go(e,d));let s$1=e.documentThemeFonts(),a={...s$1,major:s$1.major,minor:s$1.minor,majorEastAsia:s$1.majorEastAsia??null,minorEastAsia:s$1.minorEastAsia??null},p=new Map,l=(d,g)=>{let u=e$1(d,e.stylesRoot(),a,Fo(d,g)),c=v(d,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...u.direct,...Ro(d),...c,...s(d,e.stylesRoot(),a),...u.inherited]){let b=y.toLowerCase();p.has(b)||p.set(b,y);}};return l(o,"body"),l(t,"furniture"),l(n,"note"),[...p.values()]}function go(e,o){let t=ch(e.currentPackage(),o);if(!t)return [];let n=new Set(dh(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 s=zc(i),a=yc(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var xo="http://schemas.openxmlformats.org/officeDocument/2006/math";function Fo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===la&&s.localName==="p"&&r.push({paragraph:s,context:a});let p=s.namespaceUri===la&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let l=s.children.length-1;l>=0;l-=1){let d=s.children[l];d.kind!=="textValue"&&i.push({node:d,context:p});}}for(let s of r)Eo(s.paragraph,t,s.context);}return t}function Eo(e,o,t){let n=Vb(),r=null,i=null,s="",a=false,p=false,l=false,d=0,g=[];for(let u=e.children.length-1;u>=0;u-=1){let c=e.children[u];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:u,runId:c,visibility:y,containerDepth:b}=g.pop();if(b>=wa||u.namespaceUri===la&&u.localName==="p")continue;let R=u.namespaceUri===la&&u.localName==="r"?u.id:c;if(u.namespaceUri===la&&u.localName==="fldSimple"){let f=ue(u,"instr")??"";Yc(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&bo(u)!==D&&o.add(u.id);}if(u.namespaceUri===la&&u.localName==="fldChar"){let f=ue(u,"fldCharType");if(f==="begin")Yb(n),n.nesting===1&&(r=R,i=null,s="",a=false,p=false,l=Bf(u),d=0);else if(f==="separate"){let h=n.nesting===1;if(_b(n),h){let F=Xb(n);s=F.instruction,a=F.overflow||n.nestingOverflow,i=R,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let F=Xb(n);s=F.instruction,a=F.overflow||n.nestingOverflow;}if(!a&&Xc(s,{hasSeparate:p,hasLegacyFormData:l,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&d!==D){let F=i??r;F&&o.add(F);}}$b(n);}continue}if(u.namespaceUri===la&&(u.localName==="instrText"||u.localName==="delInstrText")){Zb(n,Dt(u),u.localName==="delInstrText");continue}n.nesting>0&&ac(n)&&u.namespaceUri===la&&At(u)&&(d|=y);for(let f=u.children.length-1;f>=0;f-=1){let h=u.children[f];h.kind!=="textValue"&&g.push({node:h,runId:R,visibility:y&Pt(u),containerDepth:xa(u,b)});}}Wb(n);}function At(e){return e.localName==="t"||e.localName==="delText"?Dt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,Tt=2,Lt=4,D=ce|Tt|Lt;function bo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===la&&n.localName==="p")){if(n.namespaceUri===la&&At(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&Pt(n)});}}return t}function Pt(e){return e.namespaceUri!==la?D:e.localName==="ins"||e.localName==="moveTo"?ce|Tt:e.localName==="del"||e.localName==="moveFrom"?ce|Lt:D}function Ro(e){let o=new Map,t=n=>{let r=b$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===xo&&t($c),i.namespaceUri===la&&i.localName==="sym"&&t(c$3(co(i,"font"))),i.namespaceUri===la&&i.localName==="fldSimple"){let s=ue(i,"instr");t(Wc(s??"")?.font??null);}if(i.namespaceUri===la&&i.localName==="p")for(let s of u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Dt(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 _t="FILE_TOO_LARGE",kt=8;function So(e){return typeof e=="object"&&e!==null}function Nt(e){if(!(!So(e)||typeof e.code!="string"))return e.code}function Mt(e){return e===""||e.toLowerCase()==="localhost"}function Oo(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Ct(e){let o=Oo(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 Ut(e){let o=Ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function vo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function wo(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(!Mt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Ut(o.pathname);if(t===null||vo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Ao(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 To(e){let o=Ao(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>kt)throw new TypeError(`trustedRoot must not exceed ${kt} directories`);return o.map(wo)}function Lo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function Po(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Mt(e.host))return null;let t=Ct(e.pathname);if(t===null)return null;for(let n of o){let r=Ut(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 Do(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 ko(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function It(e,o,t){return e.some(n=>ko(n,o,t))}async function Io(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Nt(r)==="ENOENT")continue;throw r}return t}function _o(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),l=e.map(y=>p.resolve(a(y.href))),d=p.resolve(a(typeof o=="string"?o:o.href));if(!It(l,d,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",u=await r(d,g),c=()=>{u.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(d);if(!It(await Io(l,i),y,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let b=(await u.stat()).size;if(!Number.isSafeInteger(b)||b<0||b>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:_t});let R=new Uint8Array(b),f=0;for(;f<R.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await u.read(R,f,R.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===R.byteLength?R:R.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await u.close().catch(()=>{});}}}function No(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=To(e.trustedRoot),t=Lo(e.maxBytes),n=e.read??_o(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=Do(i);if(p.protocol!=="file:")return r(p,s);let l=Po(p,o);if(!l)return new Response(null,{status:404});let d=a?new AbortController:void 0,g=()=>d?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let u;try{if(u=await n(l,{maxBytes:t,...d?{signal:d.signal}:{}}),a?.aborted)throw a.reason;if(u.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(d?.signal.aborted)throw d.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Nt(c);if(y===_t)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(u,{status:200})})}
2
+ export{le as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,ro as acquireSharedExportShaping,No as createPackagedFileFetch,te as hasExportAdmittedFont,ie as hasExportLaidOutText,lo as hasFontBackedExportCapabilities,po as openFontBackedDocumentForExport};