@eigenpal/docx-editor-core 1.1.0 → 1.2.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 (209) hide show
  1. package/dist/agent/index.d.mts +42 -6
  2. package/dist/agent/index.d.ts +42 -6
  3. package/dist/agent/index.js +1 -1
  4. package/dist/agent/index.mjs +1 -1
  5. package/dist/chunk-2EQGBVPV.js +2 -0
  6. package/dist/chunk-2XP6GLA4.mjs +1 -0
  7. package/dist/{chunk-CTHHUJAB.mjs → chunk-44JKHPGF.mjs} +1 -1
  8. package/dist/{chunk-J4J2Y6EU.js → chunk-4QEETB7U.js} +2 -2
  9. package/dist/{chunk-GFDIPDJ6.mjs → chunk-5BLQHXWK.mjs} +1 -1
  10. package/dist/{chunk-UOQT6A7P.js → chunk-5M7TI6TV.js} +1 -1
  11. package/dist/{chunk-7Z2AGPNQ.mjs → chunk-7BVHKWEW.mjs} +1 -1
  12. package/dist/chunk-7OW3VCZE.mjs +1 -0
  13. package/dist/chunk-7ZN4WI5N.mjs +4 -0
  14. package/dist/{chunk-GY5BWVM7.js → chunk-AMB6Y77B.js} +1 -1
  15. package/dist/{chunk-H42RXHT4.js → chunk-BXWOLARZ.js} +1 -1
  16. package/dist/chunk-C45EFOVP.js +1 -0
  17. package/dist/chunk-CCPBNE2F.mjs +2 -0
  18. package/dist/{chunk-5CDBSK2R.mjs → chunk-D62KS7QG.mjs} +1 -1
  19. package/dist/chunk-DI6CRWSW.mjs +1 -0
  20. package/dist/chunk-EQAORQC3.mjs +1 -0
  21. package/dist/chunk-FO6IX2DB.js +6 -0
  22. package/dist/chunk-FW23IMBF.mjs +1 -0
  23. package/dist/{chunk-BGE57OES.js → chunk-FYKRDDKG.js} +1 -1
  24. package/dist/chunk-GSKMHXHG.js +1 -0
  25. package/dist/{chunk-MZ2XCZAN.mjs → chunk-GUQFNJHE.mjs} +1 -1
  26. package/dist/chunk-ICE6NC3S.mjs +1 -0
  27. package/dist/chunk-IFUED5ZS.mjs +1 -0
  28. package/dist/chunk-ISKTBM4L.js +1 -0
  29. package/dist/{chunk-73AZQWIE.js → chunk-IYKBX24M.js} +1 -1
  30. package/dist/chunk-KGTEBLB6.js +1 -0
  31. package/dist/chunk-KOEWROYV.mjs +6 -0
  32. package/dist/{chunk-IF4C25FN.mjs → chunk-KRN6YSR2.mjs} +1 -1
  33. package/dist/chunk-KZXZWGFX.mjs +1 -0
  34. package/dist/chunk-L72YAV5N.js +3 -0
  35. package/dist/chunk-LK6I3HMH.mjs +0 -0
  36. package/dist/chunk-LWH66Q7Q.js +1 -0
  37. package/dist/{chunk-ONRBRDIC.mjs → chunk-MERJFGEP.mjs} +1 -1
  38. package/dist/chunk-PVAVS3IU.js +1 -0
  39. package/dist/{chunk-OUEKNYX5.mjs → chunk-QKLY4F2J.mjs} +1 -1
  40. package/dist/{chunk-LCICADWM.js → chunk-QYF7BRG3.js} +1 -1
  41. package/dist/chunk-RKDVY7I3.mjs +1 -0
  42. package/dist/chunk-ROG4MNOR.js +4 -0
  43. package/dist/{chunk-HV6HE6YR.js → chunk-SZIOF5SG.js} +3 -3
  44. package/dist/{chunk-W7GLQ6DV.js → chunk-THLJYXFB.js} +1 -1
  45. package/dist/{chunk-25KY5HLN.js → chunk-U4WUDHDK.js} +1 -1
  46. package/dist/{chunk-KGDXHUYC.js → chunk-U4XMGWF7.js} +1 -1
  47. package/dist/chunk-U67MWOPZ.mjs +1 -0
  48. package/dist/{chunk-LOCW6MR2.js → chunk-UGV4KRQB.js} +1 -1
  49. package/dist/chunk-VMRUBLPI.js +1 -0
  50. package/dist/chunk-WKUHYMDO.mjs +1 -0
  51. package/dist/chunk-WLDI6N3B.mjs +3 -0
  52. package/dist/chunk-WVERBZZU.js +1 -0
  53. package/dist/chunk-Z5MJYQSD.mjs +1 -0
  54. package/dist/chunk-ZBFNOJGY.js +1 -0
  55. package/dist/{content-5Mrz6w_b.d.mts → content-CE-ZdMwG.d.mts} +167 -109
  56. package/dist/{content-CmqAwdFL.d.ts → content-CYXJ2tfQ.d.ts} +167 -109
  57. package/dist/contentControlValues-DAwTWfgR.d.mts +187 -0
  58. package/dist/contentControlValues-gyVPsi6m.d.ts +187 -0
  59. package/dist/core-plugins.d.mts +1 -1
  60. package/dist/core-plugins.d.ts +1 -1
  61. package/dist/core-plugins.js +1 -1
  62. package/dist/core-plugins.mjs +1 -1
  63. package/dist/core.d.mts +6 -6
  64. package/dist/core.d.ts +6 -6
  65. package/dist/core.js +1 -1
  66. package/dist/core.mjs +1 -1
  67. package/dist/{documentSerializer-DgO3A9av.d.mts → documentSerializer-Bghq9rFI.d.mts} +1 -1
  68. package/dist/{documentSerializer-BRaaXIHm.d.ts → documentSerializer-C4lFC60P.d.ts} +1 -1
  69. package/dist/documentStyles-D87dxl18.d.mts +34 -0
  70. package/dist/documentStyles-DToJv9co.d.ts +34 -0
  71. package/dist/docx/index.d.mts +1 -1
  72. package/dist/docx/index.d.ts +1 -1
  73. package/dist/docx/index.js +1 -1
  74. package/dist/docx/index.mjs +1 -1
  75. package/dist/docx/parser.d.mts +1 -1
  76. package/dist/docx/parser.d.ts +1 -1
  77. package/dist/docx/parser.js +1 -1
  78. package/dist/docx/parser.mjs +1 -1
  79. package/dist/docx/rezip.d.mts +1 -1
  80. package/dist/docx/rezip.d.ts +1 -1
  81. package/dist/docx/rezip.js +1 -1
  82. package/dist/docx/rezip.mjs +1 -1
  83. package/dist/docx/serializer/index.d.mts +2 -2
  84. package/dist/docx/serializer/index.d.ts +2 -2
  85. package/dist/docx/serializer/index.js +1 -1
  86. package/dist/docx/serializer/index.mjs +1 -1
  87. package/dist/{fontLoader-CK2QLq68.d.ts → fontLoader-Cm02v7PO.d.ts} +1 -1
  88. package/dist/{fontLoader-8b4X-AIh.d.mts → fontLoader-Z7pqeNvZ.d.mts} +1 -1
  89. package/dist/{headerFooterLayout-Ca4ESDHF.d.ts → headerFooterLayout-Bd58Tum3.d.ts} +1 -1
  90. package/dist/{headerFooterLayout-72Vz7yp3.d.mts → headerFooterLayout-CuIJiIzi.d.mts} +1 -1
  91. package/dist/headless.d.mts +5 -4
  92. package/dist/headless.d.ts +5 -4
  93. package/dist/headless.js +1 -1
  94. package/dist/headless.mjs +1 -1
  95. package/dist/layout-bridge/index.d.mts +2 -2
  96. package/dist/layout-bridge/index.d.ts +2 -2
  97. package/dist/layout-bridge/index.js +1 -1
  98. package/dist/layout-bridge/index.mjs +1 -1
  99. package/dist/layout-bridge/measuring/index.d.mts +1 -1
  100. package/dist/layout-bridge/measuring/index.d.ts +1 -1
  101. package/dist/layout-bridge/tableInsertHover.js +1 -1
  102. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  103. package/dist/layout-bridge/toFlowBlocks.d.mts +1 -1
  104. package/dist/layout-bridge/toFlowBlocks.d.ts +1 -1
  105. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  106. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  107. package/dist/layout-engine/index.d.mts +2 -2
  108. package/dist/layout-engine/index.d.ts +2 -2
  109. package/dist/layout-engine/types.d.mts +31 -2
  110. package/dist/layout-engine/types.d.ts +31 -2
  111. package/dist/layout-painter/index.d.mts +4 -3
  112. package/dist/layout-painter/index.d.ts +4 -3
  113. package/dist/layout-painter/index.js +1 -1
  114. package/dist/layout-painter/index.mjs +1 -1
  115. package/dist/layout-painter/renderPage.d.mts +40 -3
  116. package/dist/layout-painter/renderPage.d.ts +40 -3
  117. package/dist/layout-painter/renderPage.js +1 -1
  118. package/dist/layout-painter/renderPage.mjs +1 -1
  119. package/dist/managers/AutoSaveManager.d.mts +1 -1
  120. package/dist/managers/AutoSaveManager.d.ts +1 -1
  121. package/dist/managers/TableSelectionManager.d.mts +1 -1
  122. package/dist/managers/TableSelectionManager.d.ts +1 -1
  123. package/dist/managers/types.d.mts +1 -1
  124. package/dist/managers/types.d.ts +1 -1
  125. package/dist/mcp-cli.mjs +23 -23
  126. package/dist/mcp.d.mts +1 -1
  127. package/dist/mcp.d.ts +1 -1
  128. package/dist/mcp.js +3 -3
  129. package/dist/mcp.mjs +1 -1
  130. package/dist/{nodes-CC_nwkT_.d.ts → nodes-BNkRKBBX.d.ts} +1 -1
  131. package/dist/{nodes-7753Bgi_.d.mts → nodes-Bz-UHhLE.d.mts} +1 -1
  132. package/dist/prosemirror/commands/formatting.js +1 -1
  133. package/dist/prosemirror/commands/formatting.mjs +1 -1
  134. package/dist/prosemirror/commands/index.js +1 -1
  135. package/dist/prosemirror/commands/index.mjs +1 -1
  136. package/dist/prosemirror/commands/paragraph.js +1 -1
  137. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  138. package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -2
  139. package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -2
  140. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  141. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  142. package/dist/prosemirror/conversion/index.d.mts +3 -3
  143. package/dist/prosemirror/conversion/index.d.ts +3 -3
  144. package/dist/prosemirror/conversion/index.js +1 -1
  145. package/dist/prosemirror/conversion/index.mjs +1 -1
  146. package/dist/prosemirror/editor.css +147 -0
  147. package/dist/prosemirror/extensions/index.js +1 -1
  148. package/dist/prosemirror/extensions/index.mjs +1 -1
  149. package/dist/prosemirror/index.d.mts +94 -6
  150. package/dist/prosemirror/index.d.ts +94 -6
  151. package/dist/prosemirror/index.js +3 -1
  152. package/dist/prosemirror/index.mjs +3 -1
  153. package/dist/prosemirror/plugins/index.d.mts +4 -1
  154. package/dist/prosemirror/plugins/index.d.ts +4 -1
  155. package/dist/prosemirror/plugins/index.js +1 -1
  156. package/dist/prosemirror/plugins/index.mjs +1 -1
  157. package/dist/prosemirror/schema/index.d.mts +2 -2
  158. package/dist/prosemirror/schema/index.d.ts +2 -2
  159. package/dist/prosemirror/schema/index.js +1 -1
  160. package/dist/prosemirror/schema/index.mjs +1 -1
  161. package/dist/prosemirror/styles/index.d.mts +9 -0
  162. package/dist/prosemirror/styles/index.d.ts +9 -0
  163. package/dist/prosemirror/styles/index.js +1 -1
  164. package/dist/prosemirror/styles/index.mjs +1 -1
  165. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +1 -1
  166. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +1 -1
  167. package/dist/types/content.d.mts +1 -1
  168. package/dist/types/content.d.ts +1 -1
  169. package/dist/types/document.d.mts +2 -2
  170. package/dist/types/document.d.ts +2 -2
  171. package/dist/utils/comments.d.mts +1 -1
  172. package/dist/utils/comments.d.ts +1 -1
  173. package/dist/utils/index.d.mts +2 -2
  174. package/dist/utils/index.d.ts +2 -2
  175. package/dist/{variableDetector-DF3-nxUC.d.mts → variableDetector-C7BLz9sJ.d.mts} +1 -1
  176. package/dist/{variableDetector-sBkgVh3f.d.ts → variableDetector-HPZbJ_gw.d.ts} +1 -1
  177. package/package.json +1 -1
  178. package/dist/chunk-CA2EYL6T.mjs +0 -1
  179. package/dist/chunk-D4RPOJC7.js +0 -1
  180. package/dist/chunk-DLCDDB66.mjs +0 -3
  181. package/dist/chunk-F44ZLDZS.js +0 -4
  182. package/dist/chunk-FEWCI2E5.mjs +0 -1
  183. package/dist/chunk-FWTP7BN7.mjs +0 -4
  184. package/dist/chunk-GM4USWKO.js +0 -2
  185. package/dist/chunk-GWBVJZVT.js +0 -3
  186. package/dist/chunk-HMBVSDCH.mjs +0 -1
  187. package/dist/chunk-ILJUDEZ5.mjs +0 -1
  188. package/dist/chunk-IP2VXNWG.js +0 -1
  189. package/dist/chunk-IQG3KLWY.mjs +0 -2
  190. package/dist/chunk-KHF4JU7D.mjs +0 -1
  191. package/dist/chunk-LBKMYD3M.mjs +0 -1
  192. package/dist/chunk-MZOVDLYL.js +0 -1
  193. package/dist/chunk-NBLJPT54.mjs +0 -1
  194. package/dist/chunk-OAWTQ3IY.js +0 -1
  195. package/dist/chunk-OCAX2KJQ.js +0 -4
  196. package/dist/chunk-ONWOHAFW.mjs +0 -1
  197. package/dist/chunk-OX75Q5ZG.mjs +0 -1
  198. package/dist/chunk-Q4CKLXWA.js +0 -1
  199. package/dist/chunk-RFC2SXZ6.mjs +0 -4
  200. package/dist/chunk-RFVFX5WK.mjs +0 -1
  201. package/dist/chunk-V5VDCQDN.mjs +0 -1
  202. package/dist/chunk-VHUVPHPI.mjs +0 -1
  203. package/dist/chunk-VQWZHPWI.mjs +0 -1
  204. package/dist/chunk-X6HFDXKB.js +0 -1
  205. package/dist/chunk-Y3ZQQI4D.js +0 -1
  206. package/dist/chunk-YTDWMXNS.js +0 -1
  207. package/dist/chunk-ZUGNF5KU.js +0 -1
  208. /package/dist/{chunk-U74VPTIU.js → chunk-53VKL6CG.js} +0 -0
  209. /package/dist/{chunk-FDEDN2RC.mjs → chunk-DTTWBKGN.mjs} +0 -0
