@eigenpal/docx-editor-core 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.mts +3 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-47SKD7QB.mjs +4 -0
- package/dist/{chunk-CDGV7CLS.js → chunk-4HNEXEGS.js} +1 -1
- package/dist/chunk-4U2S3WV2.js +1 -0
- package/dist/{chunk-C57BOE7B.mjs → chunk-5EP47PMQ.mjs} +1 -1
- package/dist/chunk-7EU6E64E.mjs +1 -0
- package/dist/{chunk-E7UN3PVC.mjs → chunk-A7C3DGQA.mjs} +1 -1
- package/dist/chunk-BMP2OSXE.js +1 -0
- package/dist/{chunk-2KUOYHXX.js → chunk-DEQFU56O.js} +1 -1
- package/dist/chunk-DFDL337G.js +4 -0
- package/dist/chunk-DKUHG27E.js +1 -0
- package/dist/{chunk-NY36MZ55.mjs → chunk-DU5TWD2W.mjs} +1 -1
- package/dist/chunk-DUVSDFRG.js +2 -0
- package/dist/{chunk-CWPIXUU2.js → chunk-DUXHJ6QP.js} +1 -1
- package/dist/chunk-HQ76VZAN.mjs +1 -0
- package/dist/{chunk-5JULVEYK.mjs → chunk-ICNIAAH7.mjs} +1 -1
- package/dist/{chunk-F44XU6G5.js → chunk-K7NSOCSY.js} +1 -1
- package/dist/{chunk-RGHRXIIZ.js → chunk-KEDY4GFG.js} +2 -2
- package/dist/{chunk-WEQA5PPW.mjs → chunk-KPWWI5UW.mjs} +1 -1
- package/dist/chunk-NKIDBERV.js +1 -0
- package/dist/chunk-NN2EJIO7.mjs +1 -0
- package/dist/{chunk-YMXWLXVF.mjs → chunk-O4RCQNUW.mjs} +1 -1
- package/dist/chunk-O5L4BZCZ.mjs +1 -0
- package/dist/chunk-OSTMAXZZ.mjs +1 -0
- package/dist/{chunk-XTPT4TNP.mjs → chunk-OWGY46IW.mjs} +1 -1
- package/dist/chunk-PGWY6UFK.js +1 -0
- package/dist/{chunk-T3UP6LF5.js → chunk-PM4KDJJ2.js} +1 -1
- package/dist/{chunk-6AGU57TL.mjs → chunk-QCPISGPW.mjs} +1 -1
- package/dist/{chunk-WQJWT4RB.mjs → chunk-QRBFMR7Z.mjs} +1 -1
- package/dist/chunk-SHZOAUHB.mjs +1 -0
- package/dist/chunk-TT3ILFZC.js +1 -0
- package/dist/chunk-TXAB4I4M.mjs +2 -0
- package/dist/{chunk-BBJMUBTD.mjs → chunk-VMBCUUZM.mjs} +1 -1
- package/dist/{chunk-7UMOUKSF.js → chunk-WTIN6QHX.js} +1 -1
- package/dist/{chunk-V3NE7Q22.js → chunk-WVY2UXAK.js} +1 -1
- package/dist/{chunk-EJ2JAYRI.js → chunk-XCTYXYEU.js} +1 -1
- package/dist/{chunk-2ZTKTE7P.js → chunk-XCXQWCV2.js} +1 -1
- package/dist/{chunk-KSW6W2EK.mjs → chunk-YSBX4LFA.mjs} +1 -1
- package/dist/{chunk-DX5XU6JN.js → chunk-YUHOVME2.js} +1 -1
- package/dist/{content-CbBCrsr0.d.mts → content-BEFz1zcs.d.mts} +1 -1
- package/dist/{content-BebvPfXc.d.ts → content-DNcMlHU0.d.ts} +1 -1
- package/dist/{contentControlValues-Com1GnZS.d.ts → contentControlValues-2pV4M4kG.d.ts} +1 -1
- package/dist/{contentControlValues-DVJyudKU.d.mts → contentControlValues-CKWIIkkr.d.mts} +1 -1
- package/dist/core-plugins.d.mts +1 -1
- package/dist/core-plugins.d.ts +1 -1
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +6 -6
- package/dist/core.d.ts +6 -6
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/docx/index.d.mts +1 -1
- package/dist/docx/index.d.ts +1 -1
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +1 -1
- package/dist/docx/parser.d.ts +1 -1
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +1 -1
- package/dist/docx/rezip.d.ts +1 -1
- package/dist/docx/serializer/index.d.mts +2 -2
- package/dist/docx/serializer/index.d.ts +2 -2
- package/dist/editor/index.d.mts +1 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-D9SBYuZZ.d.ts → fontLoader-CH12AtFF.d.ts} +1 -1
- package/dist/{fontLoader-B4uFKpAy.d.mts → fontLoader-D3X2Qgb_.d.mts} +1 -1
- package/dist/{headerFooterLayout-CtVsfqxQ.d.ts → headerFooterLayout-BdGTU0IA.d.ts} +31 -16
- package/dist/{headerFooterLayout-D2LZLkDC.d.mts → headerFooterLayout-D5-u-IsD.d.mts} +31 -16
- package/dist/headless.d.mts +4 -4
- package/dist/headless.d.ts +4 -4
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +2 -2
- package/dist/layout-bridge/index.d.ts +2 -2
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +1 -1
- package/dist/layout-bridge/measuring/index.d.ts +1 -1
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.d.mts +1 -1
- package/dist/layout-bridge/toFlowBlocks.d.ts +1 -1
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +1 -1
- package/dist/layout-engine/index.d.ts +1 -1
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +1 -1
- package/dist/layout-engine/types.d.ts +1 -1
- package/dist/layout-painter/index.d.mts +2 -2
- package/dist/layout-painter/index.d.ts +2 -2
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +2 -2
- package/dist/layout-painter/renderPage.d.ts +2 -2
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +1 -1
- package/dist/managers/AutoSaveManager.d.ts +1 -1
- package/dist/managers/TableSelectionManager.d.mts +1 -1
- package/dist/managers/TableSelectionManager.d.ts +1 -1
- package/dist/managers/types.d.mts +1 -1
- package/dist/managers/types.d.ts +1 -1
- package/dist/mcp-cli.mjs +23 -23
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -2
- package/dist/mcp.mjs +1 -1
- package/dist/{nodes-BvO8GGD4.d.mts → nodes-5w_QaI3g.d.mts} +13 -1
- package/dist/{nodes-Bd6tTkp0.d.ts → nodes-qQdZtu3Z.d.ts} +13 -1
- package/dist/prosemirror/applyFormatting.js +1 -1
- package/dist/prosemirror/applyFormatting.mjs +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/commentIdAllocator.d.mts +1 -1
- package/dist/prosemirror/commentIdAllocator.d.ts +1 -1
- package/dist/prosemirror/commentOps.d.mts +1 -1
- package/dist/prosemirror/commentOps.d.ts +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +1 -1
- package/dist/prosemirror/conversion/index.d.ts +1 -1
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/index.d.mts +3 -3
- package/dist/prosemirror/index.d.ts +3 -3
- package/dist/prosemirror/index.js +2 -2
- package/dist/prosemirror/index.mjs +2 -2
- package/dist/prosemirror/plugins/index.d.mts +1 -1
- package/dist/prosemirror/plugins/index.d.ts +1 -1
- package/dist/prosemirror/queries.d.mts +1 -1
- package/dist/prosemirror/queries.d.ts +1 -1
- package/dist/prosemirror/schema/index.d.mts +2 -2
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +1 -1
- package/dist/{sectionPropertiesSerializer-CzgskSoA.d.ts → sectionPropertiesSerializer-BJSNK-Wl.d.ts} +1 -1
- package/dist/{sectionPropertiesSerializer-D3yI82iZ.d.mts → sectionPropertiesSerializer-DI3OIQ1j.d.mts} +1 -1
- package/dist/types/content.d.mts +1 -1
- package/dist/types/content.d.ts +1 -1
- package/dist/types/document.d.mts +2 -2
- package/dist/types/document.d.ts +2 -2
- package/dist/utils/comments.d.mts +1 -1
- package/dist/utils/comments.d.ts +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/{variableDetector-D2-xDa2O.d.mts → variableDetector-7xBsshP0.d.mts} +1 -1
- package/dist/{variableDetector-d-PpDlNV.d.ts → variableDetector-Bv5Tm0D-.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2KPOGFFR.js +0 -1
- package/dist/chunk-34DJT72K.js +0 -1
- package/dist/chunk-4QJEMD23.mjs +0 -4
- package/dist/chunk-4QSFBX26.mjs +0 -1
- package/dist/chunk-4SZAFWLV.mjs +0 -1
- package/dist/chunk-6KYOT4E7.js +0 -4
- package/dist/chunk-77X765ZO.js +0 -1
- package/dist/chunk-AXVWVIIN.js +0 -1
- package/dist/chunk-BKP5QMTS.js +0 -1
- package/dist/chunk-IM56AITE.mjs +0 -1
- package/dist/chunk-KK673XRZ.mjs +0 -1
- package/dist/chunk-M65C4SQJ.mjs +0 -2
- package/dist/chunk-NO6PIL32.mjs +0 -1
- package/dist/chunk-NTYJIOUE.js +0 -2
- package/dist/chunk-WCB25ESG.mjs +0 -1
- package/dist/chunk-WWG6PUWU.js +0 -1
package/dist/core-plugins.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-
|
|
1
|
+
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-YSBX4LFA.mjs';import'./chunk-ARHPXIBJ.mjs';import'./chunk-CGJ6S3AH.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';import'./chunk-5EP47PMQ.mjs';import'./chunk-47SKD7QB.mjs';import'./chunk-MOCGHQ4A.mjs';import'./chunk-CDBKFBC2.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import'./chunk-QYUPLKLP.mjs';
|
package/dist/core.d.mts
CHANGED
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export { parseDocx } from './docx/parser.mjs';
|
|
21
|
-
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './sectionPropertiesSerializer-
|
|
21
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './sectionPropertiesSerializer-DI3OIQ1j.mjs';
|
|
22
22
|
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.mjs';
|
|
23
23
|
export { a as attemptSelectiveSave } from './selectiveSave-jinP_4xa.mjs';
|
|
24
24
|
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.mjs';
|
|
25
25
|
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, z as ThemeMatrixCell, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, h as createThemeColor, i as darkenColor, A as ensureHexPrefix, B as generateThemeTintShadeMatrix, j as getContrastingColor, l as getTemplateTags, D as getThemeTintShadeHex, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, r as processTemplate, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, E as resolveHighlightToCss, x as resolveShadingColor, y as validateTemplate } from './colorResolver-DCBfI4ld.mjs';
|
|
26
26
|
export { A as AgentContextOptions, D as DocumentAgent, E as ExtendedSelectionContext, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary } from './selectionContext-BjMyVQZO.mjs';
|
|
27
27
|
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.mjs';
|
|
28
|
-
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isGoogleFontsEnabled, s as isLineBreak, t as isPageBreak, u as loadFont, v as loadFontFromBuffer, w as loadFonts, x as onFontsLoaded, y as preloadCommonFonts, z as removePageBreak, A as setGoogleFontsEnabled } from './fontLoader-
|
|
28
|
+
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isGoogleFontsEnabled, s as isLineBreak, t as isPageBreak, u as loadFont, v as loadFontFromBuffer, w as loadFonts, x as onFontsLoaded, y as preloadCommonFonts, z as removePageBreak, A as setGoogleFontsEnabled } from './fontLoader-D3X2Qgb_.mjs';
|
|
29
29
|
export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.mjs';
|
|
30
30
|
export { f as findParagraphByParaId, a as findStartPosForParaId } from './findParagraphByParaId-Maw_8M5D.mjs';
|
|
31
|
-
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-
|
|
31
|
+
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-7xBsshP0.mjs';
|
|
32
32
|
import { Document } from './types/document.mjs';
|
|
33
33
|
export { DocxPackage } from './types/document.mjs';
|
|
34
34
|
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, DeleteTextCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, Position, Range, ReplaceTextCommand, SelectionContext, SetVariableCommand, SuggestedAction } from './types/agentApi.mjs';
|
|
@@ -41,12 +41,12 @@ import { ErrorManagerSnapshot, PluginLifecycleSnapshot, PluginLifecycleConfig }
|
|
|
41
41
|
export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinates, EditorHandle, ErrorNotification, ErrorSeverity, SavedDocumentData, TableSelectionSnapshot } from './managers/types.mjs';
|
|
42
42
|
export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.mjs';
|
|
43
43
|
export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.mjs';
|
|
44
|
-
import {
|
|
45
|
-
export { B as BlockContent,
|
|
44
|
+
import { l as Run } from './content-BEFz1zcs.mjs';
|
|
45
|
+
export { B as BlockContent, y as BookmarkEnd, z as BookmarkStart, C as Comment, f as CommentRangeEnd, g as CommentRangeStart, h as Deletion, D as DocumentBody, E as Endnote, N as Field, U as FooterReference, F as Footnote, x as HeaderFooter, Y as HeaderReference, H as Hyperlink, I as Image, i as Insertion, M as MoveFrom, j as MoveTo, P as Paragraph, k as ParagraphContent, m as RunContent, S as SectionProperties, ak as Shape, T as Table, n as TableCell, o as TableRow, av as TextBox, p as TextContent, q as TrackedChangeInfo, r as TrackedRunChange } from './content-BEFz1zcs.mjs';
|
|
46
46
|
import { EditorView } from 'prosemirror-view';
|
|
47
47
|
export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.mjs';
|
|
48
48
|
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-DFtuRFQY.mjs';
|
|
49
|
-
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES,
|
|
49
|
+
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, b as FootnoteRefLocation, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, c as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, d as StabilizeFootnoteLayoutResult, e as buildFootnoteContentMap, f as buildFootnoteRenderItems, g as calculateFootnoteReservedHeights, h as collectFootnoteRefs, i as convertHeaderFooterToContent, j as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-D5-u-IsD.mjs';
|
|
50
50
|
export { L as ListLevel, a as NumberingDefinitions } from './lists-CyGxd5Y2.mjs';
|
|
51
51
|
export { R as Relationship, a as Style, S as StyleDefinitions, T as Theme, f as ThemeColorScheme, g as ThemeFont, h as ThemeFontScheme } from './styles-Dqec8Aw6.mjs';
|
|
52
52
|
import './colors-C3vA7HUU.mjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export { parseDocx } from './docx/parser.js';
|
|
21
|
-
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './sectionPropertiesSerializer-
|
|
21
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './sectionPropertiesSerializer-BJSNK-Wl.js';
|
|
22
22
|
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.js';
|
|
23
23
|
export { a as attemptSelectiveSave } from './selectiveSave-CWaPEv0B.js';
|
|
24
24
|
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.js';
|
|
25
25
|
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, z as ThemeMatrixCell, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, h as createThemeColor, i as darkenColor, A as ensureHexPrefix, B as generateThemeTintShadeMatrix, j as getContrastingColor, l as getTemplateTags, D as getThemeTintShadeHex, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, r as processTemplate, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, E as resolveHighlightToCss, x as resolveShadingColor, y as validateTemplate } from './colorResolver-C696sd9x.js';
|
|
26
26
|
export { A as AgentContextOptions, D as DocumentAgent, E as ExtendedSelectionContext, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary } from './selectionContext-BJZZW1JA.js';
|
|
27
27
|
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.js';
|
|
28
|
-
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isGoogleFontsEnabled, s as isLineBreak, t as isPageBreak, u as loadFont, v as loadFontFromBuffer, w as loadFonts, x as onFontsLoaded, y as preloadCommonFonts, z as removePageBreak, A as setGoogleFontsEnabled } from './fontLoader-
|
|
28
|
+
export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isGoogleFontsEnabled, s as isLineBreak, t as isPageBreak, u as loadFont, v as loadFontFromBuffer, w as loadFonts, x as onFontsLoaded, y as preloadCommonFonts, z as removePageBreak, A as setGoogleFontsEnabled } from './fontLoader-CH12AtFF.js';
|
|
29
29
|
export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.js';
|
|
30
30
|
export { f as findParagraphByParaId, a as findStartPosForParaId } from './findParagraphByParaId-Maw_8M5D.js';
|
|
31
|
-
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-
|
|
31
|
+
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-Bv5Tm0D-.js';
|
|
32
32
|
import { Document } from './types/document.js';
|
|
33
33
|
export { DocxPackage } from './types/document.js';
|
|
34
34
|
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, DeleteTextCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, Position, Range, ReplaceTextCommand, SelectionContext, SetVariableCommand, SuggestedAction } from './types/agentApi.js';
|
|
@@ -41,12 +41,12 @@ import { ErrorManagerSnapshot, PluginLifecycleSnapshot, PluginLifecycleConfig }
|
|
|
41
41
|
export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinates, EditorHandle, ErrorNotification, ErrorSeverity, SavedDocumentData, TableSelectionSnapshot } from './managers/types.js';
|
|
42
42
|
export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.js';
|
|
43
43
|
export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.js';
|
|
44
|
-
import {
|
|
45
|
-
export { B as BlockContent,
|
|
44
|
+
import { l as Run } from './content-DNcMlHU0.js';
|
|
45
|
+
export { B as BlockContent, y as BookmarkEnd, z as BookmarkStart, C as Comment, f as CommentRangeEnd, g as CommentRangeStart, h as Deletion, D as DocumentBody, E as Endnote, N as Field, U as FooterReference, F as Footnote, x as HeaderFooter, Y as HeaderReference, H as Hyperlink, I as Image, i as Insertion, M as MoveFrom, j as MoveTo, P as Paragraph, k as ParagraphContent, m as RunContent, S as SectionProperties, ak as Shape, T as Table, n as TableCell, o as TableRow, av as TextBox, p as TextContent, q as TrackedChangeInfo, r as TrackedRunChange } from './content-DNcMlHU0.js';
|
|
46
46
|
import { EditorView } from 'prosemirror-view';
|
|
47
47
|
export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.js';
|
|
48
48
|
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-JhqWT_XM.js';
|
|
49
|
-
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES,
|
|
49
|
+
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, b as FootnoteRefLocation, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, c as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, d as StabilizeFootnoteLayoutResult, e as buildFootnoteContentMap, f as buildFootnoteRenderItems, g as calculateFootnoteReservedHeights, h as collectFootnoteRefs, i as convertHeaderFooterToContent, j as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-BdGTU0IA.js';
|
|
50
50
|
export { L as ListLevel, a as NumberingDefinitions } from './lists-Bn29SzeS.js';
|
|
51
51
|
export { R as Relationship, a as Style, S as StyleDefinitions, T as Theme, f as ThemeColorScheme, g as ThemeFont, h as ThemeFontScheme } from './styles-gEujs7j6.js';
|
|
52
52
|
import './colors-C3vA7HUU.js';
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunk7UMOUKSF_js=require('./chunk-7UMOUKSF.js');require('./chunk-CWPIXUU2.js');var chunk77X765ZO_js=require('./chunk-77X765ZO.js');require('./chunk-2KPOGFFR.js'),require('./chunk-MWOHCSZE.js'),require('./chunk-DX5XU6JN.js'),require('./chunk-EJ2JAYRI.js'),require('./chunk-IMKU4O3P.js'),require('./chunk-DROCYKAR.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkF44XU6G5_js=require('./chunk-F44XU6G5.js'),chunkGFM6PERG_js=require('./chunk-GFM6PERG.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkRGHRXIIZ_js=require('./chunk-RGHRXIIZ.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkFETIBXTH_js=require('./chunk-FETIBXTH.js'),chunkJQUIUKRO_js=require('./chunk-JQUIUKRO.js'),chunk4JPHW7ZI_js=require('./chunk-4JPHW7ZI.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunkV3NE7Q22_js=require('./chunk-V3NE7Q22.js');require('./chunk-6KYOT4E7.js'),require('./chunk-FIGLFSNR.js');var chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-BKP5QMTS.js'),require('./chunk-34DJT72K.js'),require('./chunk-ISKTBM4L.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-RQVHKDXK.js'),require('./chunk-LW5OFHSW.js'),require('./chunk-Z3LGMBJC.js'),require('./chunk-AXVWVIIN.js'),require('./chunk-NTYJIOUE.js'),require('./chunk-Q2VALXEU.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-ILPNMG7Q.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-LWH66Q7Q.js'),require('./chunk-X6AICTHN.js'),require('./chunk-7HANRHHL.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-C2BAPYGJ.js');var chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');require('./chunk-GSKMHXHG.js'),require('./chunk-H57LNDBH.js'),require('./chunk-3R7QHNI5.js');var chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunk7UMOUKSF_js.A}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunk77X765ZO_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunk77X765ZO_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunk77X765ZO_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunk77X765ZO_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunk77X765ZO_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunk77X765ZO_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunk77X765ZO_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunk77X765ZO_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunk77X765ZO_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkF44XU6G5_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkF44XU6G5_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkF44XU6G5_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkF44XU6G5_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkF44XU6G5_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkGFM6PERG_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkGFM6PERG_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkGFM6PERG_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkRGHRXIIZ_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFETIBXTH_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFETIBXTH_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkJQUIUKRO_js.m}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.g}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.h}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.c}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkV3NE7Q22_js.a}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.j}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.g}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkQVRMX2AC_js.f}});Object.defineProperty(exports,"isGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.e}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.k}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.h}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.r}});Object.defineProperty(exports,"setGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.d}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.u}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.h}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkBJSG6TEG_js.q}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.k}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.e}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.j}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.i}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.d}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=no;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;
|
|
1
|
+
'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunkWTIN6QHX_js=require('./chunk-WTIN6QHX.js');require('./chunk-DUXHJ6QP.js');var chunkTT3ILFZC_js=require('./chunk-TT3ILFZC.js');require('./chunk-NKIDBERV.js'),require('./chunk-MWOHCSZE.js'),require('./chunk-YUHOVME2.js'),require('./chunk-XCTYXYEU.js'),require('./chunk-IMKU4O3P.js'),require('./chunk-DROCYKAR.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkK7NSOCSY_js=require('./chunk-K7NSOCSY.js'),chunkGFM6PERG_js=require('./chunk-GFM6PERG.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkKEDY4GFG_js=require('./chunk-KEDY4GFG.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkFETIBXTH_js=require('./chunk-FETIBXTH.js'),chunkJQUIUKRO_js=require('./chunk-JQUIUKRO.js'),chunk4JPHW7ZI_js=require('./chunk-4JPHW7ZI.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunkWVY2UXAK_js=require('./chunk-WVY2UXAK.js');require('./chunk-DFDL337G.js'),require('./chunk-FIGLFSNR.js');var chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-DKUHG27E.js'),require('./chunk-PGWY6UFK.js'),require('./chunk-ISKTBM4L.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-RQVHKDXK.js'),require('./chunk-LW5OFHSW.js'),require('./chunk-Z3LGMBJC.js'),require('./chunk-4U2S3WV2.js'),require('./chunk-DUVSDFRG.js'),require('./chunk-Q2VALXEU.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-ILPNMG7Q.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-LWH66Q7Q.js'),require('./chunk-X6AICTHN.js'),require('./chunk-7HANRHHL.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-C2BAPYGJ.js');var chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');require('./chunk-GSKMHXHG.js'),require('./chunk-H57LNDBH.js'),require('./chunk-3R7QHNI5.js');var chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunkWTIN6QHX_js.A}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunkTT3ILFZC_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunkTT3ILFZC_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunkTT3ILFZC_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunkTT3ILFZC_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunkTT3ILFZC_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunkTT3ILFZC_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunkTT3ILFZC_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunkTT3ILFZC_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunkTT3ILFZC_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkK7NSOCSY_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkK7NSOCSY_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkK7NSOCSY_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkK7NSOCSY_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkK7NSOCSY_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkGFM6PERG_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkGFM6PERG_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkGFM6PERG_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkKEDY4GFG_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFETIBXTH_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFETIBXTH_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkJQUIUKRO_js.m}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.g}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.h}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.c}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.a}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.j}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.g}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkQVRMX2AC_js.f}});Object.defineProperty(exports,"isGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.e}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.k}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.h}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.r}});Object.defineProperty(exports,"setGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.d}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.u}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.h}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkBJSG6TEG_js.q}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.k}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.e}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.j}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.i}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.d}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=no;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as AutoSaveManager,b as formatLastSaveTime,e as formatStorageSize,c as getAutoSaveStatusLabel,d as getAutoSaveStorageSize,f as isAutoSaveSupported}from'./chunk-6NQSIC27.mjs';export{a as TABLE_DATA_ATTRIBUTES,f as TableSelectionManager,e as deleteTableFromDocument,b as findTableFromClick,c as getTableFromDocument,d as updateTableInDocument}from'./chunk-JHZ3HLSR.mjs';import {a}from'./chunk-D6GO7UGD.mjs';export{a as Subscribable}from'./chunk-D6GO7UGD.mjs';export{A as convertHeaderFooterToContent}from'./chunk-E7UN3PVC.mjs';import'./chunk-5JULVEYK.mjs';export{a as FOOTNOTE_SEPARATOR_HEIGHT,b as MAX_FOOTNOTE_LAYOUT_PASSES,h as buildFootnoteContentMap,k as buildFootnoteRenderItems,i as calculateFootnoteReservedHeights,d as collectFootnoteRefs,c as footnoteReservedHeightsEqual,e as mapFootnotesToPages,j as stabilizeFootnoteLayout}from'./chunk-4QSFBX26.mjs';import'./chunk-4SZAFWLV.mjs';import'./chunk-RRJKF2XI.mjs';import'./chunk-6AGU57TL.mjs';import'./chunk-BBJMUBTD.mjs';import'./chunk-FCJWLEKT.mjs';import'./chunk-7E5VBRDL.mjs';export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-WTFLNYAT.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,d as getAgentContext,f as getDocumentSummary}from'./chunk-XTPT4TNP.mjs';export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'./chunk-QZPVZY6S.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-CKKO4JWE.mjs';export{b as docxtemplaterPlugin}from'./chunk-KSW6W2EK.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-ARHPXIBJ.mjs';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CGJ6S3AH.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-B6FA4MJ5.mjs';export{t as createDocx,i as repackDocx,m as updateMultipleFiles}from'./chunk-F24WZXN4.mjs';export{g as serializeDocumentBody,h as serializeDocx,c as serializeSectionProperties}from'./chunk-2LVK7EF5.mjs';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';export{a as parseDocx}from'./chunk-C57BOE7B.mjs';import'./chunk-4QJEMD23.mjs';import'./chunk-MOCGHQ4A.mjs';export{j as canRenderFont,g as getLoadedFonts,c as isFontLoaded,f as isFontsLoading,e as isGoogleFontsEnabled,a as loadFont,k as loadFontFromBuffer,b as loadFonts,h as onFontsLoaded,r as preloadCommonFonts,d as setGoogleFontsEnabled,u as toArrayBuffer}from'./chunk-CDBKFBC2.mjs';export{b as findParagraphByParaId,a as findStartPosForParaId}from'./chunk-3SXJPJSV.mjs';import'./chunk-KK673XRZ.mjs';import'./chunk-WCB25ESG.mjs';import'./chunk-LK6I3HMH.mjs';import'./chunk-QPFJJPIC.mjs';import'./chunk-GYWTUUXX.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-NO6PIL32.mjs';import'./chunk-M65C4SQJ.mjs';import'./chunk-PJEB3ZWG.mjs';import'./chunk-OZMNIX6U.mjs';import'./chunk-AMENZY5F.mjs';import'./chunk-HEJJXAXN.mjs';import'./chunk-BGY3CB37.mjs';import'./chunk-2XP6GLA4.mjs';import'./chunk-NTBZRITU.mjs';import'./chunk-MJ6XZFVD.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,n as ensureHexPrefix,q as generateThemeTintShadeMatrix,g as getContrastingColor,p as getThemeTintShadeHex,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,o as resolveHighlightToCss,d as resolveShadingColor}from'./chunk-67LVRQIR.mjs';import'./chunk-LE67NTCN.mjs';export{f as emuToPixels,h as emuToTwips,q as formatPx,k as halfPointsToPixels,g as pixelsToEmu,e as pixelsToTwips,j as pointsToPixels,i as twipsToEmu,d as twipsToPixels}from'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import {a as a$1}from'./chunk-QYUPLKLP.mjs';function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends a{constructor(){super({notifications:[]});a$1(this,"notifications",[]);a$1(this,"idCounter",0);a$1(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends a{constructor(){super({states:new Map,version:0});a$1(this,"plugins",[]);a$1(this,"pluginStates",new Map);a$1(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});a$1(this,"_hasLayout",false);a$1(this,"_selectionRects",[]);a$1(this,"_caretPosition",null);a$1(this,"_isDragging",false);a$1(this,"_dragAnchor",null);a$1(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});a$1(this,"_selectedImageInfo",null);a$1(this,"_isImageInteracting",false);a$1(this,"_isFocused",false);a$1(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});a$1(this,"_loadingState","idle");a$1(this,"_parseError",null);a$1(this,"_zoom");a$1(this,"_fontsLoaded",false);a$1(this,"_document",null);a$1(this,"_version",0);a$1(this,"onChangeCallback");a$1(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";export{g as EditorCoordinator,d as ErrorManager,p as LayoutCoordinator,u as PluginLifecycleManager,no as VERSION,A as createSelectionFromDOM,h as extractFormattingFromElement,f as getSelectionRuns,z as injectStyles,S as rgbToHex};
|
|
1
|
+
export{a as AutoSaveManager,b as formatLastSaveTime,e as formatStorageSize,c as getAutoSaveStatusLabel,d as getAutoSaveStorageSize,f as isAutoSaveSupported}from'./chunk-6NQSIC27.mjs';export{a as TABLE_DATA_ATTRIBUTES,f as TableSelectionManager,e as deleteTableFromDocument,b as findTableFromClick,c as getTableFromDocument,d as updateTableInDocument}from'./chunk-JHZ3HLSR.mjs';import {a}from'./chunk-D6GO7UGD.mjs';export{a as Subscribable}from'./chunk-D6GO7UGD.mjs';export{A as convertHeaderFooterToContent}from'./chunk-A7C3DGQA.mjs';import'./chunk-ICNIAAH7.mjs';export{a as FOOTNOTE_SEPARATOR_HEIGHT,b as MAX_FOOTNOTE_LAYOUT_PASSES,h as buildFootnoteContentMap,k as buildFootnoteRenderItems,i as calculateFootnoteReservedHeights,d as collectFootnoteRefs,c as footnoteReservedHeightsEqual,e as mapFootnotesToPages,j as stabilizeFootnoteLayout}from'./chunk-HQ76VZAN.mjs';import'./chunk-7EU6E64E.mjs';import'./chunk-RRJKF2XI.mjs';import'./chunk-QCPISGPW.mjs';import'./chunk-VMBCUUZM.mjs';import'./chunk-FCJWLEKT.mjs';import'./chunk-7E5VBRDL.mjs';export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-WTFLNYAT.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,d as getAgentContext,f as getDocumentSummary}from'./chunk-OWGY46IW.mjs';export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'./chunk-QZPVZY6S.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-CKKO4JWE.mjs';export{b as docxtemplaterPlugin}from'./chunk-YSBX4LFA.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-ARHPXIBJ.mjs';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CGJ6S3AH.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-B6FA4MJ5.mjs';export{t as createDocx,i as repackDocx,m as updateMultipleFiles}from'./chunk-F24WZXN4.mjs';export{g as serializeDocumentBody,h as serializeDocx,c as serializeSectionProperties}from'./chunk-2LVK7EF5.mjs';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';export{a as parseDocx}from'./chunk-5EP47PMQ.mjs';import'./chunk-47SKD7QB.mjs';import'./chunk-MOCGHQ4A.mjs';export{j as canRenderFont,g as getLoadedFonts,c as isFontLoaded,f as isFontsLoading,e as isGoogleFontsEnabled,a as loadFont,k as loadFontFromBuffer,b as loadFonts,h as onFontsLoaded,r as preloadCommonFonts,d as setGoogleFontsEnabled,u as toArrayBuffer}from'./chunk-CDBKFBC2.mjs';export{b as findParagraphByParaId,a as findStartPosForParaId}from'./chunk-3SXJPJSV.mjs';import'./chunk-NN2EJIO7.mjs';import'./chunk-O5L4BZCZ.mjs';import'./chunk-LK6I3HMH.mjs';import'./chunk-QPFJJPIC.mjs';import'./chunk-GYWTUUXX.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-SHZOAUHB.mjs';import'./chunk-TXAB4I4M.mjs';import'./chunk-PJEB3ZWG.mjs';import'./chunk-OZMNIX6U.mjs';import'./chunk-AMENZY5F.mjs';import'./chunk-HEJJXAXN.mjs';import'./chunk-BGY3CB37.mjs';import'./chunk-2XP6GLA4.mjs';import'./chunk-NTBZRITU.mjs';import'./chunk-MJ6XZFVD.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,n as ensureHexPrefix,q as generateThemeTintShadeMatrix,g as getContrastingColor,p as getThemeTintShadeHex,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,o as resolveHighlightToCss,d as resolveShadingColor}from'./chunk-67LVRQIR.mjs';import'./chunk-LE67NTCN.mjs';export{f as emuToPixels,h as emuToTwips,q as formatPx,k as halfPointsToPixels,g as pixelsToEmu,e as pixelsToTwips,j as pointsToPixels,i as twipsToEmu,d as twipsToPixels}from'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import {a as a$1}from'./chunk-QYUPLKLP.mjs';function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends a{constructor(){super({notifications:[]});a$1(this,"notifications",[]);a$1(this,"idCounter",0);a$1(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends a{constructor(){super({states:new Map,version:0});a$1(this,"plugins",[]);a$1(this,"pluginStates",new Map);a$1(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});a$1(this,"_hasLayout",false);a$1(this,"_selectionRects",[]);a$1(this,"_caretPosition",null);a$1(this,"_isDragging",false);a$1(this,"_dragAnchor",null);a$1(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});a$1(this,"_selectedImageInfo",null);a$1(this,"_isImageInteracting",false);a$1(this,"_isFocused",false);a$1(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});a$1(this,"_loadingState","idle");a$1(this,"_parseError",null);a$1(this,"_zoom");a$1(this,"_fontsLoaded",false);a$1(this,"_document",null);a$1(this,"_version",0);a$1(this,"onChangeCallback");a$1(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";export{g as EditorCoordinator,d as ErrorManager,p as LayoutCoordinator,u as PluginLifecycleManager,no as VERSION,A as createSelectionFromDOM,h as extractFormattingFromElement,f as getSelectionRuns,z as injectStyles,S as rgbToHex};
|
package/dist/docx/index.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ export { parseDocx } from './parser.mjs';
|
|
|
16
16
|
export { createDocx, default as repackDocx, updateMultipleFiles } from './rezip.mjs';
|
|
17
17
|
export { a as attemptSelectiveSave } from '../selectiveSave-jinP_4xa.mjs';
|
|
18
18
|
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from '../selectiveXmlPatch-ypkxlTD_.mjs';
|
|
19
|
-
import { I as Image, E as Endnote, F as Footnote,
|
|
19
|
+
import { I as Image, E as Endnote, F as Footnote, L as EndnoteProperties, W as FootnoteProperties, l as Run, Q as FieldType, N as Field, aq as SimpleField, H as Hyperlink, ak as Shape, T as Table, n as TableCell, P as Paragraph, av as TextBox, a0 as ImageSize, $ as ImagePosition, a2 as ImageWrap, B as BlockContent, C as Comment } from '../content-BEFz1zcs.mjs';
|
|
20
20
|
import { b as RelationshipMap, M as MediaFile, a as Style, T as Theme } from '../styles-Dqec8Aw6.mjs';
|
|
21
21
|
import { Element } from 'xml-js';
|
|
22
22
|
import { N as NumberingMap } from '../numberingParser-nSPZlzKr.mjs';
|
package/dist/docx/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { parseDocx } from './parser.js';
|
|
|
16
16
|
export { createDocx, default as repackDocx, updateMultipleFiles } from './rezip.js';
|
|
17
17
|
export { a as attemptSelectiveSave } from '../selectiveSave-CWaPEv0B.js';
|
|
18
18
|
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from '../selectiveXmlPatch-ypkxlTD_.js';
|
|
19
|
-
import { I as Image, E as Endnote, F as Footnote,
|
|
19
|
+
import { I as Image, E as Endnote, F as Footnote, L as EndnoteProperties, W as FootnoteProperties, l as Run, Q as FieldType, N as Field, aq as SimpleField, H as Hyperlink, ak as Shape, T as Table, n as TableCell, P as Paragraph, av as TextBox, a0 as ImageSize, $ as ImagePosition, a2 as ImageWrap, B as BlockContent, C as Comment } from '../content-DNcMlHU0.js';
|
|
20
20
|
import { b as RelationshipMap, M as MediaFile, a as Style, T as Theme } from '../styles-gEujs7j6.js';
|
|
21
21
|
import { Element } from 'xml-js';
|
|
22
22
|
import { N as NumberingMap } from '../numberingParser-ZSQ3SDCV.js';
|
package/dist/docx/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkGFM6PERG_js=require('../chunk-GFM6PERG.js'),chunkJQUIUKRO_js=require('../chunk-JQUIUKRO.js');require('../chunk-4JPHW7ZI.js');var chunkV3NE7Q22_js=require('../chunk-V3NE7Q22.js'),chunk6KYOT4E7_js=require('../chunk-6KYOT4E7.js');require('../chunk-FIGLFSNR.js'),require('../chunk-QVRMX2AC.js');var chunkLW5OFHSW_js=require('../chunk-LW5OFHSW.js');require('../chunk-Z3LGMBJC.js'),require('../chunk-C2BAPYGJ.js');var chunkBJSG6TEG_js=require('../chunk-BJSG6TEG.js');require('../chunk-GSKMHXHG.js');var chunkH57LNDBH_js=require('../chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('../chunk-3R7QHNI5.js');require('../chunk-DC7S76ZX.js');var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function ct(e){return M.includes(e)}function ut(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function dt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ft(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function mt(e,t,n){let o=chunk3R7QHNI5_js.j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=chunk3R7QHNI5_js.j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=chunk3R7QHNI5_js.j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=chunk3R7QHNI5_js.f(e,"w","r");for(let u of l){let c=chunk6KYOT4E7_js.E(u,t,n);i.content.push(c);}return i}function ht(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function gt(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tt(e){return e.fieldType==="PAGE"}function xt(e){return e.fieldType==="NUMPAGES"}function yt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function St(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function Ft(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function bt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function Et(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ct(e,t){let n=chunkLW5OFHSW_js.b(e);if(n){if(n.type==="gradient"&&e){let r=chunk3R7QHNI5_js.i(e).find(i=>i.name==="a:gradFill");if(r)return wt(r)}return n}if(e){let o=chunk3R7QHNI5_js.i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=chunk3R7QHNI5_js.h(t,"a:fillRef");if(o){if(chunk3R7QHNI5_js.j(o,null,"idx")==="0")return {type:"none"};let i=chunkLW5OFHSW_js.a(o);if(i)return {type:"solid",color:i}}}}function wt(e){let t=chunk3R7QHNI5_js.i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=chunk3R7QHNI5_js.j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i=t.find(l=>l.name==="a:path");if(i){let l=chunk3R7QHNI5_js.j(i,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a=t.find(l=>l.name==="a:gsLst"),s=[];if(a){let l=chunk3R7QHNI5_js.g(a,"gs");for(let u of l){let c=chunk3R7QHNI5_js.j(u,null,"pos"),p=c?parseInt(c,10):0,m=chunkLW5OFHSW_js.a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function At(e,t){let n=e?chunk3R7QHNI5_js.h(e,"a:ln"):null;if(!n){if(t){let f=chunk3R7QHNI5_js.h(t,"a:lnRef");if(f){if(chunk3R7QHNI5_js.j(f,null,"idx")==="0")return;let g=chunkLW5OFHSW_js.a(f);if(g)return {color:g,width:9525}}}return}let o=chunk3R7QHNI5_js.i(n);if(o.find(f=>f.name==="a:noFill"))return;let i={},a=chunk3R7QHNI5_js.j(n,null,"w");a&&(i.width=parseInt(a,10));let s=chunk3R7QHNI5_js.j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i.join="bevel":c?i.join="round":u&&(i.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i.color=chunkLW5OFHSW_js.a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=chunk3R7QHNI5_js.j(m,null,"val");f&&(i.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i.tailEnd=X(T)),i}function X(e){let t=chunk3R7QHNI5_js.j(e,null,"type")??"none",n=chunk3R7QHNI5_js.j(e,null,"w"),o=chunk3R7QHNI5_js.j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Mt(e){if(!e)return {size:{width:0,height:0}};let t=chunk3R7QHNI5_js.h(e,"a:ext"),n=chunk3R7QHNI5_js.l(t,null,"cx")??0,o=chunk3R7QHNI5_js.l(t,null,"cy")??0,r={width:n,height:o},i=chunk3R7QHNI5_js.h(e,"a:off"),a;if(i){let m=chunk3R7QHNI5_js.l(i,null,"x")??0,y=chunk3R7QHNI5_js.l(i,null,"y")??0;a={x:m,y};}let s=chunk3R7QHNI5_js.j(e,null,"rot"),l=chunk3R7QHNI5_js.j(e,null,"flipH")==="1",u=chunk3R7QHNI5_js.j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l||u)&&(p={},c!==void 0&&(p.rotation=c),l&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function It(e){if(!e)return "rect";let t=chunk3R7QHNI5_js.h(e,"a:prstGeom");if(t){let o=chunk3R7QHNI5_js.j(t,null,"prst");if(o)return o}return chunk3R7QHNI5_js.h(e,"a:custGeom"),"rect"}function Rt(e){if(!e)return {};let t={},n=chunk3R7QHNI5_js.j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=chunk3R7QHNI5_js.j(e,null,"rot");o&&(t.rotation=H(o));let r=chunk3R7QHNI5_js.j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}chunk3R7QHNI5_js.j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=chunk3R7QHNI5_js.h(e,"a:noAutofit"),a=chunk3R7QHNI5_js.h(e,"a:normAutofit"),s=chunk3R7QHNI5_js.h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l=chunk3R7QHNI5_js.l(e,null,"lIns"),u=chunk3R7QHNI5_js.l(e,null,"rIns"),c=chunk3R7QHNI5_js.l(e,null,"tIns"),p=chunk3R7QHNI5_js.l(e,null,"bIns");return (l!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l,right:u,top:c,bottom:p}),t}function Lt(e){if(!e)return [];let t=[],n=chunk3R7QHNI5_js.g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=chunk3R7QHNI5_js.i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i=t.find(g=>g.name==="wps:txbx"),a=i?chunk3R7QHNI5_js.h(i,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=It(o??null),u=o?chunk3R7QHNI5_js.h(o,"a:xfrm"):null,{size:c,transform:p}=Mt(u),m=Ct(o??null,r??null),y=At(o??null,r??null),T,f;n&&(T=chunk3R7QHNI5_js.j(n,null,"id")??void 0,f=chunk3R7QHNI5_js.j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=Rt(s??null),P=Lt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function Dt(e){let n=chunk3R7QHNI5_js.i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=chunk3R7QHNI5_js.h(n,"a:graphic");if(!r)return null;let i=chunk3R7QHNI5_js.h(r,"a:graphicData");if(!i)return null;let a=chunk3R7QHNI5_js.h(i,"wps:wsp");if(!a)return null;let s=W(a),l=chunk3R7QHNI5_js.h(n,"wp:extent");if(l){let c=chunk3R7QHNI5_js.l(l,null,"cx")??0,p=chunk3R7QHNI5_js.l(l,null,"cy")??0;s.size={width:c,height:p};}if(o){let c=chunkLW5OFHSW_js.c(n);c&&(s.position=c);let p=chunkLW5OFHSW_js.d(n);p&&(s.wrap=p);}let u=chunk3R7QHNI5_js.h(n,"wp:docPr");if(u){let c=chunk3R7QHNI5_js.j(u,null,"id"),p=chunk3R7QHNI5_js.j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Pt(e){let n=chunk3R7QHNI5_js.i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=chunk3R7QHNI5_js.h(n,"a:graphic");if(!o)return false;let r=chunk3R7QHNI5_js.h(o,"a:graphicData");return r?chunk3R7QHNI5_js.h(r,"wps:wsp")!==null:false}function Nt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Bt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function vt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Ot(e){return chunkBJSG6TEG_js.f(e.size.width)}function kt(e){return chunkBJSG6TEG_js.f(e.size.height)}function Ut(e){return {width:chunkBJSG6TEG_js.f(e.size.width),height:chunkBJSG6TEG_js.f(e.size.height)}}function Xt(e){return e.position!==void 0||e.wrap!==void 0}function Ht(e){return e.fill!==void 0&&e.fill.type!=="none"}function Wt(e){return e.outline!==void 0}function Vt(e){return e.outline?.width?chunkBJSG6TEG_js.f(e.outline.width):0}function Gt(e){if(!(!e.fill||e.fill.type!=="solid"))return chunkLW5OFHSW_js.e(e.fill.color)}function _t(e){if(e.outline?.color)return chunkLW5OFHSW_js.e(e.outline.color)}var R=720,L="left",jt="none";function V(e){let t=chunk3R7QHNI5_js.l(e,"w","pos"),n=chunk3R7QHNI5_js.j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=chunk3R7QHNI5_js.j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=chunk3R7QHNI5_js.f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function zt(e){if(!e)return;let t=chunk3R7QHNI5_js.e(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function Kt(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function Yt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function Jt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Zt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function qt(e){return e!==void 0&&e!=="none"}function Qt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function $t(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkGFM6PERG_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkGFM6PERG_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkGFM6PERG_js.a}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkJQUIUKRO_js.m}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkV3NE7Q22_js.a}});Object.defineProperty(exports,"getEndnoteText",{enumerable:true,get:function(){return chunk6KYOT4E7_js.y}});Object.defineProperty(exports,"getFootnoteText",{enumerable:true,get:function(){return chunk6KYOT4E7_js.x}});Object.defineProperty(exports,"getHyperlinkRuns",{enumerable:true,get:function(){return chunk6KYOT4E7_js.L}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunk6KYOT4E7_js.G}});Object.defineProperty(exports,"getHyperlinkUrl",{enumerable:true,get:function(){return chunk6KYOT4E7_js.J}});Object.defineProperty(exports,"getTableColumnCount",{enumerable:true,get:function(){return chunk6KYOT4E7_js.j}});Object.defineProperty(exports,"getTableRowCount",{enumerable:true,get:function(){return chunk6KYOT4E7_js.k}});Object.defineProperty(exports,"hasContent",{enumerable:true,get:function(){return chunk6KYOT4E7_js.K}});Object.defineProperty(exports,"hasHeaderRow",{enumerable:true,get:function(){return chunk6KYOT4E7_js.n}});Object.defineProperty(exports,"isCellMergeContinuation",{enumerable:true,get:function(){return chunk6KYOT4E7_js.l}});Object.defineProperty(exports,"isCellMergeStart",{enumerable:true,get:function(){return chunk6KYOT4E7_js.m}});Object.defineProperty(exports,"isExternalLink",{enumerable:true,get:function(){return chunk6KYOT4E7_js.H}});Object.defineProperty(exports,"isInternalLink",{enumerable:true,get:function(){return chunk6KYOT4E7_js.I}});Object.defineProperty(exports,"isSeparatorEndnote",{enumerable:true,get:function(){return chunk6KYOT4E7_js.A}});Object.defineProperty(exports,"isSeparatorFootnote",{enumerable:true,get:function(){return chunk6KYOT4E7_js.z}});Object.defineProperty(exports,"parseBorderSpec",{enumerable:true,get:function(){return chunk6KYOT4E7_js.d}});Object.defineProperty(exports,"parseCellMargins",{enumerable:true,get:function(){return chunk6KYOT4E7_js.f}});Object.defineProperty(exports,"parseEndnoteProperties",{enumerable:true,get:function(){return chunk6KYOT4E7_js.w}});Object.defineProperty(exports,"parseEndnotes",{enumerable:true,get:function(){return chunk6KYOT4E7_js.u}});Object.defineProperty(exports,"parseFloatingTableProperties",{enumerable:true,get:function(){return chunk6KYOT4E7_js.i}});Object.defineProperty(exports,"parseFootnoteProperties",{enumerable:true,get:function(){return chunk6KYOT4E7_js.v}});Object.defineProperty(exports,"parseFootnotes",{enumerable:true,get:function(){return chunk6KYOT4E7_js.t}});Object.defineProperty(exports,"parseHyperlink",{enumerable:true,get:function(){return chunk6KYOT4E7_js.F}});Object.defineProperty(exports,"parseShading",{enumerable:true,get:function(){return chunk6KYOT4E7_js.g}});Object.defineProperty(exports,"parseTableBorders",{enumerable:true,get:function(){return chunk6KYOT4E7_js.e}});Object.defineProperty(exports,"parseTableLook",{enumerable:true,get:function(){return chunk6KYOT4E7_js.h}});Object.defineProperty(exports,"parseTableMeasurement",{enumerable:true,get:function(){return chunk6KYOT4E7_js.c}});Object.defineProperty(exports,"parseTableProperties",{enumerable:true,get:function(){return chunk6KYOT4E7_js.o}});Object.defineProperty(exports,"resolveHyperlinkUrl",{enumerable:true,get:function(){return chunk6KYOT4E7_js.M}});Object.defineProperty(exports,"extractTextBoxContentElements",{enumerable:true,get:function(){return chunkLW5OFHSW_js.f}});Object.defineProperty(exports,"getImageHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.G}});Object.defineProperty(exports,"getImageWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.F}});Object.defineProperty(exports,"getTextBoxContentElement",{enumerable:true,get:function(){return chunkLW5OFHSW_js.k}});Object.defineProperty(exports,"getTextBoxDimensionsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.o}});Object.defineProperty(exports,"getTextBoxHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.n}});Object.defineProperty(exports,"getTextBoxMarginsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.p}});Object.defineProperty(exports,"getTextBoxOutlineWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.x}});Object.defineProperty(exports,"getTextBoxText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.u}});Object.defineProperty(exports,"getTextBoxWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.m}});Object.defineProperty(exports,"getWrapDistancesPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.I}});Object.defineProperty(exports,"hasTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.t}});Object.defineProperty(exports,"hasTextBoxFill",{enumerable:true,get:function(){return chunkLW5OFHSW_js.r}});Object.defineProperty(exports,"hasTextBoxOutline",{enumerable:true,get:function(){return chunkLW5OFHSW_js.s}});Object.defineProperty(exports,"isBehindText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.D}});Object.defineProperty(exports,"isDecorativeImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.H}});Object.defineProperty(exports,"isFloatingImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.C}});Object.defineProperty(exports,"isFloatingTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.q}});Object.defineProperty(exports,"isInFrontOfText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.E}});Object.defineProperty(exports,"isInlineImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.B}});Object.defineProperty(exports,"isShapeTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.i}});Object.defineProperty(exports,"isTextBoxDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.h}});Object.defineProperty(exports,"parseDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.z}});Object.defineProperty(exports,"parseImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.A}});Object.defineProperty(exports,"parseTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.j}});Object.defineProperty(exports,"parseTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.g}});Object.defineProperty(exports,"parseTextBoxFromShape",{enumerable:true,get:function(){return chunkLW5OFHSW_js.l}});Object.defineProperty(exports,"resolveTextBoxFillColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.v}});Object.defineProperty(exports,"resolveTextBoxOutlineColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.w}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"computeListRendering",{enumerable:true,get:function(){return chunkH57LNDBH_js.d}});Object.defineProperty(exports,"createNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.c}});Object.defineProperty(exports,"formatNumber",{enumerable:true,get:function(){return chunkH57LNDBH_js.e}});Object.defineProperty(exports,"getBulletCharacter",{enumerable:true,get:function(){return chunkH57LNDBH_js.h}});Object.defineProperty(exports,"getCachedNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.b}});Object.defineProperty(exports,"isBulletLevel",{enumerable:true,get:function(){return chunkH57LNDBH_js.i}});Object.defineProperty(exports,"parseNumbering",{enumerable:true,get:function(){return chunkH57LNDBH_js.a}});Object.defineProperty(exports,"renderListMarker",{enumerable:true,get:function(){return chunkH57LNDBH_js.g}});exports.DEFAULT_TAB_ALIGNMENT=L;exports.DEFAULT_TAB_INTERVAL_TWIPS=R;exports.DEFAULT_TAB_LEADER=jt;exports.KNOWN_FIELD_TYPES=M;exports.calculateTabWidth=Yt;exports.calculateTabWidthWithAlignment=Jt;exports.createComplexFieldContext=ht;exports.getFieldDisplayValue=gt;exports.getFormatSwitch=dt;exports.getLeaderCharacter=Zt;exports.getNextTabStop=D;exports.getOutlineWidthPx=Vt;exports.getShapeDimensionsPx=Ut;exports.getShapeHeightPx=kt;exports.getShapeWidthPx=Ot;exports.hasFill=Ht;exports.hasMergeFormat=ft;exports.hasOutline=Wt;exports.hasTextContent=vt;exports.hasVisibleLeader=qt;exports.injectReplyRangeMarkers=Qt;exports.injectTCReplyRangeMarkers=$t;exports.isDateTimeField=yt;exports.isDocPropertyField=St;exports.isFloatingShape=Xt;exports.isKnownFieldType=ct;exports.isLineShape=Nt;exports.isMergeField=bt;exports.isPageNumberField=Tt;exports.isReferenceField=Ft;exports.isShapeDrawing=Pt;exports.isTextBoxShape=Bt;exports.isTocField=Et;exports.isTotalPagesField=xt;exports.mergeTabStops=Kt;exports.parseFieldInstruction=ut;exports.parseFieldType=I;exports.parseShape=W;exports.parseShapeFromDrawing=Dt;exports.parseSimpleField=mt;exports.parseTabStop=V;exports.parseTabStops=G;exports.parseTabStopsFromParagraphProperties=zt;exports.resolveFillColor=Gt;exports.resolveOutlineColor=_t;
|
|
1
|
+
'use strict';var chunkGFM6PERG_js=require('../chunk-GFM6PERG.js'),chunkJQUIUKRO_js=require('../chunk-JQUIUKRO.js');require('../chunk-4JPHW7ZI.js');var chunkWVY2UXAK_js=require('../chunk-WVY2UXAK.js'),chunkDFDL337G_js=require('../chunk-DFDL337G.js');require('../chunk-FIGLFSNR.js'),require('../chunk-QVRMX2AC.js');var chunkLW5OFHSW_js=require('../chunk-LW5OFHSW.js');require('../chunk-Z3LGMBJC.js'),require('../chunk-C2BAPYGJ.js');var chunkBJSG6TEG_js=require('../chunk-BJSG6TEG.js');require('../chunk-GSKMHXHG.js');var chunkH57LNDBH_js=require('../chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('../chunk-3R7QHNI5.js');require('../chunk-DC7S76ZX.js');var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function ct(e){return M.includes(e)}function ut(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function dt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ft(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function mt(e,t,n){let o=chunk3R7QHNI5_js.j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=chunk3R7QHNI5_js.j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=chunk3R7QHNI5_js.j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=chunk3R7QHNI5_js.f(e,"w","r");for(let u of l){let c=chunkDFDL337G_js.E(u,t,n);i.content.push(c);}return i}function ht(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function gt(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tt(e){return e.fieldType==="PAGE"}function xt(e){return e.fieldType==="NUMPAGES"}function yt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function St(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function Ft(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function bt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function Et(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ct(e,t){let n=chunkLW5OFHSW_js.b(e);if(n){if(n.type==="gradient"&&e){let r=chunk3R7QHNI5_js.i(e).find(i=>i.name==="a:gradFill");if(r)return wt(r)}return n}if(e){let o=chunk3R7QHNI5_js.i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=chunk3R7QHNI5_js.h(t,"a:fillRef");if(o){if(chunk3R7QHNI5_js.j(o,null,"idx")==="0")return {type:"none"};let i=chunkLW5OFHSW_js.a(o);if(i)return {type:"solid",color:i}}}}function wt(e){let t=chunk3R7QHNI5_js.i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=chunk3R7QHNI5_js.j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i=t.find(l=>l.name==="a:path");if(i){let l=chunk3R7QHNI5_js.j(i,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a=t.find(l=>l.name==="a:gsLst"),s=[];if(a){let l=chunk3R7QHNI5_js.g(a,"gs");for(let u of l){let c=chunk3R7QHNI5_js.j(u,null,"pos"),p=c?parseInt(c,10):0,m=chunkLW5OFHSW_js.a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function At(e,t){let n=e?chunk3R7QHNI5_js.h(e,"a:ln"):null;if(!n){if(t){let f=chunk3R7QHNI5_js.h(t,"a:lnRef");if(f){if(chunk3R7QHNI5_js.j(f,null,"idx")==="0")return;let g=chunkLW5OFHSW_js.a(f);if(g)return {color:g,width:9525}}}return}let o=chunk3R7QHNI5_js.i(n);if(o.find(f=>f.name==="a:noFill"))return;let i={},a=chunk3R7QHNI5_js.j(n,null,"w");a&&(i.width=parseInt(a,10));let s=chunk3R7QHNI5_js.j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i.join="bevel":c?i.join="round":u&&(i.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i.color=chunkLW5OFHSW_js.a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=chunk3R7QHNI5_js.j(m,null,"val");f&&(i.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i.tailEnd=X(T)),i}function X(e){let t=chunk3R7QHNI5_js.j(e,null,"type")??"none",n=chunk3R7QHNI5_js.j(e,null,"w"),o=chunk3R7QHNI5_js.j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Mt(e){if(!e)return {size:{width:0,height:0}};let t=chunk3R7QHNI5_js.h(e,"a:ext"),n=chunk3R7QHNI5_js.l(t,null,"cx")??0,o=chunk3R7QHNI5_js.l(t,null,"cy")??0,r={width:n,height:o},i=chunk3R7QHNI5_js.h(e,"a:off"),a;if(i){let m=chunk3R7QHNI5_js.l(i,null,"x")??0,y=chunk3R7QHNI5_js.l(i,null,"y")??0;a={x:m,y};}let s=chunk3R7QHNI5_js.j(e,null,"rot"),l=chunk3R7QHNI5_js.j(e,null,"flipH")==="1",u=chunk3R7QHNI5_js.j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l||u)&&(p={},c!==void 0&&(p.rotation=c),l&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function It(e){if(!e)return "rect";let t=chunk3R7QHNI5_js.h(e,"a:prstGeom");if(t){let o=chunk3R7QHNI5_js.j(t,null,"prst");if(o)return o}return chunk3R7QHNI5_js.h(e,"a:custGeom"),"rect"}function Rt(e){if(!e)return {};let t={},n=chunk3R7QHNI5_js.j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=chunk3R7QHNI5_js.j(e,null,"rot");o&&(t.rotation=H(o));let r=chunk3R7QHNI5_js.j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}chunk3R7QHNI5_js.j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=chunk3R7QHNI5_js.h(e,"a:noAutofit"),a=chunk3R7QHNI5_js.h(e,"a:normAutofit"),s=chunk3R7QHNI5_js.h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l=chunk3R7QHNI5_js.l(e,null,"lIns"),u=chunk3R7QHNI5_js.l(e,null,"rIns"),c=chunk3R7QHNI5_js.l(e,null,"tIns"),p=chunk3R7QHNI5_js.l(e,null,"bIns");return (l!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l,right:u,top:c,bottom:p}),t}function Lt(e){if(!e)return [];let t=[],n=chunk3R7QHNI5_js.g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=chunk3R7QHNI5_js.i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i=t.find(g=>g.name==="wps:txbx"),a=i?chunk3R7QHNI5_js.h(i,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=It(o??null),u=o?chunk3R7QHNI5_js.h(o,"a:xfrm"):null,{size:c,transform:p}=Mt(u),m=Ct(o??null,r??null),y=At(o??null,r??null),T,f;n&&(T=chunk3R7QHNI5_js.j(n,null,"id")??void 0,f=chunk3R7QHNI5_js.j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=Rt(s??null),P=Lt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function Dt(e){let n=chunk3R7QHNI5_js.i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=chunk3R7QHNI5_js.h(n,"a:graphic");if(!r)return null;let i=chunk3R7QHNI5_js.h(r,"a:graphicData");if(!i)return null;let a=chunk3R7QHNI5_js.h(i,"wps:wsp");if(!a)return null;let s=W(a),l=chunk3R7QHNI5_js.h(n,"wp:extent");if(l){let c=chunk3R7QHNI5_js.l(l,null,"cx")??0,p=chunk3R7QHNI5_js.l(l,null,"cy")??0;s.size={width:c,height:p};}if(o){let c=chunkLW5OFHSW_js.c(n);c&&(s.position=c);let p=chunkLW5OFHSW_js.d(n);p&&(s.wrap=p);}let u=chunk3R7QHNI5_js.h(n,"wp:docPr");if(u){let c=chunk3R7QHNI5_js.j(u,null,"id"),p=chunk3R7QHNI5_js.j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Pt(e){let n=chunk3R7QHNI5_js.i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=chunk3R7QHNI5_js.h(n,"a:graphic");if(!o)return false;let r=chunk3R7QHNI5_js.h(o,"a:graphicData");return r?chunk3R7QHNI5_js.h(r,"wps:wsp")!==null:false}function Nt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Bt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function vt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Ot(e){return chunkBJSG6TEG_js.f(e.size.width)}function kt(e){return chunkBJSG6TEG_js.f(e.size.height)}function Ut(e){return {width:chunkBJSG6TEG_js.f(e.size.width),height:chunkBJSG6TEG_js.f(e.size.height)}}function Xt(e){return e.position!==void 0||e.wrap!==void 0}function Ht(e){return e.fill!==void 0&&e.fill.type!=="none"}function Wt(e){return e.outline!==void 0}function Vt(e){return e.outline?.width?chunkBJSG6TEG_js.f(e.outline.width):0}function Gt(e){if(!(!e.fill||e.fill.type!=="solid"))return chunkLW5OFHSW_js.e(e.fill.color)}function _t(e){if(e.outline?.color)return chunkLW5OFHSW_js.e(e.outline.color)}var R=720,L="left",jt="none";function V(e){let t=chunk3R7QHNI5_js.l(e,"w","pos"),n=chunk3R7QHNI5_js.j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=chunk3R7QHNI5_js.j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=chunk3R7QHNI5_js.f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function zt(e){if(!e)return;let t=chunk3R7QHNI5_js.e(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function Kt(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function Yt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function Jt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Zt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function qt(e){return e!==void 0&&e!=="none"}function Qt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function $t(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkGFM6PERG_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkGFM6PERG_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkGFM6PERG_js.a}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkJQUIUKRO_js.m}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.a}});Object.defineProperty(exports,"getEndnoteText",{enumerable:true,get:function(){return chunkDFDL337G_js.y}});Object.defineProperty(exports,"getFootnoteText",{enumerable:true,get:function(){return chunkDFDL337G_js.x}});Object.defineProperty(exports,"getHyperlinkRuns",{enumerable:true,get:function(){return chunkDFDL337G_js.L}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkDFDL337G_js.G}});Object.defineProperty(exports,"getHyperlinkUrl",{enumerable:true,get:function(){return chunkDFDL337G_js.J}});Object.defineProperty(exports,"getTableColumnCount",{enumerable:true,get:function(){return chunkDFDL337G_js.j}});Object.defineProperty(exports,"getTableRowCount",{enumerable:true,get:function(){return chunkDFDL337G_js.k}});Object.defineProperty(exports,"hasContent",{enumerable:true,get:function(){return chunkDFDL337G_js.K}});Object.defineProperty(exports,"hasHeaderRow",{enumerable:true,get:function(){return chunkDFDL337G_js.n}});Object.defineProperty(exports,"isCellMergeContinuation",{enumerable:true,get:function(){return chunkDFDL337G_js.l}});Object.defineProperty(exports,"isCellMergeStart",{enumerable:true,get:function(){return chunkDFDL337G_js.m}});Object.defineProperty(exports,"isExternalLink",{enumerable:true,get:function(){return chunkDFDL337G_js.H}});Object.defineProperty(exports,"isInternalLink",{enumerable:true,get:function(){return chunkDFDL337G_js.I}});Object.defineProperty(exports,"isSeparatorEndnote",{enumerable:true,get:function(){return chunkDFDL337G_js.A}});Object.defineProperty(exports,"isSeparatorFootnote",{enumerable:true,get:function(){return chunkDFDL337G_js.z}});Object.defineProperty(exports,"parseBorderSpec",{enumerable:true,get:function(){return chunkDFDL337G_js.d}});Object.defineProperty(exports,"parseCellMargins",{enumerable:true,get:function(){return chunkDFDL337G_js.f}});Object.defineProperty(exports,"parseEndnoteProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.w}});Object.defineProperty(exports,"parseEndnotes",{enumerable:true,get:function(){return chunkDFDL337G_js.u}});Object.defineProperty(exports,"parseFloatingTableProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.i}});Object.defineProperty(exports,"parseFootnoteProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.v}});Object.defineProperty(exports,"parseFootnotes",{enumerable:true,get:function(){return chunkDFDL337G_js.t}});Object.defineProperty(exports,"parseHyperlink",{enumerable:true,get:function(){return chunkDFDL337G_js.F}});Object.defineProperty(exports,"parseShading",{enumerable:true,get:function(){return chunkDFDL337G_js.g}});Object.defineProperty(exports,"parseTableBorders",{enumerable:true,get:function(){return chunkDFDL337G_js.e}});Object.defineProperty(exports,"parseTableLook",{enumerable:true,get:function(){return chunkDFDL337G_js.h}});Object.defineProperty(exports,"parseTableMeasurement",{enumerable:true,get:function(){return chunkDFDL337G_js.c}});Object.defineProperty(exports,"parseTableProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.o}});Object.defineProperty(exports,"resolveHyperlinkUrl",{enumerable:true,get:function(){return chunkDFDL337G_js.M}});Object.defineProperty(exports,"extractTextBoxContentElements",{enumerable:true,get:function(){return chunkLW5OFHSW_js.f}});Object.defineProperty(exports,"getImageHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.G}});Object.defineProperty(exports,"getImageWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.F}});Object.defineProperty(exports,"getTextBoxContentElement",{enumerable:true,get:function(){return chunkLW5OFHSW_js.k}});Object.defineProperty(exports,"getTextBoxDimensionsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.o}});Object.defineProperty(exports,"getTextBoxHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.n}});Object.defineProperty(exports,"getTextBoxMarginsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.p}});Object.defineProperty(exports,"getTextBoxOutlineWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.x}});Object.defineProperty(exports,"getTextBoxText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.u}});Object.defineProperty(exports,"getTextBoxWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.m}});Object.defineProperty(exports,"getWrapDistancesPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.I}});Object.defineProperty(exports,"hasTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.t}});Object.defineProperty(exports,"hasTextBoxFill",{enumerable:true,get:function(){return chunkLW5OFHSW_js.r}});Object.defineProperty(exports,"hasTextBoxOutline",{enumerable:true,get:function(){return chunkLW5OFHSW_js.s}});Object.defineProperty(exports,"isBehindText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.D}});Object.defineProperty(exports,"isDecorativeImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.H}});Object.defineProperty(exports,"isFloatingImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.C}});Object.defineProperty(exports,"isFloatingTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.q}});Object.defineProperty(exports,"isInFrontOfText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.E}});Object.defineProperty(exports,"isInlineImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.B}});Object.defineProperty(exports,"isShapeTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.i}});Object.defineProperty(exports,"isTextBoxDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.h}});Object.defineProperty(exports,"parseDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.z}});Object.defineProperty(exports,"parseImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.A}});Object.defineProperty(exports,"parseTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.j}});Object.defineProperty(exports,"parseTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.g}});Object.defineProperty(exports,"parseTextBoxFromShape",{enumerable:true,get:function(){return chunkLW5OFHSW_js.l}});Object.defineProperty(exports,"resolveTextBoxFillColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.v}});Object.defineProperty(exports,"resolveTextBoxOutlineColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.w}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"computeListRendering",{enumerable:true,get:function(){return chunkH57LNDBH_js.d}});Object.defineProperty(exports,"createNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.c}});Object.defineProperty(exports,"formatNumber",{enumerable:true,get:function(){return chunkH57LNDBH_js.e}});Object.defineProperty(exports,"getBulletCharacter",{enumerable:true,get:function(){return chunkH57LNDBH_js.h}});Object.defineProperty(exports,"getCachedNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.b}});Object.defineProperty(exports,"isBulletLevel",{enumerable:true,get:function(){return chunkH57LNDBH_js.i}});Object.defineProperty(exports,"parseNumbering",{enumerable:true,get:function(){return chunkH57LNDBH_js.a}});Object.defineProperty(exports,"renderListMarker",{enumerable:true,get:function(){return chunkH57LNDBH_js.g}});exports.DEFAULT_TAB_ALIGNMENT=L;exports.DEFAULT_TAB_INTERVAL_TWIPS=R;exports.DEFAULT_TAB_LEADER=jt;exports.KNOWN_FIELD_TYPES=M;exports.calculateTabWidth=Yt;exports.calculateTabWidthWithAlignment=Jt;exports.createComplexFieldContext=ht;exports.getFieldDisplayValue=gt;exports.getFormatSwitch=dt;exports.getLeaderCharacter=Zt;exports.getNextTabStop=D;exports.getOutlineWidthPx=Vt;exports.getShapeDimensionsPx=Ut;exports.getShapeHeightPx=kt;exports.getShapeWidthPx=Ot;exports.hasFill=Ht;exports.hasMergeFormat=ft;exports.hasOutline=Wt;exports.hasTextContent=vt;exports.hasVisibleLeader=qt;exports.injectReplyRangeMarkers=Qt;exports.injectTCReplyRangeMarkers=$t;exports.isDateTimeField=yt;exports.isDocPropertyField=St;exports.isFloatingShape=Xt;exports.isKnownFieldType=ct;exports.isLineShape=Nt;exports.isMergeField=bt;exports.isPageNumberField=Tt;exports.isReferenceField=Ft;exports.isShapeDrawing=Pt;exports.isTextBoxShape=Bt;exports.isTocField=Et;exports.isTotalPagesField=xt;exports.mergeTabStops=Kt;exports.parseFieldInstruction=ut;exports.parseFieldType=I;exports.parseShape=W;exports.parseShapeFromDrawing=Dt;exports.parseSimpleField=mt;exports.parseTabStop=V;exports.parseTabStops=G;exports.parseTabStopsFromParagraphProperties=zt;exports.resolveFillColor=Gt;exports.resolveOutlineColor=_t;
|
package/dist/docx/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'../chunk-QZPVZY6S.mjs';export{t as createDocx,i as repackDocx,m as updateMultipleFiles}from'../chunk-F24WZXN4.mjs';import'../chunk-2LVK7EF5.mjs';export{a as parseDocx}from'../chunk-C57BOE7B.mjs';import {E}from'../chunk-4QJEMD23.mjs';export{y as getEndnoteText,x as getFootnoteText,L as getHyperlinkRuns,G as getHyperlinkText,J as getHyperlinkUrl,j as getTableColumnCount,k as getTableRowCount,K as hasContent,n as hasHeaderRow,l as isCellMergeContinuation,m as isCellMergeStart,H as isExternalLink,I as isInternalLink,A as isSeparatorEndnote,z as isSeparatorFootnote,d as parseBorderSpec,f as parseCellMargins,w as parseEndnoteProperties,u as parseEndnotes,i as parseFloatingTableProperties,v as parseFootnoteProperties,t as parseFootnotes,F as parseHyperlink,g as parseShading,e as parseTableBorders,h as parseTableLook,c as parseTableMeasurement,o as parseTableProperties,M as resolveHyperlinkUrl}from'../chunk-4QJEMD23.mjs';import'../chunk-MOCGHQ4A.mjs';import'../chunk-CDBKFBC2.mjs';import {c,d,e,b,a}from'../chunk-3HLRRK6N.mjs';export{f as extractTextBoxContentElements,G as getImageHeightPx,F as getImageWidthPx,k as getTextBoxContentElement,o as getTextBoxDimensionsPx,n as getTextBoxHeightPx,p as getTextBoxMarginsPx,x as getTextBoxOutlineWidthPx,u as getTextBoxText,m as getTextBoxWidthPx,I as getWrapDistancesPx,t as hasTextBoxContent,r as hasTextBoxFill,s as hasTextBoxOutline,D as isBehindText,H as isDecorativeImage,C as isFloatingImage,q as isFloatingTextBox,E as isInFrontOfText,B as isInlineImage,i as isShapeTextBox,h as isTextBoxDrawing,z as parseDrawing,A as parseImage,j as parseTextBox,g as parseTextBoxContent,l as parseTextBoxFromShape,v as resolveTextBoxFillColor,w as resolveTextBoxOutlineColor}from'../chunk-3HLRRK6N.mjs';import'../chunk-W77JXDEV.mjs';import'../chunk-LE67NTCN.mjs';import {f as f$1}from'../chunk-KNY7SXPJ.mjs';export{f as emuToPixels,g as pixelsToEmu}from'../chunk-KNY7SXPJ.mjs';import'../chunk-DI6CRWSW.mjs';export{d as computeListRendering,c as createNumberingMap,e as formatNumber,h as getBulletCharacter,b as getCachedNumberingMap,i as isBulletLevel,a as parseNumbering,g as renderListMarker}from'../chunk-VJFIAFZ5.mjs';import {j,f,i,h,l,e as e$1,g}from'../chunk-3ANZ3252.mjs';import'../chunk-QYUPLKLP.mjs';var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function ct(e){return M.includes(e)}function ut(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function dt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ft(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function mt(e,t,n){let o=j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=f(e,"w","r");for(let u of l){let c=E(u,t,n);i.content.push(c);}return i}function ht(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function gt(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tt(e){return e.fieldType==="PAGE"}function xt(e){return e.fieldType==="NUMPAGES"}function yt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function St(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function Ft(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function bt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function Et(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ct(e,t){let n=b(e);if(n){if(n.type==="gradient"&&e){let r=i(e).find(i=>i.name==="a:gradFill");if(r)return wt(r)}return n}if(e){let o=i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=h(t,"a:fillRef");if(o){if(j(o,null,"idx")==="0")return {type:"none"};let i=a(o);if(i)return {type:"solid",color:i}}}}function wt(e){let t=i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i$1=t.find(l=>l.name==="a:path");if(i$1){let l=j(i$1,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a$1=t.find(l=>l.name==="a:gsLst"),s=[];if(a$1){let l=g(a$1,"gs");for(let u of l){let c=j(u,null,"pos"),p=c?parseInt(c,10):0,m=a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function At(e,t){let n=e?h(e,"a:ln"):null;if(!n){if(t){let f=h(t,"a:lnRef");if(f){if(j(f,null,"idx")==="0")return;let g=a(f);if(g)return {color:g,width:9525}}}return}let o=i(n);if(o.find(f=>f.name==="a:noFill"))return;let i$1={},a$1=j(n,null,"w");a$1&&(i$1.width=parseInt(a$1,10));let s=j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i$1.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i$1.join="bevel":c?i$1.join="round":u&&(i$1.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i$1.color=a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=j(m,null,"val");f&&(i$1.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i$1.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i$1.tailEnd=X(T)),i$1}function X(e){let t=j(e,null,"type")??"none",n=j(e,null,"w"),o=j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Mt(e){if(!e)return {size:{width:0,height:0}};let t=h(e,"a:ext"),n=l(t,null,"cx")??0,o=l(t,null,"cy")??0,r={width:n,height:o},i=h(e,"a:off"),a;if(i){let m=l(i,null,"x")??0,y=l(i,null,"y")??0;a={x:m,y};}let s=j(e,null,"rot"),l$1=j(e,null,"flipH")==="1",u=j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l$1||u)&&(p={},c!==void 0&&(p.rotation=c),l$1&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function It(e){if(!e)return "rect";let t=h(e,"a:prstGeom");if(t){let o=j(t,null,"prst");if(o)return o}return h(e,"a:custGeom"),"rect"}function Rt(e){if(!e)return {};let t={},n=j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=j(e,null,"rot");o&&(t.rotation=H(o));let r=j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=h(e,"a:noAutofit"),a=h(e,"a:normAutofit"),s=h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l$1=l(e,null,"lIns"),u=l(e,null,"rIns"),c=l(e,null,"tIns"),p=l(e,null,"bIns");return (l$1!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l$1,right:u,top:c,bottom:p}),t}function Lt(e){if(!e)return [];let t=[],n=g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i$1=t.find(g=>g.name==="wps:txbx"),a=i$1?h(i$1,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=It(o??null),u=o?h(o,"a:xfrm"):null,{size:c,transform:p}=Mt(u),m=Ct(o??null,r??null),y=At(o??null,r??null),T,f;n&&(T=j(n,null,"id")??void 0,f=j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=Rt(s??null),P=Lt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function Dt(e){let n=i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=h(n,"a:graphic");if(!r)return null;let i$1=h(r,"a:graphicData");if(!i$1)return null;let a=h(i$1,"wps:wsp");if(!a)return null;let s=W(a),l$1=h(n,"wp:extent");if(l$1){let c=l(l$1,null,"cx")??0,p=l(l$1,null,"cy")??0;s.size={width:c,height:p};}if(o){let c$1=c(n);c$1&&(s.position=c$1);let p=d(n);p&&(s.wrap=p);}let u=h(n,"wp:docPr");if(u){let c=j(u,null,"id"),p=j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Pt(e){let n=i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=h(n,"a:graphic");if(!o)return false;let r=h(o,"a:graphicData");return r?h(r,"wps:wsp")!==null:false}function Nt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Bt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function vt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Ot(e){return f$1(e.size.width)}function kt(e){return f$1(e.size.height)}function Ut(e){return {width:f$1(e.size.width),height:f$1(e.size.height)}}function Xt(e){return e.position!==void 0||e.wrap!==void 0}function Ht(e){return e.fill!==void 0&&e.fill.type!=="none"}function Wt(e){return e.outline!==void 0}function Vt(e){return e.outline?.width?f$1(e.outline.width):0}function Gt(e$1){if(!(!e$1.fill||e$1.fill.type!=="solid"))return e(e$1.fill.color)}function _t(e$1){if(e$1.outline?.color)return e(e$1.outline.color)}var R=720,L="left",jt="none";function V(e){let t=l(e,"w","pos"),n=j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function zt(e){if(!e)return;let t=e$1(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function Kt(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function Yt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function Jt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Zt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function qt(e){return e!==void 0&&e!=="none"}function Qt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function $t(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}export{L as DEFAULT_TAB_ALIGNMENT,R as DEFAULT_TAB_INTERVAL_TWIPS,jt as DEFAULT_TAB_LEADER,M as KNOWN_FIELD_TYPES,Yt as calculateTabWidth,Jt as calculateTabWidthWithAlignment,ht as createComplexFieldContext,gt as getFieldDisplayValue,dt as getFormatSwitch,Zt as getLeaderCharacter,D as getNextTabStop,Vt as getOutlineWidthPx,Ut as getShapeDimensionsPx,kt as getShapeHeightPx,Ot as getShapeWidthPx,Ht as hasFill,ft as hasMergeFormat,Wt as hasOutline,vt as hasTextContent,qt as hasVisibleLeader,Qt as injectReplyRangeMarkers,$t as injectTCReplyRangeMarkers,yt as isDateTimeField,St as isDocPropertyField,Xt as isFloatingShape,ct as isKnownFieldType,Nt as isLineShape,bt as isMergeField,Tt as isPageNumberField,Ft as isReferenceField,Pt as isShapeDrawing,Bt as isTextBoxShape,Et as isTocField,xt as isTotalPagesField,Kt as mergeTabStops,ut as parseFieldInstruction,I as parseFieldType,W as parseShape,Dt as parseShapeFromDrawing,mt as parseSimpleField,V as parseTabStop,G as parseTabStops,zt as parseTabStopsFromParagraphProperties,Gt as resolveFillColor,_t as resolveOutlineColor};
|
|
1
|
+
export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'../chunk-QZPVZY6S.mjs';export{t as createDocx,i as repackDocx,m as updateMultipleFiles}from'../chunk-F24WZXN4.mjs';import'../chunk-2LVK7EF5.mjs';export{a as parseDocx}from'../chunk-5EP47PMQ.mjs';import {E}from'../chunk-47SKD7QB.mjs';export{y as getEndnoteText,x as getFootnoteText,L as getHyperlinkRuns,G as getHyperlinkText,J as getHyperlinkUrl,j as getTableColumnCount,k as getTableRowCount,K as hasContent,n as hasHeaderRow,l as isCellMergeContinuation,m as isCellMergeStart,H as isExternalLink,I as isInternalLink,A as isSeparatorEndnote,z as isSeparatorFootnote,d as parseBorderSpec,f as parseCellMargins,w as parseEndnoteProperties,u as parseEndnotes,i as parseFloatingTableProperties,v as parseFootnoteProperties,t as parseFootnotes,F as parseHyperlink,g as parseShading,e as parseTableBorders,h as parseTableLook,c as parseTableMeasurement,o as parseTableProperties,M as resolveHyperlinkUrl}from'../chunk-47SKD7QB.mjs';import'../chunk-MOCGHQ4A.mjs';import'../chunk-CDBKFBC2.mjs';import {c,d,e,b,a}from'../chunk-3HLRRK6N.mjs';export{f as extractTextBoxContentElements,G as getImageHeightPx,F as getImageWidthPx,k as getTextBoxContentElement,o as getTextBoxDimensionsPx,n as getTextBoxHeightPx,p as getTextBoxMarginsPx,x as getTextBoxOutlineWidthPx,u as getTextBoxText,m as getTextBoxWidthPx,I as getWrapDistancesPx,t as hasTextBoxContent,r as hasTextBoxFill,s as hasTextBoxOutline,D as isBehindText,H as isDecorativeImage,C as isFloatingImage,q as isFloatingTextBox,E as isInFrontOfText,B as isInlineImage,i as isShapeTextBox,h as isTextBoxDrawing,z as parseDrawing,A as parseImage,j as parseTextBox,g as parseTextBoxContent,l as parseTextBoxFromShape,v as resolveTextBoxFillColor,w as resolveTextBoxOutlineColor}from'../chunk-3HLRRK6N.mjs';import'../chunk-W77JXDEV.mjs';import'../chunk-LE67NTCN.mjs';import {f as f$1}from'../chunk-KNY7SXPJ.mjs';export{f as emuToPixels,g as pixelsToEmu}from'../chunk-KNY7SXPJ.mjs';import'../chunk-DI6CRWSW.mjs';export{d as computeListRendering,c as createNumberingMap,e as formatNumber,h as getBulletCharacter,b as getCachedNumberingMap,i as isBulletLevel,a as parseNumbering,g as renderListMarker}from'../chunk-VJFIAFZ5.mjs';import {j,f,i,h,l,e as e$1,g}from'../chunk-3ANZ3252.mjs';import'../chunk-QYUPLKLP.mjs';var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function ct(e){return M.includes(e)}function ut(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function dt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ft(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function mt(e,t,n){let o=j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=f(e,"w","r");for(let u of l){let c=E(u,t,n);i.content.push(c);}return i}function ht(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function gt(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tt(e){return e.fieldType==="PAGE"}function xt(e){return e.fieldType==="NUMPAGES"}function yt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function St(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function Ft(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function bt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function Et(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ct(e,t){let n=b(e);if(n){if(n.type==="gradient"&&e){let r=i(e).find(i=>i.name==="a:gradFill");if(r)return wt(r)}return n}if(e){let o=i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=h(t,"a:fillRef");if(o){if(j(o,null,"idx")==="0")return {type:"none"};let i=a(o);if(i)return {type:"solid",color:i}}}}function wt(e){let t=i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i$1=t.find(l=>l.name==="a:path");if(i$1){let l=j(i$1,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a$1=t.find(l=>l.name==="a:gsLst"),s=[];if(a$1){let l=g(a$1,"gs");for(let u of l){let c=j(u,null,"pos"),p=c?parseInt(c,10):0,m=a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function At(e,t){let n=e?h(e,"a:ln"):null;if(!n){if(t){let f=h(t,"a:lnRef");if(f){if(j(f,null,"idx")==="0")return;let g=a(f);if(g)return {color:g,width:9525}}}return}let o=i(n);if(o.find(f=>f.name==="a:noFill"))return;let i$1={},a$1=j(n,null,"w");a$1&&(i$1.width=parseInt(a$1,10));let s=j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i$1.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i$1.join="bevel":c?i$1.join="round":u&&(i$1.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i$1.color=a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=j(m,null,"val");f&&(i$1.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i$1.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i$1.tailEnd=X(T)),i$1}function X(e){let t=j(e,null,"type")??"none",n=j(e,null,"w"),o=j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Mt(e){if(!e)return {size:{width:0,height:0}};let t=h(e,"a:ext"),n=l(t,null,"cx")??0,o=l(t,null,"cy")??0,r={width:n,height:o},i=h(e,"a:off"),a;if(i){let m=l(i,null,"x")??0,y=l(i,null,"y")??0;a={x:m,y};}let s=j(e,null,"rot"),l$1=j(e,null,"flipH")==="1",u=j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l$1||u)&&(p={},c!==void 0&&(p.rotation=c),l$1&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function It(e){if(!e)return "rect";let t=h(e,"a:prstGeom");if(t){let o=j(t,null,"prst");if(o)return o}return h(e,"a:custGeom"),"rect"}function Rt(e){if(!e)return {};let t={},n=j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=j(e,null,"rot");o&&(t.rotation=H(o));let r=j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=h(e,"a:noAutofit"),a=h(e,"a:normAutofit"),s=h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l$1=l(e,null,"lIns"),u=l(e,null,"rIns"),c=l(e,null,"tIns"),p=l(e,null,"bIns");return (l$1!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l$1,right:u,top:c,bottom:p}),t}function Lt(e){if(!e)return [];let t=[],n=g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i$1=t.find(g=>g.name==="wps:txbx"),a=i$1?h(i$1,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=It(o??null),u=o?h(o,"a:xfrm"):null,{size:c,transform:p}=Mt(u),m=Ct(o??null,r??null),y=At(o??null,r??null),T,f;n&&(T=j(n,null,"id")??void 0,f=j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=Rt(s??null),P=Lt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function Dt(e){let n=i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=h(n,"a:graphic");if(!r)return null;let i$1=h(r,"a:graphicData");if(!i$1)return null;let a=h(i$1,"wps:wsp");if(!a)return null;let s=W(a),l$1=h(n,"wp:extent");if(l$1){let c=l(l$1,null,"cx")??0,p=l(l$1,null,"cy")??0;s.size={width:c,height:p};}if(o){let c$1=c(n);c$1&&(s.position=c$1);let p=d(n);p&&(s.wrap=p);}let u=h(n,"wp:docPr");if(u){let c=j(u,null,"id"),p=j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Pt(e){let n=i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=h(n,"a:graphic");if(!o)return false;let r=h(o,"a:graphicData");return r?h(r,"wps:wsp")!==null:false}function Nt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Bt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function vt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Ot(e){return f$1(e.size.width)}function kt(e){return f$1(e.size.height)}function Ut(e){return {width:f$1(e.size.width),height:f$1(e.size.height)}}function Xt(e){return e.position!==void 0||e.wrap!==void 0}function Ht(e){return e.fill!==void 0&&e.fill.type!=="none"}function Wt(e){return e.outline!==void 0}function Vt(e){return e.outline?.width?f$1(e.outline.width):0}function Gt(e$1){if(!(!e$1.fill||e$1.fill.type!=="solid"))return e(e$1.fill.color)}function _t(e$1){if(e$1.outline?.color)return e(e$1.outline.color)}var R=720,L="left",jt="none";function V(e){let t=l(e,"w","pos"),n=j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function zt(e){if(!e)return;let t=e$1(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function Kt(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function Yt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function Jt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Zt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function qt(e){return e!==void 0&&e!=="none"}function Qt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function $t(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}export{L as DEFAULT_TAB_ALIGNMENT,R as DEFAULT_TAB_INTERVAL_TWIPS,jt as DEFAULT_TAB_LEADER,M as KNOWN_FIELD_TYPES,Yt as calculateTabWidth,Jt as calculateTabWidthWithAlignment,ht as createComplexFieldContext,gt as getFieldDisplayValue,dt as getFormatSwitch,Zt as getLeaderCharacter,D as getNextTabStop,Vt as getOutlineWidthPx,Ut as getShapeDimensionsPx,kt as getShapeHeightPx,Ot as getShapeWidthPx,Ht as hasFill,ft as hasMergeFormat,Wt as hasOutline,vt as hasTextContent,qt as hasVisibleLeader,Qt as injectReplyRangeMarkers,$t as injectTCReplyRangeMarkers,yt as isDateTimeField,St as isDocPropertyField,Xt as isFloatingShape,ct as isKnownFieldType,Nt as isLineShape,bt as isMergeField,Tt as isPageNumberField,Ft as isReferenceField,Pt as isShapeDrawing,Bt as isTextBoxShape,Et as isTocField,xt as isTotalPagesField,Kt as mergeTabStops,ut as parseFieldInstruction,I as parseFieldType,W as parseShape,Dt as parseShapeFromDrawing,mt as parseSimpleField,V as parseTabStop,G as parseTabStops,zt as parseTabStopsFromParagraphProperties,Gt as resolveFillColor,_t as resolveOutlineColor};
|
package/dist/docx/parser.d.mts
CHANGED
|
@@ -24,7 +24,7 @@ import { D as DocxInput } from '../docxInput-DTbCa48g.mjs';
|
|
|
24
24
|
import '../colors-C3vA7HUU.mjs';
|
|
25
25
|
import '../formatting-DFtuRFQY.mjs';
|
|
26
26
|
import '../lists-CyGxd5Y2.mjs';
|
|
27
|
-
import '../content-
|
|
27
|
+
import '../content-BEFz1zcs.mjs';
|
|
28
28
|
import './wrapTypes.mjs';
|
|
29
29
|
import '../watermark-D90356ZM.mjs';
|
|
30
30
|
import '../styles-Dqec8Aw6.mjs';
|
package/dist/docx/parser.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { D as DocxInput } from '../docxInput-DTbCa48g.js';
|
|
|
24
24
|
import '../colors-C3vA7HUU.js';
|
|
25
25
|
import '../formatting-JhqWT_XM.js';
|
|
26
26
|
import '../lists-Bn29SzeS.js';
|
|
27
|
-
import '../content-
|
|
27
|
+
import '../content-DNcMlHU0.js';
|
|
28
28
|
import './wrapTypes.js';
|
|
29
29
|
import '../watermark-D90356ZM.js';
|
|
30
30
|
import '../styles-gEujs7j6.js';
|
package/dist/docx/parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkWVY2UXAK_js=require('../chunk-WVY2UXAK.js');require('../chunk-DFDL337G.js'),require('../chunk-FIGLFSNR.js'),require('../chunk-QVRMX2AC.js'),require('../chunk-LW5OFHSW.js'),require('../chunk-Z3LGMBJC.js'),require('../chunk-BJSG6TEG.js'),require('../chunk-GSKMHXHG.js'),require('../chunk-H57LNDBH.js'),require('../chunk-3R7QHNI5.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"fullParseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.c}});Object.defineProperty(exports,"getDocxSummary",{enumerable:true,get:function(){return chunkWVY2UXAK_js.e}});Object.defineProperty(exports,"getDocxVariables",{enumerable:true,get:function(){return chunkWVY2UXAK_js.d}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.a}});Object.defineProperty(exports,"quickParseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.b}});
|
package/dist/docx/parser.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as fullParseDocx,e as getDocxSummary,d as getDocxVariables,a as parseDocx,b as quickParseDocx}from'../chunk-
|
|
1
|
+
export{c as fullParseDocx,e as getDocxSummary,d as getDocxVariables,a as parseDocx,b as quickParseDocx}from'../chunk-5EP47PMQ.mjs';import'../chunk-47SKD7QB.mjs';import'../chunk-MOCGHQ4A.mjs';import'../chunk-CDBKFBC2.mjs';import'../chunk-3HLRRK6N.mjs';import'../chunk-W77JXDEV.mjs';import'../chunk-KNY7SXPJ.mjs';import'../chunk-DI6CRWSW.mjs';import'../chunk-VJFIAFZ5.mjs';import'../chunk-3ANZ3252.mjs';import'../chunk-QYUPLKLP.mjs';
|