@eigenpal/docx-editor-core 0.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +36 -1
  2. package/dist/agent/index.js +1 -1
  3. package/dist/agent/index.mjs +1 -1
  4. package/dist/chunk-3GNIP6IX.mjs +4 -0
  5. package/dist/chunk-7UTXBQKF.mjs +1 -0
  6. package/dist/{chunk-CKXAHSJQ.js → chunk-AFMMYLPX.js} +2 -2
  7. package/dist/{chunk-J7ULKGU2.mjs → chunk-AGNZEOVL.mjs} +1 -1
  8. package/dist/chunk-BD4CYYFB.js +1 -0
  9. package/dist/{chunk-6ILFFGGS.js → chunk-C6GSFUV2.js} +1 -1
  10. package/dist/chunk-DN36K5JU.mjs +1 -0
  11. package/dist/{chunk-CWAP26GB.js → chunk-DV6IEOP5.js} +3 -3
  12. package/dist/{chunk-23CP3TOP.js → chunk-GH5N36F7.js} +1 -1
  13. package/dist/chunk-GNPLUGUG.mjs +1 -0
  14. package/dist/chunk-HVZMO3BU.js +1 -0
  15. package/dist/chunk-ITVXBQGR.mjs +1 -0
  16. package/dist/{chunk-S7IKPRC3.js → chunk-KSYEBTYE.js} +1 -1
  17. package/dist/{chunk-ZRZ2VRQQ.mjs → chunk-LDAOONXZ.mjs} +1 -1
  18. package/dist/{chunk-36VIYQHD.mjs → chunk-N3GIC2UI.mjs} +1 -1
  19. package/dist/{chunk-FC6QL3E6.js → chunk-NFYCMDM5.js} +1 -1
  20. package/dist/chunk-P3AXSRLG.mjs +1 -0
  21. package/dist/chunk-PK4PDRTA.js +1 -0
  22. package/dist/{chunk-VKTCTMIO.mjs → chunk-R7RR6M4A.mjs} +1 -1
  23. package/dist/{chunk-BGC7QKP5.mjs → chunk-RSMS6OTE.mjs} +1 -1
  24. package/dist/chunk-TZJUO3NW.js +1 -0
  25. package/dist/chunk-YE357WVA.js +1 -0
  26. package/dist/core-plugins.js +1 -1
  27. package/dist/core-plugins.mjs +1 -1
  28. package/dist/core.d.mts +1 -1
  29. package/dist/core.d.ts +1 -1
  30. package/dist/core.js +1 -1
  31. package/dist/core.mjs +1 -1
  32. package/dist/docx/index.js +1 -1
  33. package/dist/docx/index.mjs +1 -1
  34. package/dist/docx/parser.js +1 -1
  35. package/dist/docx/parser.mjs +1 -1
  36. package/dist/headless.js +1 -1
  37. package/dist/headless.mjs +1 -1
  38. package/dist/layout-bridge/index.d.mts +1 -1
  39. package/dist/layout-bridge/index.d.ts +1 -1
  40. package/dist/layout-bridge/index.js +1 -1
  41. package/dist/layout-bridge/index.mjs +1 -1
  42. package/dist/layout-bridge/measuring/index.d.mts +17 -1
  43. package/dist/layout-bridge/measuring/index.d.ts +17 -1
  44. package/dist/layout-bridge/measuring/index.js +1 -1
  45. package/dist/layout-bridge/measuring/index.mjs +1 -1
  46. package/dist/layout-bridge/tableInsertHover.js +1 -1
  47. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  48. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  49. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  50. package/dist/layout-engine/types.d.mts +8 -4
  51. package/dist/layout-engine/types.d.ts +8 -4
  52. package/dist/layout-painter/index.js +1 -1
  53. package/dist/layout-painter/index.mjs +1 -1
  54. package/dist/layout-painter/renderPage.d.mts +7 -0
  55. package/dist/layout-painter/renderPage.d.ts +7 -0
  56. package/dist/layout-painter/renderPage.js +1 -1
  57. package/dist/layout-painter/renderPage.mjs +1 -1
  58. package/dist/mcp-cli.mjs +15 -15
  59. package/dist/mcp.js +2 -2
  60. package/dist/mcp.mjs +1 -1
  61. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  62. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  63. package/dist/prosemirror/conversion/index.js +1 -1
  64. package/dist/prosemirror/conversion/index.mjs +1 -1
  65. package/dist/prosemirror/index.js +1 -1
  66. package/dist/prosemirror/index.mjs +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-4AJYHCPB.js +0 -2
  69. package/dist/chunk-7GHQ4YCJ.mjs +0 -1
  70. package/dist/chunk-BWHUD2XC.mjs +0 -4
  71. package/dist/chunk-DY2MJCSV.js +0 -1
  72. package/dist/chunk-G6Y4UZMJ.mjs +0 -1
  73. package/dist/chunk-LMF2ELOB.js +0 -1
  74. package/dist/chunk-N27FJQTG.js +0 -1
  75. package/dist/chunk-UIROUI5I.mjs +0 -1
  76. package/dist/chunk-UOFQYE2L.mjs +0 -1
  77. package/dist/chunk-V7BKPX67.mjs +0 -2
  78. package/dist/chunk-Y7JZPBBW.js +0 -1
package/README.md CHANGED
@@ -1,3 +1,17 @@
1
+ <p align="center">
2
+ <a href="https://www.docx-editor.dev/">
3
+ <img src="https://raw.githubusercontent.com/eigenpal/docx-editor/main/assets/header.png" alt="DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side." width="500" />
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@eigenpal/docx-editor-core"><img src="https://img.shields.io/npm/v/@eigenpal/docx-editor-core.svg?style=flat-square&color=3B5BDB" alt="npm version" /></a>
9
+ <a href="https://www.npmjs.com/package/@eigenpal/docx-editor-core"><img src="https://img.shields.io/npm/dm/@eigenpal/docx-editor-core.svg?style=flat-square&color=3B5BDB" alt="npm downloads" /></a>
10
+ <a href="https://github.com/eigenpal/docx-editor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache_2.0-blue.svg?style=flat-square&color=3B5BDB" alt="license" /></a>
11
+ <a href="https://docx-editor.dev/editor"><img src="https://img.shields.io/badge/Live_Demo-3B5BDB?style=flat-square&logo=vercel&logoColor=white" alt="Demo" /></a>
12
+ <a href="https://www.docx-editor.dev/docs"><img src="https://img.shields.io/badge/Docs-3B5BDB?style=flat-square&logo=readthedocs&logoColor=white" alt="Documentation" /></a>
13
+ </p>
14
+
1
15
  # @eigenpal/docx-editor-core
2
16
 
