@eigenpal/docx-editor-core 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.mts +5 -4
- package/dist/agent/index.d.ts +5 -4
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/anchoredObjectPosition-CS-8BfhO.d.ts +48 -0
- package/dist/anchoredObjectPosition-KJEyF-wr.d.mts +48 -0
- package/dist/{chunk-U4WUDHDK.js → chunk-2SGJZYQF.js} +1 -1
- package/dist/chunk-3ANZ3252.mjs +2 -0
- package/dist/chunk-3G44SFHX.mjs +4 -0
- package/dist/{chunk-4QEETB7U.js → chunk-3QPKTG2Y.js} +2 -2
- package/dist/chunk-3R7QHNI5.js +2 -0
- package/dist/chunk-4GFTMGSV.mjs +1 -0
- package/dist/chunk-4RTVLMRZ.js +2 -0
- package/dist/{chunk-THLJYXFB.js → chunk-6V3SFHEM.js} +1 -1
- package/dist/chunk-72KLR6TJ.mjs +1 -0
- package/dist/{chunk-6ZXL3EIP.mjs → chunk-7CZEZ3UL.mjs} +1 -1
- package/dist/chunk-7JQVKJRN.mjs +1 -0
- package/dist/{chunk-Z5MJYQSD.mjs → chunk-7UZJ5YDF.mjs} +1 -1
- package/dist/chunk-7WGN2OBZ.js +1 -0
- package/dist/{chunk-BXWOLARZ.js → chunk-APNMO5JT.js} +1 -1
- package/dist/{chunk-KZXZWGFX.mjs → chunk-B46V5G46.mjs} +1 -1
- package/dist/chunk-BH3ACQ3M.js +59 -0
- package/dist/chunk-BUCOTKYY.js +1 -0
- package/dist/{chunk-5BLQHXWK.mjs → chunk-CDXCFHOY.mjs} +1 -1
- package/dist/chunk-CHN26LLL.mjs +59 -0
- package/dist/chunk-CZSAC65M.js +2 -0
- package/dist/chunk-D3PRIF3Y.mjs +1 -0
- package/dist/{chunk-7BVHKWEW.mjs → chunk-DFUWJHKF.mjs} +1 -1
- package/dist/chunk-DKKTY56Q.js +1 -0
- package/dist/chunk-FIGLFSNR.js +1 -0
- package/dist/{chunk-AMB6Y77B.js → chunk-FQS436KN.js} +1 -1
- package/dist/chunk-FYRJTDC4.mjs +2 -0
- package/dist/chunk-GYWTUUXX.mjs +2 -0
- package/dist/chunk-INDYZOOS.js +1 -0
- package/dist/chunk-IUVQJ6PX.mjs +1 -0
- package/dist/chunk-JUMHC5Z6.mjs +1 -0
- package/dist/chunk-L6YTCHOQ.mjs +1 -0
- package/dist/{chunk-D62KS7QG.mjs → chunk-LAJPGQEE.mjs} +1 -1
- package/dist/chunk-LERLET2D.js +4 -0
- package/dist/chunk-MEVZCB56.mjs +1 -0
- package/dist/{chunk-BOOHU5EW.mjs → chunk-MOCGHQ4A.mjs} +1 -1
- package/dist/chunk-NAFMAKLK.js +2 -0
- package/dist/chunk-OTHV7YV2.js +2 -0
- package/dist/chunk-Q5B5GKXD.mjs +1 -0
- package/dist/{chunk-U4XMGWF7.js → chunk-RAWVGULQ.js} +1 -1
- package/dist/chunk-RQVHKDXK.js +2 -0
- package/dist/{chunk-E4JMCA5X.js → chunk-SCK6ZM5V.js} +2 -2
- package/dist/chunk-SWBLJF6R.mjs +2 -0
- package/dist/chunk-T4RYVPAB.js +1 -0
- package/dist/{chunk-UGV4KRQB.js → chunk-TJRROR6U.js} +1 -1
- package/dist/chunk-TURYWKNS.js +1 -0
- package/dist/chunk-UE2ZKRYB.mjs +2 -0
- package/dist/chunk-VOCHZNOF.mjs +1 -0
- package/dist/{chunk-OEXVWIHW.mjs → chunk-W77JXDEV.mjs} +1 -1
- package/dist/chunk-WDBZ3QVB.js +1 -0
- package/dist/chunk-WWBNJ7KF.js +1 -0
- package/dist/chunk-WWNOXNEX.mjs +2 -0
- package/dist/chunk-XWC67YLW.js +1 -0
- package/dist/{chunk-QKLY4F2J.mjs → chunk-YNUPP7UG.mjs} +1 -1
- package/dist/{chunk-HQPWFUP5.js → chunk-Z3LGMBJC.js} +1 -1
- package/dist/{colorResolver-BZ_yScf4.d.ts → colorResolver-8A-qj-LP.d.ts} +1 -1
- package/dist/{colorResolver-C6DtsoFI.d.mts → colorResolver-BCvxTlLF.d.mts} +1 -1
- package/dist/{content-CE-ZdMwG.d.mts → content-3xF4WDE8.d.mts} +51 -7
- package/dist/{content-CYXJ2tfQ.d.ts → content-C8fc_tL6.d.ts} +51 -7
- package/dist/{contentControlValues-gyVPsi6m.d.ts → contentControlValues-DGDKD589.d.ts} +1 -1
- package/dist/{contentControlValues-DAwTWfgR.d.mts → contentControlValues-DjWvoJQ-.d.mts} +1 -1
- package/dist/core-plugins.d.mts +6 -5
- package/dist/core-plugins.d.ts +6 -5
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +12 -11
- package/dist/core.d.ts +12 -11
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{documentStyles-DToJv9co.d.ts → documentStyles-C7k_8Sye.d.ts} +1 -1
- package/dist/{documentStyles-D87dxl18.d.mts → documentStyles-qR0VR2s0.d.mts} +1 -1
- package/dist/docx/index.d.mts +3 -2
- package/dist/docx/index.d.ts +3 -2
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +3 -2
- package/dist/docx/parser.d.ts +3 -2
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +3 -2
- package/dist/docx/rezip.d.ts +3 -2
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.d.mts +42 -4
- package/dist/docx/serializer/index.d.ts +42 -4
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/{fontLoader-Z7pqeNvZ.d.mts → fontLoader-CUS1BPv7.d.mts} +1 -1
- package/dist/{fontLoader-Cm02v7PO.d.ts → fontLoader-Dl9SEKex.d.ts} +1 -1
- package/dist/{footnotes-lCH_P3N3.d.mts → footnotes-BtVc6VFl.d.mts} +14 -1
- package/dist/{footnotes-skVvEHvZ.d.ts → footnotes-DcUMWXul.d.ts} +14 -1
- package/dist/{headerFooterLayout-Bd58Tum3.d.ts → headerFooterLayout-4E-S4Aay.d.ts} +5 -5
- package/dist/{headerFooterLayout-CuIJiIzi.d.mts → headerFooterLayout-DlJLWmpR.d.mts} +5 -5
- package/dist/headless.d.mts +47 -11
- package/dist/headless.d.ts +47 -11
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/clickToPositionDom.d.mts +26 -1
- package/dist/layout-bridge/clickToPositionDom.d.ts +26 -1
- package/dist/layout-bridge/clickToPositionDom.js +1 -1
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +29 -7
- package/dist/layout-bridge/index.d.ts +29 -7
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +25 -3
- package/dist/layout-bridge/measuring/index.d.ts +25 -3
- 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 +3 -2
- package/dist/layout-bridge/toFlowBlocks.d.ts +3 -2
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +16 -3
- package/dist/layout-engine/index.d.ts +16 -3
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +22 -1
- package/dist/layout-engine/types.d.ts +22 -1
- package/dist/layout-painter/index.d.mts +6 -4
- package/dist/layout-painter/index.d.ts +6 -4
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +9 -5
- package/dist/layout-painter/renderPage.d.ts +9 -5
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +3 -2
- package/dist/managers/AutoSaveManager.d.ts +3 -2
- package/dist/managers/TableSelectionManager.d.mts +3 -2
- package/dist/managers/TableSelectionManager.d.ts +3 -2
- package/dist/managers/types.d.mts +3 -2
- package/dist/managers/types.d.ts +3 -2
- package/dist/mcp-cli.mjs +23 -23
- package/dist/mcp.d.mts +4 -3
- package/dist/mcp.d.ts +4 -3
- package/dist/mcp.js +3 -3
- package/dist/mcp.mjs +2 -2
- package/dist/{nodes-BNkRKBBX.d.ts → nodes-75Q9GBxV.d.ts} +1 -1
- package/dist/{nodes-Bz-UHhLE.d.mts → nodes-cEI7hVY2.d.mts} +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +20 -1
- package/dist/prosemirror/commands/index.d.ts +20 -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/conversion/fromProseDoc.d.mts +3 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +3 -2
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +3 -2
- package/dist/prosemirror/conversion/index.d.ts +3 -2
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/editor.css +12 -2
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/index.d.mts +6 -5
- package/dist/prosemirror/index.d.ts +6 -5
- package/dist/prosemirror/index.js +2 -2
- package/dist/prosemirror/index.mjs +1 -1
- package/dist/prosemirror/plugins/index.d.mts +4 -3
- package/dist/prosemirror/plugins/index.d.ts +4 -3
- package/dist/prosemirror/schema/index.d.mts +3 -2
- package/dist/prosemirror/schema/index.d.ts +3 -2
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/styles/index.d.mts +1 -1
- package/dist/prosemirror/styles/index.d.ts +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +2 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +2 -1
- package/dist/{registry-Cpyybgij.d.mts → registry-NLnxX7pq.d.mts} +1 -1
- package/dist/{registry-E5pahPKL.d.ts → registry-egK81C_z.d.ts} +1 -1
- package/dist/sectionPropertiesSerializer-D86QlzlT.d.mts +59 -0
- package/dist/sectionPropertiesSerializer-uXyGONxu.d.ts +59 -0
- package/dist/{styles-EI2lxeEN.d.mts → styles-BOJ93SAm.d.mts} +1 -1
- package/dist/{styles-BBv7doYK.d.ts → styles-BWqX2AS-.d.ts} +1 -1
- package/dist/types/content.d.mts +2 -1
- package/dist/types/content.d.ts +2 -1
- package/dist/types/content.js +1 -1
- package/dist/types/content.mjs +1 -0
- package/dist/types/document.d.mts +17 -6
- package/dist/types/document.d.ts +17 -6
- package/dist/types/document.js +1 -1
- package/dist/types/document.mjs +1 -0
- package/dist/{types-DXG7vqe9.d.ts → types-DDQWU7-j.d.ts} +1 -1
- package/dist/{types-dYdjUZMo.d.mts → types-DTF0N7UE.d.mts} +1 -1
- package/dist/utils/comments.d.mts +2 -1
- package/dist/utils/comments.d.ts +2 -1
- package/dist/utils/index.d.mts +5 -4
- package/dist/utils/index.d.ts +5 -4
- package/dist/{variableDetector-HPZbJ_gw.d.ts → variableDetector-1mxzPfs2.d.ts} +1 -1
- package/dist/{variableDetector-C7BLz9sJ.d.mts → variableDetector-CaY-sDau.d.mts} +1 -1
- package/dist/watermark-DAcnAs_J.d.mts +77 -0
- package/dist/watermark-DAcnAs_J.d.ts +77 -0
- package/package.json +1 -1
- package/dist/chunk-2EQGBVPV.js +0 -2
- package/dist/chunk-44FHVKSI.js +0 -1
- package/dist/chunk-44JKHPGF.mjs +0 -2
- package/dist/chunk-5M7TI6TV.js +0 -1
- package/dist/chunk-6Y6LON6Y.mjs +0 -1
- package/dist/chunk-7RDCZLTU.js +0 -1
- package/dist/chunk-7ZN4WI5N.mjs +0 -4
- package/dist/chunk-CCPBNE2F.mjs +0 -2
- package/dist/chunk-DV6GWBUJ.js +0 -2
- package/dist/chunk-EQAORQC3.mjs +0 -1
- package/dist/chunk-FYKRDDKG.js +0 -1
- package/dist/chunk-GUQFNJHE.mjs +0 -1
- package/dist/chunk-ICE6NC3S.mjs +0 -1
- package/dist/chunk-IFUED5ZS.mjs +0 -1
- package/dist/chunk-KGTEBLB6.js +0 -1
- package/dist/chunk-KRN6YSR2.mjs +0 -1
- package/dist/chunk-L72YAV5N.js +0 -3
- package/dist/chunk-LTHT4A4S.js +0 -1
- package/dist/chunk-MERJFGEP.mjs +0 -59
- package/dist/chunk-MP4QSEO2.mjs +0 -1
- package/dist/chunk-PVAVS3IU.js +0 -1
- package/dist/chunk-QYF7BRG3.js +0 -2
- package/dist/chunk-RKDVY7I3.mjs +0 -1
- package/dist/chunk-ROG4MNOR.js +0 -4
- package/dist/chunk-SORYYVJ7.js +0 -1
- package/dist/chunk-SZIOF5SG.js +0 -59
- package/dist/chunk-VMRUBLPI.js +0 -1
- package/dist/chunk-WKUHYMDO.mjs +0 -1
- package/dist/chunk-WLDI6N3B.mjs +0 -3
- package/dist/chunk-WLHNIXWC.mjs +0 -2
- package/dist/chunk-YMZ3F2FZ.mjs +0 -1
- package/dist/chunk-ZBFNOJGY.js +0 -1
- package/dist/documentSerializer-Bghq9rFI.d.mts +0 -36
- package/dist/documentSerializer-C4lFC60P.d.ts +0 -36
package/dist/agent/index.d.mts
CHANGED
|
@@ -9,17 +9,18 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { A as AgentContextOptions, S as ContextSelectionOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, h as buildSelectionContextFromContext, i as createAgent, j as createAgentFromDocument, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary, o as getSelectionFormattingSummary } from '../selectionContext-CoZat7QZ.mjs';
|
|
11
11
|
import { T as TextFormatting } from '../formatting-BH4hcZiq.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import { D as DocumentBody, P as Paragraph, H as Hyperlink, m as Run, T as Table, u as SdtProperties } from '../content-3xF4WDE8.mjs';
|
|
13
13
|
import { Position } from '../types/agentApi.mjs';
|
|
14
14
|
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, SelectionContext as AgentSelectionContext, ApplyStyleCommand, ApplyVariablesCommand, DEFAULT_AI_ACTIONS, DeleteTextCommand, FormatParagraphCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertParagraphBreakCommand, InsertTableCommand, InsertTextCommand, MergeParagraphsCommand, ParagraphContext, ParagraphOutline, Range, RemoveHyperlinkCommand, ReplaceTextCommand, SectionInfo, SetVariableCommand, SplitParagraphCommand, StyleInfo, SuggestedAction, comparePositions, createCollapsedRange, createCommand, createRange, getActionDescription, getActionLabel, isPositionInRange } from '../types/agentApi.mjs';
|
|
15
|
-
import { a as ContentControlFilter } from '../contentControlValues-
|
|
16
|
-
export { C as ContentControlBoundError, b as ContentControlInfo, c as ContentControlLockedError, d as ContentControlNotFoundError, e as ContentControlTypeError, f as ContentControlValue, g as ContentControlValueError, h as findContentControl, i as findContentControls, j as formatSdtDate, k as getContentControlText, r as removeContentControl, s as setContentControlContent, l as setContentControlValue } from '../contentControlValues-
|
|
15
|
+
import { a as ContentControlFilter } from '../contentControlValues-DjWvoJQ-.mjs';
|
|
16
|
+
export { C as ContentControlBoundError, b as ContentControlInfo, c as ContentControlLockedError, d as ContentControlNotFoundError, e as ContentControlTypeError, f as ContentControlValue, g as ContentControlValueError, h as findContentControl, i as findContentControls, j as formatSdtDate, k as getContentControlText, r as removeContentControl, s as setContentControlContent, l as setContentControlValue } from '../contentControlValues-DjWvoJQ-.mjs';
|
|
17
17
|
import { Document } from '../types/document.mjs';
|
|
18
18
|
import '../selectiveSave-jinP_4xa.mjs';
|
|
19
19
|
import '../docxInput-DTbCa48g.mjs';
|
|
20
20
|
import '../colors-C3vA7HUU.mjs';
|
|
21
21
|
import '../docx/wrapTypes.mjs';
|
|
22
|
-
import '../
|
|
22
|
+
import '../watermark-DAcnAs_J.mjs';
|
|
23
|
+
import '../styles-BOJ93SAm.mjs';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Shared Text Utilities for Agent Module
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -9,17 +9,18 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { A as AgentContextOptions, S as ContextSelectionOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, h as buildSelectionContextFromContext, i as createAgent, j as createAgentFromDocument, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary, o as getSelectionFormattingSummary } from '../selectionContext-BPAqgNgk.js';
|
|
11
11
|
import { T as TextFormatting } from '../formatting-_OXU8gLB.js';
|
|
12
|
-
import {
|
|
12
|
+
import { D as DocumentBody, P as Paragraph, H as Hyperlink, m as Run, T as Table, u as SdtProperties } from '../content-C8fc_tL6.js';
|
|
13
13
|
import { Position } from '../types/agentApi.js';
|
|
14
14
|
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, SelectionContext as AgentSelectionContext, ApplyStyleCommand, ApplyVariablesCommand, DEFAULT_AI_ACTIONS, DeleteTextCommand, FormatParagraphCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertParagraphBreakCommand, InsertTableCommand, InsertTextCommand, MergeParagraphsCommand, ParagraphContext, ParagraphOutline, Range, RemoveHyperlinkCommand, ReplaceTextCommand, SectionInfo, SetVariableCommand, SplitParagraphCommand, StyleInfo, SuggestedAction, comparePositions, createCollapsedRange, createCommand, createRange, getActionDescription, getActionLabel, isPositionInRange } from '../types/agentApi.js';
|
|
15
|
-
import { a as ContentControlFilter } from '../contentControlValues-
|
|
16
|
-
export { C as ContentControlBoundError, b as ContentControlInfo, c as ContentControlLockedError, d as ContentControlNotFoundError, e as ContentControlTypeError, f as ContentControlValue, g as ContentControlValueError, h as findContentControl, i as findContentControls, j as formatSdtDate, k as getContentControlText, r as removeContentControl, s as setContentControlContent, l as setContentControlValue } from '../contentControlValues-
|
|
15
|
+
import { a as ContentControlFilter } from '../contentControlValues-DGDKD589.js';
|
|
16
|
+
export { C as ContentControlBoundError, b as ContentControlInfo, c as ContentControlLockedError, d as ContentControlNotFoundError, e as ContentControlTypeError, f as ContentControlValue, g as ContentControlValueError, h as findContentControl, i as findContentControls, j as formatSdtDate, k as getContentControlText, r as removeContentControl, s as setContentControlContent, l as setContentControlValue } from '../contentControlValues-DGDKD589.js';
|
|
17
17
|
import { Document } from '../types/document.js';
|
|
18
18
|
import '../selectiveSave-CWaPEv0B.js';
|
|
19
19
|
import '../docxInput-DTbCa48g.js';
|
|
20
20
|
import '../colors-C3vA7HUU.js';
|
|
21
21
|
import '../docx/wrapTypes.js';
|
|
22
|
-
import '../
|
|
22
|
+
import '../watermark-DAcnAs_J.js';
|
|
23
|
+
import '../styles-BWqX2AS-.js';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Shared Text Utilities for Agent Module
|
package/dist/agent/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),
|
|
1
|
+
'use strict';var chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),chunk2SGJZYQF_js=require('../chunk-2SGJZYQF.js');require('../chunk-CZSAC65M.js'),require('../chunk-U4UCHBZ7.js');var chunkTE2AF7FM_js=require('../chunk-TE2AF7FM.js');require('../chunk-BH3ACQ3M.js'),require('../chunk-NAFMAKLK.js'),require('../chunk-4BFNWPKW.js'),require('../chunk-OTHV7YV2.js'),require('../chunk-LERLET2D.js'),require('../chunk-FIGLFSNR.js'),require('../chunk-MNOHUTKE.js');var chunkFO6IX2DB_js=require('../chunk-FO6IX2DB.js');require('../chunk-SCK6ZM5V.js'),require('../chunk-Z3LGMBJC.js'),require('../chunk-3R7QHNI5.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-GSKMHXHG.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkXXU7YQVV_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkXXU7YQVV_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkXXU7YQVV_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkXXU7YQVV_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkXXU7YQVV_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunk2SGJZYQF_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunk2SGJZYQF_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunk2SGJZYQF_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunk2SGJZYQF_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunk2SGJZYQF_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunk2SGJZYQF_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunk2SGJZYQF_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunk2SGJZYQF_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunk2SGJZYQF_js.i}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});Object.defineProperty(exports,"ContentControlBoundError",{enumerable:true,get:function(){return chunkFO6IX2DB_js.C}});Object.defineProperty(exports,"ContentControlLockedError",{enumerable:true,get:function(){return chunkFO6IX2DB_js.A}});Object.defineProperty(exports,"ContentControlNotFoundError",{enumerable:true,get:function(){return chunkFO6IX2DB_js.z}});Object.defineProperty(exports,"ContentControlTypeError",{enumerable:true,get:function(){return chunkFO6IX2DB_js.B}});Object.defineProperty(exports,"ContentControlValueError",{enumerable:true,get:function(){return chunkFO6IX2DB_js.K}});Object.defineProperty(exports,"RepeatingSectionError",{enumerable:true,get:function(){return chunkFO6IX2DB_js.R}});Object.defineProperty(exports,"addRepeatingSectionItem",{enumerable:true,get:function(){return chunkFO6IX2DB_js.T}});Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkFO6IX2DB_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkFO6IX2DB_js.f}});Object.defineProperty(exports,"findContentControl",{enumerable:true,get:function(){return chunkFO6IX2DB_js.y}});Object.defineProperty(exports,"findContentControls",{enumerable:true,get:function(){return chunkFO6IX2DB_js.x}});Object.defineProperty(exports,"formatSdtDate",{enumerable:true,get:function(){return chunkFO6IX2DB_js.L}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkFO6IX2DB_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkFO6IX2DB_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkFO6IX2DB_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkFO6IX2DB_js.h}});Object.defineProperty(exports,"getContentControlText",{enumerable:true,get:function(){return chunkFO6IX2DB_js.w}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkFO6IX2DB_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkFO6IX2DB_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkFO6IX2DB_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkFO6IX2DB_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkFO6IX2DB_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkFO6IX2DB_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkFO6IX2DB_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkFO6IX2DB_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkFO6IX2DB_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkFO6IX2DB_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkFO6IX2DB_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkFO6IX2DB_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkFO6IX2DB_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkFO6IX2DB_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkFO6IX2DB_js.m}});Object.defineProperty(exports,"isRepeatingSection",{enumerable:true,get:function(){return chunkFO6IX2DB_js.P}});Object.defineProperty(exports,"isRepeatingSectionItem",{enumerable:true,get:function(){return chunkFO6IX2DB_js.Q}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkFO6IX2DB_js.p}});Object.defineProperty(exports,"removeContentControl",{enumerable:true,get:function(){return chunkFO6IX2DB_js.J}});Object.defineProperty(exports,"removeRepeatingSectionItem",{enumerable:true,get:function(){return chunkFO6IX2DB_js.U}});Object.defineProperty(exports,"setContentControlContent",{enumerable:true,get:function(){return chunkFO6IX2DB_js.I}});Object.defineProperty(exports,"setContentControlValue",{enumerable:true,get:function(){return chunkFO6IX2DB_js.N}});
|
package/dist/agent/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'../chunk-MVZOTKNL.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,e as buildSelectionContextFromContext,b as createAgent,c as createAgentFromDocument,d as getAgentContext,f as getDocumentSummary,i as getSelectionFormattingSummary}from'../chunk-
|
|
1
|
+
export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'../chunk-MVZOTKNL.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,e as buildSelectionContextFromContext,b as createAgent,c as createAgentFromDocument,d as getAgentContext,f as getDocumentSummary,i as getSelectionFormattingSummary}from'../chunk-YNUPP7UG.mjs';import'../chunk-FYRJTDC4.mjs';import'../chunk-ARHPXIBJ.mjs';export{a as executeCommand,b as executeCommands}from'../chunk-CUY2THAO.mjs';import'../chunk-CHN26LLL.mjs';import'../chunk-WWNOXNEX.mjs';import'../chunk-3NRMSZX2.mjs';import'../chunk-UE2ZKRYB.mjs';import'../chunk-3G44SFHX.mjs';import'../chunk-MOCGHQ4A.mjs';import'../chunk-7LRR7RKE.mjs';export{C as ContentControlBoundError,A as ContentControlLockedError,z as ContentControlNotFoundError,B as ContentControlTypeError,K as ContentControlValueError,R as RepeatingSectionError,T as addRepeatingSectionItem,g as countCharacters,f as countWords,y as findContentControl,x as findContentControls,L as formatSdtDate,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,w as getContentControlText,l as getFormattingAtPosition,n as getHyperlinkAtPosition,c as getHyperlinkText,u as getParagraphAtIndex,a as getParagraphText,t as getParagraphs,b as getRunText,d as getTableText,k as getTextAfter,j as getTextBefore,r as hasHyperlinks,q as hasImages,s as hasTables,o as isHeadingStyle,m as isPositionInHyperlink,P as isRepeatingSection,Q as isRepeatingSectionItem,p as parseHeadingLevel,J as removeContentControl,U as removeRepeatingSectionItem,I as setContentControlContent,N as setContentControlValue}from'../chunk-KOEWROYV.mjs';import'../chunk-7CZEZ3UL.mjs';import'../chunk-W77JXDEV.mjs';import'../chunk-3ANZ3252.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-DI6CRWSW.mjs';import'../chunk-QYUPLKLP.mjs';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Page } from './layout-engine/types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Page geometry needed to translate OOXML `relativeFrom` anchors into painter
|
|
5
|
+
* coordinates. All values are in CSS pixels.
|
|
6
|
+
*/
|
|
7
|
+
interface PageGeometry {
|
|
8
|
+
pageWidth: number;
|
|
9
|
+
pageHeight: number;
|
|
10
|
+
marginLeft: number;
|
|
11
|
+
marginTop: number;
|
|
12
|
+
contentWidth: number;
|
|
13
|
+
contentHeight: number;
|
|
14
|
+
}
|
|
15
|
+
interface AnchoredObjectPositionInput {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
position?: {
|
|
19
|
+
horizontal?: {
|
|
20
|
+
relativeTo?: string;
|
|
21
|
+
posOffset?: number;
|
|
22
|
+
align?: string;
|
|
23
|
+
};
|
|
24
|
+
vertical?: {
|
|
25
|
+
relativeTo?: string;
|
|
26
|
+
posOffset?: number;
|
|
27
|
+
align?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
cssFloat?: 'left' | 'right' | 'none';
|
|
31
|
+
}
|
|
32
|
+
interface AnchoredObjectPosition {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
side: 'left' | 'right';
|
|
36
|
+
}
|
|
37
|
+
declare function pageGeometryFromPage(page: Pick<Page, 'size' | 'margins'>): PageGeometry;
|
|
38
|
+
declare function resolveAnchoredObjectPosition(object: AnchoredObjectPositionInput, fragmentY: number, contentWidth: number, geometry?: PageGeometry): AnchoredObjectPosition;
|
|
39
|
+
/**
|
|
40
|
+
* Content-area top Y (px) of an anchored object, resolving its OOXML vertical
|
|
41
|
+
* anchor (`page` / `margin` / `topMargin` / `bottomMargin` / `paragraph`, with
|
|
42
|
+
* `align` or `posOffset`). Exposed so the measure pipeline can reserve a
|
|
43
|
+
* `topAndBottom` band at the exact Y the painter will place the object —
|
|
44
|
+
* the two paths must not diverge (dual-renderer rule).
|
|
45
|
+
*/
|
|
46
|
+
declare function resolveAnchoredObjectVerticalTop(object: AnchoredObjectPositionInput, fragmentY: number, geometry?: PageGeometry): number;
|
|
47
|
+
|
|
48
|
+
export { type PageGeometry as P, resolveAnchoredObjectVerticalTop as a, pageGeometryFromPage as p, resolveAnchoredObjectPosition as r };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Page } from './layout-engine/types.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Page geometry needed to translate OOXML `relativeFrom` anchors into painter
|
|
5
|
+
* coordinates. All values are in CSS pixels.
|
|
6
|
+
*/
|
|
7
|
+
interface PageGeometry {
|
|
8
|
+
pageWidth: number;
|
|
9
|
+
pageHeight: number;
|
|
10
|
+
marginLeft: number;
|
|
11
|
+
marginTop: number;
|
|
12
|
+
contentWidth: number;
|
|
13
|
+
contentHeight: number;
|
|
14
|
+
}
|
|
15
|
+
interface AnchoredObjectPositionInput {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
position?: {
|
|
19
|
+
horizontal?: {
|
|
20
|
+
relativeTo?: string;
|
|
21
|
+
posOffset?: number;
|
|
22
|
+
align?: string;
|
|
23
|
+
};
|
|
24
|
+
vertical?: {
|
|
25
|
+
relativeTo?: string;
|
|
26
|
+
posOffset?: number;
|
|
27
|
+
align?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
cssFloat?: 'left' | 'right' | 'none';
|
|
31
|
+
}
|
|
32
|
+
interface AnchoredObjectPosition {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
side: 'left' | 'right';
|
|
36
|
+
}
|
|
37
|
+
declare function pageGeometryFromPage(page: Pick<Page, 'size' | 'margins'>): PageGeometry;
|
|
38
|
+
declare function resolveAnchoredObjectPosition(object: AnchoredObjectPositionInput, fragmentY: number, contentWidth: number, geometry?: PageGeometry): AnchoredObjectPosition;
|
|
39
|
+
/**
|
|
40
|
+
* Content-area top Y (px) of an anchored object, resolving its OOXML vertical
|
|
41
|
+
* anchor (`page` / `margin` / `topMargin` / `bottomMargin` / `paragraph`, with
|
|
42
|
+
* `align` or `posOffset`). Exposed so the measure pipeline can reserve a
|
|
43
|
+
* `topAndBottom` band at the exact Y the painter will place the object —
|
|
44
|
+
* the two paths must not diverge (dual-renderer rule).
|
|
45
|
+
*/
|
|
46
|
+
declare function resolveAnchoredObjectVerticalTop(object: AnchoredObjectPositionInput, fragmentY: number, geometry?: PageGeometry): number;
|
|
47
|
+
|
|
48
|
+
export { type PageGeometry as P, resolveAnchoredObjectVerticalTop as a, pageGeometryFromPage as p, resolveAnchoredObjectPosition as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCZSAC65M_js=require('./chunk-CZSAC65M.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkTE2AF7FM_js=require('./chunk-TE2AF7FM.js'),chunkBH3ACQ3M_js=require('./chunk-BH3ACQ3M.js'),chunkOTHV7YV2_js=require('./chunk-OTHV7YV2.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var P=class o{constructor(t){chunkDC7S76ZX_js.a(this,"_document");chunkDC7S76ZX_js.a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await chunkOTHV7YV2_js.f(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return chunkU4UCHBZ7_js.a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-HH2E3HBO.js'),a=r(n,e),i=await chunkOTHV7YV2_js.f(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await chunkCZSAC65M_js.c(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await chunkBH3ACQ3M_js.i(this._document);return this._document.originalBuffer=e,e}return chunkBH3ACQ3M_js.t(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(chunkTE2AF7FM_js.b(this._document,t))}_executeCommand(t){let e=new o(chunkTE2AF7FM_js.a(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
|
|
2
2
|
`)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=chunkU4UCHBZ7_js.a(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
|
|
3
3
|
`);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
|
|
4
4
|
Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {xml2js,js2xml}from'xml-js';var d=/&(?!(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+);)/g;function p(e){return e.replace(d,"&")}function g(e){let t=p(e);try{return xml2js(t,{compact:!1,ignoreComment:!0,ignoreInstruction:!0,ignoreDoctype:!0,alwaysArray:!1,trim:!1,captureSpacesBetweenElements:!0,attributesKey:"attributes",textKey:"text"})}catch(n){if(!(n instanceof Error))throw n;let l=n.message.match(/Column:\s*(\d+)/);if(l){let r=parseInt(l[1],10),i=Math.max(0,r-30),s=JSON.stringify(t.slice(i,r+30)),u=new Error(`${n.message}
|
|
2
|
+
Near: ${s}`);throw u.stack=n.stack,u}throw n}}function w(e){return js2xml({elements:[e]},{compact:false,spaces:0})}function X(e){try{let t=g(e);return t.elements&&t.elements.length>0?t.elements.find(n=>n.type==="element")??null:t}catch(t){return console.warn("Failed to parse XML:",t),null}}function o(e){let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function m(e,t,n){if(!e.name)return false;let l=`${t}:${n}`;return e.name===l||o(e.name)===n}function y(e,t,n){if(!e||!e.elements)return null;let l=`${t}:${n}`;for(let r of e.elements)if(r.type==="element"&&(r.name===l||o(r.name||"")===n))return r;return null}function b(e,t,n){if(!e||!e.elements)return [];let l=`${t}:${n}`,r=[];for(let i of e.elements)i.type==="element"&&(i.name===l||o(i.name||"")===n)&&r.push(i);return r}function A(e,t){return !e||!e.elements?[]:e.elements.filter(n=>n.type==="element"&&o(n.name||"")===t)}function C(e,t){if(!e||!e.elements)return null;for(let n of e.elements)if(n.type==="element"&&n.name===t)return n;return null}function N(e){return !e||!e.elements?[]:e.elements.filter(t=>t.type==="element")}function f(e,t,n){if(!e||!e.attributes)return null;let l=e.attributes;if(t){let r=`${t}:${n}`;if(r in l)return l[r]}return n in l?l[n]:null}function h(e){if(!e)return "";if("text"in e&&typeof e.text=="string")return e.text;if(!e.elements)return "";let t="";for(let n of e.elements)n.type==="text"&&"text"in n?t+=n.text??"":n.type==="element"&&(t+=h(n));return t}function v(e,t,n,l=1){let r=f(e,t,n);if(r===null)return;let i=parseInt(r,10);if(!isNaN(i))return i*l}function S(e,t="w"){if(!e)return false;let n=f(e,t,"val");return n===null?true:!(n==="0"||n==="false"||n==="off")}function x(e,t,n){if(!e)return null;if(m(e,t,n))return e;if(e.elements)for(let l of e.elements){if(l.type!=="element")continue;let r=x(l,t,n);if(r)return r}return null}function $(e,t,n){let l=[];function r(i){if(i&&(m(i,t,n)&&l.push(i),i.elements))for(let s of i.elements)s.type==="element"&&r(s);}return r(e),l}export{g as a,w as b,X as c,o as d,y as e,b as f,A as g,C as h,N as i,f as j,h as k,v as l,S as m,x as n,$ as o};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {h,j as j$2,k,g,z}from'./chunk-7CZEZ3UL.mjs';import {c as c$1}from'./chunk-W77JXDEV.mjs';import {c,j as j$1,e,l,i,a,f,m,d,b,o,n,k as k$1}from'./chunk-3ANZ3252.mjs';var He={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},ge={name:"Office Theme",colorScheme:He,fontScheme:J},gt=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function ht(e){if(!e)return null;switch(d(e.name||"")){case "srgbClr":return j$1(e,"a","val")??j$1(e,null,"val")??null;case "sysClr":{let n=j$1(e,"a","lastClr")??j$1(e,null,"lastClr");if(n)return n;switch(j$1(e,"a","val")??j$1(e,null,"val")){case "windowText":case "menuText":case "captionText":case "btnText":return "000000";case "window":case "menu":case "btnFace":case "btnHighlight":return "FFFFFF";case "highlight":return "0078D7";case "highlightText":return "FFFFFF";case "grayText":return "808080";default:return null}}case "schemeClr":{j$1(e,"a","val")??j$1(e,null,"val");return null}default:return null}}function wt(e$1){let t={...He};if(!e$1)return t;for(let n of gt){let o=e(e$1,"a",n);if(o){let r=i(o);if(r.length>0){let a=ht(r[0]);a&&(t[n]=a);}}}return t}function Ne(e$1){let t={latin:"",ea:"",cs:"",fonts:{}};if(!e$1)return t;let n=e(e$1,"a","latin");n&&(t.latin=j$1(n,"a","typeface")??j$1(n,null,"typeface")??"");let o=e(e$1,"a","ea");o&&(t.ea=j$1(o,"a","typeface")??j$1(o,null,"typeface")??"");let r=e(e$1,"a","cs");r&&(t.cs=j$1(r,"a","typeface")??j$1(r,null,"typeface")??"");let a=f(e$1,"a","font");for(let u of a){let l=j$1(u,"a","script")??j$1(u,null,"script"),f=j$1(u,"a","typeface")??j$1(u,null,"typeface");l&&f&&(t.fonts=t.fonts||{},t.fonts[l]=f);}return t}function yt(e$1){let t={...J};if(!e$1)return t;let n=e(e$1,"a","majorFont");n&&(t.majorFont=Ne(n));let o=e(e$1,"a","minorFont");return o&&(t.minorFont=Ne(o)),t}function In(e$1){if(!e$1)return {...ge};try{let t=c(e$1);if(!t)return {...ge};let n=j$1(t,"a","name")??j$1(t,null,"name")??"Office Theme",o=e(t,"a","themeElements"),r=e(o,"a","clrScheme"),a=wt(r),u=e(o,"a","fontScheme"),l=yt(u);return {name:n,colorScheme:a,fontScheme:l}}catch(t){return console.warn("Failed to parse theme:",t),{...ge}}}function bt(e,t="latin"){if(!e?.fontScheme?.majorFont)return J.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function Ae(e,t="latin"){if(!e?.fontScheme?.minorFont)return J.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function $(e,t){if(!t)return "Calibri";let n=t.toLowerCase().includes("major"),o=t.toLowerCase().includes("minor"),r="latin",a=t.toLowerCase();return a.includes("eastasia")?r="ea":(a.includes("bidi")||a.includes("cs"))&&(r="cs"),n?bt(e,r):o?Ae(e,r):Ae(e,"latin")}function Ie(e){if(!e)return;let t=l(e,"w","w")??0,n=j$1(e,"w","type")??"dxa",o="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(o=n),{value:t,type:o}}function O(e){return Ie(e)}function V(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,o=(j$1(e,"w","author")??"").trim(),r=(j$1(e,"w","date")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:o.length>0?o:"Unknown",date:r.length>0?r:void 0}}function ee(e){return V(e)}function W(e){if(!e)return;let o={style:j$1(e,"w","val")??"none"},r=l(e,"w","sz");r!==void 0&&(o.size=r);let a=l(e,"w","space");a!==void 0&&(o.space=a);let u=j$1(e,"w","color"),l$1=j$1(e,"w","themeColor"),f=j$1(e,"w","themeTint"),c=j$1(e,"w","themeShade");(u||l$1||f||c)&&(o.color={rgb:u??void 0,themeColor:l$1,themeTint:f??void 0,themeShade:c??void 0});let p=j$1(e,"w","shadow");(p==="1"||p==="true")&&(o.shadow=true);let d=j$1(e,"w","frame");return (d==="1"||d==="true")&&(o.frame=true),o}function te(e$1){if(!e$1)return;let t={},n=W(e(e$1,"w","top"));n&&(t.top=n);let o=W(e(e$1,"w","bottom"));o&&(t.bottom=o);let r=W(e(e$1,"w","left")??e(e$1,"w","start"));r&&(t.left=r);let a=W(e(e$1,"w","right")??e(e$1,"w","end"));a&&(t.right=a);let u=W(e(e$1,"w","insideH"));u&&(t.insideH=u);let l=W(e(e$1,"w","insideV"));if(l&&(t.insideV=l),Object.keys(t).length!==0)return t}function ne(e$1){if(!e$1)return;let t={},n=O(e(e$1,"w","top"));n&&(t.top=n);let o=O(e(e$1,"w","bottom"));o&&(t.bottom=o);let r=O(e(e$1,"w","left")??e(e$1,"w","start"));r&&(t.left=r);let a=O(e(e$1,"w","right")??e(e$1,"w","end"));if(a&&(t.right=a),Object.keys(t).length!==0)return t}function oe(e){if(!e)return;let t={},n=j$1(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let o=j$1(e,"w","themeFill");if(o){t.fill={themeColor:o};let u=j$1(e,"w","themeFillTint");u&&t.fill&&(t.fill.themeTint=u);let l=j$1(e,"w","themeFillShade");l&&t.fill&&(t.fill.themeShade=l);}let r=j$1(e,"w","color");r&&r!=="auto"&&(t.color={rgb:r});let a=j$1(e,"w","val");if(a&&(t.pattern=a),Object.keys(t).length!==0)return t}function he(e){if(!e)return;let t={},n=j$1(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=j$1(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=j$1(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let a=j$1(e,"w","lastColumn");(a==="1"||a==="true")&&(t.lastColumn=true);let u=j$1(e,"w","noHBand");(u==="1"||u==="true")&&(t.noHBand=true);let l=j$1(e,"w","noVBand");(l==="1"||l==="true")&&(t.noVBand=true);let f=j$1(e,"w","val");if(f){let c=parseInt(f,16);isNaN(c)||(c&32&&(t.firstRow=true),c&64&&(t.lastRow=true),c&128&&(t.firstColumn=true),c&256&&(t.lastColumn=true),c&512&&(t.noHBand=true),c&1024&&(t.noVBand=true));}if(Object.keys(t).length!==0)return t}function we(e){if(!e)return;let t={},n=j$1(e,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(t.horzAnchor=n);let o=j$1(e,"w","vertAnchor");(o==="margin"||o==="page"||o==="text")&&(t.vertAnchor=o);let r=l(e,"w","tblpX");r!==void 0&&(t.tblpX=r);let a=j$1(e,"w","tblpXSpec");a&&(t.tblpXSpec=a);let u=l(e,"w","tblpY");u!==void 0&&(t.tblpY=u);let l$1=j$1(e,"w","tblpYSpec");l$1&&(t.tblpYSpec=l$1);let f=l(e,"w","topFromText");f!==void 0&&(t.topFromText=f);let c=l(e,"w","bottomFromText");c!==void 0&&(t.bottomFromText=c);let p=l(e,"w","leftFromText");p!==void 0&&(t.leftFromText=p);let d=l(e,"w","rightFromText");if(d!==void 0&&(t.rightFromText=d),Object.keys(t).length!==0)return t}function Tt(e){return e.columnWidths&&e.columnWidths.length>0?e.columnWidths.length:e.rows.length===0?0:e.rows[0].cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function Ct(e){return e.rows.length}function Ft(e){return e.formatting?.vMerge==="continue"}function xt(e){return e.formatting?.vMerge==="restart"}function kt(e){return e.rows.length===0?false:e.rows[0].formatting?.header===true}var St={richText:"richText",text:"plainText",date:"date",dropDownList:"dropDownList",comboBox:"comboBox",picture:"picture",docPartObj:"buildingBlockGallery",docPartList:"buildingBlockGallery",group:"group",equation:"equation",citation:"citation",bibliography:"bibliography",checkbox:"checkbox"};function Mt(e){if(!e||!e.elements)return "richText";for(let t of e.elements){if(t.type!=="element"||!t.name)continue;let n=d(t.name),o=St[n];if(o)return o}return "richText"}function Rt(e){let t=[];for(let n of e.elements??[])n.type==="element"&&d(n.name||"")==="listItem"&&t.push({displayText:j$1(n,"w","displayText")||"",value:j$1(n,"w","value")||""});return t}function re(e$1,t){let n={sdtType:Mt(e$1)};if(e$1){n.rawPropertiesXml=b(e$1);for(let o of e$1.elements??[]){if(o.type!=="element"||!o.name)continue;switch(d(o.name)){case "id":{let a=j$1(o,"w","val");if(a!=null){let u=parseInt(a,10);Number.isNaN(u)||(n.id=u);}break}case "alias":n.alias=j$1(o,"w","val")??void 0;break;case "tag":n.tag=j$1(o,"w","val")??void 0;break;case "lock":n.lock=j$1(o,"w","val")??"unlocked";break;case "placeholder":{let a=e(o,"w","docPart");a&&(n.placeholder=j$1(a,"w","val")??void 0);break}case "showingPlcHdr":{let a=j$1(o,"w","val");n.showingPlaceholder=a==null||!/^(0|false|off)$/i.test(a);break}case "date":{let a=e(o,"w","dateFormat");a&&(n.dateFormat=j$1(a,"w","val")??void 0);break}case "dropDownList":case "comboBox":n.listItems=Rt(o);break;case "checkbox":{let a=e(o,"w14","checked")??e(o,"w","checked");n.checked=a?j$1(a,"w14","val")==="1"||j$1(a,"w","val")==="1":false;break}case "dataBinding":{let a={},u=j$1(o,"w","xpath"),l=j$1(o,"w","storeItemID"),f=j$1(o,"w","prefixMappings");u!=null&&(a.xpath=u),l!=null&&(a.storeItemID=l),f!=null&&(a.prefixMappings=f),n.dataBinding=a;break}}}}return t&&(n.rawEndPropertiesXml=b(t)),n}var Le={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};function Et(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0);return Le[t]?Le[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function Pt(e){let t=e.listRendering;t&&t.isBullet&&(t.marker=Et(t.marker||""));}function Bt(e,t,n$1,o,r,a,u){if(e.content.length===0)return;let l=i(t),f=0;function c(p){if(!h(p))return;let d=j$2(p);if(!d)return;let w=n(p,"wps","wsp");if(w){let b=k(w);b&&(d.content=g(b,Y,null,n$1,o,r,a??void 0,u??void 0));}let C={type:"shape",shapeType:"rect",size:d.size,position:d.position,wrap:d.wrap,fill:d.fill,outline:d.outline,textBody:{content:d.content,margins:d.margins}};d.id&&(C.id=d.id);let y={type:"shape",shape:C},h$1=f;if(h$1>=e.content.length){h$1=-1;for(let b=e.content.length-1;b>=0;b--)if(e.content[b].type==="run"){h$1=b;break}}if(h$1>=0){let b=e.content[h$1];b.type==="run"&&b.content.push(y);}}for(let p of l){if(d(p.name??"")!=="r")continue;let d$1=i(p);for(let w of d$1){let C=d(w.name??"");if(C==="drawing")c(w);else if(C==="AlternateContent"){let y=i(w),b=y.find(P=>d(P.name??"")==="Choice")??y.find(P=>d(P.name??"")==="Fallback");if(b)for(let P of i(b))d(P.name??"")==="drawing"&&c(P);}}f++;}}function q(e,t,n,o,r,a,u){let l=[],f=i(e);for(let c of f){let p=c.name??"";if(p==="w:p"||p.endsWith(":p")){let d=Y(c,t,n,o,r,a,u);Bt(d,c,t,n,o,r,a),Pt(d),l.push(d);}else if(p==="w:tbl"||p.endsWith(":tbl")){let d=ye(c,t,n,o,r,a,u);l.push(d);}else (p==="w:sdt"||p.endsWith(":sdt"))&&l.push(vt(c,t,n,o,r,a,u));}return l}function vt(e$1,t,n,o,r,a,u){let l=e(e$1,"w","sdtPr"),f=e(e$1,"w","sdtEndPr"),c=e(e$1,"w","sdtContent"),p=re(l,f),d=c?q(c,t,n,o,r,a,u):[];return {type:"blockSdt",properties:p,content:d}}function Xe(e){let t={};if(!e)return t;for(let n of e.split(";")){let o=n.indexOf(":");if(o<0)continue;let r=n.slice(0,o).trim().toLowerCase(),a=n.slice(o+1).trim();r&&(t[r]=a);}return t}function Nt(e){if(!e)return "#C0C0C0";let t=e.trim();return t.startsWith("#")?t:/^[0-9a-fA-F]{6}$/.test(t)?`#${t}`:t}function Oe(e){if(!e)return;let t=e.match(/^(-?[0-9.]+)(pt|px|in|cm|mm)?$/);if(!t)return;let n=parseFloat(t[1]);if(!isNaN(n))switch(t[2]){case "in":return n*96;case "cm":return n/2.54*96;case "mm":return n/25.4*96;case "px":return n;default:return n*96/72}}var De=914400/96;function At(e,t,n){if(!e||!t)return {};let o=t.get(e);if(!o?.target)return {};let r=o.target,a=r.split("/").pop()??r,u=[r,r.replace(/^\/+/,""),`word/${r.replace(/^\/+/,"")}`,`word/media/${a}`,`media/${a}`];if(n)for(let l of u){let f=l.toLowerCase();for(let[c,p]of n.entries())if(c.toLowerCase()===f)return {dataUrl:p.dataUrl??p.base64,mediaPath:p.path,contentType:p.mimeType}}return {}}function Ht(e,t){return !!(t.includes("watermark")||(j$1(e,null,"type")??"").includes("_t136"))}function We(e,t=null,n=null){if(!e)return;let o$1=o(e,"v","shape");for(let r of o$1){let a=(j$1(r,null,"id")??"").toLowerCase(),u=i(r),l=u.find(w=>w.name==="v:textpath"||w.name?.endsWith(":textpath")),f=u.find(w=>w.name==="v:imagedata"||w.name?.endsWith(":imagedata"));if(!Ht(r,a)&&!l&&!f)continue;let c=Xe(j$1(r,null,"style")),p=parseFloat(c.rotation??"0")||0,d=Math.abs(p)>5;if(l){let w=j$1(l,null,"string")??"",h=(Xe(j$1(l,null,"style"))["font-family"]??"Calibri").replace(/["']/g,"").replace(/^"|"$/g,"").trim()||"Calibri",b=u.find(x=>x.name==="v:fill"||x.name?.endsWith(":fill")),P=b?j$1(b,null,"opacity"):null,S=P!=null&&parseFloat(P)<1;return {kind:"text",text:w,font:h,color:Nt(j$1(r,null,"fillcolor")),semitransparent:S,layout:d?"diagonal":"horizontal",fontSize:void 0}}if(f){let w=j$1(f,"r","id")??j$1(f,"r","embed")??j$1(f,null,"id")??"",{dataUrl:C,mediaPath:y,contentType:h}=At(w,t,n),b=j$1(f,null,"gain"),P=j$1(f,null,"blacklevel"),S=b!=null||P!=null,x=Oe(c.width),m=Oe(c.height);return {kind:"picture",relId:w||void 0,mediaPath:y,contentType:h,dataUrl:C,scale:1,washout:S,widthEmu:x!=null?Math.round(x*De):void 0,heightEmu:m!=null?Math.round(m*De):void 0}}}}function Ve(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function je(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Ve(t),rId:n}}function Ue(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Ve(t),rId:n}}function Jn(e,t="default",n=null,o=null,r=null,a$1=null,u=null){let l={type:"header",hdrFtrType:t,content:[]};if(!e)return l;let f=a(e);if(!f)return l;let c=f.elements?.find(d=>d.type==="element"&&(d.name==="w:hdr"||d.name?.endsWith(":hdr")));if(!c)return l;l.content=q(c,n,o,r,a$1,u,{inHeaderFooter:true});let p=We(c,a$1,u);return p&&(l.watermark=p),l}function eo(e,t="default",n=null,o=null,r=null,a$1=null,u=null){let l={type:"footer",hdrFtrType:t,content:[]};if(!e)return l;let f=a(e);if(!f)return l;let c=f.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return c&&(l.content=q(c,n,o,r,a$1,u,{inHeaderFooter:true})),l}function ze(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function _e(e,t,n,o,r,a){let u=q(e,t,n,o,r,a),l=false;for(let f of i(e)){let c=f.name??"";if(c==="w:bookmarkStart"||c.endsWith(":bookmarkStart")||c==="w:bookmarkEnd"||c.endsWith(":bookmarkEnd")||c==="w:customXml"||c.endsWith(":customXml")){l=true;break}}return {blocks:u,hasUnmodeled:l}}function It(e,t,n,o,r,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=ze(l$1),{blocks:c,hasUnmodeled:p}=_e(e,t,n,o,r,a);return {type:"footnote",id:u,noteType:f,content:c,...p?{verbatimXml:b(e)}:{}}}function ro(e,t=null,n=null,o=null,r=null,a$1=null){let u=new Map,l=[];if(!e)return ie(u,l);let f$1=a(e);if(!f$1)return ie(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:footnotes"||d.name?.endsWith(":footnotes")));if(!c)return ie(u,l);let p=f(c,"w","footnote");for(let d of p){let w=It(d,t,n,o,r,a$1);u.set(w.id,w),l.push(w);}return ie(u,l)}function ie(e,t){return {byId:e,footnotes:t,getFootnote(n){return e.get(n)},hasFootnote(n){return e.has(n)},getNormalFootnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Lt(e,t,n,o,r,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=ze(l$1),{blocks:c,hasUnmodeled:p}=_e(e,t,n,o,r,a);return {type:"endnote",id:u,noteType:f,content:c,...p?{verbatimXml:b(e)}:{}}}function io(e,t=null,n=null,o=null,r=null,a$1=null){let u=new Map,l=[];if(!e)return ae(u,l);let f$1=a(e);if(!f$1)return ae(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:endnotes"||d.name?.endsWith(":endnotes")));if(!c)return ae(u,l);let p=f(c,"w","endnote");for(let d of p){let w=Lt(d,t,n,o,r,a$1);u.set(w.id,w),l.push(w);}return ae(u,l)}function ae(e,t){return {byId:e,endnotes:t,getEndnote(n){return e.get(n)},hasEndnote(n){return e.has(n)},getNormalEndnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function qe(e){return e?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[e]:void 0}function Xt(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Ot(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Ge(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function $e(e$1){let t={};if(!e$1)return t;let n=e(e$1,"w","pos");if(n){let u=j$1(n,"w","val");t.position=Xt(u);}let o=e(e$1,"w","numFmt");if(o){let u=j$1(o,"w","val");t.numFmt=qe(u);}let r=e(e$1,"w","numStart");r&&(t.numStart=l(r,"w","val")??void 0);let a=e(e$1,"w","numRestart");if(a){let u=j$1(a,"w","val");t.numRestart=Ge(u);}return t}function Ye(e$1){let t={};if(!e$1)return t;let n=e(e$1,"w","pos");if(n){let u=j$1(n,"w","val");t.position=Ot(u);}let o=e(e$1,"w","numFmt");if(o){let u=j$1(o,"w","val");t.numFmt=qe(u);}let r=e(e$1,"w","numStart");r&&(t.numStart=l(r,"w","val")??void 0);let a=e(e$1,"w","numRestart");if(a){let u=j$1(a,"w","val");t.numRestart=Ge(u);}return t}function ao(e){let t=[];for(let n of e.content){if(n.type!=="paragraph")continue;let o=[];for(let r of n.content)if(r.type==="run")for(let a of r.content)a.type==="text"&&o.push(a.text);t.push(o.join(""));}return t.join(`
|
|
2
|
+
`)}function lo(e){let t=[];for(let n of e.content){if(n.type!=="paragraph")continue;let o=[];for(let r of n.content)if(r.type==="run")for(let a of r.content)a.type==="text"&&o.push(a.text);t.push(o.join(""));}return t.join(`
|
|
3
|
+
`)}function so(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function uo(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function Dt(e,t,n,o){if(!e&&!t)return;let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),Object.keys(r).length>0?r:void 0}function le(e){if(!e)return;let o={style:j$1(e,"w","val")??"none"},r=l(e,"w","sz");r!==void 0&&(o.size=r);let a=l(e,"w","space");a!==void 0&&(o.space=a);let u=j$1(e,"w","color"),l$1=j$1(e,"w","themeColor"),f=j$1(e,"w","themeTint"),c=j$1(e,"w","themeShade"),p=Dt(u,l$1,f,c);p&&(o.color=p);let d=j$1(e,"w","shadow");(d==="1"||d==="true")&&(o.shadow=true);let w=j$1(e,"w","frame");return (w==="1"||w==="true")&&(o.frame=true),o}function Wt(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function Vt(e){switch(e){case "continuous":return "continuous";case "nextPage":return "nextPage";case "oddPage":return "oddPage";case "evenPage":return "evenPage";case "nextColumn":return "nextColumn";default:return}}function jt(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function Ut(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function Ze(e$1,t){let n={};if(!e$1)return n;let o=e(e$1,"w","pgSz");if(o){let m=l(o,"w","w");m!==void 0&&(n.pageWidth=m);let F=l(o,"w","h");F!==void 0&&(n.pageHeight=F);let E=j$1(o,"w","orient"),T=Wt(E);T&&(n.orientation=T);}let r=e(e$1,"w","pgMar");if(r){let m=l(r,"w","top");m!==void 0&&(n.marginTop=m);let F=l(r,"w","bottom");F!==void 0&&(n.marginBottom=F);let E=l(r,"w","left");E!==void 0&&(n.marginLeft=E);let T=l(r,"w","right");T!==void 0&&(n.marginRight=T);let k=l(r,"w","header");k!==void 0&&(n.headerDistance=k);let B=l(r,"w","footer");B!==void 0&&(n.footerDistance=B);let v=l(r,"w","gutter");v!==void 0&&(n.gutter=v);}let a=e(e$1,"w","cols");if(a){let m=l(a,"w","num");m!==void 0&&(n.columnCount=m);let F=l(a,"w","space");F!==void 0&&(n.columnSpace=F);let E=j$1(a,"w","equalWidth");E==="1"||E==="true"?n.equalWidth=true:(E==="0"||E==="false")&&(n.equalWidth=false);let T=j$1(a,"w","sep");(T==="1"||T==="true")&&(n.separator=true);let k=f(a,"w","col");if(k.length>0){n.columns=[];for(let B of k){let v={},I=l(B,"w","w");I!==void 0&&(v.width=I);let H=l(B,"w","space");H!==void 0&&(v.space=H),n.columns.push(v);}n.columnCount===void 0&&(n.columnCount=k.length);}}let u=e(e$1,"w","type");if(u){let m=j$1(u,"w","val"),F=Vt(m);F&&(n.sectionStart=F);}let l$1=e(e$1,"w","vAlign");if(l$1){let m=j$1(l$1,"w","val"),F=jt(m);F&&(n.verticalAlign=F);}let f$1=e(e$1,"w","bidi");f$1&&(n.bidi=m(f$1));let c=f(e$1,"w","headerReference");c.length>0&&(n.headerReferences=c.map(m=>je(m)));let p=f(e$1,"w","footerReference");p.length>0&&(n.footerReferences=p.map(m=>Ue(m)));let d=e(e$1,"w","titlePg");d&&(n.titlePg=m(d));let w=e(e$1,"w","evenAndOddHeaders");w&&(n.evenAndOddHeaders=m(w));let C=e(e$1,"w","lnNumType");if(C){n.lineNumbers={};let m=l(C,"w","start");m!==void 0&&(n.lineNumbers.start=m);let F=l(C,"w","countBy");F!==void 0&&(n.lineNumbers.countBy=F);let E=l(C,"w","distance");E!==void 0&&(n.lineNumbers.distance=E);let T=j$1(C,"w","restart"),k=Ut(T);k&&(n.lineNumbers.restart=k);}let y=e(e$1,"w","pgBorders");if(y){n.pageBorders={};let m=le(e(y,"w","top"));m&&(n.pageBorders.top=m);let F=le(e(y,"w","bottom"));F&&(n.pageBorders.bottom=F);let E=le(e(y,"w","left"));E&&(n.pageBorders.left=E);let T=le(e(y,"w","right"));T&&(n.pageBorders.right=T);let k=j$1(y,"w","display");(k==="allPages"||k==="firstPage"||k==="notFirstPage")&&(n.pageBorders.display=k);let B=j$1(y,"w","offsetFrom");(B==="page"||B==="text")&&(n.pageBorders.offsetFrom=B);let v=j$1(y,"w","zOrder");(v==="front"||v==="back")&&(n.pageBorders.zOrder=v);}let h=e(e$1,"w","background");if(h){n.background={};let m=j$1(h,"w","color");m&&m!=="auto"&&(n.background.color={rgb:m});let F=j$1(h,"w","themeColor");F&&(n.background.themeColor=F);let E=j$1(h,"w","themeTint");E&&(n.background.themeTint=E);let T=j$1(h,"w","themeShade");T&&(n.background.themeShade=T);}let b=e(e$1,"w","footnotePr");if(b){let m=$e(b);Object.keys(m).length>0&&(n.footnotePr=m);}let P=e(e$1,"w","endnotePr");if(P){let m=Ye(P);Object.keys(m).length>0&&(n.endnotePr=m);}let S=e(e$1,"w","docGrid");if(S){n.docGrid={};let m=j$1(S,"w","type");(m==="default"||m==="lines"||m==="linesAndChars"||m==="snapToChars")&&(n.docGrid.type=m);let F=l(S,"w","linePitch");F!==void 0&&(n.docGrid.linePitch=F);let E=l(S,"w","charSpace");E!==void 0&&(n.docGrid.charSpace=E);}let x=e(e$1,"w","paperSrc");if(x){let m=l(x,"w","first");m!==void 0&&(n.paperSrcFirst=m);let F=l(x,"w","other");F!==void 0&&(n.paperSrcOther=F);}return n}function go(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function Ke(e,t){if(!t||t.length===0)return e;let n=new Set((e??[]).map(r=>r.type)),o=t.filter(r=>!n.has(r.type));return o.length===0?e:[...e??[],...o]}function ho(e){if(e.length<2)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let o=t[n-1].properties,r=e[n].properties,a=Ke(r.headerReferences,o.headerReferences),u=Ke(r.footerReferences,o.footerReferences),l=r.titlePg!==void 0?r.titlePg:o.titlePg;if(a===r.headerReferences&&u===r.footerReferences&&l===r.titlePg){t.push(e[n]);continue}t.push({...e[n],properties:{...r,headerReferences:a,footerReferences:u,titlePg:l}});}return t}function zt(e,t){return !e&&!t?true:!(!e||!t||e.bold!==t.bold||e.boldCs!==t.boldCs||e.italic!==t.italic||e.italicCs!==t.italicCs||e.strike!==t.strike||e.doubleStrike!==t.doubleStrike||e.smallCaps!==t.smallCaps||e.allCaps!==t.allCaps||e.hidden!==t.hidden||e.emboss!==t.emboss||e.imprint!==t.imprint||e.outline!==t.outline||e.shadow!==t.shadow||e.rtl!==t.rtl||e.cs!==t.cs||e.fontSize!==t.fontSize||e.fontSizeCs!==t.fontSizeCs||e.spacing!==t.spacing||e.position!==t.position||e.scale!==t.scale||e.kerning!==t.kerning||e.vertAlign!==t.vertAlign||e.highlight!==t.highlight||e.effect!==t.effect||e.emphasisMark!==t.emphasisMark||e.styleId!==t.styleId||!_t(e.underline,t.underline)||!se(e.color,t.color)||!qt(e.shading,t.shading)||!Gt(e.fontFamily,t.fontFamily))}function _t(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:se(e.color,t.color)}function se(e,t){return !e&&!t?true:!e||!t?false:e.rgb===t.rgb&&e.auto===t.auto&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade}function qt(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!se(e.color,t.color)||!se(e.fill,t.fill))}function Gt(e,t){return !e&&!t?true:!e||!t?false:e.ascii===t.ascii&&e.hAnsi===t.hAnsi&&e.eastAsia===t.eastAsia&&e.cs===t.cs&&e.asciiTheme===t.asciiTheme&&e.hAnsiTheme===t.hAnsiTheme&&e.eastAsiaTheme===t.eastAsiaTheme&&e.csTheme===t.csTheme}function $t(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function Qe(e){return e.content.length===0?true:e.content.every($t)}function Yt(e,t){let n=[];for(let o of e)n.push(o);if(n.length>0&&t.length>0&&n[n.length-1].type==="text"&&t[0].type==="text"){let o=n[n.length-1],r=t[0];n[n.length-1]={type:"text",text:o.text+r.text,preserveSpace:o.preserveSpace||r.preserveSpace||void 0};for(let a=1;a<t.length;a++)n.push(t[a]);}else for(let o of t)n.push(o);return n}function Kt(e){if(e.length<=1)return e;let t=[],n=null;for(let o of e)if(o.content.length!==0){if(n===null){n={...o,content:[...o.content]};continue}Qe(n)&&Qe(o)&&zt(n.formatting,o.formatting)?n={type:"run",formatting:n.formatting,content:Yt(n.content,o.content)}:(t.push(n),n={...o,content:[...o.content]});}return n!==null&&t.push(n),t}function be(e){if(e.length<=1)return e;let t=[],n=[];function o(){if(n.length>0){let r=Kt(n);t.push(...r),n.length=0;}}for(let r of e)if(r.type==="run")n.push(r);else if(o(),r.type==="hyperlink"){let a={...r,children:be(r.children)};t.push(a);}else t.push(r);return o(),t}function Je(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function Zt(e){if(!e)return;let t={},n=j$1(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=j$1(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=j$1(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let a=j$1(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=j$1(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=j$1(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function fe(e$1,t,n){if(!e$1)return;let o={},r=e(e$1,"w","b");r&&(o.bold=m(r));let a=e(e$1,"w","bCs");a&&(o.boldCs=m(a));let u=e(e$1,"w","i");u&&(o.italic=m(u));let l$1=e(e$1,"w","iCs");l$1&&(o.italicCs=m(l$1));let f=e(e$1,"w","u");if(f){let M=j$1(f,"w","val");if(M){o.underline={style:M};let U=j$1(f,"w","color"),z=j$1(f,"w","themeColor");(U||z)&&(o.underline.color=Je(U,z,j$1(f,"w","themeTint"),j$1(f,"w","themeShade")));}}let c=e(e$1,"w","strike");c&&(o.strike=m(c));let p=e(e$1,"w","dstrike");p&&(o.doubleStrike=m(p));let d=e(e$1,"w","vertAlign");if(d){let M=j$1(d,"w","val");(M==="superscript"||M==="subscript"||M==="baseline")&&(o.vertAlign=M);}let w=e(e$1,"w","smallCaps");w&&(o.smallCaps=m(w));let C=e(e$1,"w","caps");C&&(o.allCaps=m(C));let y=e(e$1,"w","vanish");y&&(o.hidden=m(y));let h=e(e$1,"w","color");h&&(o.color=Je(j$1(h,"w","val"),j$1(h,"w","themeColor"),j$1(h,"w","themeTint"),j$1(h,"w","themeShade")));let b=e(e$1,"w","highlight");if(b){let M=j$1(b,"w","val");M&&(o.highlight=M);}let P=e(e$1,"w","shd");P&&(o.shading=Zt(P));let S=e(e$1,"w","sz");if(S){let M=l(S,"w","val");M!==void 0&&(o.fontSize=M);}let x=e(e$1,"w","szCs");if(x){let M=l(x,"w","val");M!==void 0&&(o.fontSizeCs=M);}let m$1=e(e$1,"w","rFonts");if(m$1){o.fontFamily={ascii:j$1(m$1,"w","ascii")??void 0,hAnsi:j$1(m$1,"w","hAnsi")??void 0,eastAsia:j$1(m$1,"w","eastAsia")??void 0,cs:j$1(m$1,"w","cs")??void 0};let M=j$1(m$1,"w","asciiTheme");M&&(o.fontFamily.asciiTheme=M,t&&!o.fontFamily.ascii&&(o.fontFamily.ascii=$(t,M)));let U=j$1(m$1,"w","hAnsiTheme");U&&(o.fontFamily.hAnsiTheme=U,t&&!o.fontFamily.hAnsi&&(o.fontFamily.hAnsi=$(t,U)));let z=j$1(m$1,"w","eastAsiaTheme");z&&(o.fontFamily.eastAsiaTheme=z,t&&!o.fontFamily.eastAsia&&(o.fontFamily.eastAsia=$(t,z)));let pe=j$1(m$1,"w","cstheme");pe&&(o.fontFamily.csTheme=pe,t&&!o.fontFamily.cs&&(o.fontFamily.cs=$(t,pe)));}let F=e(e$1,"w","spacing");if(F){let M=l(F,"w","val");M!==void 0&&(o.spacing=M);}let E=e(e$1,"w","position");if(E){let M=l(E,"w","val");M!==void 0&&(o.position=M);}let T=e(e$1,"w","w");if(T){let M=l(T,"w","val");M!==void 0&&(o.scale=M);}let k=e(e$1,"w","kern");if(k){let M=l(k,"w","val");M!==void 0&&(o.kerning=M);}let B=e(e$1,"w","effect");if(B){let M=j$1(B,"w","val");M&&(o.effect=M);}let v=e(e$1,"w","em");if(v){let M=j$1(v,"w","val");M&&(o.emphasisMark=M);}let I=e(e$1,"w","emboss");I&&(o.emboss=m(I));let H=e(e$1,"w","imprint");H&&(o.imprint=m(H));let X=e(e$1,"w","outline");X&&(o.outline=m(X));let Te=e(e$1,"w","shadow");Te&&(o.shadow=m(Te));let Ce=e(e$1,"w","rtl");Ce&&(o.rtl=m(Ce));let Fe=e(e$1,"w","cs");Fe&&(o.cs=m(Fe));let xe=e(e$1,"w","rStyle");if(xe){let M=j$1(xe,"w","val");M&&(o.styleId=M);}return Object.keys(o).length>0?o:void 0}function Qt(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,o=(j$1(e,"w","author")??"").trim(),r=(j$1(e,"w","date")??"").trim(),a=(j$1(e,"w","rsid")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:o.length>0?o:"Unknown",date:r.length>0?r:void 0,rsid:a.length>0?a:void 0}}function Jt(e$1,t,n,o){if(!e$1)return;let r=f(e$1,"w","rPrChange").map(a=>{let u=e(a,"w","rPr");return {type:"runPropertyChange",info:Qt(a),previousFormatting:fe(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function en(e){let t=k$1(e),n=j$1(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function tn(){return {type:"tab"}}function nn(e){let t=j$1(e,"w","type"),n=j$1(e,"w","clear"),o={type:"break"};return (t==="page"||t==="column"||t==="textWrapping")&&(o.breakType=t),(n==="none"||n==="left"||n==="right"||n==="all")&&(o.clear=n),o}function on(e){let t=j$1(e,"w","font")??"",n=j$1(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function rn(e){return {type:"footnoteRef",id:l(e,"w","id")??0}}function an(e){return {type:"endnoteRef",id:l(e,"w","id")??0}}function ln(e){let t=j$1(e,"w","fldCharType"),n=j$1(e,"w","fldLock")==="true"||j$1(e,"w","fldLock")==="1",o=j$1(e,"w","dirty")==="true"||j$1(e,"w","dirty")==="1",r="begin";return t==="separate"?r="separate":t==="end"&&(r="end"),{type:"fieldChar",charType:r,fldLock:n||void 0,dirty:o||void 0}}function sn(e){return {type:"instrText",text:k$1(e)}}function et(e,t,n){let o=z(e,t??void 0,n??void 0);return o?{type:"drawing",image:o}:null}function ue(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function un(e,t,n){let o=[],r=i(e);for(let a of r)switch(ue(a.name)){case "t":o.push(en(a));break;case "tab":o.push(tn());break;case "br":o.push(nn(a));break;case "sym":o.push(on(a));break;case "footnoteReference":o.push(rn(a));break;case "endnoteReference":o.push(an(a));break;case "fldChar":o.push(ln(a));break;case "instrText":o.push(sn(a));break;case "softHyphen":o.push({type:"softHyphen"});break;case "noBreakHyphen":o.push({type:"noBreakHyphen"});break;case "drawing":let l=et(a,t,n);l&&o.push(l);break;case "pict":case "object":break;case "rPr":break;case "lastRenderedPageBreak":break;case "cr":o.push({type:"break",breakType:"textWrapping"});break;case "AlternateContent":{let c=i(a).find(p=>ue(p.name)==="Choice")??i(a).find(p=>ue(p.name)==="Fallback");if(c){for(let p of i(c))if(ue(p.name)==="drawing"){let w=et(p,t,n);w?.image?.src&&o.push(w);}}break}case "footnoteRef":o.push({type:"footnoteRefMark"});break;case "endnoteRef":o.push({type:"endnoteRefMark"});break;case "separator":o.push({type:"separator"});break;case "continuationSeparator":o.push({type:"continuationSeparator"});break;}return o}function K(e$1,t,n,o=null,r=null){let a={type:"run",content:[]},u=e(e$1,"w","rPr");return u&&(a.formatting=fe(u,n),a.propertyChanges=Jt(u,n,t,a.formatting)),a.content=un(e$1,o,r),a}function fn(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function cn(e){if(!e)return;let t={},n=j$1(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=j$1(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=j$1(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let a=j$1(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=j$1(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=j$1(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function G(e){if(!e)return;let t=j$1(e,"w","val");if(!t)return;let n={style:t},o=j$1(e,"w","color"),r=j$1(e,"w","themeColor");(o||r)&&(n.color=fn(o,r,j$1(e,"w","themeTint"),j$1(e,"w","themeShade")));let a=l(e,"w","sz");a!==void 0&&(n.size=a);let u=l(e,"w","space");u!==void 0&&(n.space=u);let l$1=j$1(e,"w","shadow");l$1&&(n.shadow=l$1==="1"||l$1==="true");let f=j$1(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function pn(e){if(!e)return;let t=f(e,"w","tab");if(t.length===0)return;let n=[];for(let o of t){let r=l(o,"w","pos"),a=j$1(o,"w","val");if(r!==void 0&&a){let u={position:r,alignment:a},l=j$1(o,"w","leader");l&&(u.leader=l),n.push(u);}}return n.length>0?n:void 0}function dn(e){if(!e)return;let t={},n=l(e,"w","w");n!==void 0&&(t.width=n);let o=l(e,"w","h");o!==void 0&&(t.height=o);let r=j$1(e,"w","hAnchor");(r==="text"||r==="margin"||r==="page")&&(t.hAnchor=r);let a=j$1(e,"w","vAnchor");(a==="text"||a==="margin"||a==="page")&&(t.vAnchor=a);let u=l(e,"w","x");u!==void 0&&(t.x=u);let l$1=l(e,"w","y");l$1!==void 0&&(t.y=l$1);let f=j$1(e,"w","xAlign");f&&(t.xAlign=f);let c=j$1(e,"w","yAlign");c&&(t.yAlign=c);let p=j$1(e,"w","wrap");return p&&(t.wrap=p),Object.keys(t).length>0?t:void 0}function ce(e$1,t,n){if(!e$1)return;let o={},r=e(e$1,"w","jc");if(r){let T=j$1(r,"w","val");T&&(o.alignment=T);}let a=e(e$1,"w","bidi");a&&(o.bidi=m(a));let u=e(e$1,"w","spacing");if(u){let T=l(u,"w","before");T!==void 0&&(o.spaceBefore=T);let k=l(u,"w","after");k!==void 0&&(o.spaceAfter=k);let B=l(u,"w","line");B!==void 0&&(o.lineSpacing=B);let v={};T!==void 0&&(v.before=true),k!==void 0&&(v.after=true),(v.before||v.after)&&(o.spacingExplicit=v);let I=j$1(u,"w","lineRule");I&&(o.lineSpacingRule=I);let H=j$1(u,"w","beforeAutospacing");H&&(o.beforeAutospacing=H==="1"||H==="true");let X=j$1(u,"w","afterAutospacing");X&&(o.afterAutospacing=X==="1"||X==="true");}let l$1=e(e$1,"w","ind");if(l$1){let T=l(l$1,"w","left");T!==void 0&&(o.indentLeft=T);let k=l(l$1,"w","right");k!==void 0&&(o.indentRight=k);let B=l(l$1,"w","firstLine");B!==void 0&&(o.indentFirstLine=B);let v=l(l$1,"w","hanging");v!==void 0&&(o.indentFirstLine=-v,o.hangingIndent=true);let I=l(l$1,"w","start");I!==void 0&&o.indentLeft===void 0&&(o.indentLeft=I);let H=l(l$1,"w","end");H!==void 0&&o.indentRight===void 0&&(o.indentRight=H);}let f=e(e$1,"w","pBdr");if(f){let T={},k=G(e(f,"w","top"));k&&(T.top=k);let B=G(e(f,"w","bottom"));B&&(T.bottom=B);let v=G(e(f,"w","left"));v&&(T.left=v);let I=G(e(f,"w","right"));I&&(T.right=I);let H=G(e(f,"w","between"));H&&(T.between=H);let X=G(e(f,"w","bar"));X&&(T.bar=X),Object.keys(T).length>0&&(o.borders=T);}let c=e(e$1,"w","shd");c&&(o.shading=cn(c));let p=e(e$1,"w","tabs");p&&(o.tabs=pn(p));let d=e(e$1,"w","keepNext");d&&(o.keepNext=m(d));let w=e(e$1,"w","keepLines");w&&(o.keepLines=m(w));let C=e(e$1,"w","widowControl");C&&(o.widowControl=m(C));let y=e(e$1,"w","pageBreakBefore");y&&(o.pageBreakBefore=m(y));let h=e(e$1,"w","contextualSpacing");h&&(o.contextualSpacing=m(h));let b=e(e$1,"w","numPr");if(b){let T=e(b,"w","numId"),k=e(b,"w","ilvl");if(T||k){if(o.numPr={},T){let B=l(T,"w","val");B!==void 0&&(o.numPr.numId=B);}if(k){let B=l(k,"w","val");B!==void 0&&(o.numPr.ilvl=B);}}}let P=e(e$1,"w","outlineLvl");if(P){let T=l(P,"w","val");T!==void 0&&(o.outlineLevel=T);}let S=e(e$1,"w","pStyle");if(S){let T=j$1(S,"w","val");T&&(o.styleId=T);}let x=e(e$1,"w","framePr");x&&(o.frame=dn(x));let m$1=e(e$1,"w","suppressLineNumbers");m$1&&(o.suppressLineNumbers=m(m$1));let F=e(e$1,"w","suppressAutoHyphens");F&&(o.suppressAutoHyphens=m(F));let E=e(e$1,"w","rPr");return E&&(o.runProperties=fe(E,t)),Object.keys(o).length>0?o:void 0}function mn(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function gn(e){let t=l(e,"w","id")??0,n=j$1(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=l(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let a=l(e,"w","colLast");return a!==void 0&&(o.colLast=a),o}function hn(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function tt(e,t,n=null,o=null,r=null){let a={type:"hyperlink",children:[]},u=j$1(e,"r","id");if(u&&(a.rId=u,t)){let C=t.get(u);C&&(c$1(C),a.href=C.target);}let l=j$1(e,"w","anchor");l&&(a.anchor=l,a.href||(a.href=`#${l}`));let f=j$1(e,"w","tooltip");f&&(a.tooltip=f);let c=j$1(e,"w","tgtFrame");c&&(a.target=c);let p=j$1(e,"w","history");(p==="1"||p==="true")&&(a.history=true);let d=j$1(e,"w","docLocation");d&&(a.docLocation=d);let w=i(e);for(let C of w)switch(mn(C.name)){case "r":a.children.push(K(C,n,o,t,r));break;case "bookmarkStart":a.children.push(gn(C));break;case "bookmarkEnd":a.children.push(hn(C));break}return a}function Po(e){let t="";for(let n of e.children)if(n.type==="run")for(let o of n.content)o.type==="text"?t+=o.text:o.type==="tab"&&(t+=" ");return t}function Bo(e){return e.href?/^https?:\/\/|^mailto:|^tel:|^ftp:/i.test(e.href):!!e.rId&&!e.anchor}function vo(e){return !!e.anchor}function No(e){return e.href}function Ao(e){return e.children.some(t=>t.type==="run")}function Ho(e){return e.children.filter(t=>t.type==="run")}function Io(e,t){if(e.rId){let n=t.get(e.rId);if(n)return c$1(n),e.href=n.target,e.href}return e.anchor&&!e.href&&(e.href=`#${e.anchor}`),e.href}function nt(e){let t=l(e,"w","id")??0,n=j$1(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=l(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let a=l(e,"w","colLast");return a!==void 0&&(o.colLast=a),o}function ot(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function it(e){let t="";if(e.type==="text"&&typeof e.text=="string")return e.text;if(e.elements)for(let n of e.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let r of n.elements)r.type==="text"&&typeof r.text=="string"&&(t+=r.text);else t+=it(n);return t}function Q(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function at(e){let t=new Set(["hyperlink","smartTag","sdt","sdtContent","fldSimple","customXml","ins","del","moveFrom","moveTo"]),n=new Set(["pPr","proofErr","bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","commentReference","permStart","permEnd","rsidR"]),o=new Set(["t","tab","br","cr","sym","drawing","pict","object","softHyphen","noBreakHyphen","fldChar","instrText","pgNum","separator","continuationSeparator","footnoteRef","endnoteRef","footnoteReference","endnoteReference","ptab","monthShort","monthLong","yearShort","yearLong","dayShort","dayLong"]),r=false;function a(l){for(let f of i(l)){let c=Q(f.name);if(!n.has(c)){if(c==="lastRenderedPageBreak"){r=true;continue}if(c==="r"){for(let p of i(f)){let d=Q(p.name);if(d!=="rPr"){if(d==="lastRenderedPageBreak"){r=true;continue}if(d==="br"&&j$1(p,"w","type")==="page")return "forced";if(o.has(d))return "visible"}}continue}if(t.has(c)){let p=a(f);if(p!=="continue")return p;continue}return "continue"}}return "continue"}let u=a(e);return u==="forced"?true:u==="visible"?r:false}function rt(e,t){if(!e)return `w:${t}`;let n=e.indexOf(":");return n<0?t:`${e.substring(0,n+1)}${t}`}function lt(e){if(e.type!=="element")return e;let t=Q(e.name),n=e.name;return t==="delText"?n=rt(e.name,"t"):t==="delInstrText"&&(n=rt(e.name,"instrText")),{...e,name:n,elements:e.elements?.map(lt)}}function Z(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,o=j$1(e,"w","author"),r=j$1(e,"w","date"),a=o?.trim()??"",u=r?.trim()??"";return {id:Number.isInteger(n)&&n>=0?n:0,author:a.length>0?a:"Unknown",date:u.length>0?u:void 0}}function wn(e){return Z(e)}function st(e$1,t,n,o){if(!e$1)return;let r=f(e$1,"w","pPrChange").map(a=>{let u=e(a,"w","pPr");return {type:"paragraphPropertyChange",info:wn(a),previousFormatting:ce(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function yn(e,t,n,o,r){return tt(e,t,n,o,r)}function bn(e){return nt(e)}function Tn(e){return ot(e)}function ut(e){let t=e.trim().match(/^\\?([A-Z]+)/i);if(!t)return "UNKNOWN";let n=t[1].toUpperCase();return ["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function Cn(e,t,n,o,r){let a=j$1(e,"w","instr")??"",u=ut(a),l={type:"simpleField",instruction:a,fieldType:u,content:[]},f=j$1(e,"w","fldLock");(f==="1"||f==="true")&&(l.fldLock=true);let c=j$1(e,"w","dirty");(c==="1"||c==="true")&&(l.dirty=true);let p=i(e);for(let d of p)Q(d.name)==="r"&&l.content.push(K(d,t,n,o,r));return l}function j(e,t,n,o,r,a,u="default"){let l=[],f=i(e),c=false,p="",d=[],w=[],C=false,y=false,h=false;for(let b$1 of f){let P=Q(b$1.name);switch(P){case "r":{let S=u==="deletion"?lt(b$1):b$1,x=K(S,t,n,r,a),m=false,F=false,E=false,T="";for(let k of x.content)k.type==="fieldChar"?k.charType==="begin"?(m=true,k.fldLock&&(y=true),k.dirty&&(h=true)):k.charType==="separate"?F=true:k.charType==="end"&&(E=true):k.type==="instrText"&&(T+=k.text);if(m&&(c=true,C=false,p="",d=[],w=[],y=false,h=false),c){if(T&&(p+=T),F&&(C=true),C&&!E?F||w.push(x):!C&&!m&&d.push(x),E){let k={type:"complexField",instruction:p.trim(),fieldType:ut(p),fieldCode:d,fieldResult:w};y&&(k.fldLock=true),h&&(k.dirty=true),l.push(k),c=false;}}else l.push(x);break}case "hyperlink":l.push(yn(b$1,r,t,n,a));break;case "bookmarkStart":l.push(bn(b$1));break;case "bookmarkEnd":l.push(Tn(b$1));break;case "fldSimple":l.push(Cn(b$1,t,n,r,a));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let S=(b$1.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtPr"||m.name?.endsWith(":sdtPr"))),x=(b$1.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(x){let m=j(x,t,n,null,r,a,u),E={type:"inlineSdt",properties:re(S??null),content:m.filter(T=>T.type==="run"||T.type==="hyperlink"||T.type==="simpleField"||T.type==="complexField"||T.type==="inlineSdt"||T.type==="mathEquation")};l.push(E);}break}case "ins":{let S=Z(b$1),x=j(b$1,t,n,null,r,a),m={type:"insertion",info:S,content:x.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "del":{let S=Z(b$1),x=j(b$1,t,n,null,r,a,"deletion"),m={type:"deletion",info:S,content:x.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "moveFrom":{let S=Z(b$1),x=j(b$1,t,n,null,r,a,"deletion"),m={type:"moveFrom",info:S,content:x.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "moveTo":{let S=Z(b$1),x=j(b$1,t,n,null,r,a),m={type:"moveTo",info:S,content:x.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "smartTag":break;case "moveFromRangeStart":{let S=parseInt(j$1(b$1,"w","id")??"0",10),x=j$1(b$1,"w","name")??"";l.push({type:"moveFromRangeStart",id:S,name:x});break}case "moveFromRangeEnd":{let S=parseInt(j$1(b$1,"w","id")??"0",10);l.push({type:"moveFromRangeEnd",id:S});break}case "moveToRangeStart":{let S=parseInt(j$1(b$1,"w","id")??"0",10),x=j$1(b$1,"w","name")??"";l.push({type:"moveToRangeStart",id:S,name:x});break}case "moveToRangeEnd":{let S=parseInt(j$1(b$1,"w","id")??"0",10);l.push({type:"moveToRangeEnd",id:S});break}case "commentRangeStart":{let S=parseInt(j$1(b$1,"w","id")??"0",10);l.push({type:"commentRangeStart",id:S});break}case "commentRangeEnd":{let S=parseInt(j$1(b$1,"w","id")??"0",10);l.push({type:"commentRangeEnd",id:S});break}case "oMath":case "oMathPara":{let S=P==="oMathPara",x=b(b$1),m=it(b$1),F={type:"mathEquation",display:S?"block":"inline",ommlXml:x,plainText:m||void 0};l.push(F);break}}}return l}function Fn(e){let t="";for(let n of e.content)if(n.type==="run")for(let o of n.content)o.type==="text"?t+=o.text:o.type==="tab"?t+=" ":o.type==="break"&&(o.breakType==="page"?t+="\f":t+=`
|
|
4
|
+
`);else if(n.type==="hyperlink"){for(let o of n.children)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="simpleField"){for(let o of n.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="complexField")for(let o of n.fieldResult)for(let r of o.content)r.type==="text"&&(t+=r.text);return t}function ft(e){let t=j$1(e,"w","id");if(t==null)return null;let n=parseInt(t,10);if(Number.isNaN(n))return null;let o=j$1(e,"w","author")??"",r=j$1(e,"w","date")??void 0,a={id:n,author:o};return r&&(a.date=r),a}function Y(e$1,t,n,o,r=null,a=null,u){let l={type:"paragraph",content:[]},f=j$1(e$1,"w14","paraId")??j$1(e$1,"w","paraId");f&&(l.paraId=f);let c=j$1(e$1,"w14","textId")??j$1(e$1,"w","textId");c&&(l.textId=c),!u?.inHeaderFooter&&at(e$1)&&(l.renderedPageBreakBefore=true);let p=e(e$1,"w","pPr");if(p){l.formatting=ce(p,n),l.propertyChanges=st(p,n,t,l.formatting);let C=e(p,"w","rPr");if(C){let h=e(C,"w","ins");if(h){let P=ft(h);P&&(l.pPrIns=P);}let b=e(C,"w","del");if(b){let P=ft(b);P&&(l.pPrDel=P);}}let y=e(p,"w","sectPr");y&&(l.sectionProperties=Ze(y));}let d=j(e$1,t,n,o,r,a);l.content=be(d);let w=l.formatting?.numPr;if(!w&&l.formatting?.styleId&&t){let C=t.get(l.formatting.styleId);C?.pPr?.numPr&&(w=C.pPr.numPr,l.formatting||(l.formatting={}),l.formatting.numPr=w);}if(w&&o){let{numId:C,ilvl:y=0}=w;if(C!==void 0&&C!==0){let h=o.getLevel(C,y);if(h){let b=[];for(let x=0;x<=y;x+=1){let m=o.getLevel(C,x);b.push(m?.numFmt??"decimal");}let P=o.getInstance(C),S=P?.levelOverrides?.find(x=>x.ilvl===y);if(l.listRendering={level:y,numId:C,marker:h.lvlText,isBullet:h.numFmt==="bullet",numFmt:h.numFmt,markerHidden:h.rPr?.hidden||void 0,markerFontFamily:h.rPr?.fontFamily?.ascii||h.rPr?.fontFamily?.hAnsi||void 0,markerFontSize:h.rPr?.fontSize?h.rPr.fontSize/2:void 0,markerSuffix:h.suffix,levelNumFmts:b,abstractNumId:P?.abstractNumId,startOverride:S?.startOverride},h.pPr){l.formatting||(l.formatting={});let x=p?e(p,"w","ind"):null,m=x!=null&&(j$1(x,"w","left")!==null||j$1(x,"w","start")!==null),F=T=>{let k=x?j$1(x,"w",T):null;if(k===null)return false;let B=parseInt(k,10);return Number.isNaN(B)||B!==0},E=x!=null&&(F("firstLine")||F("hanging"));!m&&h.pPr.indentLeft!==void 0&&(l.formatting.indentLeft=h.pPr.indentLeft),E||(h.pPr.indentFirstLine!==void 0&&(l.formatting.indentFirstLine=h.pPr.indentFirstLine),h.pPr.hangingIndent!==void 0&&(l.formatting.hangingIndent=h.pPr.hangingIndent));}}}}return l}function ct(e$1){if(!e$1)return;let t={},n=O(e(e$1,"w","tblW"));n&&(t.width=n);let o=e(e$1,"w","jc");if(o){let h=j$1(o,"w","val");(h==="left"||h==="center"||h==="right"||h==="start")&&(t.justification=h==="start"?"left":h);}let r=O(e(e$1,"w","tblCellSpacing"));r&&(t.cellSpacing=r);let a=O(e(e$1,"w","tblInd"));a&&(t.indent=a);let u=te(e(e$1,"w","tblBorders"));u&&(t.borders=u);let l=ne(e(e$1,"w","tblCellMar"));l&&(t.cellMargins=l);let f=e(e$1,"w","tblLayout");if(f){let h=j$1(f,"w","type");(h==="fixed"||h==="autofit")&&(t.layout=h);}let c=e(e$1,"w","tblStyle");if(c){let h=j$1(c,"w","val");h&&(t.styleId=h);}let p=he(e(e$1,"w","tblLook"));p&&(t.look=p);let d=oe(e(e$1,"w","shd"));d&&(t.shading=d);let w=e(e$1,"w","tblOverlap");if(w){let h=j$1(w,"w","val");(h==="never"||h==="overlap")&&(t.overlap=h);}let C=we(e(e$1,"w","tblpPr"));if(C&&(t.floating=C),m(e(e$1,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function xn(e$1,t){if(!e$1)return;let n=f(e$1,"w","tblPrChange").map(o=>{let r=e(o,"w","tblPr");return {type:"tablePropertyChange",info:ee(o),previousFormatting:ct(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function kn(e$1,t){if(!e$1)return;let n=f(e$1,"w","trPrChange").map(o=>{let r=e(o,"w","trPr");return {type:"tableRowPropertyChange",info:ee(o),previousFormatting:pt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function Sn(e$1,t){if(!e$1)return;let n=f(e$1,"w","tcPrChange").map(o=>{let r=e(o,"w","tcPr");return {type:"tableCellPropertyChange",info:ee(o),previousFormatting:mt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function Mn(e$1){if(!e$1)return;let t=e(e$1,"w","ins");if(t)return {type:"tableRowInsertion",info:V(t)};let n=e(e$1,"w","del");if(n)return {type:"tableRowDeletion",info:V(n)}}function Rn(e$1){if(!e$1)return;let t=e(e$1,"w","cellIns");if(t)return {type:"tableCellInsertion",info:V(t)};let n=e(e$1,"w","cellDel");if(n)return {type:"tableCellDeletion",info:V(n)};let o=e(e$1,"w","cellMerge");if(o){let r=j$1(o,"w","vMerge"),a=j$1(o,"w","vMergeOrig"),u=l=>l==="rest"||l==="cont";return {type:"tableCellMerge",info:V(o),...u(r)?{vMerge:r}:{},...u(a)?{vMergeOrig:a}:{}}}}function pt(e$1){if(!e$1)return;let t={},n=e(e$1,"w","trHeight");if(n){let f=l(n,"w","val");f!==void 0&&f>0&&(t.height={value:f,type:"dxa"});let c=j$1(n,"w","hRule");(c==="auto"||c==="atLeast"||c==="exact")&&(t.heightRule=c);}m(e(e$1,"w","tblHeader"))&&(t.header=true),m(e(e$1,"w","cantSplit"))&&(t.cantSplit=true);let a=e(e$1,"w","jc");if(a){let f=j$1(a,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}m(e(e$1,"w","hidden"))&&(t.hidden=true);let l$1=dt(e(e$1,"w","cnfStyle"));if(l$1&&(t.conditionalFormat=l$1),Object.keys(t).length!==0)return t}function dt(e){if(!e)return;let t={},n=j$1(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=j$1(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=j$1(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let a=j$1(e,"w","lastColumn");(a==="1"||a==="true")&&(t.lastColumn=true);let u=j$1(e,"w","oddHBand");(u==="1"||u==="true")&&(t.oddHBand=true);let l=j$1(e,"w","evenHBand");(l==="1"||l==="true")&&(t.evenHBand=true);let f=j$1(e,"w","oddVBand");(f==="1"||f==="true")&&(t.oddVBand=true);let c=j$1(e,"w","evenVBand");(c==="1"||c==="true")&&(t.evenVBand=true);let p=j$1(e,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(t.nwCell=true);let d=j$1(e,"w","firstRowLastColumn");(d==="1"||d==="true")&&(t.neCell=true);let w=j$1(e,"w","lastRowFirstColumn");(w==="1"||w==="true")&&(t.swCell=true);let C=j$1(e,"w","lastRowLastColumn");(C==="1"||C==="true")&&(t.seCell=true);let y=j$1(e,"w","val");if(y&&y.length===12&&(y[0]==="1"&&(t.firstRow=true),y[1]==="1"&&(t.lastRow=true),y[2]==="1"&&(t.firstColumn=true),y[3]==="1"&&(t.lastColumn=true),y[4]==="1"&&(t.oddVBand=true),y[5]==="1"&&(t.evenVBand=true),y[6]==="1"&&(t.oddHBand=true),y[7]==="1"&&(t.evenHBand=true),y[8]==="1"&&(t.nwCell=true),y[9]==="1"&&(t.neCell=true),y[10]==="1"&&(t.swCell=true),y[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function mt(e$1){if(!e$1)return;let t={},n=O(e(e$1,"w","tcW"));n&&(t.width=n);let o=te(e(e$1,"w","tcBorders"));o&&(t.borders=o);let r=ne(e(e$1,"w","tcMar"));r&&(t.margins=r);let a=oe(e(e$1,"w","shd"));a&&(t.shading=a);let u=e(e$1,"w","vAlign");if(u){let y=j$1(u,"w","val");(y==="top"||y==="center"||y==="bottom")&&(t.verticalAlign=y);}let l$1=e(e$1,"w","textDirection");if(l$1){let y=j$1(l$1,"w","val");y&&(t.textDirection=y);}let f=e(e$1,"w","gridSpan");if(f){let y=l(f,"w","val");y!==void 0&&y>1&&(t.gridSpan=y);}let c=e(e$1,"w","vMerge");c&&(j$1(c,"w","val")==="restart"?t.vMerge="restart":t.vMerge="continue"),m(e(e$1,"w","tcFitText"))&&(t.fitText=true),m(e(e$1,"w","noWrap"))&&(t.noWrap=true),m(e(e$1,"w","hideMark"))&&(t.hideMark=true);let C=dt(e(e$1,"w","cnfStyle"));if(C&&(t.conditionalFormat=C),Object.keys(t).length!==0)return t}function En(e,t,n,o,r,a,u){let l=[],f=e.elements||[];for(let c of f){if(!c.name)continue;let p=c.name.split(":").pop();if(p==="p"){let d=Y(c,t,n,o,r,a,u);l.push(d);}else if(p==="tbl"){let d=ye(c,t,n,o,r,a,u);l.push(d);}}return l.length===0&&l.push({type:"paragraph",content:[]}),l}function Pn(e$1,t,n,o,r,a,u){let l={type:"tableCell",content:[]},f=e(e$1,"w","tcPr"),c=mt(f);return c&&(l.formatting=c),l.propertyChanges=Sn(f,c),l.structuralChange=Rn(f),l.content=En(e$1,t,n,o,r,a,u),l}function Bn(e$1,t,n,o,r,a,u){let l={type:"tableRow",cells:[]},f$1=e(e$1,"w","trPr"),c=pt(f$1);c&&(l.formatting=c),l.propertyChanges=kn(f$1,c),l.structuralChange=Mn(f$1);let p=f(e$1,"w","tc");for(let d of p){let w=Pn(d,t,n,o,r,a,u);l.cells.push(w);}return l}function vn(e){if(!e)return;let t=[],n=f(e,"w","gridCol");for(let o of n){let r=l(o,"w","w")??0;t.push(r);}if(!(t.length>0&&t.every(o=>o<=0)))return t.length>0?t:void 0}function Nn(e){return e.cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function An(e){let t=Math.max(e.columnWidths?.length??0,...e.rows.map(n=>Nn(n)));if(!(t<=1))for(let n of e.rows){if(n.cells.length!==1)continue;let o=n.cells[0];(o.formatting?.gridSpan??1)>=t||o.formatting?.vMerge||o.formatting?.gridSpan==null&&(o.formatting={...o.formatting??{},gridSpan:t});}}function ye(e$1,t,n,o,r,a,u){let l={type:"table",rows:[]},f$1=e(e$1,"w","tblPr"),c=ct(f$1);c&&(l.formatting=c),l.propertyChanges=xn(f$1,c);let p=vn(e(e$1,"w","tblGrid"));p&&(l.columnWidths=p);let d=f(e$1,"w","tr");for(let w of d){let C=Bn(w,t,n,o,r,a,u);l.rows.push(C);}return An(l),l}export{uo as A,Ze as B,go as C,ho as D,K as E,tt as F,Po as G,Bo as H,vo as I,No as J,Ao as K,Ho as L,Io as M,Fn as N,Y as O,In as a,$ as b,Ie as c,W as d,te as e,ne as f,oe as g,he as h,we as i,Tt as j,Ct as k,Ft as l,xt as m,kt as n,ct as o,Et as p,q,Jn as r,eo as s,ro as t,io as u,$e as v,Ye as w,ao as x,lo as y,so as z};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),
|
|
1
|
+
'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkOTHV7YV2_js=require('./chunk-OTHV7YV2.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
|
|
2
2
|
Returns variable names without braces, along with their locations (body, headers, footers, etc.).
|
|
3
3
|
Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=chunkU4UCHBZ7_js.b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
|
|
4
4
|
The variable can later be substituted with actual values using docx_apply_template.
|
|
5
5
|
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-DZAMMQ35.js'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
|
|
6
6
|
Replaces all {variable} placeholders with the corresponding values provided.
|
|
7
7
|
Preserves all formatting (fonts, styles, colors, tables).
|
|
8
|
-
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await
|
|
8
|
+
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkOTHV7YV2_js.f(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
|
|
9
9
|
Checks for syntax errors like unclosed braces, invalid tag names, etc.
|
|
10
10
|
Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!n.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let t=chunkESI4BSBF_js.f(n.buffer);return {content:[{type:"text",text:JSON.stringify({valid:t.valid,tags:t.tags,errors:t.errors.map(e=>({message:e.message,variable:e.variable,type:e.type}))},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},P=[V,R,S,k];var E={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:v,replaceWithTemplateVariable:w},mcpTools:P};exports.a=M;exports.b=E;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var xmlJs=require('xml-js');var d=/&(?!(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+);)/g;function p(e){return e.replace(d,"&")}function g(e){let t=p(e);try{return xmlJs.xml2js(t,{compact:!1,ignoreComment:!0,ignoreInstruction:!0,ignoreDoctype:!0,alwaysArray:!1,trim:!1,captureSpacesBetweenElements:!0,attributesKey:"attributes",textKey:"text"})}catch(n){if(!(n instanceof Error))throw n;let l=n.message.match(/Column:\s*(\d+)/);if(l){let r=parseInt(l[1],10),i=Math.max(0,r-30),s=JSON.stringify(t.slice(i,r+30)),u=new Error(`${n.message}
|
|
2
|
+
Near: ${s}`);throw u.stack=n.stack,u}throw n}}function w(e){return xmlJs.js2xml({elements:[e]},{compact:false,spaces:0})}function X(e){try{let t=g(e);return t.elements&&t.elements.length>0?t.elements.find(n=>n.type==="element")??null:t}catch(t){return console.warn("Failed to parse XML:",t),null}}function o(e){let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function m(e,t,n){if(!e.name)return false;let l=`${t}:${n}`;return e.name===l||o(e.name)===n}function y(e,t,n){if(!e||!e.elements)return null;let l=`${t}:${n}`;for(let r of e.elements)if(r.type==="element"&&(r.name===l||o(r.name||"")===n))return r;return null}function b(e,t,n){if(!e||!e.elements)return [];let l=`${t}:${n}`,r=[];for(let i of e.elements)i.type==="element"&&(i.name===l||o(i.name||"")===n)&&r.push(i);return r}function A(e,t){return !e||!e.elements?[]:e.elements.filter(n=>n.type==="element"&&o(n.name||"")===t)}function C(e,t){if(!e||!e.elements)return null;for(let n of e.elements)if(n.type==="element"&&n.name===t)return n;return null}function N(e){return !e||!e.elements?[]:e.elements.filter(t=>t.type==="element")}function f(e,t,n){if(!e||!e.attributes)return null;let l=e.attributes;if(t){let r=`${t}:${n}`;if(r in l)return l[r]}return n in l?l[n]:null}function h(e){if(!e)return "";if("text"in e&&typeof e.text=="string")return e.text;if(!e.elements)return "";let t="";for(let n of e.elements)n.type==="text"&&"text"in n?t+=n.text??"":n.type==="element"&&(t+=h(n));return t}function v(e,t,n,l=1){let r=f(e,t,n);if(r===null)return;let i=parseInt(r,10);if(!isNaN(i))return i*l}function S(e,t="w"){if(!e)return false;let n=f(e,t,"val");return n===null?true:!(n==="0"||n==="false"||n==="off")}function x(e,t,n){if(!e)return null;if(m(e,t,n))return e;if(e.elements)for(let l of e.elements){if(l.type!=="element")continue;let r=x(l,t,n);if(r)return r}return null}function $(e,t,n){let l=[];function r(i){if(i&&(m(i,t,n)&&l.push(i),i.elements))for(let s of i.elements)s.type==="element"&&r(s);}return r(e),l}exports.a=g;exports.b=w;exports.c=X;exports.d=o;exports.e=y;exports.f=b;exports.g=A;exports.h=C;exports.i=N;exports.j=f;exports.k=h;exports.l=v;exports.m=S;exports.n=x;exports.o=$;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q,p}from'./chunk-SWBLJF6R.mjs';var t=new q(p());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();export{s as a,n as b};
|