@@ -1,10 +1,10 @@
1
- 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkLCICADWM_js=require('./chunk-LCICADWM.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'),chunkQYF7BRG3_js=require('./chunk-QYF7BRG3.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 chunkLCICADWM_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 chunkQYF7BRG3_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 +1 @@
1
- import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-CA2EYL6T.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e$1){let t=O(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b$1=Y(i.table,l),h=b(b$1,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,P=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),v=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);v[p.row].push(p.data.type.create(g,p.data.content));});let u=v.map((p,g)=>i.table.type.schema.nodes.tableRow.create(P[g],p)),c$1=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c$1),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ve(){return m.toggleNoWrap()}function ke(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function we(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function De(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function We(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),P=Math.min(t,S);d&&h.marks.some(v=>v.type===d)&&b.push({from:x,to:P}),i&&h.marks.some(v=>v.type===i)&&l.removeMark(x,P,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let P=[...d].sort((u,c)=>c.pos-u.pos);for(let u of P){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let v=[...i].sort((u,c)=>c.pos-u.pos);for(let u of v){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let k=l.doc.resolve(c+1),w=k.node(k.depth-1),I=k.before(k.depth-1);if(w?.type.name==="table"&&w.childCount>1)l.delete(c,c+f.nodeSize);else if(w?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+w.nodeSize,U.create());}else l.delete(I,I+w.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let k={...f.attrs};g&&(k.trIns=null),T&&(k.trDel=null),l.setNodeMarkup(c,void 0,k);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}export{xe as A,Pe as B,we as C,Ie as D,Ae as E,Ee as F,Me as G,Re as H,Be as I,De as J,Fe as K,We as L,Le as M,ze as N,He as O,je as P,$ as Q,Ye as R,qe as S,J as T,q as a,Q as b,ee as c,te as d,re as e,ne as f,oe as g,ae as h,ie as i,se as j,le as k,ce as l,de as m,ue as n,pe as o,me as p,fe as q,ge as r,be as s,he as t,ye as u,Ce as v,Te as w,Se as x,ve as y,ke as z};
1
+ import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-ICE6NC3S.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e$1){let t=O(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b$1=Y(i.table,l),h=b(b$1,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,P=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),v=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);v[p.row].push(p.data.type.create(g,p.data.content));});let u=v.map((p,g)=>i.table.type.schema.nodes.tableRow.create(P[g],p)),c$1=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c$1),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ve(){return m.toggleNoWrap()}function ke(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function we(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function De(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function We(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),P=Math.min(t,S);d&&h.marks.some(v=>v.type===d)&&b.push({from:x,to:P}),i&&h.marks.some(v=>v.type===i)&&l.removeMark(x,P,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let P=[...d].sort((u,c)=>c.pos-u.pos);for(let u of P){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let v=[...i].sort((u,c)=>c.pos-u.pos);for(let u of v){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let k=l.doc.resolve(c+1),w=k.node(k.depth-1),I=k.before(k.depth-1);if(w?.type.name==="table"&&w.childCount>1)l.delete(c,c+f.nodeSize);else if(w?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+w.nodeSize,U.create());}else l.delete(I,I+w.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let k={...f.attrs};g&&(k.trIns=null),T&&(k.trDel=null),l.setNodeMarkup(c,void 0,k);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}export{xe as A,Pe as B,we as C,Ie as D,Ae as E,Ee as F,Me as G,Re as H,Be as I,De as J,Fe as K,We as L,Le as M,ze as N,He as O,je as P,$ as Q,Ye as R,qe as S,J as T,q as a,Q as b,ee as c,te as d,re as e,ne as f,oe as g,ae as h,ie as i,se as j,le as k,ce as l,de as m,ue as n,pe as o,me as p,fe as q,ge as r,be as s,he as t,ye as u,Ce as v,Te as w,Se as x,ve as y,ke as z};
@@ -1 +1 @@
1
- 'use strict';var chunkHV6HE6YR_js=require('./chunk-HV6HE6YR.js'),chunkGWBVJZVT_js=require('./chunk-GWBVJZVT.js'),chunkHQPWFUP5_js=require('./chunk-HQPWFUP5.js');function H(t,s){let r=j(s),e=new RegExp(`<w:p[\\s][^>]*w14:paraId="${r}"`,"g"),o=[],i;for(;(i=e.exec(t))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let l=o[0],n=l,a=0;for(;n<t.length;){let f=t.indexOf("<",n);if(f===-1)break;if(t.startsWith("<w:p",f)){let w=t[f+4];if(w===">"||w===" "||w==="/"){let u=t.indexOf(">",f);if(u===-1)break;if(t[u-1]==="/"){if(a===0)return {start:l,end:u+1};n=u+1;}else a++,n=u+1;}else n=f+1;}else if(t.startsWith("</w:p>",f)){if(a--,a===0)return {start:l,end:f+6};n=f+6;}else n=f+1;}return null}function L(t,s){let r=H(t,s);return r?t.substring(r.start,r.end):null}function Y(t){let s=0,r=/<w:p[\s>]/g,e;for(;(e=r.exec(t))!==null;){let o=e.index,i=t[o+4];(i===">"||i===" ")&&s++;}return s}function B(t){let s=new Map,r=/w14:paraId="([^"]+)"/g,e;for(;(e=r.exec(t))!==null;){let o=e[1];s.set(o,(s.get(o)||0)+1);}return s}function V(t,s,r){if(r.size===0)return {safe:true};let e=B(t),o=B(s);for(let n of r){let a=e.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of r){let a=o.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=Y(t),l=Y(s);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function W(t,s,r){if(r.size===0)return t;if(!V(t,s,r).safe)return null;let o=[];for(let l of r){let n=H(t,l);if(!n)return null;let a=L(s,l);if(!a)return null;o.push({start:n.start,end:n.end,newXml:a});}o.sort((l,n)=>n.start-l.start);let i=t;for(let{start:l,end:n,newXml:a}of o)i=i.substring(0,l)+a+i.substring(n);return i}function j(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(t){let s=r=>r.content.some(e=>e.type==="drawing"&&e.image?.src?.startsWith("data:")&&!e.image?.rId);for(let r of t)if(r.type==="paragraph")for(let e of r.content)if(e.type==="run"){if(s(e))return true}else {if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true;if(e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo"){for(let o of e.content)if(o.type==="run"&&s(o))return true}}else if(r.type==="table"){for(let e of r.rows)for(let o of e.cells)if(Z(o.content))return true}return false}async function nt(t,s,r){let{changedParaIds:e,structuralChange:o,hasUntrackedChanges:i}=r;if(o||i||!s)return null;let l=t.package.document.content;if(Z(l))return null;let n=t.package.document.comments,a=n&&n.length>0,f=chunkHV6HE6YR_js.f(t);try{let u=await(await import('jszip')).default.loadAsync(s),c=new Map;if(e.size>0){let d=u.file("word/document.xml");if(!d)return null;let p=await d.async("text"),y=chunkGWBVJZVT_js.g(t),g=W(p,y,e);if(!g)return null;c.set("word/document.xml",g);}if(a){let{xml:d,paraInfos:p}=chunkGWBVJZVT_js.i(n);c.set("word/comments.xml",d);let y=chunkGWBVJZVT_js.k(p);y&&c.set("word/commentsExtended.xml",y);let g=chunkGWBVJZVT_js.l(p);g&&c.set("word/commentsIds.xml",g);let P=chunkGWBVJZVT_js.m(p,n);P&&c.set("word/commentsExtensible.xml",P);let S=u.file("[Content_Types].xml");if(S){let m=c.get("[Content_Types].xml")??await S.async("text"),x=!1,C=[["/word/comments.xml",chunkHV6HE6YR_js.b],["/word/commentsExtended.xml",chunkHV6HE6YR_js.c],["/word/commentsIds.xml",chunkHV6HE6YR_js.d],["/word/commentsExtensible.xml",chunkHV6HE6YR_js.e]];for(let[h,b]of C)m.includes(h)||(m=m.replace("</Types>",`<Override PartName="${h}" ContentType="${b}"/></Types>`),x=!0);x&&c.set("[Content_Types].xml",m);}let T="word/_rels/document.xml.rels",N=u.file(T);if(N){let m=c.get(T)??await N.async("text"),x=!1,C=[["comments.xml",chunkHQPWFUP5_js.a.comments],["commentsExtended.xml",chunkHQPWFUP5_js.a.commentsExtended],["commentsIds.xml",chunkHQPWFUP5_js.a.commentsIds],["commentsExtensible.xml",chunkHQPWFUP5_js.a.commentsExtensible]];for(let[h,b]of C)if(!m.includes(h)){let J=chunkHV6HE6YR_js.a(m);m=m.replace("</Relationships>",`<Relationship Id="rId${J+1}" Type="${b}" Target="${h}"/></Relationships>`),x=!0;}x&&c.set(T,m);}}for(let[d,p]of f)c.set(d,p);let I=u.file("docProps/core.xml");if(I){let d=await I.async("text");c.set("docProps/core.xml",chunkHV6HE6YR_js.p(d,{updateModifiedDate:!0}));}return await chunkHV6HE6YR_js.m(u,c)}catch{return null}}exports.a=V;exports.b=W;exports.c=nt;
1
+ 'use strict';var chunkSZIOF5SG_js=require('./chunk-SZIOF5SG.js'),chunkL72YAV5N_js=require('./chunk-L72YAV5N.js'),chunkHQPWFUP5_js=require('./chunk-HQPWFUP5.js');function H(t,s){let r=j(s),e=new RegExp(`<w:p[\\s][^>]*w14:paraId="${r}"`,"g"),o=[],i;for(;(i=e.exec(t))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let l=o[0],n=l,a=0;for(;n<t.length;){let f=t.indexOf("<",n);if(f===-1)break;if(t.startsWith("<w:p",f)){let w=t[f+4];if(w===">"||w===" "||w==="/"){let u=t.indexOf(">",f);if(u===-1)break;if(t[u-1]==="/"){if(a===0)return {start:l,end:u+1};n=u+1;}else a++,n=u+1;}else n=f+1;}else if(t.startsWith("</w:p>",f)){if(a--,a===0)return {start:l,end:f+6};n=f+6;}else n=f+1;}return null}function L(t,s){let r=H(t,s);return r?t.substring(r.start,r.end):null}function Y(t){let s=0,r=/<w:p[\s>]/g,e;for(;(e=r.exec(t))!==null;){let o=e.index,i=t[o+4];(i===">"||i===" ")&&s++;}return s}function B(t){let s=new Map,r=/w14:paraId="([^"]+)"/g,e;for(;(e=r.exec(t))!==null;){let o=e[1];s.set(o,(s.get(o)||0)+1);}return s}function V(t,s,r){if(r.size===0)return {safe:true};let e=B(t),o=B(s);for(let n of r){let a=e.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of r){let a=o.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=Y(t),l=Y(s);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function W(t,s,r){if(r.size===0)return t;if(!V(t,s,r).safe)return null;let o=[];for(let l of r){let n=H(t,l);if(!n)return null;let a=L(s,l);if(!a)return null;o.push({start:n.start,end:n.end,newXml:a});}o.sort((l,n)=>n.start-l.start);let i=t;for(let{start:l,end:n,newXml:a}of o)i=i.substring(0,l)+a+i.substring(n);return i}function j(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(t){let s=r=>r.content.some(e=>e.type==="drawing"&&e.image?.src?.startsWith("data:")&&!e.image?.rId);for(let r of t)if(r.type==="paragraph")for(let e of r.content)if(e.type==="run"){if(s(e))return true}else {if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true;if(e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo"){for(let o of e.content)if(o.type==="run"&&s(o))return true}}else if(r.type==="table"){for(let e of r.rows)for(let o of e.cells)if(Z(o.content))return true}return false}async function nt(t,s,r){let{changedParaIds:e,structuralChange:o,hasUntrackedChanges:i}=r;if(o||i||!s)return null;let l=t.package.document.content;if(Z(l))return null;let n=t.package.document.comments,a=n&&n.length>0,f=chunkSZIOF5SG_js.f(t);try{let u=await(await import('jszip')).default.loadAsync(s),c=new Map;if(e.size>0){let d=u.file("word/document.xml");if(!d)return null;let p=await d.async("text"),y=chunkL72YAV5N_js.g(t),g=W(p,y,e);if(!g)return null;c.set("word/document.xml",g);}if(a){let{xml:d,paraInfos:p}=chunkL72YAV5N_js.i(n);c.set("word/comments.xml",d);let y=chunkL72YAV5N_js.k(p);y&&c.set("word/commentsExtended.xml",y);let g=chunkL72YAV5N_js.l(p);g&&c.set("word/commentsIds.xml",g);let P=chunkL72YAV5N_js.m(p,n);P&&c.set("word/commentsExtensible.xml",P);let S=u.file("[Content_Types].xml");if(S){let m=c.get("[Content_Types].xml")??await S.async("text"),x=!1,C=[["/word/comments.xml",chunkSZIOF5SG_js.b],["/word/commentsExtended.xml",chunkSZIOF5SG_js.c],["/word/commentsIds.xml",chunkSZIOF5SG_js.d],["/word/commentsExtensible.xml",chunkSZIOF5SG_js.e]];for(let[h,b]of C)m.includes(h)||(m=m.replace("</Types>",`<Override PartName="${h}" ContentType="${b}"/></Types>`),x=!0);x&&c.set("[Content_Types].xml",m);}let T="word/_rels/document.xml.rels",N=u.file(T);if(N){let m=c.get(T)??await N.async("text"),x=!1,C=[["comments.xml",chunkHQPWFUP5_js.a.comments],["commentsExtended.xml",chunkHQPWFUP5_js.a.commentsExtended],["commentsIds.xml",chunkHQPWFUP5_js.a.commentsIds],["commentsExtensible.xml",chunkHQPWFUP5_js.a.commentsExtensible]];for(let[h,b]of C)if(!m.includes(h)){let J=chunkSZIOF5SG_js.a(m);m=m.replace("</Relationships>",`<Relationship Id="rId${J+1}" Type="${b}" Target="${h}"/></Relationships>`),x=!0;}x&&c.set(T,m);}}for(let[d,p]of f)c.set(d,p);let I=u.file("docProps/core.xml");if(I){let d=await I.async("text");c.set("docProps/core.xml",chunkSZIOF5SG_js.p(d,{updateModifiedDate:!0}));}return await chunkSZIOF5SG_js.m(u,c)}catch{return null}}exports.a=V;exports.b=W;exports.c=nt;
@@ -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-CTHHUJAB.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-44JKHPGF.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
+ import {a as a$1}from'./chunk-QPFJJPIC.mjs';import {e,f as f$1}from'./chunk-VW22RZ6C.mjs';function u(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function g(e){let i={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(i.id=e.id),e.alias!=null&&(i.alias=String(e.alias)),e.tag!=null&&(i.tag=String(e.tag)),e.lock!=null&&(i.lock=e.lock),e.placeholder!=null&&(i.placeholder=String(e.placeholder)),e.showingPlaceholder&&(i.showingPlaceholder=true),e.dateFormat!=null&&(i.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{i.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(i.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{i.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(i.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(i.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),i}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function w(e$1){let i=e$1.wrap?.type??"inline",t=e$1.wrap?.wrapText,l=e$1.position?.horizontal?.alignment;return {displayMode:d(i),cssFloat:p(i,t,l),wrapType:i,wrapText:t,anchorTarget:a(e$1)?"followingBlock":void 0,position:e$1.position?f(e$1.position):void 0,distTop:e$1.wrap?.distT!=null?e(e$1.wrap.distT):void 0,distBottom:e$1.wrap?.distB!=null?e(e$1.wrap.distB):void 0,distLeft:e$1.wrap?.distL!=null?e(e$1.wrap.distL):void 0,distRight:e$1.wrap?.distR!=null?e(e$1.wrap.distR):void 0}}function x(e){return e.anchorTarget==="followingBlock"||s(e)}function P(e){let i=e.position;if(!(!i?.horizontal&&!i?.vertical))return {horizontal:{relativeTo:i.horizontal?.relativeTo??"margin",alignment:i.horizontal?.align,posOffset:i.horizontal?.posOffset},vertical:{relativeTo:i.vertical?.relativeTo??"paragraph",alignment:i.vertical?.align,posOffset:i.vertical?.posOffset}}}function y(e){let i=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!i||i==="inline")return;let t={type:i};return e.wrapText&&(t.wrapText=e.wrapText),e.distTop!=null&&(t.distT=f$1(e.distTop)),e.distBottom!=null&&(t.distB=f$1(e.distBottom)),e.distLeft!=null&&(t.distL=f$1(e.distLeft)),e.distRight!=null&&(t.distR=f$1(e.distRight)),t}function d(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function s(e){return e.displayMode==="float"||a$1(e.wrapType)}function p(e,i,t){return e==="inline"||e==="topAndBottom"?"none":i==="left"?"right":i==="right"||t==="left"?"left":t==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}export{u as a,g as b,a as c,w as d,x as e,P as f,y as g};
@@ -0,0 +1,4 @@
1
+ import {h,j as j$2,k,g,z}from'./chunk-6ZXL3EIP.mjs';import {c as c$1}from'./chunk-OEXVWIHW.mjs';import {c,j as j$1,e,l,i,a,f,m,d,b,n,k as k$1}from'./chunk-WLHNIXWC.mjs';var He={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},he={name:"Office Theme",colorScheme:He,fontScheme:J},ft=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function ct(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 pt(e$1){let t={...He};if(!e$1)return t;for(let n of ft){let o=e(e$1,"a",n);if(o){let r=i(o);if(r.length>0){let a=ct(r[0]);a&&(t[n]=a);}}}return t}function ve(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 dt(e$1){let t={...J};if(!e$1)return t;let n=e(e$1,"a","majorFont");n&&(t.majorFont=ve(n));let o=e(e$1,"a","minorFont");return o&&(t.minorFont=ve(o)),t}function Rn(e$1){if(!e$1)return {...he};try{let t=c(e$1);if(!t)return {...he};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=pt(r),u=e(o,"a","fontScheme"),l=dt(u);return {name:n,colorScheme:a,fontScheme:l}}catch(t){return console.warn("Failed to parse theme:",t),{...he}}}function mt(e,t="latin"){if(!e?.fontScheme?.majorFont)return J.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function Ne(e,t="latin"){if(!e?.fontScheme?.minorFont)return J.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function 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?mt(e,r):o?Ne(e,r):Ne(e,"latin")}function Ae(e){if(!e)return;let t=l(e,"w","w")??0,n=j$1(e,"w","type")??"dxa",o="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(o=n),{value:t,type:o}}function O(e){return Ae(e)}function V(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,o=(j$1(e,"w","author")??"").trim(),r=(j$1(e,"w","date")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:o.length>0?o:"Unknown",date:r.length>0?r:void 0}}function ee(e){return V(e)}function D(e){if(!e)return;let o={style:j$1(e,"w","val")??"none"},r=l(e,"w","sz");r!==void 0&&(o.size=r);let a=l(e,"w","space");a!==void 0&&(o.space=a);let u=j$1(e,"w","color"),l$1=j$1(e,"w","themeColor"),f=j$1(e,"w","themeTint"),c=j$1(e,"w","themeShade");(u||l$1||f||c)&&(o.color={rgb:u??void 0,themeColor:l$1,themeTint:f??void 0,themeShade:c??void 0});let p=j$1(e,"w","shadow");(p==="1"||p==="true")&&(o.shadow=true);let d=j$1(e,"w","frame");return (d==="1"||d==="true")&&(o.frame=true),o}function te(e$1){if(!e$1)return;let t={},n=D(e(e$1,"w","top"));n&&(t.top=n);let o=D(e(e$1,"w","bottom"));o&&(t.bottom=o);let r=D(e(e$1,"w","left")??e(e$1,"w","start"));r&&(t.left=r);let a=D(e(e$1,"w","right")??e(e$1,"w","end"));a&&(t.right=a);let u=D(e(e$1,"w","insideH"));u&&(t.insideH=u);let l=D(e(e$1,"w","insideV"));if(l&&(t.insideV=l),Object.keys(t).length!==0)return t}function ne(e$1){if(!e$1)return;let t={},n=O(e(e$1,"w","top"));n&&(t.top=n);let o=O(e(e$1,"w","bottom"));o&&(t.bottom=o);let r=O(e(e$1,"w","left")??e(e$1,"w","start"));r&&(t.left=r);let a=O(e(e$1,"w","right")??e(e$1,"w","end"));if(a&&(t.right=a),Object.keys(t).length!==0)return t}function oe(e){if(!e)return;let t={},n=j$1(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let o=j$1(e,"w","themeFill");if(o){t.fill={themeColor:o};let u=j$1(e,"w","themeFillTint");u&&t.fill&&(t.fill.themeTint=u);let l=j$1(e,"w","themeFillShade");l&&t.fill&&(t.fill.themeShade=l);}let r=j$1(e,"w","color");r&&r!=="auto"&&(t.color={rgb:r});let a=j$1(e,"w","val");if(a&&(t.pattern=a),Object.keys(t).length!==0)return t}function we(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 ye(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 gt(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 ht(e){return e.rows.length}function wt(e){return e.formatting?.vMerge==="continue"}function yt(e){return e.formatting?.vMerge==="restart"}function bt(e){return e.rows.length===0?false:e.rows[0].formatting?.header===true}var Tt={richText:"richText",text:"plainText",date:"date",dropDownList:"dropDownList",comboBox:"comboBox",picture:"picture",docPartObj:"buildingBlockGallery",docPartList:"buildingBlockGallery",group:"group",equation:"equation",citation:"citation",bibliography:"bibliography",checkbox:"checkbox"};function Ft(e){if(!e||!e.elements)return "richText";for(let t of e.elements){if(t.type!=="element"||!t.name)continue;let n=d(t.name),o=Tt[n];if(o)return o}return "richText"}function Ct(e){let t=[];for(let n of e.elements??[])n.type==="element"&&d(n.name||"")==="listItem"&&t.push({displayText:j$1(n,"w","displayText")||"",value:j$1(n,"w","value")||""});return t}function re(e$1,t){let n={sdtType:Ft(e$1)};if(e$1){n.rawPropertiesXml=b(e$1);for(let o of e$1.elements??[]){if(o.type!=="element"||!o.name)continue;switch(d(o.name)){case "id":{let a=j$1(o,"w","val");if(a!=null){let u=parseInt(a,10);Number.isNaN(u)||(n.id=u);}break}case "alias":n.alias=j$1(o,"w","val")??void 0;break;case "tag":n.tag=j$1(o,"w","val")??void 0;break;case "lock":n.lock=j$1(o,"w","val")??"unlocked";break;case "placeholder":{let a=e(o,"w","docPart");a&&(n.placeholder=j$1(a,"w","val")??void 0);break}case "showingPlcHdr":{let a=j$1(o,"w","val");n.showingPlaceholder=a==null||!/^(0|false|off)$/i.test(a);break}case "date":{let a=e(o,"w","dateFormat");a&&(n.dateFormat=j$1(a,"w","val")??void 0);break}case "dropDownList":case "comboBox":n.listItems=Ct(o);break;case "checkbox":{let a=e(o,"w14","checked")??e(o,"w","checked");n.checked=a?j$1(a,"w14","val")==="1"||j$1(a,"w","val")==="1":false;break}case "dataBinding":{let a={},u=j$1(o,"w","xpath"),l=j$1(o,"w","storeItemID"),f=j$1(o,"w","prefixMappings");u!=null&&(a.xpath=u),l!=null&&(a.storeItemID=l),f!=null&&(a.prefixMappings=f),n.dataBinding=a;break}}}}return t&&(n.rawEndPropertiesXml=b(t)),n}var Ie={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};function xt(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0);return Ie[t]?Ie[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function St(e){let t=e.listRendering;t&&t.isBullet&&(t.marker=xt(t.marker||""));}function kt(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 C=n(p,"wps","wsp");if(C){let T=k(C);T&&(d.content=g(T,W,null,n$1,o,r,a??void 0,u??void 0));}let b={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&&(b.id=d.id);let w={type:"shape",shape:b},h$1=f;if(h$1>=e.content.length){h$1=-1;for(let T=e.content.length-1;T>=0;T--)if(e.content[T].type==="run"){h$1=T;break}}if(h$1>=0){let T=e.content[h$1];T.type==="run"&&T.content.push(w);}}for(let p of l){if(d(p.name??"")!=="r")continue;let d$1=i(p);for(let C of d$1){let b=d(C.name??"");if(b==="drawing")c(C);else if(b==="AlternateContent"){let w=i(C),T=w.find(B=>d(B.name??"")==="Choice")??w.find(B=>d(B.name??"")==="Fallback");if(T)for(let B of i(T))d(B.name??"")==="drawing"&&c(B);}}f++;}}function ie(e,t,n,o,r,a,u){let l=[],f=i(e);for(let c of f){let p=c.name??"";if(p==="w:p"||p.endsWith(":p")){let d=W(c,t,n,o,r,a,u);kt(d,c,t,n,o,r,a),St(d),l.push(d);}else if(p==="w:tbl"||p.endsWith(":tbl")){let d=$(c,t,n,o,r,a,u);l.push(d);}else (p==="w:sdt"||p.endsWith(":sdt"))&&l.push(Mt(c,t,n,o,r,a,u));}return l}function Mt(e$1,t,n,o,r,a,u){let l=e(e$1,"w","sdtPr"),f=e(e$1,"w","sdtEndPr"),c=e(e$1,"w","sdtContent"),p=re(l,f),d=c?ie(c,t,n,o,r,a,u):[];return {type:"blockSdt",properties:p,content:d}}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 Oe(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Le(t),rId:n}}function jn(e,t="default",n=null,o=null,r=null,a$1=null,u=null){let l={type:"header",hdrFtrType:t,content:[]};if(!e)return l;let f=a(e);if(!f)return l;let c=f.elements?.find(p=>p.type==="element"&&(p.name==="w:hdr"||p.name?.endsWith(":hdr")));return c&&(l.content=ie(c,n,o,r,a$1,u,{inHeaderFooter:true})),l}function zn(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=ie(c,n,o,r,a$1,u,{inHeaderFooter:true})),l}function De(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function Ve(e,t,n,o,r,a){let u=[];for(let l of i(e)){let f=l.name??"";f==="w:p"?u.push(W(l,t,n,o,r)):f==="w:tbl"&&u.push($(l,t,n,o,r,a));}return u}function Rt(e,t,n,o,r,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=De(l$1),c=Ve(e,t,n,o,r,a);return {type:"footnote",id:u,noteType:f,content:c}}function Yn(e,t=null,n=null,o=null,r=null,a$1=null){let u=new Map,l=[];if(!e)return ae(u,l);let f$1=a(e);if(!f$1)return ae(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:footnotes"||d.name?.endsWith(":footnotes")));if(!c)return ae(u,l);let p=f(c,"w","footnote");for(let d of p){let C=Rt(d,t,n,o,r,a$1);u.set(C.id,C),l.push(C);}return ae(u,l)}function ae(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 Et(e,t,n,o,r,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=De(l$1),c=Ve(e,t,n,o,r,a);return {type:"endnote",id:u,noteType:f,content:c}}function $n(e,t=null,n=null,o=null,r=null,a$1=null){let u=new Map,l=[];if(!e)return le(u,l);let f$1=a(e);if(!f$1)return le(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:endnotes"||d.name?.endsWith(":endnotes")));if(!c)return le(u,l);let p=f(c,"w","endnote");for(let d of p){let C=Et(d,t,n,o,r,a$1);u.set(C.id,C),l.push(C);}return le(u,l)}function le(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 We(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 Pt(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Bt(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=Pt(u);}let o=e(e$1,"w","numFmt");if(o){let u=j$1(o,"w","val");t.numFmt=We(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=Bt(u);}let o=e(e$1,"w","numFmt");if(o){let u=j$1(o,"w","val");t.numFmt=We(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 Kn(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 Zn(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 Qn(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function Jn(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function vt(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 se(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=vt(u,l$1,f,c);p&&(o.color=p);let d=j$1(e,"w","shadow");(d==="1"||d==="true")&&(o.shadow=true);let C=j$1(e,"w","frame");return (C==="1"||C==="true")&&(o.frame=true),o}function Nt(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function Ht(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 It(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function qe(e$1,t){let n={};if(!e$1)return n;let o=e(e$1,"w","pgSz");if(o){let m=l(o,"w","w");m!==void 0&&(n.pageWidth=m);let F=l(o,"w","h");F!==void 0&&(n.pageHeight=F);let E=j$1(o,"w","orient"),y=Nt(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 F=l(r,"w","bottom");F!==void 0&&(n.marginBottom=F);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 x=l(r,"w","header");x!==void 0&&(n.headerDistance=x);let P=l(r,"w","footer");P!==void 0&&(n.footerDistance=P);let v=l(r,"w","gutter");v!==void 0&&(n.gutter=v);}let a=e(e$1,"w","cols");if(a){let m=l(a,"w","num");m!==void 0&&(n.columnCount=m);let F=l(a,"w","space");F!==void 0&&(n.columnSpace=F);let E=j$1(a,"w","equalWidth");E==="1"||E==="true"?n.equalWidth=true:(E==="0"||E==="false")&&(n.equalWidth=false);let y=j$1(a,"w","sep");(y==="1"||y==="true")&&(n.separator=true);let x=f(a,"w","col");if(x.length>0){n.columns=[];for(let P of x){let v={},I=l(P,"w","w");I!==void 0&&(v.width=I);let A=l(P,"w","space");A!==void 0&&(v.space=A),n.columns.push(v);}n.columnCount===void 0&&(n.columnCount=x.length);}}let u=e(e$1,"w","type");if(u){let m=j$1(u,"w","val"),F=Ht(m);F&&(n.sectionStart=F);}let l$1=e(e$1,"w","vAlign");if(l$1){let m=j$1(l$1,"w","val"),F=At(m);F&&(n.verticalAlign=F);}let f$1=e(e$1,"w","bidi");f$1&&(n.bidi=m(f$1));let c=f(e$1,"w","headerReference");c.length>0&&(n.headerReferences=c.map(m=>Xe(m)));let p=f(e$1,"w","footerReference");p.length>0&&(n.footerReferences=p.map(m=>Oe(m)));let d=e(e$1,"w","titlePg");d&&(n.titlePg=m(d));let C=e(e$1,"w","evenAndOddHeaders");C&&(n.evenAndOddHeaders=m(C));let b=e(e$1,"w","lnNumType");if(b){n.lineNumbers={};let m=l(b,"w","start");m!==void 0&&(n.lineNumbers.start=m);let F=l(b,"w","countBy");F!==void 0&&(n.lineNumbers.countBy=F);let E=l(b,"w","distance");E!==void 0&&(n.lineNumbers.distance=E);let y=j$1(b,"w","restart"),x=It(y);x&&(n.lineNumbers.restart=x);}let w=e(e$1,"w","pgBorders");if(w){n.pageBorders={};let m=se(e(w,"w","top"));m&&(n.pageBorders.top=m);let F=se(e(w,"w","bottom"));F&&(n.pageBorders.bottom=F);let E=se(e(w,"w","left"));E&&(n.pageBorders.left=E);let y=se(e(w,"w","right"));y&&(n.pageBorders.right=y);let x=j$1(w,"w","display");(x==="allPages"||x==="firstPage"||x==="notFirstPage")&&(n.pageBorders.display=x);let P=j$1(w,"w","offsetFrom");(P==="page"||P==="text")&&(n.pageBorders.offsetFrom=P);let v=j$1(w,"w","zOrder");(v==="front"||v==="back")&&(n.pageBorders.zOrder=v);}let h=e(e$1,"w","background");if(h){n.background={};let m=j$1(h,"w","color");m&&m!=="auto"&&(n.background.color={rgb:m});let F=j$1(h,"w","themeColor");F&&(n.background.themeColor=F);let E=j$1(h,"w","themeTint");E&&(n.background.themeTint=E);let y=j$1(h,"w","themeShade");y&&(n.background.themeShade=y);}let T=e(e$1,"w","footnotePr");if(T){let m=ze(T);Object.keys(m).length>0&&(n.footnotePr=m);}let B=e(e$1,"w","endnotePr");if(B){let m=Ue(B);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 F=l(M,"w","linePitch");F!==void 0&&(n.docGrid.linePitch=F);let E=l(M,"w","charSpace");E!==void 0&&(n.docGrid.charSpace=E);}let S=e(e$1,"w","paperSrc");if(S){let m=l(S,"w","first");m!==void 0&&(n.paperSrcFirst=m);let F=l(S,"w","other");F!==void 0&&(n.paperSrcOther=F);}return n}function ro(){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 io(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 Lt(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||!Xt(e.underline,t.underline)||!ue(e.color,t.color)||!Ot(e.shading,t.shading)||!Dt(e.fontFamily,t.fontFamily))}function Xt(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:ue(e.color,t.color)}function ue(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 Ot(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!ue(e.color,t.color)||!ue(e.fill,t.fill))}function Dt(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 Vt(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function _e(e){return e.content.length===0?true:e.content.every(Vt)}function Wt(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 jt(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}_e(n)&&_e(o)&&Lt(n.formatting,o.formatting)?n={type:"run",formatting:n.formatting,content:Wt(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=jt(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 Ye(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function zt(e){if(!e)return;let t={},n=j$1(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=j$1(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=j$1(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let a=j$1(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=j$1(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=j$1(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function ce(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 z=j$1(f,"w","color"),U=j$1(f,"w","themeColor");(z||U)&&(o.underline.color=Ye(z,U,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 C=e(e$1,"w","smallCaps");C&&(o.smallCaps=m(C));let b=e(e$1,"w","caps");b&&(o.allCaps=m(b));let w=e(e$1,"w","vanish");w&&(o.hidden=m(w));let h=e(e$1,"w","color");h&&(o.color=Ye(j$1(h,"w","val"),j$1(h,"w","themeColor"),j$1(h,"w","themeTint"),j$1(h,"w","themeShade")));let T=e(e$1,"w","highlight");if(T){let k=j$1(T,"w","val");k&&(o.highlight=k);}let B=e(e$1,"w","shd");B&&(o.shading=zt(B));let M=e(e$1,"w","sz");if(M){let k=l(M,"w","val");k!==void 0&&(o.fontSize=k);}let S=e(e$1,"w","szCs");if(S){let k=l(S,"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 z=j$1(m$1,"w","hAnsiTheme");z&&(o.fontFamily.hAnsiTheme=z,t&&!o.fontFamily.hAnsi&&(o.fontFamily.hAnsi=Y(t,z)));let U=j$1(m$1,"w","eastAsiaTheme");U&&(o.fontFamily.eastAsiaTheme=U,t&&!o.fontFamily.eastAsia&&(o.fontFamily.eastAsia=Y(t,U)));let de=j$1(m$1,"w","cstheme");de&&(o.fontFamily.csTheme=de,t&&!o.fontFamily.cs&&(o.fontFamily.cs=Y(t,de)));}let F=e(e$1,"w","spacing");if(F){let k=l(F,"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 x=e(e$1,"w","kern");if(x){let k=l(x,"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 v=e(e$1,"w","em");if(v){let k=j$1(v,"w","val");k&&(o.emphasisMark=k);}let I=e(e$1,"w","emboss");I&&(o.emboss=m(I));let A=e(e$1,"w","imprint");A&&(o.imprint=m(A));let X=e(e$1,"w","outline");X&&(o.outline=m(X));let Te=e(e$1,"w","shadow");Te&&(o.shadow=m(Te));let Fe=e(e$1,"w","rtl");Fe&&(o.rtl=m(Fe));let Ce=e(e$1,"w","cs");Ce&&(o.cs=m(Ce));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 Ut(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 Gt(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:Ut(a),previousFormatting:ce(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function qt(e){let t=k$1(e),n=j$1(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function _t(){return {type:"tab"}}function Yt(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 Kt(e){return {type:"footnoteRef",id:l(e,"w","id")??0}}function Zt(e){return {type:"endnoteRef",id:l(e,"w","id")??0}}function Qt(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 Jt(e){return {type:"instrText",text:k$1(e)}}function $e(e,t,n){let o=z(e,t??void 0,n??void 0);return o?{type:"drawing",image:o}:null}function fe(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function en(e,t,n){let o=[],r=i(e);for(let a of r)switch(fe(a.name)){case "t":o.push(qt(a));break;case "tab":o.push(_t());break;case "br":o.push(Yt(a));break;case "sym":o.push($t(a));break;case "footnoteReference":o.push(Kt(a));break;case "endnoteReference":o.push(Zt(a));break;case "fldChar":o.push(Qt(a));break;case "instrText":o.push(Jt(a));break;case "softHyphen":o.push({type:"softHyphen"});break;case "noBreakHyphen":o.push({type:"noBreakHyphen"});break;case "drawing":let l=$e(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=>fe(p.name)==="Choice")??i(a).find(p=>fe(p.name)==="Fallback");if(c){for(let p of i(c))if(fe(p.name)==="drawing"){let C=$e(p,t,n);C?.image?.src&&o.push(C);}}break}}return o}function K(e$1,t,n,o=null,r=null){let a={type:"run",content:[]},u=e(e$1,"w","rPr");return u&&(a.formatting=ce(u,n),a.propertyChanges=Gt(u,n,t,a.formatting)),a.content=en(e$1,o,r),a}function tn(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 nn(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 q(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=tn(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 on(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 rn(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 pe(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 x=l(u,"w","after");x!==void 0&&(o.spaceAfter=x);let P=l(u,"w","line");P!==void 0&&(o.lineSpacing=P);let v={};y!==void 0&&(v.before=true),x!==void 0&&(v.after=true),(v.before||v.after)&&(o.spacingExplicit=v);let I=j$1(u,"w","lineRule");I&&(o.lineSpacingRule=I);let A=j$1(u,"w","beforeAutospacing");A&&(o.beforeAutospacing=A==="1"||A==="true");let X=j$1(u,"w","afterAutospacing");X&&(o.afterAutospacing=X==="1"||X==="true");}let l$1=e(e$1,"w","ind");if(l$1){let y=l(l$1,"w","left");y!==void 0&&(o.indentLeft=y);let x=l(l$1,"w","right");x!==void 0&&(o.indentRight=x);let P=l(l$1,"w","firstLine");P!==void 0&&(o.indentFirstLine=P);let v=l(l$1,"w","hanging");v!==void 0&&(o.indentFirstLine=-v,o.hangingIndent=true);let I=l(l$1,"w","start");I!==void 0&&o.indentLeft===void 0&&(o.indentLeft=I);let A=l(l$1,"w","end");A!==void 0&&o.indentRight===void 0&&(o.indentRight=A);}let f=e(e$1,"w","pBdr");if(f){let y={},x=q(e(f,"w","top"));x&&(y.top=x);let P=q(e(f,"w","bottom"));P&&(y.bottom=P);let v=q(e(f,"w","left"));v&&(y.left=v);let I=q(e(f,"w","right"));I&&(y.right=I);let A=q(e(f,"w","between"));A&&(y.between=A);let X=q(e(f,"w","bar"));X&&(y.bar=X),Object.keys(y).length>0&&(o.borders=y);}let c=e(e$1,"w","shd");c&&(o.shading=nn(c));let p=e(e$1,"w","tabs");p&&(o.tabs=on(p));let d=e(e$1,"w","keepNext");d&&(o.keepNext=m(d));let C=e(e$1,"w","keepLines");C&&(o.keepLines=m(C));let b=e(e$1,"w","widowControl");b&&(o.widowControl=m(b));let w=e(e$1,"w","pageBreakBefore");w&&(o.pageBreakBefore=m(w));let h=e(e$1,"w","contextualSpacing");h&&(o.contextualSpacing=m(h));let T=e(e$1,"w","numPr");if(T){let y=e(T,"w","numId"),x=e(T,"w","ilvl");if(y||x){if(o.numPr={},y){let P=l(y,"w","val");P!==void 0&&(o.numPr.numId=P);}if(x){let P=l(x,"w","val");P!==void 0&&(o.numPr.ilvl=P);}}}let B=e(e$1,"w","outlineLvl");if(B){let y=l(B,"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 S=e(e$1,"w","framePr");S&&(o.frame=rn(S));let m$1=e(e$1,"w","suppressLineNumbers");m$1&&(o.suppressLineNumbers=m(m$1));let F=e(e$1,"w","suppressAutoHyphens");F&&(o.suppressAutoHyphens=m(F));let E=e(e$1,"w","rPr");return E&&(o.runProperties=ce(E,t)),Object.keys(o).length>0?o:void 0}function an(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function ln(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 sn(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 b=t.get(u);b&&(c$1(b),a.href=b.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 C=i(e);for(let b of C)switch(an(b.name)){case "r":a.children.push(K(b,n,o,t,r));break;case "bookmarkStart":a.children.push(ln(b));break;case "bookmarkEnd":a.children.push(sn(b));break}return a}function bo(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 To(e){return e.href?/^https?:\/\/|^mailto:|^tel:|^ftp:/i.test(e.href):!!e.rId&&!e.anchor}function Fo(e){return !!e.anchor}function Co(e){return e.href}function xo(e){return e.children.some(t=>t.type==="run")}function So(e){return e.children.filter(t=>t.type==="run")}function ko(e,t){if(e.rId){let n=t.get(e.rId);if(n)return c$1(n),e.href=n.target,e.href}return e.anchor&&!e.href&&(e.href=`#${e.anchor}`),e.href}function Ze(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 Qe(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function et(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+=et(n);return t}function Q(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function tt(e){let t=new Set(["hyperlink","smartTag","sdt","sdtContent","fldSimple","customXml","ins","del","moveFrom","moveTo"]),n=new Set(["pPr","proofErr","bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","commentReference","permStart","permEnd","rsidR"]),o=new Set(["t","tab","br","cr","sym","drawing","pict","object","softHyphen","noBreakHyphen","fldChar","instrText","pgNum","separator","continuationSeparator","footnoteRef","endnoteRef","footnoteReference","endnoteReference","ptab","monthShort","monthLong","yearShort","yearLong","dayShort","dayLong"]),r=false;function a(l){for(let f of i(l)){let c=Q(f.name);if(!n.has(c)){if(c==="lastRenderedPageBreak"){r=true;continue}if(c==="r"){for(let p of i(f)){let d=Q(p.name);if(d!=="rPr"){if(d==="lastRenderedPageBreak"){r=true;continue}if(d==="br"&&j$1(p,"w","type")==="page")return "forced";if(o.has(d))return "visible"}}continue}if(t.has(c)){let p=a(f);if(p!=="continue")return p;continue}return "continue"}}return "continue"}let u=a(e);return u==="forced"?true:u==="visible"?r:false}function Je(e,t){if(!e)return `w:${t}`;let n=e.indexOf(":");return n<0?t:`${e.substring(0,n+1)}${t}`}function nt(e){if(e.type!=="element")return e;let t=Q(e.name),n=e.name;return t==="delText"?n=Je(e.name,"t"):t==="delInstrText"&&(n=Je(e.name,"instrText")),{...e,name:n,elements:e.elements?.map(nt)}}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 un(e){return Z(e)}function ot(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:un(a),previousFormatting:pe(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function fn(e,t,n,o,r){return Ke(e,t,n,o,r)}function cn(e){return Ze(e)}function pn(e){return Qe(e)}function rt(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 dn(e,t,n,o,r){let a=j$1(e,"w","instr")??"",u=rt(a),l={type:"simpleField",instruction:a,fieldType:u,content:[]},f=j$1(e,"w","fldLock");(f==="1"||f==="true")&&(l.fldLock=true);let c=j$1(e,"w","dirty");(c==="1"||c==="true")&&(l.dirty=true);let p=i(e);for(let d of p)Q(d.name)==="r"&&l.content.push(K(d,t,n,o,r));return l}function j(e,t,n,o,r,a,u="default"){let l=[],f=i(e),c=false,p="",d=[],C=[],b$1=false,w=false,h=false;for(let T of f){let B=Q(T.name);switch(B){case "r":{let M=u==="deletion"?nt(T):T,S=K(M,t,n,r,a),m=false,F=false,E=false,y="";for(let x of S.content)x.type==="fieldChar"?x.charType==="begin"?(m=true,x.fldLock&&(w=true),x.dirty&&(h=true)):x.charType==="separate"?F=true:x.charType==="end"&&(E=true):x.type==="instrText"&&(y+=x.text);if(m&&(c=true,b$1=false,p="",d=[],C=[],w=false,h=false),c){if(y&&(p+=y),F&&(b$1=true),b$1&&!E?F||C.push(S):!b$1&&!m&&d.push(S),E){let x={type:"complexField",instruction:p.trim(),fieldType:rt(p),fieldCode:d,fieldResult:C};w&&(x.fldLock=true),h&&(x.dirty=true),l.push(x),c=false;}}else l.push(S);break}case "hyperlink":l.push(fn(T,r,t,n,a));break;case "bookmarkStart":l.push(cn(T));break;case "bookmarkEnd":l.push(pn(T));break;case "fldSimple":l.push(dn(T,t,n,r,a));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let M=(T.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtPr"||m.name?.endsWith(":sdtPr"))),S=(T.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(S){let m=j(S,t,n,null,r,a,u),E={type:"inlineSdt",properties:re(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(T),S=j(T,t,n,null,r,a),m={type:"insertion",info:M,content:S.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "del":{let M=Z(T),S=j(T,t,n,null,r,a,"deletion"),m={type:"deletion",info:M,content:S.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "moveFrom":{let M=Z(T),S=j(T,t,n,null,r,a,"deletion"),m={type:"moveFrom",info:M,content:S.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "moveTo":{let M=Z(T),S=j(T,t,n,null,r,a),m={type:"moveTo",info:M,content:S.filter(F=>F.type==="run"||F.type==="hyperlink")};l.push(m);break}case "smartTag":break;case "moveFromRangeStart":{let M=parseInt(j$1(T,"w","id")??"0",10),S=j$1(T,"w","name")??"";l.push({type:"moveFromRangeStart",id:M,name:S});break}case "moveFromRangeEnd":{let M=parseInt(j$1(T,"w","id")??"0",10);l.push({type:"moveFromRangeEnd",id:M});break}case "moveToRangeStart":{let M=parseInt(j$1(T,"w","id")??"0",10),S=j$1(T,"w","name")??"";l.push({type:"moveToRangeStart",id:M,name:S});break}case "moveToRangeEnd":{let M=parseInt(j$1(T,"w","id")??"0",10);l.push({type:"moveToRangeEnd",id:M});break}case "commentRangeStart":{let M=parseInt(j$1(T,"w","id")??"0",10);l.push({type:"commentRangeStart",id:M});break}case "commentRangeEnd":{let M=parseInt(j$1(T,"w","id")??"0",10);l.push({type:"commentRangeEnd",id:M});break}case "oMath":case "oMathPara":{let M=B==="oMathPara",S=b(T),m=et(T),F={type:"mathEquation",display:M?"block":"inline",ommlXml:S,plainText:m||void 0};l.push(F);break}}}return l}function mn(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 it(e){let t=j$1(e,"w","id");if(t==null)return null;let n=parseInt(t,10);if(Number.isNaN(n))return null;let o=j$1(e,"w","author")??"",r=j$1(e,"w","date")??void 0,a={id:n,author:o};return r&&(a.date=r),a}function W(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&&tt(e$1)&&(l.renderedPageBreakBefore=true);let p=e(e$1,"w","pPr");if(p){l.formatting=pe(p,n),l.propertyChanges=ot(p,n,t,l.formatting);let b=e(p,"w","rPr");if(b){let h=e(b,"w","ins");if(h){let B=it(h);B&&(l.pPrIns=B);}let T=e(b,"w","del");if(T){let B=it(T);B&&(l.pPrDel=B);}}let w=e(p,"w","sectPr");w&&(l.sectionProperties=qe(w));}let d=j(e$1,t,n,o,r,a);l.content=be(d);let C=l.formatting?.numPr;if(!C&&l.formatting?.styleId&&t){let b=t.get(l.formatting.styleId);b?.pPr?.numPr&&(C=b.pPr.numPr,l.formatting||(l.formatting={}),l.formatting.numPr=C);}if(C&&o){let{numId:b,ilvl:w=0}=C;if(b!==void 0&&b!==0){let h=o.getLevel(b,w);if(h){let T=[];for(let S=0;S<=w;S+=1){let m=o.getLevel(b,S);T.push(m?.numFmt??"decimal");}let B=o.getInstance(b),M=B?.levelOverrides?.find(S=>S.ilvl===w);if(l.listRendering={level:w,numId:b,marker:h.lvlText,isBullet:h.numFmt==="bullet",numFmt:h.numFmt,markerHidden:h.rPr?.hidden||void 0,markerFontFamily:h.rPr?.fontFamily?.ascii||h.rPr?.fontFamily?.hAnsi||void 0,markerFontSize:h.rPr?.fontSize?h.rPr.fontSize/2:void 0,markerSuffix:h.suffix,levelNumFmts:T,abstractNumId:B?.abstractNumId,startOverride:M?.startOverride},h.pPr){l.formatting||(l.formatting={});let S=p?e(p,"w","ind"):null,m=S!=null&&(j$1(S,"w","left")!==null||j$1(S,"w","start")!==null),F=y=>{let x=S?j$1(S,"w",y):null;if(x===null)return false;let P=parseInt(x,10);return Number.isNaN(P)||P!==0},E=S!=null&&(F("firstLine")||F("hanging"));!m&&h.pPr.indentLeft!==void 0&&(l.formatting.indentLeft=h.pPr.indentLeft),E||(h.pPr.indentFirstLine!==void 0&&(l.formatting.indentFirstLine=h.pPr.indentFirstLine),h.pPr.hangingIndent!==void 0&&(l.formatting.hangingIndent=h.pPr.hangingIndent));}}}}return l}function at(e$1){if(!e$1)return;let t={},n=O(e(e$1,"w","tblW"));n&&(t.width=n);let o=e(e$1,"w","jc");if(o){let h=j$1(o,"w","val");(h==="left"||h==="center"||h==="right"||h==="start")&&(t.justification=h==="start"?"left":h);}let r=O(e(e$1,"w","tblCellSpacing"));r&&(t.cellSpacing=r);let a=O(e(e$1,"w","tblInd"));a&&(t.indent=a);let u=te(e(e$1,"w","tblBorders"));u&&(t.borders=u);let l=ne(e(e$1,"w","tblCellMar"));l&&(t.cellMargins=l);let f=e(e$1,"w","tblLayout");if(f){let h=j$1(f,"w","type");(h==="fixed"||h==="autofit")&&(t.layout=h);}let c=e(e$1,"w","tblStyle");if(c){let h=j$1(c,"w","val");h&&(t.styleId=h);}let p=we(e(e$1,"w","tblLook"));p&&(t.look=p);let d=oe(e(e$1,"w","shd"));d&&(t.shading=d);let C=e(e$1,"w","tblOverlap");if(C){let h=j$1(C,"w","val");(h==="never"||h==="overlap")&&(t.overlap=h);}let b=ye(e(e$1,"w","tblpPr"));if(b&&(t.floating=b),m(e(e$1,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function gn(e$1,t){if(!e$1)return;let n=f(e$1,"w","tblPrChange").map(o=>{let r=e(o,"w","tblPr");return {type:"tablePropertyChange",info:ee(o),previousFormatting:at(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function hn(e$1,t){if(!e$1)return;let n=f(e$1,"w","trPrChange").map(o=>{let r=e(o,"w","trPr");return {type:"tableRowPropertyChange",info:ee(o),previousFormatting:lt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function wn(e$1,t){if(!e$1)return;let n=f(e$1,"w","tcPrChange").map(o=>{let r=e(o,"w","tcPr");return {type:"tableCellPropertyChange",info:ee(o),previousFormatting:ut(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function yn(e$1){if(!e$1)return;let t=e(e$1,"w","ins");if(t)return {type:"tableRowInsertion",info:V(t)};let n=e(e$1,"w","del");if(n)return {type:"tableRowDeletion",info:V(n)}}function bn(e$1){if(!e$1)return;let t=e(e$1,"w","cellIns");if(t)return {type:"tableCellInsertion",info:V(t)};let n=e(e$1,"w","cellDel");if(n)return {type:"tableCellDeletion",info:V(n)};let o=e(e$1,"w","cellMerge");if(o){let r=j$1(o,"w","vMerge"),a=j$1(o,"w","vMergeOrig"),u=l=>l==="rest"||l==="cont";return {type:"tableCellMerge",info:V(o),...u(r)?{vMerge:r}:{},...u(a)?{vMergeOrig:a}:{}}}}function lt(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=st(e(e$1,"w","cnfStyle"));if(l$1&&(t.conditionalFormat=l$1),Object.keys(t).length!==0)return t}function st(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 C=j$1(e,"w","lastRowFirstColumn");(C==="1"||C==="true")&&(t.swCell=true);let b=j$1(e,"w","lastRowLastColumn");(b==="1"||b==="true")&&(t.seCell=true);let w=j$1(e,"w","val");if(w&&w.length===12&&(w[0]==="1"&&(t.firstRow=true),w[1]==="1"&&(t.lastRow=true),w[2]==="1"&&(t.firstColumn=true),w[3]==="1"&&(t.lastColumn=true),w[4]==="1"&&(t.oddVBand=true),w[5]==="1"&&(t.evenVBand=true),w[6]==="1"&&(t.oddHBand=true),w[7]==="1"&&(t.evenHBand=true),w[8]==="1"&&(t.nwCell=true),w[9]==="1"&&(t.neCell=true),w[10]==="1"&&(t.swCell=true),w[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function ut(e$1){if(!e$1)return;let t={},n=O(e(e$1,"w","tcW"));n&&(t.width=n);let o=te(e(e$1,"w","tcBorders"));o&&(t.borders=o);let r=ne(e(e$1,"w","tcMar"));r&&(t.margins=r);let a=oe(e(e$1,"w","shd"));a&&(t.shading=a);let u=e(e$1,"w","vAlign");if(u){let w=j$1(u,"w","val");(w==="top"||w==="center"||w==="bottom")&&(t.verticalAlign=w);}let l$1=e(e$1,"w","textDirection");if(l$1){let w=j$1(l$1,"w","val");w&&(t.textDirection=w);}let f=e(e$1,"w","gridSpan");if(f){let w=l(f,"w","val");w!==void 0&&w>1&&(t.gridSpan=w);}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 b=st(e(e$1,"w","cnfStyle"));if(b&&(t.conditionalFormat=b),Object.keys(t).length!==0)return t}function Tn(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=W(c,t,n,o,r,a,u);l.push(d);}else if(p==="tbl"){let d=$(c,t,n,o,r,a,u);l.push(d);}}return l.length===0&&l.push({type:"paragraph",content:[]}),l}function Fn(e$1,t,n,o,r,a,u){let l={type:"tableCell",content:[]},f=e(e$1,"w","tcPr"),c=ut(f);return c&&(l.formatting=c),l.propertyChanges=wn(f,c),l.structuralChange=bn(f),l.content=Tn(e$1,t,n,o,r,a,u),l}function Cn(e$1,t,n,o,r,a,u){let l={type:"tableRow",cells:[]},f$1=e(e$1,"w","trPr"),c=lt(f$1);c&&(l.formatting=c),l.propertyChanges=hn(f$1,c),l.structuralChange=yn(f$1);let p=f(e$1,"w","tc");for(let d of p){let C=Fn(d,t,n,o,r,a,u);l.cells.push(C);}return l}function xn(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 Sn(e){return e.cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function kn(e){let t=Math.max(e.columnWidths?.length??0,...e.rows.map(n=>Sn(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 $(e$1,t,n,o,r,a,u){let l={type:"table",rows:[]},f$1=e(e$1,"w","tblPr"),c=at(f$1);c&&(l.formatting=c),l.propertyChanges=gn(f$1,c);let p=xn(e(e$1,"w","tblGrid"));p&&(l.columnWidths=p);let d=f(e$1,"w","tr");for(let C of d){let b=Cn(C,t,n,o,r,a,u);l.rows.push(b);}return kn(l),l}export{Jn as A,qe as B,ro as C,io as D,K as E,Ke as F,bo as G,To as H,Fo as I,Co as J,xo as K,So as L,ko as M,mn as N,W as O,Rn as a,Y as b,Ae as c,D as d,te as e,ne as f,oe as g,we as h,ye as i,gt as j,ht as k,wt as l,yt as m,bt as n,at as o,xt as p,ie as q,jn as r,zn as s,Yn as t,$n as u,ze as v,Ue as w,Kn as x,Zn as y,Qn as z};
@@ -1 +1 @@
1
- 'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkF44ZLDZS_js=require('./chunk-F44ZLDZS.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function B(e,a){let i={};for(let t of e)switch(t.type.name){case "bold":i.bold=true;break;case "italic":i.italic=true;break;case "underline":{let n=t.attrs;if(n.style||n.color){let r=n.color?chunkMJ5FQX7Q_js.a(n.color,a):void 0;i.underline={style:n.style,color:r};}else i.underline=true;break}case "strike":i.strike=true;break;case "textColor":{let n=t.attrs;(n.themeColor||n.rgb)&&(i.color=chunkMJ5FQX7Q_js.a({rgb:n.rgb,themeColor:n.themeColor,themeTint:n.themeTint,themeShade:n.themeShade},a));break}case "highlight":i.highlight=chunkMJ5FQX7Q_js.o(t.attrs.color);break;case "fontSize":{let n=t.attrs;i.fontSize=n.size/2;break}case "fontFamily":{let n=t.attrs;i.fontFamily=n.ascii||n.hAnsi;break}case "characterSpacing":{let n=t.attrs;n.spacing!=null&&n.spacing!==0&&(i.letterSpacing=chunkIMKU4O3P_js.a(n.spacing)),n.position!=null&&n.position!==0&&(i.positionPx=chunk4Q2IP5FW_js.j(n.position)),n.scale!=null&&n.scale!==100&&(i.horizontalScale=n.scale),n.kerning!=null&&n.kerning>0&&(i.kerningMinPt=chunk4Q2IP5FW_js.k(n.kerning));break}case "allCaps":i.allCaps=true;break;case "smallCaps":i.smallCaps=true;break;case "emboss":i.emboss=true;break;case "imprint":i.imprint=true;break;case "textShadow":i.textShadow=true;break;case "textOutline":i.textOutline=true;break;case "hidden":i.hidden=true;break;case "rtl":i.rtl=true;break;case "textEffect":{let n=t.attrs.effect;(n==="blinkBackground"||n==="lights"||n==="antsBlack"||n==="antsRed"||n==="shimmer"||n==="sparkle")&&(i.textEffect=n);break}case "emphasisMark":{let n=t.attrs.type;n==="dot"||n==="comma"||n==="circle"||n==="underDot"?i.emphasisMark=n:i.emphasisMark="dot";break}case "superscript":i.superscript=true;break;case "subscript":i.subscript=true;break;case "hyperlink":{let n=t.attrs;i.hyperlink={href:n.href,tooltip:n.tooltip};break}case "footnoteRef":{let n=t.attrs,r=typeof n.id=="string"?parseInt(n.id,10):n.id;n.noteType==="endnote"?i.endnoteRefId=r:i.footnoteRefId=r;break}case "comment":{let n=t.attrs.commentId;n&&(i.commentIds||(i.commentIds=[]),i.commentIds.push(n));break}case "insertion":i.isInsertion=true,i.changeAuthor=t.attrs.author,i.changeDate=t.attrs.date,i.changeRevisionId=t.attrs.revisionId;break;case "deletion":i.isDeletion=true,i.changeAuthor=t.attrs.author,i.changeDate=t.attrs.date,i.changeRevisionId=t.attrs.revisionId;break}return i}function _(e){let a=e.defaultTextFormatting;if(!a)return {};let i={};if(a.fontFamily){let t=a.fontFamily.ascii||a.fontFamily.hAnsi;t&&(i.fontFamily=t);}return a.fontSize!=null&&(i.fontSize=a.fontSize/2),i}function E(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function L(e,a,i){let t=[],n=a+1,r=i.theme,s=_(e.attrs),l=e.attrs.styleId,g=typeof l=="string"&&/^TOC\d*$/i.test(l);function p(d,f){if(d.isText&&d.text){let o=B(d.marks,r);g&&E(o);let u={kind:"text",text:d.text,...s,...o,pmStart:f,pmEnd:f+d.nodeSize};t.push(u);}else if(d.type.name==="hardBreak")t.push({kind:"lineBreak",pmStart:f,pmEnd:f+d.nodeSize});else if(d.type.name==="tab"){let o=B(d.marks,r),u={kind:"tab",...s,...o,pmStart:f,pmEnd:f+d.nodeSize};t.push(u);}else if(d.type.name==="image"){let o=d.attrs,u=chunkIMKU4O3P_js.b(o.width||100,o.height||100,i.pageContentHeight),c=B(d.marks,r),b={kind:"image",src:o.src,width:u.width,height:u.height,alt:o.alt,transform:o.transform,wrapType:o.wrapType,displayMode:o.displayMode,cssFloat:o.cssFloat,distTop:o.distTop,distBottom:o.distBottom,distLeft:o.distLeft,distRight:o.distRight,position:o.position,cropTop:o.cropTop,cropRight:o.cropRight,cropBottom:o.cropBottom,cropLeft:o.cropLeft,opacity:o.opacity,isInsertion:c.isInsertion,isDeletion:c.isDeletion,changeAuthor:c.changeAuthor,changeDate:c.changeDate,changeRevisionId:c.changeRevisionId,pmStart:f,pmEnd:f+d.nodeSize};t.push(b);}else if(d.type.name==="field"){let o=d.attrs.fieldType,u=o==="PAGE"?"PAGE":o==="NUMPAGES"?"NUMPAGES":o==="DATE"?"DATE":o==="TIME"?"TIME":"OTHER",c=B(d.marks,r);g&&E(c),t.push({kind:"field",fieldType:u,fallback:d.attrs.displayText||"",...s,...c,pmStart:f,pmEnd:f+d.nodeSize});}else if(d.type.name==="math"){let o=d.attrs.plainText||"[equation]";t.push({kind:"text",text:o,italic:true,fontFamily:"Cambria Math",pmStart:f,pmEnd:f+d.nodeSize});}else if(d.type.name==="sdt"){let o=f+1;d.forEach((u,c)=>{p(u,o+c);});}}return e.forEach((d,f)=>{p(d,n+f);}),t}function U(e){return Math.max(1,Math.round(e/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 F(e,a){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let i={style:Y[e.style]||"solid",width:U(e.size??0),color:e.color?chunkMJ5FQX7Q_js.a(e.color,a):"#000000"};return e.space!==void 0&&(i.space=chunk4Q2IP5FW_js.i(e.space)),i}function D(e,a){let i=e.borders;if(!i)return;let t={},n=["top","bottom","left","right"];for(let r of n){let s=i[r],l=s?F(s,a):void 0;t[r]=l??{width:0,style:"none"};}return Object.keys(t).length>0?t:void 0}function $(e,a){let i=[];for(let t=0;t<=a;t+=1){let n=e[t]??0;if(n<=0)break;i.push(n);}return i.length===0?"1.":`${i.join(".")}.`}var G=[[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 N(e,a){if(e<=0)return "";let i=e,t="";for(let[n,r]of G)for(;i>=n;)t+=r,i-=n;return a?t:t.toLowerCase()}function O(e,a){if(e<=0)return "";let i=e,t="";for(;i>0;){let n=(i-1)%26;t=String.fromCharCode(65+n)+t,i=Math.floor((i-1)/26);}return a?t:t.toLowerCase()}function j(e,a){if(e<=0)return "";switch(a){case "upperRoman":return N(e,true);case "lowerRoman":return N(e,false);case "upperLetter":return O(e,true);case "lowerLetter":return O(e,false);case "decimalZero":return e<10?`0${e}`:String(e);case "none":return "";default:return String(e)}}function H(e,a,i){return e.replace(/%(\d)([.):\]])?/g,(t,n,r="")=>{let s=parseInt(n,10)-1;if(s<0)return "";let l=a[s]??0,g=i?.[s]??"decimal",p=j(l,g);return p?p+r:""})}function W(e,a,i){let t=e.numPr;if(!t)return null;let n=t.numId;if(n==null||n===0)return null;if(e.listIsBullet)return chunkF44ZLDZS_js.p(e.listMarker||"");let r=t.ilvl??0,s=e.listAbstractNumId??n,l=a.get(s)??new Array(9).fill(0),g=`${n}:${r}`;i.has(g)||(i.add(g),e.listStartOverride!=null&&(l[r]=e.listStartOverride-1)),l[r]=(l[r]??0)+1;for(let p=r+1;p<l.length;p+=1)l[p]=0;return a.set(s,l),e.listMarker&&e.listMarker.includes("%")?H(e.listMarker,l,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:$(l,r)}var V="Calibri",q=11;function K(e,a,i,t,n){let r={};if(e.alignment){let o=e.alignment;o==="both"||o==="distribute"?r.alignment="justify":o==="left"?r.alignment="left":o==="center"?r.alignment="center":o==="right"&&(r.alignment="right");}(e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(r.spacing={},e.spaceBefore!=null&&(r.spacing.before=chunkIMKU4O3P_js.a(e.spaceBefore)),e.spaceAfter!=null&&(r.spacing.after=chunkIMKU4O3P_js.a(e.spaceAfter)),e.lineSpacing!=null&&(e.lineSpacingRule==="exact"||e.lineSpacingRule==="atLeast"?(r.spacing.line=chunkIMKU4O3P_js.a(e.lineSpacing),r.spacing.lineUnit="px",r.spacing.lineRule=e.lineSpacingRule):(r.spacing.line=e.lineSpacing/240,r.spacing.lineUnit="multiplier",r.spacing.lineRule="auto"))),e.spacingExplicit&&(r.spacingExplicit=e.spacingExplicit);let s=e.indentLeft,l=e.indentFirstLine,g=e.hangingIndent;if(e.numPr?.numId&&s==null&&(s=((e.numPr.ilvl??0)+1)*720,l==null&&(l=-360,g=true)),(s!=null||e.indentRight!=null||l!=null)&&(r.indent={},s!=null&&(r.indent.left=chunkIMKU4O3P_js.a(s)),e.indentRight!=null&&(r.indent.right=chunkIMKU4O3P_js.a(e.indentRight)),l!=null&&(g?r.indent.hanging=Math.abs(chunkIMKU4O3P_js.a(l)):r.indent.firstLine=chunkIMKU4O3P_js.a(l))),e.styleId&&(r.styleId=e.styleId),e.borders){let o=e.borders;r.borders={};let u=c=>c?F(c,a):void 0;o.top&&(r.borders.top=u(o.top)),o.bottom&&(r.borders.bottom=u(o.bottom)),o.left&&(r.borders.left=u(o.left)),o.right&&(r.borders.right=u(o.right)),o.between&&(r.borders.between=u(o.between)),o.bar&&(r.borders.bar=u(o.bar)),!r.borders.top&&!r.borders.bottom&&!r.borders.left&&!r.borders.right&&!r.borders.between&&!r.borders.bar&&delete r.borders;}let p=chunkMJ5FQX7Q_js.b(e.shading?.fill,a);p&&(r.shading=`#${p}`),e.tabs&&e.tabs.length>0&&(r.tabs=e.tabs.map(o=>({val:Z(o.alignment),pos:o.position,leader:o.leader}))),e.pageBreakBefore&&(r.pageBreakBefore=true),e.keepNext&&(r.keepNext=true),e.keepLines&&(r.keepLines=true),e.contextualSpacing&&(r.contextualSpacing=true),e.bidi&&(r.bidi=true),e.styleId&&(r.styleId=e.styleId),e.numPr&&(r.numPr={numId:e.numPr.numId,ilvl:e.numPr.ilvl});let d=i&&t?W(e,i,t):null;d!=null?r.listMarker=d:e.listMarker&&(r.listMarker=e.listMarker),e.listIsBullet!=null&&(r.listIsBullet=e.listIsBullet),e.listMarkerHidden&&(r.listMarkerHidden=true),e.listMarkerFontFamily&&(r.listMarkerFontFamily=e.listMarkerFontFamily),e.listMarkerFontSize&&(r.listMarkerFontSize=e.listMarkerFontSize),e.listMarkerSuffix&&(r.listMarkerSuffix=e.listMarkerSuffix),n!==void 0&&(r.defaultTabStopTwips=n);let f=e.defaultTextFormatting;if(f&&(f.fontSize!=null&&(r.defaultFontSize=f.fontSize/2),f.fontFamily&&(r.defaultFontFamily=f.fontFamily.ascii||f.fontFamily.hAnsi)),e.pPrIns&&(r.pPrIns=e.pPrIns),e.pPrDel&&(r.pPrDel=e.pPrDel),e.numPr){let o=e.pPrChange,u=Array.isArray(o)&&o.some(c=>!c?.previousFormatting?.numPr);e.pPrDel?r.listMarkerRevision="del":(e.pPrIns||u)&&(r.listMarkerRevision="ins");}return r}function Z(e){switch(e){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 w(e,a,i){let t=e.attrs,n=L(e,a,i),r=K(t,i.theme,i.listCounters,i.listSeenNumIds,i.defaultTabStopTwips);return {kind:"paragraph",id:chunkIMKU4O3P_js.c(),runs:n,attrs:r,pmStart:a,pmEnd:a+e.nodeSize}}function J(e,a,i,t){let n=[],r=a+1;e.forEach(c=>{c.type.name==="paragraph"?n.push(w(c,r,i)):c.type.name==="table"&&n.push(X(c,r,i)),r+=c.nodeSize;});let s=e.attrs,l=s.width,g=s.widthType,p=l&&(!g||g==="dxa"||g==="auto")?chunkIMKU4O3P_js.a(l):void 0,d=s.margins,f=(c,b)=>{if(c!=null){let k=chunkIMKU4O3P_js.a(c);if(k>0)return k}if(b!=null){let k=chunkIMKU4O3P_js.a(b);if(k>=0)return k}return 0},o={top:f(d?.top,t?.top),right:f(d?.right,t?.right),bottom:f(d?.bottom,t?.bottom),left:f(d?.left,t?.left)},u=s.cellMarker;return {id:chunkIMKU4O3P_js.c(),blocks:n,colSpan:s.colspan,rowSpan:s.rowspan,width:p,widthValue:l,widthType:g,verticalAlign:s.verticalAlign,background:s.backgroundColor?`#${s.backgroundColor}`:void 0,borders:D(s,i.theme),padding:o,noWrap:s.noWrap||void 0,trackedMarker:u??void 0}}function Q(e,a,i,t){let n=[],r=a+1;e.forEach(l=>{(l.type.name==="tableCell"||l.type.name==="tableHeader")&&n.push(J(l,r,i,t)),r+=l.nodeSize;});let s=e.attrs;return {id:chunkIMKU4O3P_js.c(),cells:n,height:s.height?chunkIMKU4O3P_js.a(s.height):void 0,heightRule:s.heightRule??void 0,isHeader:s.isHeader,trackedIns:s.trIns??void 0,trackedDel:s.trDel??void 0}}function X(e,a,i){let t=[],n=a+1,r=e.attrs.cellMargins;e.forEach(b=>{b.type.name==="tableRow"&&t.push(Q(b,n,i,r)),n+=b.nodeSize;});let l=e.attrs.columnWidths?.map(chunkIMKU4O3P_js.a),g=e.attrs.width,p=e.attrs.widthType;if(!l&&t.length>0){let k=t[0].cells.map(S=>S.width);k.every(S=>S!==void 0&&S>0)&&(l=k);}let d=e.attrs.justification,f=e.attrs._originalFormatting,o=f?.indent?.value&&f.indent.type==="dxa"?chunkIMKU4O3P_js.a(f.indent.value):void 0,u=e.attrs.floating,c=u?{horzAnchor:u.horzAnchor,vertAnchor:u.vertAnchor,tblpX:u.tblpX!==void 0?chunkIMKU4O3P_js.a(u.tblpX):void 0,tblpXSpec:u.tblpXSpec,tblpY:u.tblpY!==void 0?chunkIMKU4O3P_js.a(u.tblpY):void 0,tblpYSpec:u.tblpYSpec,topFromText:u.topFromText!==void 0?chunkIMKU4O3P_js.a(u.topFromText):void 0,bottomFromText:u.bottomFromText!==void 0?chunkIMKU4O3P_js.a(u.bottomFromText):void 0,leftFromText:u.leftFromText!==void 0?chunkIMKU4O3P_js.a(u.leftFromText):void 0,rightFromText:u.rightFromText!==void 0?chunkIMKU4O3P_js.a(u.rightFromText):void 0}:void 0;return {kind:"table",id:chunkIMKU4O3P_js.c(),rows:t,columnWidths:l,width:g,widthType:p,justification:d,indent:o,floating:c,pmStart:a,pmEnd:a+e.nodeSize}}function A(e,a,i){let t=e.attrs,n=t.wrapType,r=n==="behind"||n==="inFront",s=chunkIMKU4O3P_js.b(t.width||100,t.height||100,i);return {kind:"image",id:chunkIMKU4O3P_js.c(),src:t.src,width:s.width,height:s.height,alt:t.alt,transform:t.transform,anchor:r?{isAnchored:true,offsetH:t.distLeft,offsetV:t.distTop,behindDoc:n==="behind"}:void 0,hlinkHref:t.hlinkHref,pmStart:a,pmEnd:a+e.nodeSize}}function ee(e,a,i){let t=e.attrs,n=[];return e.forEach((r,s)=>{if(r.type.name==="paragraph"){let l=w(r,a+1+s,i);n.push(l);}}),{kind:"textBox",id:chunkIMKU4O3P_js.c(),width:t.width??chunkDROCYKAR_js.b,height:t.height??void 0,fillColor:t.fillColor,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,margins:{top:t.marginTop??chunkDROCYKAR_js.a.top,bottom:t.marginBottom??chunkDROCYKAR_js.a.bottom,left:t.marginLeft??chunkDROCYKAR_js.a.left,right:t.marginRight??chunkDROCYKAR_js.a.right},content:n,displayMode:t.displayMode,cssFloat:t.cssFloat,wrapType:t.wrapType,wrapText:t.wrapText,anchorTarget:t.anchorTarget,position:t.position,distTop:t.distTop,distBottom:t.distBottom,distLeft:t.distLeft,distRight:t.distRight,pmStart:a,pmEnd:a+e.nodeSize}}function he(e,a={}){let i=e.attrs?.defaultTabStopTwips,t={...a,defaultFont:a.defaultFont??V,defaultSize:a.defaultSize??q,defaultTabStopTwips:a.defaultTabStopTwips??i},n=[],r=0,s={top:1440,bottom:1440,left:1440,right:1440};return t.listCounters||(t.listCounters=new Map),t.listSeenNumIds||(t.listSeenNumIds=new Set),e.forEach((l,g)=>{let p=r+g;switch(l.type.name){case "paragraph":{let d=w(l,p,t),f=l.attrs;n.push(d);let o=f._sectionProperties;if(o||f.sectionBreakType){let u={kind:"sectionBreak",id:chunkIMKU4O3P_js.c(),type:o?.sectionStart??f.sectionBreakType};if(o){if((o.pageWidth!==void 0||o.pageHeight!==void 0)&&(u.pageSize={w:chunkIMKU4O3P_js.a(o.pageWidth??12240),h:chunkIMKU4O3P_js.a(o.pageHeight??15840)}),o.marginTop!==void 0||o.marginBottom!==void 0||o.marginLeft!==void 0||o.marginRight!==void 0){let b={top:o.marginTop??s.top,bottom:o.marginBottom??s.bottom,left:o.marginLeft??s.left,right:o.marginRight??s.right};u.margins={top:chunkIMKU4O3P_js.a(b.top),bottom:chunkIMKU4O3P_js.a(b.bottom),left:chunkIMKU4O3P_js.a(b.left),right:chunkIMKU4O3P_js.a(b.right)},s=b;}let c=o.columnCount??1;if(c>1){let b={count:c,gap:chunkIMKU4O3P_js.a(o.columnSpace??720),equalWidth:o.equalWidth??true,separator:o.separator};u.columns=b;}}n.push(u);}}break;case "table":n.push(X(l,p,t));break;case "image":n.push(A(l,p,t.pageContentHeight));break;case "textBox":n.push(ee(l,p,t));break;case "horizontalRule":case "pageBreak":{let d={kind:"pageBreak",id:chunkIMKU4O3P_js.c(),pmStart:p,pmEnd:p+l.nodeSize};n.push(d);break}}}),n}exports.a=F;exports.b=H;exports.c=he;
1
+ 'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkROG4MNOR_js=require('./chunk-ROG4MNOR.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function B(e,a){let i={};for(let t of e)switch(t.type.name){case "bold":i.bold=true;break;case "italic":i.italic=true;break;case "underline":{let n=t.attrs;if(n.style||n.color){let r=n.color?chunkMJ5FQX7Q_js.a(n.color,a):void 0;i.underline={style:n.style,color:r};}else i.underline=true;break}case "strike":i.strike=true;break;case "textColor":{let n=t.attrs;(n.themeColor||n.rgb)&&(i.color=chunkMJ5FQX7Q_js.a({rgb:n.rgb,themeColor:n.themeColor,themeTint:n.themeTint,themeShade:n.themeShade},a));break}case "highlight":i.highlight=chunkMJ5FQX7Q_js.o(t.attrs.color);break;case "fontSize":{let n=t.attrs;i.fontSize=n.size/2;break}case "fontFamily":{let n=t.attrs;i.fontFamily=n.ascii||n.hAnsi;break}case "characterSpacing":{let n=t.attrs;n.spacing!=null&&n.spacing!==0&&(i.letterSpacing=chunkIMKU4O3P_js.a(n.spacing)),n.position!=null&&n.position!==0&&(i.positionPx=chunk4Q2IP5FW_js.j(n.position)),n.scale!=null&&n.scale!==100&&(i.horizontalScale=n.scale),n.kerning!=null&&n.kerning>0&&(i.kerningMinPt=chunk4Q2IP5FW_js.k(n.kerning));break}case "allCaps":i.allCaps=true;break;case "smallCaps":i.smallCaps=true;break;case "emboss":i.emboss=true;break;case "imprint":i.imprint=true;break;case "textShadow":i.textShadow=true;break;case "textOutline":i.textOutline=true;break;case "hidden":i.hidden=true;break;case "rtl":i.rtl=true;break;case "textEffect":{let n=t.attrs.effect;(n==="blinkBackground"||n==="lights"||n==="antsBlack"||n==="antsRed"||n==="shimmer"||n==="sparkle")&&(i.textEffect=n);break}case "emphasisMark":{let n=t.attrs.type;n==="dot"||n==="comma"||n==="circle"||n==="underDot"?i.emphasisMark=n:i.emphasisMark="dot";break}case "superscript":i.superscript=true;break;case "subscript":i.subscript=true;break;case "hyperlink":{let n=t.attrs;i.hyperlink={href:n.href,tooltip:n.tooltip};break}case "footnoteRef":{let n=t.attrs,r=typeof n.id=="string"?parseInt(n.id,10):n.id;n.noteType==="endnote"?i.endnoteRefId=r:i.footnoteRefId=r;break}case "comment":{let n=t.attrs.commentId;n&&(i.commentIds||(i.commentIds=[]),i.commentIds.push(n));break}case "insertion":i.isInsertion=true,i.changeAuthor=t.attrs.author,i.changeDate=t.attrs.date,i.changeRevisionId=t.attrs.revisionId;break;case "deletion":i.isDeletion=true,i.changeAuthor=t.attrs.author,i.changeDate=t.attrs.date,i.changeRevisionId=t.attrs.revisionId;break}return i}function _(e){let a=e.defaultTextFormatting;if(!a)return {};let i={};if(a.fontFamily){let t=a.fontFamily.ascii||a.fontFamily.hAnsi;t&&(i.fontFamily=t);}return a.fontSize!=null&&(i.fontSize=a.fontSize/2),i}function E(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function L(e,a,i){let t=[],n=a+1,r=i.theme,s=_(e.attrs),d=e.attrs.styleId,m=typeof d=="string"&&/^TOC\d*$/i.test(d);function g(c,f){if(c.isText&&c.text){let o=B(c.marks,r);m&&E(o);let u={kind:"text",text:c.text,...s,...o,pmStart:f,pmEnd:f+c.nodeSize};t.push(u);}else if(c.type.name==="hardBreak")t.push({kind:"lineBreak",pmStart:f,pmEnd:f+c.nodeSize});else if(c.type.name==="tab"){let o=B(c.marks,r),u={kind:"tab",...s,...o,pmStart:f,pmEnd:f+c.nodeSize};t.push(u);}else if(c.type.name==="image"){let o=c.attrs,u=chunkIMKU4O3P_js.b(o.width||100,o.height||100,i.pageContentHeight),l=B(c.marks,r),b={kind:"image",src:o.src,width:u.width,height:u.height,alt:o.alt,transform:o.transform,wrapType:o.wrapType,displayMode:o.displayMode,cssFloat:o.cssFloat,distTop:o.distTop,distBottom:o.distBottom,distLeft:o.distLeft,distRight:o.distRight,position:o.position,cropTop:o.cropTop,cropRight:o.cropRight,cropBottom:o.cropBottom,cropLeft:o.cropLeft,opacity:o.opacity,isInsertion:l.isInsertion,isDeletion:l.isDeletion,changeAuthor:l.changeAuthor,changeDate:l.changeDate,changeRevisionId:l.changeRevisionId,pmStart:f,pmEnd:f+c.nodeSize};t.push(b);}else if(c.type.name==="field"){let o=c.attrs.fieldType,u=o==="PAGE"?"PAGE":o==="NUMPAGES"?"NUMPAGES":o==="DATE"?"DATE":o==="TIME"?"TIME":"OTHER",l=B(c.marks,r);m&&E(l),t.push({kind:"field",fieldType:u,fallback:c.attrs.displayText||"",...s,...l,pmStart:f,pmEnd:f+c.nodeSize});}else if(c.type.name==="math"){let o=c.attrs.plainText||"[equation]";t.push({kind:"text",text:o,italic:true,fontFamily:"Cambria Math",pmStart:f,pmEnd:f+c.nodeSize});}else if(c.type.name==="sdt"){let o=f+1;c.forEach((u,l)=>{g(u,o+l);});}}return e.forEach((c,f)=>{g(c,n+f);}),t}function U(e){return Math.max(1,Math.round(e/8*1.333))}var G={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 F(e,a){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let i={style:G[e.style]||"solid",width:U(e.size??0),color:e.color?chunkMJ5FQX7Q_js.a(e.color,a):"#000000"};return e.space!==void 0&&(i.space=chunk4Q2IP5FW_js.i(e.space)),i}function D(e,a){let i=e.borders;if(!i)return;let t={},n=["top","bottom","left","right"];for(let r of n){let s=i[r],d=s?F(s,a):void 0;t[r]=d??{width:0,style:"none"};}return Object.keys(t).length>0?t:void 0}function $(e,a){let i=[];for(let t=0;t<=a;t+=1){let n=e[t]??0;if(n<=0)break;i.push(n);}return i.length===0?"1.":`${i.join(".")}.`}var Y=[[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 N(e,a){if(e<=0)return "";let i=e,t="";for(let[n,r]of Y)for(;i>=n;)t+=r,i-=n;return a?t:t.toLowerCase()}function O(e,a){if(e<=0)return "";let i=e,t="";for(;i>0;){let n=(i-1)%26;t=String.fromCharCode(65+n)+t,i=Math.floor((i-1)/26);}return a?t:t.toLowerCase()}function j(e,a){if(e<=0)return "";switch(a){case "upperRoman":return N(e,true);case "lowerRoman":return N(e,false);case "upperLetter":return O(e,true);case "lowerLetter":return O(e,false);case "decimalZero":return e<10?`0${e}`:String(e);case "none":return "";default:return String(e)}}function H(e,a,i){return e.replace(/%(\d)([.):\]])?/g,(t,n,r="")=>{let s=parseInt(n,10)-1;if(s<0)return "";let d=a[s]??0,m=i?.[s]??"decimal",g=j(d,m);return g?g+r:""})}function X(e,a,i){let t=e.numPr;if(!t)return null;let n=t.numId;if(n==null||n===0)return null;if(e.listIsBullet)return chunkROG4MNOR_js.p(e.listMarker||"");let r=t.ilvl??0,s=e.listAbstractNumId??n,d=a.get(s)??new Array(9).fill(0),m=`${n}:${r}`;i.has(m)||(i.add(m),e.listStartOverride!=null&&(d[r]=e.listStartOverride-1)),d[r]=(d[r]??0)+1;for(let g=r+1;g<d.length;g+=1)d[g]=0;return a.set(s,d),e.listMarker&&e.listMarker.includes("%")?H(e.listMarker,d,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:$(d,r)}var V="Calibri",q=11;function K(e,a,i,t,n){let r={};if(e.alignment){let o=e.alignment;o==="both"||o==="distribute"?r.alignment="justify":o==="left"?r.alignment="left":o==="center"?r.alignment="center":o==="right"&&(r.alignment="right");}(e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(r.spacing={},e.spaceBefore!=null&&(r.spacing.before=chunkIMKU4O3P_js.a(e.spaceBefore)),e.spaceAfter!=null&&(r.spacing.after=chunkIMKU4O3P_js.a(e.spaceAfter)),e.lineSpacing!=null&&(e.lineSpacingRule==="exact"||e.lineSpacingRule==="atLeast"?(r.spacing.line=chunkIMKU4O3P_js.a(e.lineSpacing),r.spacing.lineUnit="px",r.spacing.lineRule=e.lineSpacingRule):(r.spacing.line=e.lineSpacing/240,r.spacing.lineUnit="multiplier",r.spacing.lineRule="auto"))),e.spacingExplicit&&(r.spacingExplicit=e.spacingExplicit);let s=e.indentLeft,d=e.indentFirstLine,m=e.hangingIndent;if(e.numPr?.numId&&s==null&&(s=((e.numPr.ilvl??0)+1)*720,d==null&&(d=-360,m=true)),(s!=null||e.indentRight!=null||d!=null)&&(r.indent={},s!=null&&(r.indent.left=chunkIMKU4O3P_js.a(s)),e.indentRight!=null&&(r.indent.right=chunkIMKU4O3P_js.a(e.indentRight)),d!=null&&(m?r.indent.hanging=Math.abs(chunkIMKU4O3P_js.a(d)):r.indent.firstLine=chunkIMKU4O3P_js.a(d))),e.styleId&&(r.styleId=e.styleId),e.borders){let o=e.borders;r.borders={};let u=l=>l?F(l,a):void 0;o.top&&(r.borders.top=u(o.top)),o.bottom&&(r.borders.bottom=u(o.bottom)),o.left&&(r.borders.left=u(o.left)),o.right&&(r.borders.right=u(o.right)),o.between&&(r.borders.between=u(o.between)),o.bar&&(r.borders.bar=u(o.bar)),!r.borders.top&&!r.borders.bottom&&!r.borders.left&&!r.borders.right&&!r.borders.between&&!r.borders.bar&&delete r.borders;}let g=chunkMJ5FQX7Q_js.b(e.shading?.fill,a);g&&(r.shading=`#${g}`),e.tabs&&e.tabs.length>0&&(r.tabs=e.tabs.map(o=>({val:Z(o.alignment),pos:o.position,leader:o.leader}))),e.pageBreakBefore&&(r.pageBreakBefore=true),e.keepNext&&(r.keepNext=true),e.keepLines&&(r.keepLines=true),e.contextualSpacing&&(r.contextualSpacing=true),e.bidi&&(r.bidi=true),e.styleId&&(r.styleId=e.styleId),e.numPr&&(r.numPr={numId:e.numPr.numId,ilvl:e.numPr.ilvl});let c=i&&t?X(e,i,t):null;c!=null?r.listMarker=c:e.listMarker&&(r.listMarker=e.listMarker),e.listIsBullet!=null&&(r.listIsBullet=e.listIsBullet),e.listMarkerHidden&&(r.listMarkerHidden=true),e.listMarkerFontFamily&&(r.listMarkerFontFamily=e.listMarkerFontFamily),e.listMarkerFontSize&&(r.listMarkerFontSize=e.listMarkerFontSize),e.listMarkerSuffix&&(r.listMarkerSuffix=e.listMarkerSuffix),n!==void 0&&(r.defaultTabStopTwips=n);let f=e.defaultTextFormatting;if(f&&(f.fontSize!=null&&(r.defaultFontSize=f.fontSize/2),f.fontFamily&&(r.defaultFontFamily=f.fontFamily.ascii||f.fontFamily.hAnsi)),e.pPrIns&&(r.pPrIns=e.pPrIns),e.pPrDel&&(r.pPrDel=e.pPrDel),e.numPr){let o=e.pPrChange,u=Array.isArray(o)&&o.some(l=>!l?.previousFormatting?.numPr);e.pPrDel?r.listMarkerRevision="del":(e.pPrIns||u)&&(r.listMarkerRevision="ins");}return r}function Z(e){switch(e){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 w(e,a,i){let t=e.attrs,n=L(e,a,i),r=K(t,i.theme,i.listCounters,i.listSeenNumIds,i.defaultTabStopTwips);return {kind:"paragraph",id:chunkIMKU4O3P_js.c(),runs:n,attrs:r,pmStart:a,pmEnd:a+e.nodeSize}}function J(e,a,i,t){let n=[],r=a+1;e.forEach(l=>{l.type.name==="paragraph"?n.push(w(l,r,i)):l.type.name==="table"&&n.push(W(l,r,i)),r+=l.nodeSize;});let s=e.attrs,d=s.width,m=s.widthType,g=d&&(!m||m==="dxa"||m==="auto")?chunkIMKU4O3P_js.a(d):void 0,c=s.margins,f=(l,b)=>{if(l!=null){let h=chunkIMKU4O3P_js.a(l);if(h>0)return h}if(b!=null){let h=chunkIMKU4O3P_js.a(b);if(h>=0)return h}return 0},o={top:f(c?.top,t?.top),right:f(c?.right,t?.right),bottom:f(c?.bottom,t?.bottom),left:f(c?.left,t?.left)},u=s.cellMarker;return {id:chunkIMKU4O3P_js.c(),blocks:n,colSpan:s.colspan,rowSpan:s.rowspan,width:g,widthValue:d,widthType:m,verticalAlign:s.verticalAlign,background:s.backgroundColor?`#${s.backgroundColor}`:void 0,borders:D(s,i.theme),padding:o,noWrap:s.noWrap||void 0,trackedMarker:u??void 0}}function Q(e,a,i,t){let n=[],r=a+1;e.forEach(d=>{(d.type.name==="tableCell"||d.type.name==="tableHeader")&&n.push(J(d,r,i,t)),r+=d.nodeSize;});let s=e.attrs;return {id:chunkIMKU4O3P_js.c(),cells:n,height:s.height?chunkIMKU4O3P_js.a(s.height):void 0,heightRule:s.heightRule??void 0,isHeader:s.isHeader,trackedIns:s.trIns??void 0,trackedDel:s.trDel??void 0}}function W(e,a,i){let t=[],n=a+1,r=e.attrs.cellMargins;e.forEach(b=>{b.type.name==="tableRow"&&t.push(Q(b,n,i,r)),n+=b.nodeSize;});let d=e.attrs.columnWidths?.map(chunkIMKU4O3P_js.a),m=e.attrs.width,g=e.attrs.widthType;if(!d&&t.length>0){let h=t[0].cells.map(k=>k.width);h.every(k=>k!==void 0&&k>0)&&(d=h);}let c=e.attrs.justification,f=e.attrs._originalFormatting,o=f?.indent?.value&&f.indent.type==="dxa"?chunkIMKU4O3P_js.a(f.indent.value):void 0,u=e.attrs.floating,l=u?{horzAnchor:u.horzAnchor,vertAnchor:u.vertAnchor,tblpX:u.tblpX!==void 0?chunkIMKU4O3P_js.a(u.tblpX):void 0,tblpXSpec:u.tblpXSpec,tblpY:u.tblpY!==void 0?chunkIMKU4O3P_js.a(u.tblpY):void 0,tblpYSpec:u.tblpYSpec,topFromText:u.topFromText!==void 0?chunkIMKU4O3P_js.a(u.topFromText):void 0,bottomFromText:u.bottomFromText!==void 0?chunkIMKU4O3P_js.a(u.bottomFromText):void 0,leftFromText:u.leftFromText!==void 0?chunkIMKU4O3P_js.a(u.leftFromText):void 0,rightFromText:u.rightFromText!==void 0?chunkIMKU4O3P_js.a(u.rightFromText):void 0}:void 0;return {kind:"table",id:chunkIMKU4O3P_js.c(),rows:t,columnWidths:d,width:m,widthType:g,justification:c,indent:o,floating:l,pmStart:a,pmEnd:a+e.nodeSize}}function A(e,a,i){let t=e.attrs,n=t.wrapType,r=n==="behind"||n==="inFront",s=chunkIMKU4O3P_js.b(t.width||100,t.height||100,i);return {kind:"image",id:chunkIMKU4O3P_js.c(),src:t.src,width:s.width,height:s.height,alt:t.alt,transform:t.transform,anchor:r?{isAnchored:true,offsetH:t.distLeft,offsetV:t.distTop,behindDoc:n==="behind"}:void 0,hlinkHref:t.hlinkHref,pmStart:a,pmEnd:a+e.nodeSize}}function ee(e,a,i){let t=e.attrs,n=[];return e.forEach((r,s)=>{if(r.type.name==="paragraph"){let d=w(r,a+1+s,i);n.push(d);}}),{kind:"textBox",id:chunkIMKU4O3P_js.c(),width:t.width??chunkDROCYKAR_js.b,height:t.height??void 0,fillColor:t.fillColor,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,margins:{top:t.marginTop??chunkDROCYKAR_js.a.top,bottom:t.marginBottom??chunkDROCYKAR_js.a.bottom,left:t.marginLeft??chunkDROCYKAR_js.a.left,right:t.marginRight??chunkDROCYKAR_js.a.right},content:n,displayMode:t.displayMode,cssFloat:t.cssFloat,wrapType:t.wrapType,wrapText:t.wrapText,anchorTarget:t.anchorTarget,position:t.position,distTop:t.distTop,distBottom:t.distBottom,distLeft:t.distLeft,distRight:t.distRight,pmStart:a,pmEnd:a+e.nodeSize}}function he(e,a={}){let i=e.attrs?.defaultTabStopTwips,t={...a,defaultFont:a.defaultFont??V,defaultSize:a.defaultSize??q,defaultTabStopTwips:a.defaultTabStopTwips??i},n=[],r=0,s={top:1440,bottom:1440,left:1440,right:1440};t.listCounters||(t.listCounters=new Map),t.listSeenNumIds||(t.listSeenNumIds=new Set);let d=(m,g,c)=>{if(m.type.name==="blockSdt"){let o=m.attrs,u={id:`sdt@${g}`,sdtType:typeof o.sdtType=="string"?o.sdtType:"richText",tag:o.tag!=null?String(o.tag):void 0,alias:o.alias!=null?String(o.alias):void 0,lock:o.lock!=null?String(o.lock):void 0,checked:typeof o.checked=="boolean"?o.checked:void 0,bound:o.dataBinding!=null?true:void 0,repeatingItem:/<w15:repeatingSectionItem[\s/>]/.test(String(o.rawPropertiesXml??""))?true:void 0},l=[...c,u];m.forEach((b,h)=>{d(b,g+1+h,l);});return}let f=n.length;switch(m.type.name){case "paragraph":{let o=w(m,g,t),u=m.attrs;n.push(o);let l=u._sectionProperties;if(l||u.sectionBreakType){let b={kind:"sectionBreak",id:chunkIMKU4O3P_js.c(),type:l?.sectionStart??u.sectionBreakType};if(l){if((l.pageWidth!==void 0||l.pageHeight!==void 0)&&(b.pageSize={w:chunkIMKU4O3P_js.a(l.pageWidth??12240),h:chunkIMKU4O3P_js.a(l.pageHeight??15840)}),l.marginTop!==void 0||l.marginBottom!==void 0||l.marginLeft!==void 0||l.marginRight!==void 0){let k={top:l.marginTop??s.top,bottom:l.marginBottom??s.bottom,left:l.marginLeft??s.left,right:l.marginRight??s.right};b.margins={top:chunkIMKU4O3P_js.a(k.top),bottom:chunkIMKU4O3P_js.a(k.bottom),left:chunkIMKU4O3P_js.a(k.left),right:chunkIMKU4O3P_js.a(k.right)},s=k;}let h=l.columnCount??1;if(h>1){let k={count:h,gap:chunkIMKU4O3P_js.a(l.columnSpace??720),equalWidth:l.equalWidth??true,separator:l.separator};b.columns=k;}}n.push(b);}}break;case "table":n.push(W(m,g,t));break;case "image":n.push(A(m,g,t.pageContentHeight));break;case "textBox":n.push(ee(m,g,t));break;case "horizontalRule":case "pageBreak":{let o={kind:"pageBreak",id:chunkIMKU4O3P_js.c(),pmStart:g,pmEnd:g+m.nodeSize};n.push(o);break}}if(c.length>0)for(let o=f;o<n.length;o++)n[o].sdtGroups=c;};return e.forEach((m,g)=>{d(m,r+g,[]);}),n}exports.a=F;exports.b=H;exports.c=he;
@@ -1 +1 @@
1
- 'use strict';var chunkOAWTQ3IY_js=require('./chunk-OAWTQ3IY.js');var e=chunkOAWTQ3IY_js.a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();exports.A=j;exports.B=q;exports.C=w;exports.D=z;exports.a=g;exports.b=l;exports.c=u;exports.d=x;exports.e=C;exports.f=f;exports.g=S;exports.h=L;exports.i=b;exports.j=y;exports.k=v;exports.l=A;exports.m=I;exports.n=h;exports.o=R;exports.p=T;exports.q=P;exports.r=B;exports.s=k;exports.t=E;exports.u=F;exports.v=H;exports.w=J;exports.x=N;exports.y=O;exports.z=M;
1
+ 'use strict';var chunkVMRUBLPI_js=require('./chunk-VMRUBLPI.js');var e=chunkVMRUBLPI_js.a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();exports.A=j;exports.B=q;exports.C=w;exports.D=z;exports.a=g;exports.b=l;exports.c=u;exports.d=x;exports.e=C;exports.f=f;exports.g=S;exports.h=L;exports.i=b;exports.j=y;exports.k=v;exports.l=A;exports.m=I;exports.n=h;exports.o=R;exports.p=T;exports.q=P;exports.r=B;exports.s=k;exports.t=E;exports.u=F;exports.v=H;exports.w=J;exports.x=N;exports.y=O;exports.z=M;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function u(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function g(e){let i={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(i.id=e.id),e.alias!=null&&(i.alias=String(e.alias)),e.tag!=null&&(i.tag=String(e.tag)),e.lock!=null&&(i.lock=e.lock),e.placeholder!=null&&(i.placeholder=String(e.placeholder)),e.showingPlaceholder&&(i.showingPlaceholder=true),e.dateFormat!=null&&(i.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{i.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(i.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{i.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(i.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(i.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),i}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function w(e){let i=e.wrap?.type??"inline",t=e.wrap?.wrapText,l=e.position?.horizontal?.alignment;return {displayMode:d(i),cssFloat:p(i,t,l),wrapType:i,wrapText:t,anchorTarget:a(e)?"followingBlock":void 0,position:e.position?f(e.position):void 0,distTop:e.wrap?.distT!=null?chunk4Q2IP5FW_js.e(e.wrap.distT):void 0,distBottom:e.wrap?.distB!=null?chunk4Q2IP5FW_js.e(e.wrap.distB):void 0,distLeft:e.wrap?.distL!=null?chunk4Q2IP5FW_js.e(e.wrap.distL):void 0,distRight:e.wrap?.distR!=null?chunk4Q2IP5FW_js.e(e.wrap.distR):void 0}}function x(e){return e.anchorTarget==="followingBlock"||s(e)}function P(e){let i=e.position;if(!(!i?.horizontal&&!i?.vertical))return {horizontal:{relativeTo:i.horizontal?.relativeTo??"margin",alignment:i.horizontal?.align,posOffset:i.horizontal?.posOffset},vertical:{relativeTo:i.vertical?.relativeTo??"paragraph",alignment:i.vertical?.align,posOffset:i.vertical?.posOffset}}}function y(e){let i=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!i||i==="inline")return;let t={type:i};return e.wrapText&&(t.wrapText=e.wrapText),e.distTop!=null&&(t.distT=chunk4Q2IP5FW_js.f(e.distTop)),e.distBottom!=null&&(t.distB=chunk4Q2IP5FW_js.f(e.distBottom)),e.distLeft!=null&&(t.distL=chunk4Q2IP5FW_js.f(e.distLeft)),e.distRight!=null&&(t.distR=chunk4Q2IP5FW_js.f(e.distRight)),t}function d(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function s(e){return e.displayMode==="float"||chunkJFZIXFRC_js.a(e.wrapType)}function p(e,i,t){return e==="inline"||e==="topAndBottom"?"none":i==="left"?"right":i==="right"||t==="left"?"left":t==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}exports.a=u;exports.b=g;exports.c=a;exports.d=w;exports.e=x;exports.f=P;exports.g=y;