3
17
  Framework-agnostic core for the [docx-editor](https://docx-editor.dev). Parses DOCX, builds the document model, runs ProseMirror, and renders Word-fidelity pages. Powers the React and Vue adapters and anything else you build on top.
@@ -21,6 +35,18 @@ console.log(document.paragraphs.length);
21
35
 
22
36
  Each subpath tree-shakes independently. Pick the smallest entry point that gives you what you need.
23
37
 
38
+ ## Packages
39
+
40
+ | Package | Description |
41
+ | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
42
+ | [`@eigenpal/docx-editor-react`](https://www.npmjs.com/package/@eigenpal/docx-editor-react) | <img src="https://cdn.simpleicons.org/react/61DAFB" width="20" align="middle" /> &nbsp; React adapter. Toolbar, paged editor, plugins. |
43
+ | [`@eigenpal/docx-editor-vue`](https://www.npmjs.com/package/@eigenpal/docx-editor-vue) | <img src="https://cdn.simpleicons.org/vuedotjs/4FC08D" width="20" align="middle" /> &nbsp; Vue 3 adapter. Toolbar, paged editor, plugins. |
44
+ | [`@eigenpal/docx-editor-core`](https://www.npmjs.com/package/@eigenpal/docx-editor-core) | Framework-agnostic core: OOXML parser, serializer, layout engine, ProseMirror schema. Depend on this if you fork the React or Vue adapter. |
45
+ | [`@eigenpal/docx-editor-i18n`](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) | Shared locale strings and types consumed by both adapters. |
46
+ | [`@eigenpal/docx-editor-agents`](https://www.npmjs.com/package/@eigenpal/docx-editor-agents) | Agent SDK and chat UI: framework-agnostic bridge, MCP server, AI SDK adapters, plus React UI. |
47
+
48
+ > **Forking the adapter?** Keep your fork thin. Depend on `@eigenpal/docx-editor-core` directly so parser, serializer, and rendering fixes land in your build automatically, without backporting each upstream change by hand.
49
+
24
50
  ## Subpath map
25
51
 
26
52
  | Building... | Import from | What you get |
@@ -51,4 +77,13 @@ npm i prosemirror-commands prosemirror-dropcursor prosemirror-history \
51
77
 
52
78
  ## Architecture
53
79
 
54
- Dual-rendering: a hidden ProseMirror instance owns editing state (selection, undo/redo, commands) while `layout-painter` produces the visible pages. Full breakdown: [CLAUDE.md](https://github.com/eigenpal/docx-editor/blob/main/CLAUDE.md#editor-architecture--dual-rendering-system).
80
+ Dual-rendering: a hidden ProseMirror instance owns editing state (selection, undo/redo, commands) while `layout-painter` produces the visible pages. Full breakdown: **[docx-editor.dev/docs/architecture](https://www.docx-editor.dev/docs/architecture)**.
81
+
82
+ ## Contributing
83
+
84
+ Contributions welcome. See [CONTRIBUTING.md](https://github.com/eigenpal/docx-editor/blob/main/CONTRIBUTING.md) for setup, tests, and the one-time CLA signature.
85
+
86
+ ## Commercial Support
87
+
88
+ > [!TIP]
89
+ > Questions or custom features? Email **[docx-editor@eigenpal.com](mailto:docx-editor@eigenpal.com)**.
@@ -1 +1 @@
1
- 'use strict';var chunkOCAX2KJQ_js=require('../chunk-OCAX2KJQ.js'),chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),chunkS7IKPRC3_js=require('../chunk-S7IKPRC3.js');require('../chunk-WLQEPVDR.js'),require('../chunk-U4UCHBZ7.js');var chunkTE2AF7FM_js=require('../chunk-TE2AF7FM.js');require('../chunk-WNTT4MGC.js'),require('../chunk-CCWOLPZE.js'),require('../chunk-4BFNWPKW.js'),require('../chunk-6ILFFGGS.js'),require('../chunk-CWAP26GB.js'),require('../chunk-KBU6QQFU.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-YGHHSCPR.js'),require('../chunk-7VCMJCBY.js'),require('../chunk-T4CPTPRP.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.p}});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 chunkS7IKPRC3_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkS7IKPRC3_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkS7IKPRC3_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_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}});
1
+ 'use strict';var chunkOCAX2KJQ_js=require('../chunk-OCAX2KJQ.js'),chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),chunkKSYEBTYE_js=require('../chunk-KSYEBTYE.js');require('../chunk-WLQEPVDR.js'),require('../chunk-U4UCHBZ7.js');var chunkTE2AF7FM_js=require('../chunk-TE2AF7FM.js');require('../chunk-WNTT4MGC.js'),require('../chunk-CCWOLPZE.js'),require('../chunk-4BFNWPKW.js'),require('../chunk-C6GSFUV2.js'),require('../chunk-DV6IEOP5.js'),require('../chunk-KBU6QQFU.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-YGHHSCPR.js'),require('../chunk-7VCMJCBY.js'),require('../chunk-T4CPTPRP.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.p}});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 chunkKSYEBTYE_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkKSYEBTYE_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkKSYEBTYE_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkKSYEBTYE_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkKSYEBTYE_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}});
@@ -1 +1 @@
1
- export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,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 parseHeadingLevel}from'../chunk-FWTP7BN7.mjs';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-36VIYQHD.mjs';import'../chunk-O5X22KZ6.mjs';import'../chunk-ARHPXIBJ.mjs';export{a as executeCommand,b as executeCommands}from'../chunk-CUY2THAO.mjs';import'../chunk-4EHBV73E.mjs';import'../chunk-ZYESB4KC.mjs';import'../chunk-3NRMSZX2.mjs';import'../chunk-VKTCTMIO.mjs';import'../chunk-BWHUD2XC.mjs';import'../chunk-Y5HZAMND.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-IBNUQL57.mjs';import'../chunk-6LOYA7G5.mjs';import'../chunk-6VUYFDHY.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';
1
+ export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,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 parseHeadingLevel}from'../chunk-FWTP7BN7.mjs';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-N3GIC2UI.mjs';import'../chunk-O5X22KZ6.mjs';import'../chunk-ARHPXIBJ.mjs';export{a as executeCommand,b as executeCommands}from'../chunk-CUY2THAO.mjs';import'../chunk-4EHBV73E.mjs';import'../chunk-ZYESB4KC.mjs';import'../chunk-3NRMSZX2.mjs';import'../chunk-R7RR6M4A.mjs';import'../chunk-3GNIP6IX.mjs';import'../chunk-Y5HZAMND.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-IBNUQL57.mjs';import'../chunk-6LOYA7G5.mjs';import'../chunk-6VUYFDHY.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';
@@ -0,0 +1,4 @@
1
+ import {z as z$1,h,j as j$2,k as k$1,g}from'./chunk-IBNUQL57.mjs';import {c,j as j$1,e,l,a,f,q,i,m,b,d,k,n}from'./chunk-6LOYA7G5.mjs';var Ne={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},Q={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},ge={name:"Office Theme",colorScheme:Ne,fontScheme:Q},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={...Ne};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 Ae(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={...Q};if(!e$1)return t;let n=e(e$1,"a","majorFont");n&&(t.majorFont=Ae(n));let o=e(e$1,"a","minorFont");return o&&(t.minorFont=Ae(o)),t}function Pn(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 Q.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 He(e,t="latin"){if(!e?.fontScheme?.minorFont)return Q.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 Y(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?He(e,r):He(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 X(e){return Ie(e)}function j(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 J(e){let t=j(e),n=(j$1(e,"w","rsid")??"").trim();return n.length>0?{...t,rsid:n}:t}function V(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 ee(e$1){if(!e$1)return;let t={},n=V(e(e$1,"w","top"));n&&(t.top=n);let o=V(e(e$1,"w","bottom"));o&&(t.bottom=o);let r=V(e(e$1,"w","left")??e(e$1,"w","start"));r&&(t.left=r);let a=V(e(e$1,"w","right")??e(e$1,"w","end"));a&&(t.right=a);let u=V(e(e$1,"w","insideH"));u&&(t.insideH=u);let l=V(e(e$1,"w","insideV"));if(l&&(t.insideV=l),Object.keys(t).length!==0)return t}function te(e$1){if(!e$1)return;let t={},n=X(e(e$1,"w","top"));n&&(t.top=n);let o=X(e(e$1,"w","bottom"));o&&(t.bottom=o);let r=X(e(e$1,"w","left")??e(e$1,"w","start"));r&&(t.left=r);let a=X(e(e$1,"w","right")??e(e$1,"w","end"));if(a&&(t.right=a),Object.keys(t).length!==0)return t}function ne(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 St(e){return e.rows.length===0?false:e.rows[0].formatting?.header===true}function Le(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function Xe(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Le(t),rId:n}}function De(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Le(t),rId:n}}function ye(e,t,n,o,r,a){let u=[],l=e.elements??[],f={inHeaderFooter:true};for(let c of l){if(c.type!=="element")continue;let p=c.name??"";if(p==="w:p"||p.endsWith(":p"))u.push(D(c,t,n,o,r,a,f));else if(p==="w:tbl"||p.endsWith(":tbl")){let d=z(c,t,n,o,r,a,f);u.push(d);}else if(p==="w:sdt"||p.endsWith(":sdt")){let d=(c.elements??[]).find(h=>h.type==="element"&&(h.name==="w:sdtContent"||h.name?.endsWith(":sdtContent")));if(d){let h=ye(d,t,n,o,r,a);u.push(...h);}}}return u}function Xn(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(p=>p.type==="element"&&(p.name==="w:hdr"||p.name?.endsWith(":hdr")));return c&&(l.content=ye(c,n,o,r,a$1,u)),l}function Dn(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=ye(c,n,o,r,a$1,u)),l}function Oe(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function We(e,t,n,o,r,a){let u=[];for(let l of i(e)){let f=l.name??"";f==="w:p"?u.push(D(l,t,n,o,r)):f==="w:tbl"&&u.push(z(l,t,n,o,r,a));}return u}function kt(e,t,n,o,r,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=Oe(l$1),c=We(e,t,n,o,r,a);return {type:"footnote",id:u,noteType:f,content:c}}function zn(e,t=null,n=null,o=null,r=null,a$1=null){let u=new Map,l=[];if(!e)return oe(u,l);let f$1=a(e);if(!f$1)return oe(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:footnotes"||d.name?.endsWith(":footnotes")));if(!c)return oe(u,l);let p=f(c,"w","footnote");for(let d of p){let h=kt(d,t,n,o,r,a$1);u.set(h.id,h),l.push(h);}return oe(u,l)}function oe(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 Mt(e,t,n,o,r,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=Oe(l$1),c=We(e,t,n,o,r,a);return {type:"endnote",id:u,noteType:f,content:c}}function Un(e,t=null,n=null,o=null,r=null,a$1=null){let u=new Map,l=[];if(!e)return re(u,l);let f$1=a(e);if(!f$1)return re(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:endnotes"||d.name?.endsWith(":endnotes")));if(!c)return re(u,l);let p=f(c,"w","endnote");for(let d of p){let h=Mt(d,t,n,o,r,a$1);u.set(h.id,h),l.push(h);}return re(u,l)}function re(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 Ve(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 Rt(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Et(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function je(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function ze(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=Rt(u);}let o=e(e$1,"w","numFmt");if(o){let u=j$1(o,"w","val");t.numFmt=Ve(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=je(u);}return t}function Ue(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=Et(u);}let o=e(e$1,"w","numFmt");if(o){let u=j$1(o,"w","val");t.numFmt=Ve(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=je(u);}return t}function Gn(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 qn(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 _n(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function Yn(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function Pt(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 ie(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=Pt(u,l$1,f,c);p&&(o.color=p);let d=j$1(e,"w","shadow");(d==="1"||d==="true")&&(o.shadow=true);let h=j$1(e,"w","frame");return (h==="1"||h==="true")&&(o.frame=true),o}function Bt(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 At(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function Ht(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function ae(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 C=l(o,"w","h");C!==void 0&&(n.pageHeight=C);let E=j$1(o,"w","orient"),y=Bt(E);y&&(n.orientation=y);}let r=e(e$1,"w","pgMar");if(r){let m=l(r,"w","top");m!==void 0&&(n.marginTop=m);let C=l(r,"w","bottom");C!==void 0&&(n.marginBottom=C);let E=l(r,"w","left");E!==void 0&&(n.marginLeft=E);let y=l(r,"w","right");y!==void 0&&(n.marginRight=y);let S=l(r,"w","header");S!==void 0&&(n.headerDistance=S);let P=l(r,"w","footer");P!==void 0&&(n.footerDistance=P);let B=l(r,"w","gutter");B!==void 0&&(n.gutter=B);}let a=e(e$1,"w","cols");if(a){let m=l(a,"w","num");m!==void 0&&(n.columnCount=m);let C=l(a,"w","space");C!==void 0&&(n.columnSpace=C);let E=j$1(a,"w","equalWidth");E==="1"||E==="true"?n.equalWidth=true:(E==="0"||E==="false")&&(n.equalWidth=false);let y=j$1(a,"w","sep");(y==="1"||y==="true")&&(n.separator=true);let S=f(a,"w","col");if(S.length>0){n.columns=[];for(let P of S){let B={},I=l(P,"w","w");I!==void 0&&(B.width=I);let N=l(P,"w","space");N!==void 0&&(B.space=N),n.columns.push(B);}n.columnCount===void 0&&(n.columnCount=S.length);}}let u=e(e$1,"w","type");if(u){let m=j$1(u,"w","val"),C=vt(m);C&&(n.sectionStart=C);}let l$1=e(e$1,"w","vAlign");if(l$1){let m=j$1(l$1,"w","val"),C=At(m);C&&(n.verticalAlign=C);}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=>Xe(m)));let p=f(e$1,"w","footerReference");p.length>0&&(n.footerReferences=p.map(m=>De(m)));let d=e(e$1,"w","titlePg");d&&(n.titlePg=m(d));let h=e(e$1,"w","evenAndOddHeaders");h&&(n.evenAndOddHeaders=m(h));let T=e(e$1,"w","lnNumType");if(T){n.lineNumbers={};let m=l(T,"w","start");m!==void 0&&(n.lineNumbers.start=m);let C=l(T,"w","countBy");C!==void 0&&(n.lineNumbers.countBy=C);let E=l(T,"w","distance");E!==void 0&&(n.lineNumbers.distance=E);let y=j$1(T,"w","restart"),S=Ht(y);S&&(n.lineNumbers.restart=S);}let b=e(e$1,"w","pgBorders");if(b){n.pageBorders={};let m=ie(e(b,"w","top"));m&&(n.pageBorders.top=m);let C=ie(e(b,"w","bottom"));C&&(n.pageBorders.bottom=C);let E=ie(e(b,"w","left"));E&&(n.pageBorders.left=E);let y=ie(e(b,"w","right"));y&&(n.pageBorders.right=y);let S=j$1(b,"w","display");(S==="allPages"||S==="firstPage"||S==="notFirstPage")&&(n.pageBorders.display=S);let P=j$1(b,"w","offsetFrom");(P==="page"||P==="text")&&(n.pageBorders.offsetFrom=P);let B=j$1(b,"w","zOrder");(B==="front"||B==="back")&&(n.pageBorders.zOrder=B);}let w=e(e$1,"w","background");if(w){n.background={};let m=j$1(w,"w","color");m&&m!=="auto"&&(n.background.color={rgb:m});let C=j$1(w,"w","themeColor");C&&(n.background.themeColor=C);let E=j$1(w,"w","themeTint");E&&(n.background.themeTint=E);let y=j$1(w,"w","themeShade");y&&(n.background.themeShade=y);}let F=e(e$1,"w","footnotePr");if(F){let m=ze(F);Object.keys(m).length>0&&(n.footnotePr=m);}let H=e(e$1,"w","endnotePr");if(H){let m=Ue(H);Object.keys(m).length>0&&(n.endnotePr=m);}let M=e(e$1,"w","docGrid");if(M){n.docGrid={};let m=j$1(M,"w","type");(m==="default"||m==="lines"||m==="linesAndChars"||m==="snapToChars")&&(n.docGrid.type=m);let C=l(M,"w","linePitch");C!==void 0&&(n.docGrid.linePitch=C);let E=l(M,"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 C=l(x,"w","other");C!==void 0&&(n.paperSrcOther=C);}return n}function qe(){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 Ge(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 _e(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=Ge(r.headerReferences,o.headerReferences),u=Ge(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 Nt(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||!It(e.underline,t.underline)||!le(e.color,t.color)||!Lt(e.shading,t.shading)||!Xt(e.fontFamily,t.fontFamily))}function It(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:le(e.color,t.color)}function le(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 Lt(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!le(e.color,t.color)||!le(e.fill,t.fill))}function Xt(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 Dt(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function Ye(e){return e.content.length===0?true:e.content.every(Dt)}function Ot(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 Wt(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}Ye(n)&&Ye(o)&&Nt(n.formatting,o.formatting)?n={type:"run",formatting:n.formatting,content:Ot(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=Wt(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 $e(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 Vt(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 ue(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 k=j$1(f,"w","val");if(k){o.underline={style:k};let G=j$1(f,"w","color"),q=j$1(f,"w","themeColor");(G||q)&&(o.underline.color=$e(G,q,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 k=j$1(d,"w","val");(k==="superscript"||k==="subscript"||k==="baseline")&&(o.vertAlign=k);}let h=e(e$1,"w","smallCaps");h&&(o.smallCaps=m(h));let T=e(e$1,"w","caps");T&&(o.allCaps=m(T));let b=e(e$1,"w","vanish");b&&(o.hidden=m(b));let w=e(e$1,"w","color");w&&(o.color=$e(j$1(w,"w","val"),j$1(w,"w","themeColor"),j$1(w,"w","themeTint"),j$1(w,"w","themeShade")));let F=e(e$1,"w","highlight");if(F){let k=j$1(F,"w","val");k&&(o.highlight=k);}let H=e(e$1,"w","shd");H&&(o.shading=Vt(H));let M=e(e$1,"w","sz");if(M){let k=l(M,"w","val");k!==void 0&&(o.fontSize=k);}let x=e(e$1,"w","szCs");if(x){let k=l(x,"w","val");k!==void 0&&(o.fontSizeCs=k);}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 k=j$1(m$1,"w","asciiTheme");k&&(o.fontFamily.asciiTheme=k,t&&!o.fontFamily.ascii&&(o.fontFamily.ascii=Y(t,k)));let G=j$1(m$1,"w","hAnsiTheme");G&&(o.fontFamily.hAnsiTheme=G,t&&!o.fontFamily.hAnsi&&(o.fontFamily.hAnsi=Y(t,G)));let q=j$1(m$1,"w","eastAsiaTheme");q&&(o.fontFamily.eastAsiaTheme=q,t&&!o.fontFamily.eastAsia&&(o.fontFamily.eastAsia=Y(t,q)));let pe=j$1(m$1,"w","cstheme");pe&&(o.fontFamily.csTheme=pe,t&&!o.fontFamily.cs&&(o.fontFamily.cs=Y(t,pe)));}let C=e(e$1,"w","spacing");if(C){let k=l(C,"w","val");k!==void 0&&(o.spacing=k);}let E=e(e$1,"w","position");if(E){let k=l(E,"w","val");k!==void 0&&(o.position=k);}let y=e(e$1,"w","w");if(y){let k=l(y,"w","val");k!==void 0&&(o.scale=k);}let S=e(e$1,"w","kern");if(S){let k=l(S,"w","val");k!==void 0&&(o.kerning=k);}let P=e(e$1,"w","effect");if(P){let k=j$1(P,"w","val");k&&(o.effect=k);}let B=e(e$1,"w","em");if(B){let k=j$1(B,"w","val");k&&(o.emphasisMark=k);}let I=e(e$1,"w","emboss");I&&(o.emboss=m(I));let N=e(e$1,"w","imprint");N&&(o.imprint=m(N));let L=e(e$1,"w","outline");L&&(o.outline=m(L));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 k=j$1(xe,"w","val");k&&(o.styleId=k);}return Object.keys(o).length>0?o:void 0}function jt(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 zt(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:jt(a),previousFormatting:ue(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function Ut(e){let t=k(e),n=j$1(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function Gt(){return {type:"tab"}}function qt(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 _t(e){let t=j$1(e,"w","font")??"",n=j$1(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function Yt(e){return {type:"footnoteRef",id:l(e,"w","id")??0}}function $t(e){return {type:"endnoteRef",id:l(e,"w","id")??0}}function Zt(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 Kt(e){return {type:"instrText",text:k(e)}}function Ze(e,t,n){let o=z$1(e,t??void 0,n??void 0);return o?{type:"drawing",image:o}:null}function se(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Qt(e,t,n){let o=[],r=i(e);for(let a of r)switch(se(a.name)){case "t":o.push(Ut(a));break;case "tab":o.push(Gt());break;case "br":o.push(qt(a));break;case "sym":o.push(_t(a));break;case "footnoteReference":o.push(Yt(a));break;case "endnoteReference":o.push($t(a));break;case "fldChar":o.push(Zt(a));break;case "instrText":o.push(Kt(a));break;case "softHyphen":o.push({type:"softHyphen"});break;case "noBreakHyphen":o.push({type:"noBreakHyphen"});break;case "drawing":let l=Ze(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=>se(p.name)==="Choice")??i(a).find(p=>se(p.name)==="Fallback");if(c){for(let p of i(c))if(se(p.name)==="drawing"){let h=Ze(p,t,n);h?.image?.src&&o.push(h);}}break}}return o}function $(e$1,t,n,o=null,r=null){let a={type:"run",content:[]},u=e(e$1,"w","rPr");return u&&(a.formatting=ue(u,n),a.propertyChanges=zt(u,n,t,a.formatting)),a.content=Qt(e$1,o,r),a}function Jt(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 en(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 _(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=Jt(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 tn(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 nn(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 fe(e$1,t,n){if(!e$1)return;let o={},r=e(e$1,"w","jc");if(r){let y=j$1(r,"w","val");y&&(o.alignment=y);}let a=e(e$1,"w","bidi");a&&(o.bidi=m(a));let u=e(e$1,"w","spacing");if(u){let y=l(u,"w","before");y!==void 0&&(o.spaceBefore=y);let S=l(u,"w","after");S!==void 0&&(o.spaceAfter=S);let P=l(u,"w","line");P!==void 0&&(o.lineSpacing=P);let B={};y!==void 0&&(B.before=true),S!==void 0&&(B.after=true),(B.before||B.after)&&(o.spacingExplicit=B);let I=j$1(u,"w","lineRule");I&&(o.lineSpacingRule=I);let N=j$1(u,"w","beforeAutospacing");N&&(o.beforeAutospacing=N==="1"||N==="true");let L=j$1(u,"w","afterAutospacing");L&&(o.afterAutospacing=L==="1"||L==="true");}let l$1=e(e$1,"w","ind");if(l$1){let y=l(l$1,"w","left");y!==void 0&&(o.indentLeft=y);let S=l(l$1,"w","right");S!==void 0&&(o.indentRight=S);let P=l(l$1,"w","firstLine");P!==void 0&&(o.indentFirstLine=P);let B=l(l$1,"w","hanging");B!==void 0&&(o.indentFirstLine=-B,o.hangingIndent=true);let I=l(l$1,"w","start");I!==void 0&&o.indentLeft===void 0&&(o.indentLeft=I);let N=l(l$1,"w","end");N!==void 0&&o.indentRight===void 0&&(o.indentRight=N);}let f=e(e$1,"w","pBdr");if(f){let y={},S=_(e(f,"w","top"));S&&(y.top=S);let P=_(e(f,"w","bottom"));P&&(y.bottom=P);let B=_(e(f,"w","left"));B&&(y.left=B);let I=_(e(f,"w","right"));I&&(y.right=I);let N=_(e(f,"w","between"));N&&(y.between=N);let L=_(e(f,"w","bar"));L&&(y.bar=L),Object.keys(y).length>0&&(o.borders=y);}let c=e(e$1,"w","shd");c&&(o.shading=en(c));let p=e(e$1,"w","tabs");p&&(o.tabs=tn(p));let d=e(e$1,"w","keepNext");d&&(o.keepNext=m(d));let h=e(e$1,"w","keepLines");h&&(o.keepLines=m(h));let T=e(e$1,"w","widowControl");T&&(o.widowControl=m(T));let b=e(e$1,"w","pageBreakBefore");b&&(o.pageBreakBefore=m(b));let w=e(e$1,"w","contextualSpacing");w&&(o.contextualSpacing=m(w));let F=e(e$1,"w","numPr");if(F){let y=e(F,"w","numId"),S=e(F,"w","ilvl");if(y||S){if(o.numPr={},y){let P=l(y,"w","val");P!==void 0&&(o.numPr.numId=P);}if(S){let P=l(S,"w","val");P!==void 0&&(o.numPr.ilvl=P);}}}let H=e(e$1,"w","outlineLvl");if(H){let y=l(H,"w","val");y!==void 0&&(o.outlineLevel=y);}let M=e(e$1,"w","pStyle");if(M){let y=j$1(M,"w","val");y&&(o.styleId=y);}let x=e(e$1,"w","framePr");x&&(o.frame=nn(x));let m$1=e(e$1,"w","suppressLineNumbers");m$1&&(o.suppressLineNumbers=m(m$1));let C=e(e$1,"w","suppressAutoHyphens");C&&(o.suppressAutoHyphens=m(C));let E=e(e$1,"w","rPr");return E&&(o.runProperties=ue(E,t)),Object.keys(o).length>0?o:void 0}function on(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function rn(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 an(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function Ke(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 T=t.get(u);T&&(q(T),a.href=T.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 h=i(e);for(let T of h)switch(on(T.name)){case "r":a.children.push($(T,n,o,t,r));break;case "bookmarkStart":a.children.push(rn(T));break;case "bookmarkEnd":a.children.push(an(T));break}return a}function co(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 po(e){return e.href?/^https?:\/\/|^mailto:|^tel:|^ftp:/i.test(e.href):!!e.rId&&!e.anchor}function mo(e){return !!e.anchor}function go(e){return e.href}function ho(e){return e.children.some(t=>t.type==="run")}function wo(e){return e.children.filter(t=>t.type==="run")}function yo(e,t){if(e.rId){let n=t.get(e.rId);if(n)return q(n),e.href=n.target,e.href}return e.anchor&&!e.href&&(e.href=`#${e.anchor}`),e.href}function Qe(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 Je(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function ln(e$1){let t={sdtType:"richText"};if(!e$1||!e$1.elements)return t;for(let n of e$1.elements){if(n.type!=="element")continue;switch(n.name?.replace(/^w:/,"")??""){case "alias":t.alias=j$1(n,"w","val")??void 0;break;case "tag":t.tag=j$1(n,"w","val")??void 0;break;case "lock":t.lock=j$1(n,"w","val")??"unlocked";break;case "placeholder":{let r=e(n,"w","docPart");if(r){let a=e(r,"w","val");t.placeholder=a?j$1(a,"w","val")??void 0:void 0;}break}case "showingPlcHdr":t.showingPlaceholder=true;break;case "text":t.sdtType="plainText";break;case "date":t.sdtType="date",t.dateFormat=j$1(n,"w","fullDate")??void 0;break;case "dropDownList":t.sdtType="dropdown",t.listItems=et(n);break;case "comboBox":t.sdtType="comboBox",t.listItems=et(n);break;case "checkbox":{t.sdtType="checkbox";let r=e(n,"w14","checked")??e(n,"w","checked");t.checked=r?j$1(r,"w14","val")==="1"||j$1(r,"w","val")==="1":false;break}case "picture":t.sdtType="picture";break;case "docPartObj":t.sdtType="buildingBlockGallery";break;case "group":t.sdtType="group";break}}return t}function et(e){let t=[];for(let n of e.elements??[])n.type==="element"&&(n.name==="w:listItem"||n.name?.endsWith(":listItem"))&&t.push({displayText:j$1(n,"w","displayText")??"",value:j$1(n,"w","value")??""});return t}function nt(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+=nt(n);return t}function K(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function ot(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=K(f.name);if(!n.has(c)){if(c==="lastRenderedPageBreak"){r=true;continue}if(c==="r"){for(let p of i(f)){let d=K(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 tt(e,t){if(!e)return `w:${t}`;let n=e.indexOf(":");return n<0?t:`${e.substring(0,n+1)}${t}`}function rt(e){if(e.type!=="element")return e;let t=K(e.name),n=e.name;return t==="delText"?n=tt(e.name,"t"):t==="delInstrText"&&(n=tt(e.name,"instrText")),{...e,name:n,elements:e.elements?.map(rt)}}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 sn(e){let t=Z(e),n=(j$1(e,"w","rsid")??"").trim();return n.length>0?{...t,rsid:n}:t}function it(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:sn(a),previousFormatting:fe(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function un(e,t,n,o,r){return Ke(e,t,n,o,r)}function fn(e){return Qe(e)}function cn(e){return Je(e)}function at(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 pn(e,t,n,o,r){let a=j$1(e,"w","instr")??"",u=at(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)K(d.name)==="r"&&l.content.push($(d,t,n,o,r));return l}function U(e,t,n,o,r,a,u="default"){let l=[],f=i(e),c=false,p="",d=[],h=[],T=false,b$1=false,w=false;for(let F of f){let H=K(F.name);switch(H){case "r":{let M=u==="deletion"?rt(F):F,x=$(M,t,n,r,a),m=false,C=false,E=false,y="";for(let S of x.content)S.type==="fieldChar"?S.charType==="begin"?(m=true,S.fldLock&&(b$1=true),S.dirty&&(w=true)):S.charType==="separate"?C=true:S.charType==="end"&&(E=true):S.type==="instrText"&&(y+=S.text);if(m&&(c=true,T=false,p="",d=[],h=[],b$1=false,w=false),c){if(y&&(p+=y),C&&(T=true),T&&!E?C||h.push(x):!T&&!m&&d.push(x),E){let S={type:"complexField",instruction:p.trim(),fieldType:at(p),fieldCode:d,fieldResult:h};b$1&&(S.fldLock=true),w&&(S.dirty=true),l.push(S),c=false;}}else l.push(x);break}case "hyperlink":l.push(un(F,r,t,n,a));break;case "bookmarkStart":l.push(fn(F));break;case "bookmarkEnd":l.push(cn(F));break;case "fldSimple":l.push(pn(F,t,n,r,a));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let M=(F.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtPr"||m.name?.endsWith(":sdtPr"))),x=(F.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(x){let m=U(x,t,n,null,r,a,u),E={type:"inlineSdt",properties:ln(M??null),content:m.filter(y=>y.type==="run"||y.type==="hyperlink"||y.type==="simpleField"||y.type==="complexField"||y.type==="inlineSdt"||y.type==="mathEquation")};l.push(E);}break}case "ins":{let M=Z(F),x=U(F,t,n,null,r,a),m={type:"insertion",info:M,content:x.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "del":{let M=Z(F),x=U(F,t,n,null,r,a,"deletion"),m={type:"deletion",info:M,content:x.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "moveFrom":{let M=Z(F),x=U(F,t,n,null,r,a,"deletion"),m={type:"moveFrom",info:M,content:x.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "moveTo":{let M=Z(F),x=U(F,t,n,null,r,a),m={type:"moveTo",info:M,content:x.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "smartTag":break;case "moveFromRangeStart":{let M=parseInt(j$1(F,"w","id")??"0",10),x=j$1(F,"w","name")??"";l.push({type:"moveFromRangeStart",id:M,name:x});break}case "moveFromRangeEnd":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"moveFromRangeEnd",id:M});break}case "moveToRangeStart":{let M=parseInt(j$1(F,"w","id")??"0",10),x=j$1(F,"w","name")??"";l.push({type:"moveToRangeStart",id:M,name:x});break}case "moveToRangeEnd":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"moveToRangeEnd",id:M});break}case "commentRangeStart":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"commentRangeStart",id:M});break}case "commentRangeEnd":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"commentRangeEnd",id:M});break}case "oMath":case "oMathPara":{let M=H==="oMathPara",x=b(F),m=nt(F),C={type:"mathEquation",display:M?"block":"inline",ommlXml:x,plainText:m||void 0};l.push(C);break}}}return l}function ce(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 D(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&&ot(e$1)&&(l.renderedPageBreakBefore=true);let p=e(e$1,"w","pPr");if(p){l.formatting=fe(p,n),l.propertyChanges=it(p,n,t,l.formatting);let T=e(p,"w","sectPr");T&&(l.sectionProperties=ae(T));}let d=U(e$1,t,n,o,r,a);l.content=be(d);let h=l.formatting?.numPr;if(!h&&l.formatting?.styleId&&t){let T=t.get(l.formatting.styleId);T?.pPr?.numPr&&(h=T.pPr.numPr,l.formatting||(l.formatting={}),l.formatting.numPr=h);}if(h&&o){let{numId:T,ilvl:b=0}=h;if(T!==void 0&&T!==0){let w=o.getLevel(T,b);if(w){let F=[];for(let x=0;x<=b;x+=1){let m=o.getLevel(T,x);F.push(m?.numFmt??"decimal");}let H=o.getInstance(T),M=H?.levelOverrides?.find(x=>x.ilvl===b);if(l.listRendering={level:b,numId:T,marker:w.lvlText,isBullet:w.numFmt==="bullet",numFmt:w.numFmt,markerHidden:w.rPr?.hidden||void 0,markerFontFamily:w.rPr?.fontFamily?.ascii||w.rPr?.fontFamily?.hAnsi||void 0,markerFontSize:w.rPr?.fontSize?w.rPr.fontSize/2:void 0,levelNumFmts:F,abstractNumId:H?.abstractNumId,startOverride:M?.startOverride},w.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),C=x!=null&&(j$1(x,"w","firstLine")!==null||j$1(x,"w","hanging")!==null);!m&&w.pPr.indentLeft!==void 0&&(l.formatting.indentLeft=w.pPr.indentLeft),C||(w.pPr.indentFirstLine!==void 0&&(l.formatting.indentFirstLine=w.pPr.indentFirstLine),w.pPr.hangingIndent!==void 0&&(l.formatting.hangingIndent=w.pPr.hangingIndent));}}}}return l}function lt(e$1){if(!e$1)return;let t={},n=X(e(e$1,"w","tblW"));n&&(t.width=n);let o=e(e$1,"w","jc");if(o){let w=j$1(o,"w","val");(w==="left"||w==="center"||w==="right"||w==="start")&&(t.justification=w==="start"?"left":w);}let r=X(e(e$1,"w","tblCellSpacing"));r&&(t.cellSpacing=r);let a=X(e(e$1,"w","tblInd"));a&&(t.indent=a);let u=ee(e(e$1,"w","tblBorders"));u&&(t.borders=u);let l=te(e(e$1,"w","tblCellMar"));l&&(t.cellMargins=l);let f=e(e$1,"w","tblLayout");if(f){let w=j$1(f,"w","type");(w==="fixed"||w==="autofit")&&(t.layout=w);}let c=e(e$1,"w","tblStyle");if(c){let w=j$1(c,"w","val");w&&(t.styleId=w);}let p=he(e(e$1,"w","tblLook"));p&&(t.look=p);let d=ne(e(e$1,"w","shd"));d&&(t.shading=d);let h=e(e$1,"w","tblOverlap");if(h){let w=j$1(h,"w","val");(w==="never"||w==="overlap")&&(t.overlap=w);}let T=we(e(e$1,"w","tblpPr"));if(T&&(t.floating=T),m(e(e$1,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function dn(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:J(o),previousFormatting:lt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function mn(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:J(o),previousFormatting:st(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function gn(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:J(o),previousFormatting:ft(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function hn(e$1){if(!e$1)return;let t=e(e$1,"w","ins");if(t)return {type:"tableRowInsertion",info:j(t)};let n=e(e$1,"w","del");if(n)return {type:"tableRowDeletion",info:j(n)}}function wn(e$1){if(!e$1)return;let t=e(e$1,"w","cellIns");if(t)return {type:"tableCellInsertion",info:j(t)};let n=e(e$1,"w","cellDel");if(n)return {type:"tableCellDeletion",info:j(n)};let o=e(e$1,"w","cellMerge");if(o)return {type:"tableCellMerge",info:j(o)}}function st(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=ut(e(e$1,"w","cnfStyle"));if(l$1&&(t.conditionalFormat=l$1),Object.keys(t).length!==0)return t}function ut(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 h=j$1(e,"w","lastRowFirstColumn");(h==="1"||h==="true")&&(t.swCell=true);let T=j$1(e,"w","lastRowLastColumn");(T==="1"||T==="true")&&(t.seCell=true);let b=j$1(e,"w","val");if(b&&b.length===12&&(b[0]==="1"&&(t.firstRow=true),b[1]==="1"&&(t.lastRow=true),b[2]==="1"&&(t.firstColumn=true),b[3]==="1"&&(t.lastColumn=true),b[4]==="1"&&(t.oddVBand=true),b[5]==="1"&&(t.evenVBand=true),b[6]==="1"&&(t.oddHBand=true),b[7]==="1"&&(t.evenHBand=true),b[8]==="1"&&(t.nwCell=true),b[9]==="1"&&(t.neCell=true),b[10]==="1"&&(t.swCell=true),b[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function ft(e$1){if(!e$1)return;let t={},n=X(e(e$1,"w","tcW"));n&&(t.width=n);let o=ee(e(e$1,"w","tcBorders"));o&&(t.borders=o);let r=te(e(e$1,"w","tcMar"));r&&(t.margins=r);let a=ne(e(e$1,"w","shd"));a&&(t.shading=a);let u=e(e$1,"w","vAlign");if(u){let b=j$1(u,"w","val");(b==="top"||b==="center"||b==="bottom")&&(t.verticalAlign=b);}let l$1=e(e$1,"w","textDirection");if(l$1){let b=j$1(l$1,"w","val");b&&(t.textDirection=b);}let f=e(e$1,"w","gridSpan");if(f){let b=l(f,"w","val");b!==void 0&&b>1&&(t.gridSpan=b);}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 T=ut(e(e$1,"w","cnfStyle"));if(T&&(t.conditionalFormat=T),Object.keys(t).length!==0)return t}function yn(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=D(c,t,n,o,r,a,u);l.push(d);}else if(p==="tbl"){let d=z(c,t,n,o,r,a,u);l.push(d);}}return l.length===0&&l.push({type:"paragraph",content:[]}),l}function bn(e$1,t,n,o,r,a,u){let l={type:"tableCell",content:[]},f=e(e$1,"w","tcPr"),c=ft(f);return c&&(l.formatting=c),l.propertyChanges=gn(f,c),l.structuralChange=wn(f),l.content=yn(e$1,t,n,o,r,a,u),l}function Tn(e$1,t,n,o,r,a,u){let l={type:"tableRow",cells:[]},f$1=e(e$1,"w","trPr"),c=st(f$1);c&&(l.formatting=c),l.propertyChanges=mn(f$1,c),l.structuralChange=hn(f$1);let p=f(e$1,"w","tc");for(let d of p){let h=bn(d,t,n,o,r,a,u);l.cells.push(h);}return l}function Cn(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 Fn(e){return e.cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function xn(e){let t=Math.max(e.columnWidths?.length??0,...e.rows.map(n=>Fn(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 z(e$1,t,n,o,r,a,u){let l={type:"table",rows:[]},f$1=e(e$1,"w","tblPr"),c=lt(f$1);c&&(l.formatting=c),l.propertyChanges=dn(f$1,c);let p=Cn(e(e$1,"w","tblGrid"));p&&(l.columnWidths=p);let d=f(e$1,"w","tr");for(let h of d){let T=Tn(h,t,n,o,r,a,u);l.rows.push(T);}return xn(l),l}function Sn(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0),n={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:"-"};return n[t]?n[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function kn(e){let t=e.listRendering;t&&t.isBullet&&(t.marker=Sn(t.marker||""));}var ct=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function pt(e){let t=[],n;for(ct.lastIndex=0;(n=ct.exec(e))!==null;){let o=n[1].trim();o&&!t.includes(o)&&t.push(o);}return t}function nr(e){let t=[];for(let n of e)if(n.type==="paragraph"){let o=ce(n),r=pt(o);for(let a of r)t.includes(a)||t.push(a);}else if(n.type==="table"){let o=dt(n);for(let r of o)t.includes(r)||t.push(r);}return t}function dt(e){let t=[];for(let n of e.rows)for(let o of n.cells)for(let r of o.content)if(r.type==="paragraph"){let a=ce(r),u=pt(a);for(let l of u)t.includes(l)||t.push(l);}else if(r.type==="table"){let a=dt(r);for(let u of a)t.includes(u)||t.push(u);}return t}function Mn(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 h$1=n(p,"wps","wsp");if(h$1){let F=k$1(h$1);F&&(d.content=g(F,D,null,n$1,o,r,a??void 0,u??void 0));}let T={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&&(T.id=d.id);let b={type:"shape",shape:T},w=f;if(w>=e.content.length){w=-1;for(let F=e.content.length-1;F>=0;F--)if(e.content[F].type==="run"){w=F;break}}if(w>=0){let F=e.content[w];F.type==="run"&&F.content.push(b);}}for(let p of l){if(d(p.name??"")!=="r")continue;let d$1=i(p);for(let h of d$1){let T=d(h.name??"");if(T==="drawing")c(h);else if(T==="AlternateContent"){let b=i(h),F=b.find(H=>d(H.name??"")==="Choice")??b.find(H=>d(H.name??"")==="Fallback");if(F)for(let H of i(F))d(H.name??"")==="drawing"&&c(H);}}f++;}}function mt(e,t,n,o,r,a){let u=[],l=i(e);for(let f of l){let c=f.name??"";if(c==="w:p"||c.endsWith(":p")){let p=D(f,t,n,o,r,a);Mn(p,f,t,n,o,r,a),kn(p),u.push(p);}else if(c==="w:tbl"||c.endsWith(":tbl")){let p=z(f,t,n,o,r,a);u.push(p);}else if(c==="w:sdt"||c.endsWith(":sdt")){let p=(f.elements??[]).find(d=>d.type==="element"&&(d.name==="w:sdtContent"||d.name?.endsWith(":sdtContent")));if(p){let d=mt(p,t,n,o,r,a);u.push(...d);}}}return u}function Rn(e,t){let n=[],o=[];for(let r of e)o.push(r),r.type==="paragraph"&&r.sectionProperties&&(n.push({properties:r.sectionProperties,content:o}),o=[]);return (o.length>0||n.length===0)&&n.push({properties:t??qe(),content:o}),n}function or(e$1,t=null,n=null,o=null,r=null,a$1=null){let u={content:[]};if(!e$1)return u;let l=a(e$1);if(!l)return u;let f=(l.elements??[]).find(h=>h.type==="element"&&(h.name==="w:document"||h.name?.endsWith(":document")));if(!f)return u;let c=e(f,"w","body");if(!c)return u;u.content=mt(c,t,n,o,r,a$1);let p=e(c,"w","sectPr");p&&(u.finalSectionProperties=ae(p));let d=Rn(u.content,u.finalSectionProperties);return u.sections=_e(d),u.finalSectionProperties&&u.sections.length>0&&(u.finalSectionProperties=u.sections[u.sections.length-1].properties),u}export{Ke as A,co as B,po as C,mo as D,go as E,ho as F,wo as G,yo as H,D as I,Sn as J,nr as K,or as L,Pn as a,Y as b,Ie as c,V as d,ee as e,te as f,ne as g,he as h,we as i,Tt as j,Ct as k,Ft as l,xt as m,St as n,lt as o,Xn as p,Dn as q,zn as r,Un as s,ze as t,Ue as u,Gn as v,qn as w,_n as x,Yn as y,$ as z};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-AMENZY5F.mjs';var Ut=1440,G=96,ct=Ut/G,ft=11,ht="Calibri",Yt=1,Xt=.8,jt=.2,I=null;function Z(){if(!I){let t=typeof document<"u"?document.createElement("canvas"):null;if(!t)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(I=t.getContext("2d"),!I)throw new Error("Failed to get 2D context from canvas")}return I}function Gt(){I=null;}var lt=new Map;function gt(t){let e=lt.get(t);if(e===void 0){let n=a(t);e={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},lt.set(t,e);}return e}function Kt(t){return gt(t).cssFallback}function B(t){let e=[];t.italic&&e.push("italic"),t.bold&&e.push("bold");let n=t.fontSize??ft,i=L(n);e.push(`${i}px`);let r=t.fontFamily??ht;return e.push(Kt(r)),e.join(" ")}function H(t){let e=t.fontSize??ft,n=t.fontFamily??ht,i=L(e),r=i*Xt,o=i*jt,g=i*Yt;try{let m=Z();m.font=B(t);let d=m.measureText("Hg");typeof d.actualBoundingBoxAscent=="number"&&typeof d.actualBoundingBoxDescent=="number"&&(r=d.actualBoundingBoxAscent,o=d.actualBoundingBoxDescent);}catch{}g=Math.max(g,r+o);let h=gt(n).singleLineRatio;return {fontSize:e,ascent:r,descent:o,lineHeight:g,fontFamily:n,singleLineRatio:h}}function C(t,e){if(!t)return 0;let n=Z();n.font=B(e);let r=n.measureText(t).width;return e.letterSpacing&&t.length>1&&(r+=e.letterSpacing*(t.length-1)),r}function qt(t,e){let n=C(t,e),i=H(e);return {width:n,height:i.ascent+i.descent,ascent:i.ascent,descent:i.descent}}function K(t,e){let n=H(e);if(!t)return {width:0,charWidths:[],metrics:n};let i=Z();i.font=B(e);let r=e.letterSpacing??0,o=[],g=0;for(let h=0;h<t.length;h++){let m=t[h],y=i.measureText(m).width;r&&h<t.length-1&&(y+=r),o.push(y),g+=y;}return {width:g,charWidths:o,metrics:n}}function Jt(t,e){if(e.length===0||t<=0)return 0;let n=0;for(let i=0;i<e.length;i++){let r=e[i],o=n+r/2;if(t<=o)return i;n+=r;}return e.length}function Qt(t,e){if(t<=0||e.length===0)return 0;let n=Math.min(t,e.length),i=0;for(let r=0;r<n;r++)i+=e[r];return i}function q(t){return t/ct}function Vt(t){return Math.round(t*ct)}function L(t){return t*G/72}function mt(t){return t*72/G}function te(t){return L(t/2)}function ee(t){return mt(t)*2}function ne(t,e){return t.map(n=>{let i=n.x-n.distLeft,r=n.x+n.width+n.distRight,o=n.y-n.distTop,g=n.y+n.height+n.distBottom,h=0,m=0,d,y=n.wrapText??"bothSides";y==="right"?h=J(r):y==="left"?m=Q(i,e):y==="largest"?{leftMargin:h,rightMargin:m}=oe(i,r,e):re(i,r,e)?d=ae(i,r,e):n.side==="left"?h=J(r):m=Q(i,e);let _=tt(h,m,e);return {leftMargin:_.leftMargin,rightMargin:_.rightMargin,topY:o,bottomY:g,segments:d}})}function V(t,e){return t.segments?.reduce((i,r)=>i+r.availableWidth,0)??e-t.leftMargin-t.rightMargin}function $(t,e,n,i){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let r=0,o=0,g,h=i+t,m=h+e;for(let d of n)if(!(m<=d.topY||h>=d.bottomY)){if(d.segments?.length){g=g?ie(g,d.segments):d.segments;continue}r=Math.max(r,d.leftMargin),o=Math.max(o,d.rightMargin);}return {leftMargin:r,rightMargin:o,segments:g}}function ie(t,e){let n=[];for(let i of t)for(let r of e){let o=Math.max(i.leftOffset,r.leftOffset),g=Math.min(i.leftOffset+i.availableWidth,r.leftOffset+r.availableWidth);g>o&&n.push({leftOffset:o,availableWidth:g-o});}return n}function re(t,e,n){return t>0&&e<n}function ae(t,e,n){return [{leftOffset:0,availableWidth:Math.max(0,t)},{leftOffset:Math.max(0,e),availableWidth:Math.max(0,n-e)}].filter(i=>i.availableWidth>1)}function oe(t,e,n){let i=Math.max(0,t);return Math.max(0,n-e)>=i?{leftMargin:J(e),rightMargin:0}:{leftMargin:0,rightMargin:Q(t,n)}}function J(t){return Math.max(0,t)}function Q(t,e){return Math.max(0,e-t)}var R=11,O="Calibri",se=1.15,N=1,E=.5;function ue(t,e){if(e&&e.length>0)for(let i of e){let r=q(i.pos);if(r>t+.5)return Math.max(1,r-t)}let n=t%et;return Math.max(1,n<.5?et:et-n)}function dt(t,e,n,i=false){let r=1,o=t.length,g=0;for(;r<=o;){let h=r+o>>>1;C(t.slice(0,h),e)<=n?(g=h,r=h+1):o=h-1;}return i&&g===0?1:g}function z(t){return {fontFamily:t.fontFamily??O,fontSize:t.fontSize??R,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function bt(t,e,n){let i=L(t),r=n?.ascent??i*.8,o=n?.descent??i*.2,g=n?.singleLineRatio??1.15,h=i*g,m;if(e?.lineRule==="exact"&&e.line!==void 0)m=e.line;else if(e?.lineRule==="atLeast"&&e.line!==void 0){let d=h*N;m=Math.max(e.line,d);}else e?.line!==void 0&&e?.lineUnit==="multiplier"?m=h*e.line:e?.line!==void 0&&e?.lineUnit==="px"?m=e.line:m=h*N;return {ascent:r,descent:o,lineHeight:m}}function pt(t,e,n){let i=H({fontSize:t,fontFamily:n??O}),r=bt(t,e,i),o=e?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let g=L(t),h=Math.max(r.lineHeight,g*se);if(h!==r.lineHeight)return {...r,lineHeight:h}}return r}function D(t){return t.kind==="text"}function xt(t){return t.kind==="tab"}function Ft(t){return t.kind==="image"}function Mt(t){return t.kind==="lineBreak"}function Tt(t){return t.kind==="field"}function le(t){return !t.text||t.text.replace(/\u00a0/g," ").trim().length===0}function ce(t,e){let n=0;for(let i=e+1;i<t.length;i++){let r=t[i];if(xt(r)||Mt(r))break;if(D(r))n+=C(r.text||"",z(r));else if(Tt(r)){let o={fontFamily:r.fontFamily??O,fontSize:r.fontSize??R,bold:r.bold,italic:r.italic};n+=C(r.fallback||"1",o);}else Ft(r)&&(n+=r.width||0);}return n}function fe(t){let e=[];for(let n=0;n<t.length;n++){let i=t[n];(i===" "||i==="-"||i===" ")&&e.push(n+1);}return e}var et=48;function tt(t,e,n){let i=Math.max(1,n),r=Math.max(0,t),o=Math.max(0,e);return r>=i||o>=i||r+o>=i?{leftMargin:0,rightMargin:0}:{leftMargin:r,rightMargin:o}}function Ct(t,e,n){let i=t.runs,r=t.attrs,o=r?.spacing,g=n?.floatingZones,h=n?.paragraphYOffset??0,m=r?.indent,d=m?.left??0,y=m?.right??0,_=(m?.firstLine??0)-(m?.hanging??0),it=Math.max(1,e-d-y),_t=Math.max(1,it-_),rt=0,At=L(R)*N,A=$(0,At,g,h),Zt=Math.max(1,V(A,_t)),T=[];if(i.length===0){if(r?.suppressEmptyParagraphHeight)return T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:T,totalHeight:0};let s=r?.defaultFontSize??R,u=r?.defaultFontFamily??O,c=pt(s,o,u);T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...c});let l=c.lineHeight;return o?.before&&(l+=o.before),o?.after&&(l+=o.after),{kind:"paragraph",lines:T,totalHeight:l}}if(i.length===1&&D(i[0])&&le(i[0])){let s=i[0],u=s.fontSize??r?.defaultFontSize??R,c=s.fontFamily??r?.defaultFontFamily??O,l=pt(u,o,c);T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...l});let f=l.lineHeight;return o?.before&&(f+=o.before),o?.after&&(f+=o.after),{kind:"paragraph",lines:T,totalHeight:f}}let a={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:R,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:Zt,leftOffset:A.leftMargin,rightOffset:A.rightMargin,segmentZones:A.segments},at=()=>{let s=bt(a.maxFontSize,o,a.maxFontMetrics),u={...s};if(a.maxImageHeightPx>u.lineHeight){let l=a.maxImageHeightPx,f=u.descent;u.lineHeight=l+f*2,u.ascent=l+f;}let c={fromRun:a.fromRun,fromChar:a.fromChar,toRun:a.toRun,toChar:a.toChar,width:a.width,...u};a.leftOffset>0&&(c.leftOffset=a.leftOffset),a.rightOffset>0&&(c.rightOffset=a.rightOffset),a.segmentZones?.length&&(c.segments=Bt(c,a.segmentZones)),T.push(c),rt+=s.lineHeight;},Bt=(s,u)=>{let c=u[0],l=u[1];if(!c)return;if(!l||s.width<=c.availableWidth+E)return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:s.toChar,width:s.width,leftOffset:c.leftOffset,availableWidth:c.availableWidth}];if(s.fromRun!==s.toRun)return;let f=i[s.fromRun];if(!f||!D(f))return;let M=f,p=M.text.slice(s.fromChar,s.toChar),b=z(M),x=dt(p,b,c.availableWidth);if(x<=0||x>=p.length)return;let k=s.fromChar+x,F=p.slice(0,x),Y=p.slice(x);return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:k,width:C(F,b),leftOffset:c.leftOffset,availableWidth:c.availableWidth},{fromRun:s.fromRun,fromChar:k,toRun:s.toRun,toChar:s.toChar,width:C(Y,b),leftOffset:l.leftOffset,availableWidth:l.availableWidth}]},S=(s,u)=>{at();let c=L(R)*N,l=$(rt,c,g,h),f=Math.max(1,V(l,it));a={fromRun:s,fromChar:u,toRun:s,toChar:u,width:0,maxFontSize:R,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:f,leftOffset:l.leftMargin,rightOffset:l.rightMargin,segmentZones:l.segments};},W=s=>{let u=s.fontSize??R;(!a.maxFontMetrics||u>a.maxFontSize)&&(a.maxFontSize=u,a.maxFontMetrics=H(s));};for(let s=0;s<i.length;s++){let u=i[s];if(Mt(u)){a.toRun=s,a.toChar=0,S(s+1,0);continue}if(xt(u)){let c=z(u);W(c);let l=r?.tabs,f=a.width+(a.leftOffset??0),M=ue(f,l);if(f+M>a.availableWidth+E){let p=ce(i,s),b=a.availableWidth-f-p;b>1&&(M=b);}a.width+M>a.availableWidth+E&&(S(s,0),W(c)),a.width+=M,a.toRun=s,a.toChar=1;continue}if(Ft(u)){let c$1=u.wrapType,l=u.displayMode==="float"||c(c$1);if(u.position&&l){a.toRun=s,a.toChar=1;continue}if(c$1==="topAndBottom"||u.displayMode==="block"){a.width>0&&S(s,0);let p=u.height,b=u.distTop??6,x=u.distBottom??6;a.toRun=s,a.toChar=1,a.maxImageHeightPx=p+b+x,S(s+1,0);continue}let f=u.width,M=u.height;M>a.maxImageHeightPx&&(a.maxImageHeightPx=M),a.width+f>a.availableWidth+E&&S(s,0),a.width+=f,a.toRun=s,a.toChar=1;continue}if(Tt(u)){let c=u.fallback||"1",l={fontFamily:u.fontFamily??O,fontSize:u.fontSize??R,bold:u.bold,italic:u.italic};W(l);let f=C(c,l);a.width>0&&a.width+f>a.availableWidth+E&&(S(s,0),W(l)),a.width+=f,a.toRun=s,a.toChar=1;continue}if(D(u)){let c=u,l=c.text,f=z(c);if(W(f),!l||l.length===0){a.toRun=s,a.toChar=0;continue}let M=fe(l),p=0;for(;p<l.length;){let b=l.length;for(let F of M)if(F>p){b=F;break}let x=l.slice(p,b),k=C(x,f);if(k>a.availableWidth+E){let F=0;for(;F<x.length;){let Y=a.availableWidth-a.width+E,$t=x.slice(F),X=dt($t,f,Y);if(X===0){if(a.width>0){S(s,p+F),W(f);continue}X=1;}let j=F+X,Dt=x.slice(F,j),Nt=C(Dt,f);a.width+=Nt,a.toRun=s,a.toChar=p+j,F=j,F<x.length&&(S(s,p+F),W(f));}p=b;continue}a.width>0&&a.width+k>a.availableWidth+E&&(S(s,p),W(f)),a.width+=k,a.toRun=s,a.toChar=b,p=b;}}}at();let ot=T.reduce((s,u)=>s+u.lineHeight,0);r?.listMarker&&!r?.listMarkerHidden&&(m?.hanging??0)===0&&T.length>0&&(ot+=T[0].lineHeight);let U=ot;return o?.before&&(U+=o.before),o?.after&&(U+=o.after),{kind:"paragraph",lines:T,totalHeight:U}}function he(t,e){return t.map(n=>Ct(n,e))}function ge(t){let e=z(t);return K(t.text,e).charWidths}var Rt=2e4,P=new Map;function yt(t,e,n){return `${t}|${e}|${n||0}`}function St(){for(;P.size>Rt;){let t=P.keys().next().value;if(t===void 0)break;P.delete(t);}}function me(t,e,n=0){let i=yt(t,e,n),r=P.get(i);if(r!==void 0)return P.delete(i),P.set(i,r),r.width}function de(t,e,n,i){let r=yt(t,e,n);P.set(r,{width:i}),St();}function Lt(){P.clear();}function pe(t){!Number.isFinite(t)||t<=0||(Rt=t,St());}function Pt(){return P.size}var be=1e3,wt=be,w=new Map;function vt(t,e,n=false,i=false){return `${t}|${e}|${n}|${i}`}function Wt(){for(;w.size>wt;){let t=w.keys().next().value;if(t===void 0)break;w.delete(t);}}function xe(t,e,n=false,i=false){let r=vt(t,e,n,i),o=w.get(r);if(o!==void 0)return w.delete(r),w.set(r,o),o}function Fe(t,e,n,i,r){let o=vt(t,e,n,i);w.set(o,r),Wt();}function Et(){w.clear();}function Me(t){!Number.isFinite(t)||t<=0||(wt=t,Wt());}function kt(){return w.size}var Te=5e3,Ht=Te,v=new Map;function nt(t){let e=[];for(let i of t.runs)i.kind==="text"?e.push(`t:${i.text}|${i.fontFamily}|${i.fontSize}|${i.bold}|${i.italic}`):i.kind==="tab"?e.push(`tab:${i.width}`):i.kind==="image"?e.push(`img:${i.width}x${i.height}`):i.kind==="lineBreak"&&e.push("br");let n=t.attrs;if(n){n.alignment&&e.push(`align:${n.alignment}`),n.indent&&e.push(`indent:${n.indent.left}|${n.indent.right}|${n.indent.firstLine}|${n.indent.hanging}`),n.spacing&&e.push(`spacing:${n.spacing.before}|${n.spacing.after}|${n.spacing.line}|${n.spacing.lineRule}`),n.defaultFontSize!=null&&e.push(`dfs:${n.defaultFontSize}`),n.defaultFontFamily!=null&&e.push(`dff:${n.defaultFontFamily}`);let i=n.borders;if(i){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";e.push(`bdr:${r(i.top)}|${r(i.bottom)}|${r(i.left)}|${r(i.right)}`);}n.suppressEmptyParagraphHeight&&e.push("sup");}return e.join("||")}function Ot(){for(;v.size>Ht;){let t=v.keys().next().value;if(t===void 0)break;v.delete(t);}}function Ce(t,e){let n=nt(t),i=v.get(n);if(i!==void 0&&i.maxWidth===e)return v.delete(n),v.set(n,i),i.measure}function Re(t,e,n){let i=nt(t);v.set(i,{measure:n,maxWidth:e}),Ot();}function It(){v.clear();}function ye(t){!Number.isFinite(t)||t<=0||(Ht=t,Ot());}function zt(){return v.size}function Se(){Lt(),Et(),It();}function Le(){return Pt()+kt()+zt()}export{xe as A,Fe as B,Et as C,Me as D,kt as E,nt as F,Ce as G,Re as H,It as I,ye as J,zt as K,Se as L,Le as M,Z as a,Gt as b,B as c,H as d,C as e,qt as f,K as g,Jt as h,Qt as i,q as j,Vt as k,L as l,mt as m,te as n,ee as o,ne as p,$ as q,tt as r,Ct as s,he as t,ge as u,me as v,de as w,Lt as x,pe as y,Pt as z};
@@ -1,10 +1,10 @@
1
- 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunk6ILFFGGS_js=require('./chunk-6ILFFGGS.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.
1
+ 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkC6GSFUV2_js=require('./chunk-C6GSFUV2.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 chunk6ILFFGGS_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.
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 chunkC6GSFUV2_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;
@@ -1,4 +1,4 @@
1
- import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f as f$1}from'./chunk-CGJ6S3AH.mjs';import {f}from'./chunk-VKTCTMIO.mjs';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.
1
+ import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f as f$1}from'./chunk-CGJ6S3AH.mjs';import {f}from'./chunk-R7RR6M4A.mjs';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=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.
@@ -0,0 +1 @@
1
+ 'use strict';var chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkDV6IEOP5_js=require('./chunk-DV6IEOP5.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function f(t){return t/1440*96}function x(t,i,r){if(!r||i<=r)return {width:t,height:i};let n=r/i;return {width:Math.round(t*n),height:r}}var z=0;function h(){return `block-${++z}`}function _(){z=0;}function E(t,i){let r={};for(let n of t)switch(n.type.name){case "bold":r.bold=true;break;case "italic":r.italic=true;break;case "underline":{let e=n.attrs;if(e.style||e.color){let s=e.color?chunkMJ5FQX7Q_js.a(e.color,i):void 0;r.underline={style:e.style,color:s};}else r.underline=true;break}case "strike":r.strike=true;break;case "textColor":{let e=n.attrs;(e.themeColor||e.rgb)&&(r.color=chunkMJ5FQX7Q_js.a({rgb:e.rgb,themeColor:e.themeColor,themeTint:e.themeTint,themeShade:e.themeShade},i));break}case "highlight":r.highlight=chunkMJ5FQX7Q_js.o(n.attrs.color);break;case "fontSize":{let e=n.attrs;r.fontSize=e.size/2;break}case "fontFamily":{let e=n.attrs;r.fontFamily=e.ascii||e.hAnsi;break}case "characterSpacing":{let e=n.attrs;e.spacing!=null&&e.spacing!==0&&(r.letterSpacing=f(e.spacing)),e.position!=null&&e.position!==0&&(r.positionPx=chunk4Q2IP5FW_js.j(e.position)),e.scale!=null&&e.scale!==100&&(r.horizontalScale=e.scale),e.kerning!=null&&e.kerning>0&&(r.kerningMinPt=chunk4Q2IP5FW_js.k(e.kerning));break}case "allCaps":r.allCaps=true;break;case "smallCaps":r.smallCaps=true;break;case "emboss":r.emboss=true;break;case "imprint":r.imprint=true;break;case "textShadow":r.textShadow=true;break;case "textOutline":r.textOutline=true;break;case "hidden":r.hidden=true;break;case "rtl":r.rtl=true;break;case "textEffect":{let e=n.attrs.effect;(e==="blinkBackground"||e==="lights"||e==="antsBlack"||e==="antsRed"||e==="shimmer"||e==="sparkle")&&(r.textEffect=e);break}case "emphasisMark":{let e=n.attrs.type;e==="dot"||e==="comma"||e==="circle"||e==="underDot"?r.emphasisMark=e:r.emphasisMark="dot";break}case "superscript":r.superscript=true;break;case "subscript":r.subscript=true;break;case "hyperlink":{let e=n.attrs;r.hyperlink={href:e.href,tooltip:e.tooltip};break}case "footnoteRef":{let e=n.attrs,s=typeof e.id=="string"?parseInt(e.id,10):e.id;e.noteType==="endnote"?r.endnoteRefId=s:r.footnoteRefId=s;break}case "comment":{let e=n.attrs.commentId;e&&(r.commentIds||(r.commentIds=[]),r.commentIds.push(e));break}case "insertion":r.isInsertion=true,r.changeAuthor=n.attrs.author,r.changeDate=n.attrs.date,r.changeRevisionId=n.attrs.revisionId;break;case "deletion":r.isDeletion=true,r.changeAuthor=n.attrs.author,r.changeDate=n.attrs.date,r.changeRevisionId=n.attrs.revisionId;break}return r}function U(t){let i=t.defaultTextFormatting;if(!i)return {};let r={};if(i.fontFamily){let n=i.fontFamily.ascii||i.fontFamily.hAnsi;n&&(r.fontFamily=n);}return i.fontSize!=null&&(r.fontSize=i.fontSize/2),r}function L(t,i,r){let n=[],e=i+1,s=r.theme,l=U(t.attrs),c=t.attrs.styleId,m=typeof c=="string"&&/^TOC\d*$/i.test(c);function p(d,o){if(d.isText&&d.text){let a=E(d.marks,s);m&&a.hyperlink&&(a.hyperlink={...a.hyperlink,noDefaultStyle:true},delete a.color,delete a.underline);let u={kind:"text",text:d.text,...l,...a,pmStart:o,pmEnd:o+d.nodeSize};n.push(u);}else if(d.type.name==="hardBreak")n.push({kind:"lineBreak",pmStart:o,pmEnd:o+d.nodeSize});else if(d.type.name==="tab"){let a=E(d.marks,s),u={kind:"tab",...l,...a,pmStart:o,pmEnd:o+d.nodeSize};n.push(u);}else if(d.type.name==="image"){let a=d.attrs,u=x(a.width||100,a.height||100,r.pageContentHeight),g={kind:"image",src:a.src,width:u.width,height:u.height,alt:a.alt,transform:a.transform,wrapType:a.wrapType,displayMode:a.displayMode,cssFloat:a.cssFloat,distTop:a.distTop,distBottom:a.distBottom,distLeft:a.distLeft,distRight:a.distRight,position:a.position,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity,pmStart:o,pmEnd:o+d.nodeSize};n.push(g);}else if(d.type.name==="field"){let a=d.attrs.fieldType,u=a==="PAGE"?"PAGE":a==="NUMPAGES"?"NUMPAGES":a==="DATE"?"DATE":a==="TIME"?"TIME":"OTHER";n.push({kind:"field",fieldType:u,fallback:d.attrs.displayText||"",pmStart:o,pmEnd:o+d.nodeSize});}else if(d.type.name==="math"){let a=d.attrs.plainText||"[equation]";n.push({kind:"text",text:a,italic:true,fontFamily:"Cambria Math",pmStart:o,pmEnd:o+d.nodeSize});}else if(d.type.name==="sdt"){let a=o+1;d.forEach((u,g)=>{p(u,a+g);});}}return t.forEach((d,o)=>{p(d,e+o);}),n}function $(t){return Math.max(1,Math.round(t/8*1.333))}var Y={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",wave:"solid",doubleWave:"double",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function S(t,i){if(!t||!t.style||t.style==="none"||t.style==="nil")return;let r={style:Y[t.style]||"solid",width:$(t.size??0),color:t.color?chunkMJ5FQX7Q_js.a(t.color,i):"#000000"};return t.space!==void 0&&(r.space=chunk4Q2IP5FW_js.i(t.space)),r}function N(t,i){let r=t.borders;if(!r)return;let n={},e=["top","bottom","left","right"];for(let s of e){let l=r[s],c=l?S(l,i):void 0;n[s]=c??{width:0,style:"none"};}return Object.keys(n).length>0?n:void 0}function G(t,i){let r=[];for(let n=0;n<=i;n+=1){let e=t[n]??0;if(e<=0)break;r.push(e);}return r.length===0?"1.":`${r.join(".")}.`}var j=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function O(t,i){if(t<=0)return "";let r=t,n="";for(let[e,s]of j)for(;r>=e;)n+=s,r-=e;return i?n:n.toLowerCase()}function D(t,i){if(t<=0)return "";let r=t,n="";for(;r>0;){let e=(r-1)%26;n=String.fromCharCode(65+e)+n,r=Math.floor((r-1)/26);}return i?n:n.toLowerCase()}function V(t,i){if(t<=0)return "";switch(i){case "upperRoman":return O(t,true);case "lowerRoman":return O(t,false);case "upperLetter":return D(t,true);case "lowerLetter":return D(t,false);case "decimalZero":return t<10?`0${t}`:String(t);case "none":return "";default:return String(t)}}function W(t,i,r){return t.replace(/%(\d)([.):\]])?/g,(n,e,s="")=>{let l=parseInt(e,10)-1;if(l<0)return "";let c=i[l]??0,m=r?.[l]??"decimal",p=V(c,m);return p?p+s:""})}function X(t,i,r){let n=t.numPr;if(!n)return null;let e=n.numId;if(e==null||e===0)return null;if(t.listIsBullet)return chunkDV6IEOP5_js.J(t.listMarker||"");let s=n.ilvl??0,l=t.listAbstractNumId??e,c=i.get(l)??new Array(9).fill(0),m=`${e}:${s}`;r.has(m)||(r.add(m),t.listStartOverride!=null&&(c[s]=t.listStartOverride-1)),c[s]=(c[s]??0)+1;for(let p=s+1;p<c.length;p+=1)c[p]=0;return i.set(l,c),t.listMarker&&t.listMarker.includes("%")?W(t.listMarker,c,t.listLevelNumFmts??void 0):t.listMarker?t.listMarker:G(c,s)}var q="Calibri",K=11;function Z(t,i,r,n){let e={};if(t.alignment){let o=t.alignment;o==="both"||o==="distribute"?e.alignment="justify":o==="left"?e.alignment="left":o==="center"?e.alignment="center":o==="right"&&(e.alignment="right");}(t.spaceBefore!=null||t.spaceAfter!=null||t.lineSpacing!=null)&&(e.spacing={},t.spaceBefore!=null&&(e.spacing.before=f(t.spaceBefore)),t.spaceAfter!=null&&(e.spacing.after=f(t.spaceAfter)),t.lineSpacing!=null&&(t.lineSpacingRule==="exact"||t.lineSpacingRule==="atLeast"?(e.spacing.line=f(t.lineSpacing),e.spacing.lineUnit="px",e.spacing.lineRule=t.lineSpacingRule):(e.spacing.line=t.lineSpacing/240,e.spacing.lineUnit="multiplier",e.spacing.lineRule="auto"))),t.spacingExplicit&&(e.spacingExplicit=t.spacingExplicit);let s=t.indentLeft,l=t.indentFirstLine,c=t.hangingIndent;if(t.numPr?.numId&&s==null&&(s=((t.numPr.ilvl??0)+1)*720,l==null&&(l=-360,c=true)),(s!=null||t.indentRight!=null||l!=null)&&(e.indent={},s!=null&&(e.indent.left=f(s)),t.indentRight!=null&&(e.indent.right=f(t.indentRight)),l!=null&&(c?e.indent.hanging=Math.abs(f(l)):e.indent.firstLine=f(l))),t.styleId&&(e.styleId=t.styleId),t.borders){let o=t.borders;e.borders={};let a=u=>u?S(u,i):void 0;o.top&&(e.borders.top=a(o.top)),o.bottom&&(e.borders.bottom=a(o.bottom)),o.left&&(e.borders.left=a(o.left)),o.right&&(e.borders.right=a(o.right)),o.between&&(e.borders.between=a(o.between)),o.bar&&(e.borders.bar=a(o.bar)),!e.borders.top&&!e.borders.bottom&&!e.borders.left&&!e.borders.right&&!e.borders.between&&!e.borders.bar&&delete e.borders;}let m=chunkMJ5FQX7Q_js.b(t.shading?.fill,i);m&&(e.shading=`#${m}`),t.tabs&&t.tabs.length>0&&(e.tabs=t.tabs.map(o=>({val:A(o.alignment),pos:o.position,leader:o.leader}))),t.pageBreakBefore&&(e.pageBreakBefore=true),t.keepNext&&(e.keepNext=true),t.keepLines&&(e.keepLines=true),t.contextualSpacing&&(e.contextualSpacing=true),t.bidi&&(e.bidi=true),t.styleId&&(e.styleId=t.styleId),t.numPr&&(e.numPr={numId:t.numPr.numId,ilvl:t.numPr.ilvl});let p=r&&n?X(t,r,n):null;p!=null?e.listMarker=p:t.listMarker&&(e.listMarker=t.listMarker),t.listIsBullet!=null&&(e.listIsBullet=t.listIsBullet),t.listMarkerHidden&&(e.listMarkerHidden=true),t.listMarkerFontFamily&&(e.listMarkerFontFamily=t.listMarkerFontFamily),t.listMarkerFontSize&&(e.listMarkerFontSize=t.listMarkerFontSize);let d=t.defaultTextFormatting;return d&&(d.fontSize!=null&&(e.defaultFontSize=d.fontSize/2),d.fontFamily&&(e.defaultFontFamily=d.fontFamily.ascii||d.fontFamily.hAnsi)),e}function A(t){switch(t){case "left":return "start";case "right":return "end";case "center":return "center";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "start";default:return "start"}}function B(t,i,r){let n=t.attrs,e=L(t,i,r),s=Z(n,r.theme,r.listCounters,r.listSeenNumIds);return {kind:"paragraph",id:h(),runs:e,attrs:s,pmStart:i,pmEnd:i+t.nodeSize}}function J(t,i,r,n){let e=[],s=i+1;t.forEach(u=>{u.type.name==="paragraph"?e.push(B(u,s,r)):u.type.name==="table"&&e.push(H(u,s,r)),s+=u.nodeSize;});let l=t.attrs,c=l.width,m=l.widthType,p=c&&(!m||m==="dxa"||m==="auto")?f(c):void 0,d=l.margins,o=(u,g)=>{if(u!=null){let b=f(u);if(b>0)return b}if(g!=null){let b=f(g);if(b>=0)return b}return 0},a={top:o(d?.top,n?.top),right:o(d?.right,n?.right),bottom:o(d?.bottom,n?.bottom),left:o(d?.left,n?.left)};return {id:h(),blocks:e,colSpan:l.colspan,rowSpan:l.rowspan,width:p,widthValue:c,widthType:m,verticalAlign:l.verticalAlign,background:l.backgroundColor?`#${l.backgroundColor}`:void 0,borders:N(l,r.theme),padding:a,noWrap:l.noWrap||void 0}}function Q(t,i,r,n){let e=[],s=i+1;t.forEach(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&e.push(J(c,s,r,n)),s+=c.nodeSize;});let l=t.attrs;return {id:h(),cells:e,height:l.height?f(l.height):void 0,heightRule:l.heightRule??void 0,isHeader:l.isHeader}}function H(t,i,r){let n=[],e=i+1,s=t.attrs.cellMargins;t.forEach(b=>{b.type.name==="tableRow"&&n.push(Q(b,e,r,s)),e+=b.nodeSize;});let c=t.attrs.columnWidths?.map(f),m=t.attrs.width,p=t.attrs.widthType;if(!c&&n.length>0){let F=n[0].cells.map(y=>y.width);F.every(y=>y!==void 0&&y>0)&&(c=F);}let d=t.attrs.justification,o=t.attrs._originalFormatting,a=o?.indent?.value&&o.indent.type==="dxa"?f(o.indent.value):void 0,u=t.attrs.floating,g=u?{horzAnchor:u.horzAnchor,vertAnchor:u.vertAnchor,tblpX:u.tblpX!==void 0?f(u.tblpX):void 0,tblpXSpec:u.tblpXSpec,tblpY:u.tblpY!==void 0?f(u.tblpY):void 0,tblpYSpec:u.tblpYSpec,topFromText:u.topFromText!==void 0?f(u.topFromText):void 0,bottomFromText:u.bottomFromText!==void 0?f(u.bottomFromText):void 0,leftFromText:u.leftFromText!==void 0?f(u.leftFromText):void 0,rightFromText:u.rightFromText!==void 0?f(u.rightFromText):void 0}:void 0;return {kind:"table",id:h(),rows:n,columnWidths:c,width:m,widthType:p,justification:d,indent:a,floating:g,pmStart:i,pmEnd:i+t.nodeSize}}function ee(t,i,r){let n=t.attrs,e=n.wrapType,s=e==="behind"||e==="inFront",l=x(n.width||100,n.height||100,r);return {kind:"image",id:h(),src:n.src,width:l.width,height:l.height,alt:n.alt,transform:n.transform,anchor:s?{isAnchored:true,offsetH:n.distLeft,offsetV:n.distTop,behindDoc:e==="behind"}:void 0,hlinkHref:n.hlinkHref,pmStart:i,pmEnd:i+t.nodeSize}}function te(t,i,r){let n=t.attrs,e=[];return t.forEach((s,l)=>{if(s.type.name==="paragraph"){let c=B(s,i+1+l,r);e.push(c);}}),{kind:"textBox",id:h(),width:n.width??chunkDROCYKAR_js.b,height:n.height??void 0,fillColor:n.fillColor,outlineWidth:n.outlineWidth,outlineColor:n.outlineColor,outlineStyle:n.outlineStyle,margins:{top:n.marginTop??chunkDROCYKAR_js.a.top,bottom:n.marginBottom??chunkDROCYKAR_js.a.bottom,left:n.marginLeft??chunkDROCYKAR_js.a.left,right:n.marginRight??chunkDROCYKAR_js.a.right},content:e,displayMode:n.displayMode,cssFloat:n.cssFloat,wrapType:n.wrapType,wrapText:n.wrapText,anchorTarget:n.anchorTarget,position:n.position,distTop:n.distTop,distBottom:n.distBottom,distLeft:n.distLeft,distRight:n.distRight,pmStart:i,pmEnd:i+t.nodeSize}}function ke(t,i={}){let r={...i,defaultFont:i.defaultFont??q,defaultSize:i.defaultSize??K},n=[],e=0,s={top:1440,bottom:1440,left:1440,right:1440};return r.listCounters||(r.listCounters=new Map),r.listSeenNumIds||(r.listSeenNumIds=new Set),t.forEach((l,c)=>{let m=e+c;switch(l.type.name){case "paragraph":{let p=B(l,m,r),d=l.attrs;n.push(p);let o=d._sectionProperties;if(o||d.sectionBreakType){let a={kind:"sectionBreak",id:h(),type:o?.sectionStart??d.sectionBreakType};if(o){if((o.pageWidth!==void 0||o.pageHeight!==void 0)&&(a.pageSize={w:f(o.pageWidth??12240),h:f(o.pageHeight??15840)}),o.marginTop!==void 0||o.marginBottom!==void 0||o.marginLeft!==void 0||o.marginRight!==void 0){let g={top:o.marginTop??s.top,bottom:o.marginBottom??s.bottom,left:o.marginLeft??s.left,right:o.marginRight??s.right};a.margins={top:f(g.top),bottom:f(g.bottom),left:f(g.left),right:f(g.right)},s=g;}let u=o.columnCount??1;if(u>1){let g={count:u,gap:f(o.columnSpace??720),equalWidth:o.equalWidth??true,separator:o.separator};a.columns=g;}}n.push(a);}}break;case "table":n.push(H(l,m,r));break;case "image":n.push(ee(l,m,r.pageContentHeight));break;case "textBox":n.push(te(l,m,r));break;case "horizontalRule":case "pageBreak":{let p={kind:"pageBreak",id:h(),pmStart:m,pmEnd:m+l.nodeSize};n.push(p);break}}}),n}exports.a=_;exports.b=S;exports.c=W;exports.d=ke;