@eigenpal/docx-editor-core 1.0.1 → 1.0.2

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 (84) hide show
  1. package/dist/agent/index.js +1 -1
  2. package/dist/agent/index.mjs +1 -1
  3. package/dist/chunk-2D3UPAMA.mjs +1 -0
  4. package/dist/{chunk-GNPLUGUG.mjs → chunk-2RCMY2GE.mjs} +1 -1
  5. package/dist/{chunk-YUKBAAB5.mjs → chunk-4S5VOHQK.mjs} +1 -1
  6. package/dist/chunk-5TNMVXDS.mjs +1 -0
  7. package/dist/{chunk-SYJAAHUK.js → chunk-6DK4UBGM.js} +1 -1
  8. package/dist/{chunk-LDAOONXZ.mjs → chunk-6PR4XHQ3.mjs} +1 -1
  9. package/dist/{chunk-62NPHRTF.js → chunk-7SGC3CXJ.js} +1 -1
  10. package/dist/{chunk-GXW7YSFL.mjs → chunk-APFTVA4F.mjs} +1 -1
  11. package/dist/chunk-BKHQA6JJ.js +1 -0
  12. package/dist/{chunk-O5X22KZ6.mjs → chunk-BOYVCOLZ.mjs} +1 -1
  13. package/dist/{chunk-NFYCMDM5.js → chunk-BS35CXMN.js} +1 -1
  14. package/dist/chunk-BTOBVF4I.mjs +1 -0
  15. package/dist/chunk-C2BAPYGJ.js +1 -0
  16. package/dist/{chunk-WLQEPVDR.js → chunk-CP767TWV.js} +1 -1
  17. package/dist/{chunk-N3GIC2UI.mjs → chunk-EXOP727C.mjs} +1 -1
  18. package/dist/{chunk-GH5N36F7.js → chunk-GFQM7PKY.js} +1 -1
  19. package/dist/{chunk-ZYESB4KC.mjs → chunk-LDKESXXK.mjs} +1 -1
  20. package/dist/chunk-LE67NTCN.mjs +1 -0
  21. package/dist/{chunk-WNTT4MGC.js → chunk-LTYW3NLX.js} +3 -3
  22. package/dist/{chunk-KSYEBTYE.js → chunk-NLTX7XVR.js} +1 -1
  23. package/dist/chunk-NMSU4MWP.mjs +1 -0
  24. package/dist/chunk-OLKDLRJ4.js +1 -0
  25. package/dist/{chunk-LVD6HXRF.mjs → chunk-P6RNOYAG.mjs} +1 -1
  26. package/dist/{chunk-RSMS6OTE.mjs → chunk-RCS6UNIJ.mjs} +1 -1
  27. package/dist/chunk-T5RYEG2V.js +1 -0
  28. package/dist/chunk-TYYOBPNK.js +1 -0
  29. package/dist/{chunk-4EHBV73E.mjs → chunk-UCZVMHB5.mjs} +1 -1
  30. package/dist/{chunk-CCWOLPZE.js → chunk-V435QKZB.js} +2 -2
  31. package/dist/{chunk-DFZTUQ7O.js → chunk-VQ2QGHYS.js} +1 -1
  32. package/dist/{chunk-HVZMO3BU.js → chunk-WZP6ZHBR.js} +1 -1
  33. package/dist/{chunk-UDPROEUK.js → chunk-XCMA7AY7.js} +1 -1
  34. package/dist/{chunk-DWFWYHM5.mjs → chunk-XDH55WXX.mjs} +1 -1
  35. package/dist/core.js +1 -1
  36. package/dist/core.mjs +1 -1
  37. package/dist/docx/index.js +1 -1
  38. package/dist/docx/index.mjs +1 -1
  39. package/dist/docx/rezip.js +1 -1
  40. package/dist/docx/rezip.mjs +1 -1
  41. package/dist/docx/serializer/index.js +1 -1
  42. package/dist/docx/serializer/index.mjs +1 -1
  43. package/dist/headless.js +1 -1
  44. package/dist/headless.mjs +1 -1
  45. package/dist/layout-bridge/index.js +1 -1
  46. package/dist/layout-bridge/index.mjs +1 -1
  47. package/dist/layout-bridge/measuring/index.js +1 -1
  48. package/dist/layout-bridge/measuring/index.mjs +1 -1
  49. package/dist/layout-bridge/tableInsertHover.js +1 -1
  50. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  51. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  52. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  53. package/dist/layout-painter/index.js +1 -1
  54. package/dist/layout-painter/index.mjs +1 -1
  55. package/dist/layout-painter/renderPage.js +1 -1
  56. package/dist/layout-painter/renderPage.mjs +1 -1
  57. package/dist/mcp-cli.mjs +9 -9
  58. package/dist/mcp.js +2 -2
  59. package/dist/mcp.mjs +1 -1
  60. package/dist/prosemirror/commands/formatting.js +1 -1
  61. package/dist/prosemirror/commands/formatting.mjs +1 -1
  62. package/dist/prosemirror/commands/index.js +1 -1
  63. package/dist/prosemirror/commands/index.mjs +1 -1
  64. package/dist/prosemirror/commands/paragraph.js +1 -1
  65. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  66. package/dist/prosemirror/conversion/index.js +1 -1
  67. package/dist/prosemirror/conversion/index.mjs +1 -1
  68. package/dist/prosemirror/extensions/index.js +1 -1
  69. package/dist/prosemirror/extensions/index.mjs +1 -1
  70. package/dist/prosemirror/index.js +1 -1
  71. package/dist/prosemirror/index.mjs +1 -1
  72. package/dist/prosemirror/schema/index.js +1 -1
  73. package/dist/prosemirror/schema/index.mjs +1 -1
  74. package/package.json +1 -1
  75. package/dist/chunk-6VUYFDHY.mjs +0 -1
  76. package/dist/chunk-7UTXBQKF.mjs +0 -1
  77. package/dist/chunk-BD4CYYFB.js +0 -1
  78. package/dist/chunk-DN36K5JU.mjs +0 -1
  79. package/dist/chunk-ITVXBQGR.mjs +0 -1
  80. package/dist/chunk-JKVXID22.mjs +0 -1
  81. package/dist/chunk-PK4PDRTA.js +0 -1
  82. package/dist/chunk-SUXJX72X.js +0 -1
  83. package/dist/chunk-T4CPTPRP.js +0 -1
  84. package/dist/chunk-TZJUO3NW.js +0 -1
@@ -1 +1 @@
1
- 'use strict';var chunkOCAX2KJQ_js=require('../chunk-OCAX2KJQ.js'),chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),chunkKSYEBTYE_js=require('../chunk-KSYEBTYE.js');require('../chunk-WLQEPVDR.js'),require('../chunk-U4UCHBZ7.js');var chunkTE2AF7FM_js=require('../chunk-TE2AF7FM.js');require('../chunk-WNTT4MGC.js'),require('../chunk-CCWOLPZE.js'),require('../chunk-4BFNWPKW.js'),require('../chunk-C6GSFUV2.js'),require('../chunk-DV6IEOP5.js'),require('../chunk-KBU6QQFU.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-YGHHSCPR.js'),require('../chunk-7VCMJCBY.js'),require('../chunk-T4CPTPRP.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.p}});Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkXXU7YQVV_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkXXU7YQVV_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkXXU7YQVV_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkXXU7YQVV_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkXXU7YQVV_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkKSYEBTYE_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkKSYEBTYE_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkKSYEBTYE_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkKSYEBTYE_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkKSYEBTYE_js.i}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});
1
+ 'use strict';var chunkOCAX2KJQ_js=require('../chunk-OCAX2KJQ.js'),chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),chunkNLTX7XVR_js=require('../chunk-NLTX7XVR.js');require('../chunk-CP767TWV.js'),require('../chunk-U4UCHBZ7.js');var chunkTE2AF7FM_js=require('../chunk-TE2AF7FM.js');require('../chunk-LTYW3NLX.js'),require('../chunk-V435QKZB.js'),require('../chunk-4BFNWPKW.js'),require('../chunk-C6GSFUV2.js'),require('../chunk-DV6IEOP5.js'),require('../chunk-KBU6QQFU.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-YGHHSCPR.js'),require('../chunk-7VCMJCBY.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.p}});Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkXXU7YQVV_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkXXU7YQVV_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkXXU7YQVV_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkXXU7YQVV_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkXXU7YQVV_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkNLTX7XVR_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkNLTX7XVR_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkNLTX7XVR_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkNLTX7XVR_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkNLTX7XVR_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkNLTX7XVR_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkNLTX7XVR_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkNLTX7XVR_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkNLTX7XVR_js.i}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});
@@ -1 +1 @@
1
- export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,l as getFormattingAtPosition,n as getHyperlinkAtPosition,c as getHyperlinkText,u as getParagraphAtIndex,a as getParagraphText,t as getParagraphs,b as getRunText,d as getTableText,k as getTextAfter,j as getTextBefore,r as hasHyperlinks,q as hasImages,s as hasTables,o as isHeadingStyle,m as isPositionInHyperlink,p as parseHeadingLevel}from'../chunk-FWTP7BN7.mjs';export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'../chunk-MVZOTKNL.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,e as buildSelectionContextFromContext,b as createAgent,c as createAgentFromDocument,d as getAgentContext,f as getDocumentSummary,i as getSelectionFormattingSummary}from'../chunk-N3GIC2UI.mjs';import'../chunk-O5X22KZ6.mjs';import'../chunk-ARHPXIBJ.mjs';export{a as executeCommand,b as executeCommands}from'../chunk-CUY2THAO.mjs';import'../chunk-4EHBV73E.mjs';import'../chunk-ZYESB4KC.mjs';import'../chunk-3NRMSZX2.mjs';import'../chunk-R7RR6M4A.mjs';import'../chunk-3GNIP6IX.mjs';import'../chunk-Y5HZAMND.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-IBNUQL57.mjs';import'../chunk-6LOYA7G5.mjs';import'../chunk-6VUYFDHY.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';
1
+ export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,l as getFormattingAtPosition,n as getHyperlinkAtPosition,c as getHyperlinkText,u as getParagraphAtIndex,a as getParagraphText,t as getParagraphs,b as getRunText,d as getTableText,k as getTextAfter,j as getTextBefore,r as hasHyperlinks,q as hasImages,s as hasTables,o as isHeadingStyle,m as isPositionInHyperlink,p as parseHeadingLevel}from'../chunk-FWTP7BN7.mjs';export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'../chunk-MVZOTKNL.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,e as buildSelectionContextFromContext,b as createAgent,c as createAgentFromDocument,d as getAgentContext,f as getDocumentSummary,i as getSelectionFormattingSummary}from'../chunk-EXOP727C.mjs';import'../chunk-BOYVCOLZ.mjs';import'../chunk-ARHPXIBJ.mjs';export{a as executeCommand,b as executeCommands}from'../chunk-CUY2THAO.mjs';import'../chunk-UCZVMHB5.mjs';import'../chunk-LDKESXXK.mjs';import'../chunk-3NRMSZX2.mjs';import'../chunk-R7RR6M4A.mjs';import'../chunk-3GNIP6IX.mjs';import'../chunk-Y5HZAMND.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-IBNUQL57.mjs';import'../chunk-6LOYA7G5.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-AMENZY5F.mjs';var Xt=1440,q=96,ft=Xt/q,ht=11,gt="Calibri",Yt=1,jt=.8,Gt=.2,z=null;function $(){if(!z){let t=typeof document<"u"?document.createElement("canvas"):null;if(!t)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(z=t.getContext("2d"),!z)throw new Error("Failed to get 2D context from canvas")}return z}function Kt(){z=null;}var ct=new Map;function mt(t){let e=ct.get(t);if(e===void 0){let i=a(t);e={cssFallback:i.cssFallback,singleLineRatio:i.singleLineRatio},ct.set(t,e);}return e}function Vt(t){return mt(t).cssFallback}function D(t){let e=[];t.italic&&e.push("italic"),t.bold&&e.push("bold");let i=t.fontSize??ht,n=W(i);e.push(`${n}px`);let r=t.fontFamily??gt;return e.push(Vt(r)),e.join(" ")}function A(t){let e=t.fontSize??ht,i=t.fontFamily??gt,n=W(e),r=n*jt,o=n*Gt,u=n*Yt;try{let g=$();g.font=D(t);let c=g.measureText("Hg");typeof c.actualBoundingBoxAscent=="number"&&typeof c.actualBoundingBoxDescent=="number"&&(r=c.actualBoundingBoxAscent,o=c.actualBoundingBoxDescent);}catch{}u=Math.max(u,r+o);let f=mt(i).singleLineRatio;return {fontSize:e,ascent:r,descent:o,lineHeight:u,fontFamily:i,singleLineRatio:f}}function S(t,e){if(!t)return 0;let i=$();i.font=D(e);let r=i.measureText(t).width;return e.letterSpacing&&t.length>1&&(r+=e.letterSpacing*(t.length-1)),r}function qt(t,e){let i=S(t,e),n=A(e);return {width:i,height:n.ascent+n.descent,ascent:n.ascent,descent:n.descent}}function J(t,e){let i=A(e);if(!t)return {width:0,charWidths:[],metrics:i};let n=$();n.font=D(e);let r=e.letterSpacing??0,o=[],u=0;for(let f=0;f<t.length;f++){let g=t[f],b=n.measureText(g).width;r&&f<t.length-1&&(b+=r),o.push(b),u+=b;}return {width:u,charWidths:o,metrics:i}}function Jt(t,e){if(e.length===0||t<=0)return 0;let i=0;for(let n=0;n<e.length;n++){let r=e[n],o=i+r/2;if(t<=o)return n;i+=r;}return e.length}function Qt(t,e){if(t<=0||e.length===0)return 0;let i=Math.min(t,e.length),n=0;for(let r=0;r<i;r++)n+=e[r];return n}function te(t){return t/ft}function ee(t){return Math.round(t*ft)}function W(t){return t*q/72}function dt(t){return t*72/q}function ne(t){return W(t/2)}function ie(t){return dt(t)*2}function re(t,e){return t.map(i=>{let n=i.x-i.distLeft,r=i.x+i.width+i.distRight,o=i.y-i.distTop,u=i.y+i.height+i.distBottom,f=0,g=0,c,b=i.wrapText??"bothSides";b==="right"?f=Q(r):b==="left"?g=tt(n,e):b==="largest"?{leftMargin:f,rightMargin:g}=le(n,r,e):oe(n,r,e)?c=se(n,r,e):i.side==="left"?f=Q(r):g=tt(n,e);let p=nt(f,g,e);return {leftMargin:p.leftMargin,rightMargin:p.rightMargin,topY:o,bottomY:u,segments:c}})}function et(t,e){return t.segments?.reduce((n,r)=>n+r.availableWidth,0)??e-t.leftMargin-t.rightMargin}function N(t,e,i,n){if(!i||i.length===0)return {leftMargin:0,rightMargin:0};let r=0,o=0,u,f=n+t,g=f+e;for(let c of i)if(!(g<=c.topY||f>=c.bottomY)){if(c.segments?.length){u=u?ae(u,c.segments):c.segments;continue}r=Math.max(r,c.leftMargin),o=Math.max(o,c.rightMargin);}return {leftMargin:r,rightMargin:o,segments:u}}function ae(t,e){let i=[];for(let n of t)for(let r of e){let o=Math.max(n.leftOffset,r.leftOffset),u=Math.min(n.leftOffset+n.availableWidth,r.leftOffset+r.availableWidth);u>o&&i.push({leftOffset:o,availableWidth:u-o});}return i}function oe(t,e,i){return t>0&&e<i}function se(t,e,i){return [{leftOffset:0,availableWidth:Math.max(0,t)},{leftOffset:Math.max(0,e),availableWidth:Math.max(0,i-e)}].filter(n=>n.availableWidth>1)}function le(t,e,i){let n=Math.max(0,t);return Math.max(0,i-e)>=n?{leftMargin:Q(e),rightMargin:0}:{leftMargin:0,rightMargin:tt(t,i)}}function Q(t){return Math.max(0,t)}function tt(t,e){return Math.max(0,e-t)}function it(t){return t/1440*96}function rt(t){return t/96*1440}function ue(t){let{explicitStops:e=[],defaultTabInterval:i=720,leftIndent:n=0}=t,r=e.filter(p=>p.val!=="clear").filter(p=>p.pos>=n),o=e.filter(p=>p.val==="clear").map(p=>p.pos),u=r.reduce((p,R)=>Math.max(p,R.pos),0),f=[...r];n>0&&!r.some(p=>p.pos<=n)&&(o.some(R=>Math.abs(R-n)<20)||f.push({val:"start",pos:n,leader:"none"}));let c=u>0?Math.max(u,n):n,b=n+14400;for(;c<b;){c+=i;let p=r.some(H=>Math.abs(H.pos-c)<20),R=o.some(H=>Math.abs(H-c)<20),Y=n>0&&Math.abs(c-n)<20;!p&&!R&&!Y&&f.push({val:"start",pos:c,leader:"none"});}return f.sort((p,R)=>p.pos-R.pos)}function pt(t,e,i={}){let{defaultTabInterval:n=720}=e,r=rt(t),u=ue(e).find(c=>c.pos>r);if(!u){let c=it(n),b=c-t%c;return b<=0&&(b=c),{width:b,alignment:"default"}}let g=it(u.pos)-t;if(u.val==="center")g-=(i.followingWidth??0)/2;else if(u.val==="end")g-=i.followingWidth??0;else if(u.val==="decimal")g-=i.decimalPrefixWidth??0;else if(u.val==="bar")return {width:0,leader:u.leader,alignment:"bar"};if(g<1){let c=it(n),b=c-t%c;return b<=0&&(b=c),{width:b,alignment:"default"}}return {width:g,leader:u.leader,alignment:u.val}}var y=11,O="Calibri",ce=1.15,X=1,k=.5;function bt(t,e,i,n=false){let r=1,o=t.length,u=0;for(;r<=o;){let f=r+o>>>1;S(t.slice(0,f),e)<=i?(u=f,r=f+1):o=f-1;}return n&&u===0?1:u}function Z(t){return {fontFamily:t.fontFamily??O,fontSize:t.fontSize??y,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function Ft(t,e,i){let n=W(t),r=i?.ascent??n*.8,o=i?.descent??n*.2,u=i?.singleLineRatio??1.15,f=n*u,g;if(e?.lineRule==="exact"&&e.line!==void 0)g=e.line;else if(e?.lineRule==="atLeast"&&e.line!==void 0){let c=f*X;g=Math.max(e.line,c);}else e?.line!==void 0&&e?.lineUnit==="multiplier"?g=f*e.line:e?.line!==void 0&&e?.lineUnit==="px"?g=e.line:g=f*X;return {ascent:r,descent:o,lineHeight:g}}function xt(t,e,i){let n=A({fontSize:t,fontFamily:i??O}),r=Ft(t,e,n),o=e?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let u=W(t),f=Math.max(r.lineHeight,u*ce);if(f!==r.lineHeight)return {...r,lineHeight:f}}return r}function U(t){return t.kind==="text"}function Tt(t){return t.kind==="tab"}function Mt(t){return t.kind==="image"}function Ct(t){return t.kind==="lineBreak"}function St(t){return t.kind==="field"}function fe(t){return !t.text||t.text.replace(/\u00a0/g," ").trim().length===0}function he(t,e){let i=0;for(let n=e+1;n<t.length;n++){let r=t[n];if(Tt(r)||Ct(r))break;if(U(r))i+=S(r.text||"",Z(r));else if(St(r)){let o={fontFamily:r.fontFamily??O,fontSize:r.fontSize??y,bold:r.bold,italic:r.italic};i+=S(r.fallback||"1",o);}else Mt(r)&&(i+=r.width||0);}return i}function ge(t){let e=[];for(let i=0;i<t.length;i++){let n=t[i];(n===" "||n==="-"||n===" ")&&e.push(i+1);}return e}function nt(t,e,i){let n=Math.max(1,i),r=Math.max(0,t),o=Math.max(0,e);return r>=n||o>=n||r+o>=n?{leftMargin:0,rightMargin:0}:{leftMargin:r,rightMargin:o}}function Rt(t,e,i){let n=t.runs,r=t.attrs,o=r?.spacing,u=i?.floatingZones,f=i?.paragraphYOffset??0,g=r?.indent,c$1=g?.left??0,b=g?.right??0,p=(g?.firstLine??0)-(g?.hanging??0),R=Math.max(1,e-c$1-b),Y=Math.max(1,R-p),H=0,Zt=W(y)*X,B=N(0,Zt,u,f),Bt=Math.max(1,et(B,Y)),C=[];if(n.length===0){if(r?.suppressEmptyParagraphHeight)return C.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:C,totalHeight:0};let s=r?.defaultFontSize??y,l=r?.defaultFontFamily??O,m=xt(s,o,l);C.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...m});let h=m.lineHeight;return o?.before&&(h+=o.before),o?.after&&(h+=o.after),{kind:"paragraph",lines:C,totalHeight:h}}if(n.length===1&&U(n[0])&&fe(n[0])){let s=n[0],l=s.fontSize??r?.defaultFontSize??y,m=s.fontFamily??r?.defaultFontFamily??O,h=xt(l,o,m);C.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...h});let d=h.lineHeight;return o?.before&&(d+=o.before),o?.after&&(d+=o.after),{kind:"paragraph",lines:C,totalHeight:d}}let a={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:y,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:Bt,leftOffset:B.leftMargin,rightOffset:B.rightMargin,segmentZones:B.segments},ot=()=>{let s=Ft(a.maxFontSize,o,a.maxFontMetrics),l={...s};if(a.maxImageHeightPx>l.lineHeight){let h=a.maxImageHeightPx,d=l.descent;l.lineHeight=h+d*2,l.ascent=h+d;}let m={fromRun:a.fromRun,fromChar:a.fromChar,toRun:a.toRun,toChar:a.toChar,width:a.width,...l};a.leftOffset>0&&(m.leftOffset=a.leftOffset),a.rightOffset>0&&(m.rightOffset=a.rightOffset),a.segmentZones?.length&&(m.segments=$t(m,a.segmentZones)),C.push(m),H+=s.lineHeight;},$t=(s,l)=>{let m=l[0],h=l[1];if(!m)return;if(!h||s.width<=m.availableWidth+k)return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:s.toChar,width:s.width,leftOffset:m.leftOffset,availableWidth:m.availableWidth}];if(s.fromRun!==s.toRun)return;let d=n[s.fromRun];if(!d||!U(d))return;let P=d,x=P.text.slice(s.fromChar,s.toChar),T=Z(P),F=bt(x,T,m.availableWidth);if(F<=0||F>=x.length)return;let w=s.fromChar+F,M=x.slice(0,F),G=x.slice(F);return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:w,width:S(M,T),leftOffset:m.leftOffset,availableWidth:m.availableWidth},{fromRun:s.fromRun,fromChar:w,toRun:s.toRun,toChar:s.toChar,width:S(G,T),leftOffset:h.leftOffset,availableWidth:h.availableWidth}]},L=(s,l)=>{ot();let m=W(y)*X,h=N(H,m,u,f),d=Math.max(1,et(h,R));a={fromRun:s,fromChar:l,toRun:s,toChar:l,width:0,maxFontSize:y,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:d,leftOffset:h.leftMargin,rightOffset:h.rightMargin,segmentZones:h.segments};},_=s=>{let l=s.fontSize??y;(!a.maxFontMetrics||l>a.maxFontSize)&&(a.maxFontSize=l,a.maxFontMetrics=A(s));};for(let s=0;s<n.length;s++){let l=n[s];if(Ct(l)){a.toRun=s,a.toChar=0,L(s+1,0);continue}if(Tt(l)){let m=Z(l);_(m);let h=he(n,s),d=a.width+(a.leftOffset??0),P=C.length===0,x=c$1+(P?p:0)+d,T={explicitStops:r?.tabs,leftIndent:rt(c$1)},F=pt(x,T,{followingWidth:h}).width;if(d+F>a.availableWidth+k){let w=a.availableWidth-d-h;w>1&&(F=w);}a.width+F>a.availableWidth+k&&(L(s,0),_(m)),a.width+=F,a.toRun=s,a.toChar=1;continue}if(Mt(l)){let m=l.wrapType,h=l.displayMode==="float"||c(m);if(l.position&&h){a.toRun=s,a.toChar=1;continue}if(m==="topAndBottom"||l.displayMode==="block"){a.width>0&&L(s,0);let x=l.height,T=l.distTop??6,F=l.distBottom??6;a.toRun=s,a.toChar=1,a.maxImageHeightPx=x+T+F,L(s+1,0);continue}let d=l.width,P=l.height;P>a.maxImageHeightPx&&(a.maxImageHeightPx=P),a.width+d>a.availableWidth+k&&L(s,0),a.width+=d,a.toRun=s,a.toChar=1;continue}if(St(l)){let m=l.fallback||"1",h={fontFamily:l.fontFamily??O,fontSize:l.fontSize??y,bold:l.bold,italic:l.italic};_(h);let d=S(m,h);a.width>0&&a.width+d>a.availableWidth+k&&(L(s,0),_(h)),a.width+=d,a.toRun=s,a.toChar=1;continue}if(U(l)){let m=l,h=m.text,d=Z(m);if(_(d),!h||h.length===0){a.toRun=s,a.toChar=0;continue}let P=ge(h),x=0;for(;x<h.length;){let T=h.length;for(let M of P)if(M>x){T=M;break}let F=h.slice(x,T),w=S(F,d);if(w>a.availableWidth+k){let M=0;for(;M<F.length;){let G=a.availableWidth-a.width+k,Dt=F.slice(M),K=bt(Dt,d,G);if(K===0){if(a.width>0){L(s,x+M),_(d);continue}K=1;}let V=M+K,Nt=F.slice(M,V),Ut=S(Nt,d);a.width+=Ut,a.toRun=s,a.toChar=x+V,M=V,M<F.length&&(L(s,x+M),_(d));}x=T;continue}a.width>0&&a.width+w>a.availableWidth+k&&(L(s,x),_(d)),a.width+=w,a.toRun=s,a.toChar=T,x=T;}}}ot();let st=C.reduce((s,l)=>s+l.lineHeight,0);r?.listMarker&&!r?.listMarkerHidden&&(g?.hanging??0)===0&&C.length>0&&(st+=C[0].lineHeight);let j=st;return o?.before&&(j+=o.before),o?.after&&(j+=o.after),{kind:"paragraph",lines:C,totalHeight:j}}function me(t,e){return t.map(i=>Rt(i,e))}function de(t){let e=Z(t);return J(t.text,e).charWidths}var yt=2e4,v=new Map;function Lt(t,e,i){return `${t}|${e}|${i||0}`}function Pt(){for(;v.size>yt;){let t=v.keys().next().value;if(t===void 0)break;v.delete(t);}}function pe(t,e,i=0){let n=Lt(t,e,i),r=v.get(n);if(r!==void 0)return v.delete(n),v.set(n,r),r.width}function be(t,e,i,n){let r=Lt(t,e,i);v.set(r,{width:n}),Pt();}function wt(){v.clear();}function xe(t){!Number.isFinite(t)||t<=0||(yt=t,Pt());}function Wt(){return v.size}var Fe=1e3,vt=Fe,E=new Map;function Et(t,e,i=false,n=false){return `${t}|${e}|${i}|${n}`}function It(){for(;E.size>vt;){let t=E.keys().next().value;if(t===void 0)break;E.delete(t);}}function Te(t,e,i=false,n=false){let r=Et(t,e,i,n),o=E.get(r);if(o!==void 0)return E.delete(r),E.set(r,o),o}function Me(t,e,i,n,r){let o=Et(t,e,i,n);E.set(o,r),It();}function _t(){E.clear();}function Ce(t){!Number.isFinite(t)||t<=0||(vt=t,It());}function kt(){return E.size}var Se=5e3,Ht=Se,I=new Map;function at(t){let e=[];for(let n of t.runs)n.kind==="text"?e.push(`t:${n.text}|${n.fontFamily}|${n.fontSize}|${n.bold}|${n.italic}`):n.kind==="tab"?e.push(`tab:${n.width}`):n.kind==="image"?e.push(`img:${n.width}x${n.height}`):n.kind==="lineBreak"&&e.push("br");let i=t.attrs;if(i){i.alignment&&e.push(`align:${i.alignment}`),i.indent&&e.push(`indent:${i.indent.left}|${i.indent.right}|${i.indent.firstLine}|${i.indent.hanging}`),i.spacing&&e.push(`spacing:${i.spacing.before}|${i.spacing.after}|${i.spacing.line}|${i.spacing.lineRule}`),i.defaultFontSize!=null&&e.push(`dfs:${i.defaultFontSize}`),i.defaultFontFamily!=null&&e.push(`dff:${i.defaultFontFamily}`);let n=i.borders;if(n){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";e.push(`bdr:${r(n.top)}|${r(n.bottom)}|${r(n.left)}|${r(n.right)}`);}i.suppressEmptyParagraphHeight&&e.push("sup");}return e.join("||")}function At(){for(;I.size>Ht;){let t=I.keys().next().value;if(t===void 0)break;I.delete(t);}}function Re(t,e){let i=at(t),n=I.get(i);if(n!==void 0&&n.maxWidth===e)return I.delete(i),I.set(i,n),n.measure}function ye(t,e,i){let n=at(t);I.set(n,{measure:i,maxWidth:e}),At();}function Ot(){I.clear();}function Le(t){!Number.isFinite(t)||t<=0||(Ht=t,At());}function zt(){return I.size}function Pe(){wt(),_t(),Ot();}function we(){return Wt()+kt()+zt()}export{Wt as A,Te as B,Me as C,_t as D,Ce as E,kt as F,at as G,Re as H,ye as I,Ot as J,Le as K,zt as L,Pe as M,we as N,$ as a,Kt as b,D as c,A as d,S as e,qt as f,J as g,Jt as h,Qt as i,te as j,ee as k,W as l,dt as m,ne as n,ie as o,re as p,N as q,pt as r,nt as s,Rt as t,me as u,de as v,pe as w,be as x,wt as y,xe as z};
@@ -1 +1 @@
1
- import {a as a$1,b as b$2}from'./chunk-LBKMYD3M.mjs';import {b}from'./chunk-NBLJPT54.mjs';import {b as b$4}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-ILJUDEZ5.mjs';import {b as b$1}from'./chunk-JKVXID22.mjs';import {b as b$3}from'./chunk-67LVRQIR.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function _(e){if(!e)return [];let n=[];return e.bold&&n.push(b$1.mark("bold")),e.italic&&n.push(b$1.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(b$1.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(b$1.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(b$1.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade})),e.highlight&&e.highlight!=="none"&&n.push(b$1.mark("highlight",{color:e.highlight})),e.fontSize&&n.push(b$1.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(b$1.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(b$1.mark("superscript")):e.vertAlign==="subscript"&&n.push(b$1.mark("subscript")),e.allCaps&&n.push(b$1.mark("allCaps")),e.smallCaps&&n.push(b$1.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(b$1.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(b$1.mark("emboss")),e.imprint&&n.push(b$1.mark("imprint")),e.shadow&&n.push(b$1.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(b$1.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(b$1.mark("textOutline")),e.hidden&&n.push(b$1.mark("hidden")),e.rtl&&n.push(b$1.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(b$1.mark("textEffect",{effect:e.effect})),n}function A(e,n){if(!e)return;if(!n)return e;let r=n.resolveRunStyle(e.styleId);return r?a(r,e):e}function ee(e,n){let r="",i,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let f of s.content)f.type==="text"&&(r+=f.text);!i&&s.formatting&&(i=s.formatting);}}let l=a(n,i),o=_(l);return b$1.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:r,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,o)}function te(e){return b$1.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function q(e,n,r){let i=[],t=e.formatting?.styleId?r?.getRunStyleOwnProperties(e.formatting.styleId):void 0,l=a(a(n,t),e.formatting),o=_(l);for(let s of e.content){let f=fe(s,o);i.push(...f);}return i}function fe(e,n){switch(e.type){case "text":return e.text?[b$1.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[b$1.node("hardBreak",null,void 0,n)]:[];case "tab":return [b$1.node("tab",null,void 0,n)];case "drawing":return e.image?[Te(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[be(t)]}case "footnoteRef":let r=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [b$1.text(e.id.toString(),[...n,r])];case "endnoteRef":let i=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [b$1.text(e.id.toString(),[...n,i])];default:return []}}function Te(e$1){let n=e$1.size?.width?e(e$1.size.width):void 0,r=e$1.size?.height?e(e$1.size.height):void 0,i=e$1.wrap.type,t=e$1.wrap.wrapText,l=e$1.position?.horizontal?.alignment,o;i==="inline"||i==="topAndBottom"?o="none":i==="square"||i==="tight"||i==="through"?t==="left"?o="right":t==="right"||l==="left"?o="left":l==="right"?o="right":o="none":o="none";let s="inline";i==="inline"?s="inline":i==="topAndBottom"?s="block":b$4(i)||o&&o!=="none"?s="float":s="block";let f;if(e$1.transform){let P=[];e$1.transform.rotation&&P.push(`rotate(${e$1.transform.rotation}deg)`),e$1.transform.flipH&&P.push("scaleX(-1)"),e$1.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(f=P.join(" "));}let p=e$1.wrap.distT?e(e$1.wrap.distT):void 0,c=e$1.wrap.distB?e(e$1.wrap.distB):void 0,d=e$1.wrap.distL?e(e$1.wrap.distL):void 0,m=e$1.wrap.distR?e(e$1.wrap.distR):void 0,u;e$1.position&&(u={horizontal:e$1.position.horizontal?{relativeTo:e$1.position.horizontal.relativeTo,posOffset:e$1.position.horizontal.posOffset,align:e$1.position.horizontal.alignment}:void 0,vertical:e$1.position.vertical?{relativeTo:e$1.position.vertical.relativeTo,posOffset:e$1.position.vertical.posOffset,align:e$1.position.vertical.alignment}:void 0});let F,k,v;if(e$1.outline&&e$1.outline.width){F=Math.round(e$1.outline.width/914400*96*100)/100,e$1.outline.color?.rgb&&(k=`#${e$1.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};v=e$1.outline.style&&P[e$1.outline.style]||"solid";}let N=e$1.padding?.top?e(e$1.padding.top):void 0,R=e$1.padding?.bottom?e(e$1.padding.bottom):void 0,B=e$1.padding?.left?e(e$1.padding.left):void 0,h=e$1.padding?.right?e(e$1.padding.right):void 0;return b$1.node("image",{src:e$1.src||"",alt:e$1.alt,title:e$1.title,width:n,height:r,rId:e$1.rId,wrapType:i,displayMode:s,cssFloat:o,transform:f,distTop:p,distBottom:c,distLeft:d,distRight:m,position:u,borderWidth:F,borderColor:k,borderStyle:v,wrapText:t,hlinkHref:e$1.hlinkHref,cropTop:e$1.crop?.top,cropRight:e$1.crop?.right,cropBottom:e$1.crop?.bottom,cropLeft:e$1.crop?.left,opacity:e$1.opacity,effectExtentTop:N,effectExtentBottom:R,effectExtentLeft:B,effectExtentRight:h,layoutInCell:e$1.layoutInCell,allowOverlap:e$1.allowOverlap})}function j(e,n,r){let i=[],t=e.href||(e.anchor?`#${e.anchor}`:""),l=b$1.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let o of e.children)if(o.type==="run"){let s=o.formatting?.styleId?r?.getRunStyleOwnProperties(o.formatting.styleId):void 0,f=a(a(n,s),o.formatting),c=[..._(f),l];for(let d of o.content)i.push(...fe(d,c));}return i}function be(e$1){let n=e$1.size?.width?e(e$1.size.width):100,r=e$1.size?.height?e(e$1.size.height):80,i,t="solid",l,o,s;if(e$1.fill&&(t=e$1.fill.type,e$1.fill.color?.rgb&&(i=`#${e$1.fill.color.rgb}`),e$1.fill.type==="gradient"&&e$1.fill.gradient)){let m=e$1.fill.gradient;l=m.type,o=m.angle,s=JSON.stringify(m.stops.map(u=>({position:u.position,color:u.color.rgb?`#${u.color.rgb}`:"#000000"})));}let f,p,c;e$1.outline&&(e$1.outline.width&&(f=Math.round(e$1.outline.width/914400*96*100)/100),e$1.outline.color?.rgb&&(p=`#${e$1.outline.color.rgb}`),c=e$1.outline.style||"solid");let d;if(e$1.transform){let m=[];e$1.transform.rotation&&m.push(`rotate(${e$1.transform.rotation}deg)`),e$1.transform.flipH&&m.push("scaleX(-1)"),e$1.transform.flipV&&m.push("scaleY(-1)"),m.length>0&&(d=m.join(" "));}return b$1.node("shape",{shapeType:e$1.shapeType||"rect",shapeId:e$1.id,width:n,height:r,fillColor:i,fillType:t,gradientType:l,gradientAngle:o,gradientStops:s,outlineWidth:f,outlineColor:p,outlineStyle:c,transform:d})}function E(e,n,r,i){let t=Pe(e,n),l=[],o,s=new Set,f;n&&(f=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let p=a(f,i);for(let c of e.content){if(c.type==="commentRangeStart")s.add(c.id);else if(c.type==="commentRangeEnd")s.delete(c.id);else if(c.type==="run"){let d=q(c,p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="hyperlink"){let d=j(c,p,n);l.push(...d);}else if(c.type==="simpleField"||c.type==="complexField"){let d=ee(c,p);d&&l.push(d);}else if(c.type==="inlineSdt"){let d=ce(c,p,n);d&&l.push(d);}else if(c.type==="insertion"){let d=X(c,"insertion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="deletion"){let d=X(c,"deletion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="moveFrom"){let d=X(c,"deletion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="moveTo"){let d=X(c,"insertion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="mathEquation"){let d=te(c);d&&l.push(d);}c.type==="bookmarkStart"&&(o||(o=[]),o.push({id:c.id,name:c.name}));}return o&&(t.bookmarks=o),b$1.node("paragraph",t,l)}function D(e,n){if(n.size===0)return e;let r=[...n][0],i=b$1.marks.comment.create({commentId:r});return e.map(t=>t.isText?t.mark(i.addToSet(t.marks)):t)}function X(e,n,r,i){let t=[];for(let o of e.content)o.type==="run"?t.push(...q(o,r,i)):o.type==="hyperlink"&&t.push(...j(o,r,i));let l=b$1.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null});return t.map(o=>o.isText?o.mark(l.addToSet(o.marks)):o)}function Pe(e,n){let r=e.formatting,i=r?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:i,numPr:r?.numPr,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:r||void 0};if(n){let l=n.resolveParagraphStyle(i),o=l.paragraphFormatting,s=l.runFormatting;t.alignment=r?.alignment??o?.alignment,t.spaceBefore=r?.spaceBefore??o?.spaceBefore,t.spaceAfter=r?.spaceAfter??o?.spaceAfter,t.lineSpacing=r?.lineSpacing??o?.lineSpacing,t.lineSpacingRule=r?.lineSpacingRule??o?.lineSpacingRule,r?.spacingExplicit&&(t.spacingExplicit=r.spacingExplicit),t.indentLeft=r?.indentLeft??o?.indentLeft,t.indentRight=r?.indentRight??o?.indentRight,t.indentFirstLine=r?.indentFirstLine??o?.indentFirstLine,t.hangingIndent=r?.hangingIndent??o?.hangingIndent,t.borders=r?.borders??o?.borders,t.shading=r?.shading??o?.shading,t.tabs=r?.tabs??o?.tabs,t.pageBreakBefore=r?.pageBreakBefore??o?.pageBreakBefore,t.keepNext=r?.keepNext??o?.keepNext,t.keepLines=r?.keepLines??o?.keepLines,t.contextualSpacing=r?.contextualSpacing??o?.contextualSpacing,t.outlineLevel=r?.outlineLevel??o?.outlineLevel,t.bidi=r?.bidi??o?.bidi;let f=n.getDefaultCharacterStyle()?.rPr,p=f?a(s,f):s,c=A(r?.runProperties,n);t.defaultTextFormatting=a(p,c),!r?.numPr&&o?.numPr&&o.numPr.numId!==0&&(t.numPr=o.numPr);}else t.alignment=r?.alignment,t.spaceBefore=r?.spaceBefore,t.spaceAfter=r?.spaceAfter,t.lineSpacing=r?.lineSpacing,t.lineSpacingRule=r?.lineSpacingRule,r?.spacingExplicit&&(t.spacingExplicit=r.spacingExplicit),t.indentLeft=r?.indentLeft,t.indentRight=r?.indentRight,t.indentFirstLine=r?.indentFirstLine,t.hangingIndent=r?.hangingIndent,t.borders=r?.borders,t.shading=r?.shading,t.tabs=r?.tabs,t.pageBreakBefore=r?.pageBreakBefore,t.keepNext=r?.keepNext,t.keepLines=r?.keepLines,t.outlineLevel=r?.outlineLevel,t.bidi=r?.bidi,t.defaultTextFormatting=A(r?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let l=e.sectionProperties.sectionStart;(l==="nextPage"||l==="continuous"||l==="oddPage"||l==="evenPage")&&(t.sectionBreakType=l);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),t}function ce(e,n,r){let i=e.properties,t=[];for(let l of e.content)if(l.type==="run"){let o=q(l,n,r);t.push(...o);}else if(l.type==="hyperlink"){let o=j(l,n,r);t.push(...o);}else if(l.type==="simpleField"||l.type==="complexField"){let o=ee(l,n);o&&t.push(o);}else if(l.type==="inlineSdt"){let o=ce(l,n,r);o&&t.push(o);}else if(l.type==="mathEquation"){let o=te(l);o&&t.push(o);}return b$1.node("sdt",{sdtType:i.sdtType,alias:i.alias??null,tag:i.tag??null,lock:i.lock??null,placeholder:i.placeholder??null,showingPlaceholder:i.showingPlaceholder??false,dateFormat:i.dateFormat??null,listItems:i.listItems?JSON.stringify(i.listItems):null,checked:i.checked??null},t.length>0?t:void 0)}function ue(e){function n(i){return i.type==="break"&&i.breakType==="page"}function r(i){if(i.type==="run"){for(let t of i.content)if(n(t))return true;return false}if(i.type==="hyperlink"){for(let t of i.children)if(t.type==="run"&&r(t))return true;return false}if(i.type==="insertion"||i.type==="deletion"){let t=i;for(let l of t.content)if(r(l))return true;return false}return false}for(let i of e.content)if(r(i))return true;return false}function x(e,n,r){if(!e||!n)return;let i=e.getStyle(n);if(!i?.tblStylePr)return;let t=i.tblStylePr.find(f=>f.type===r);if(!t)return;let l=A(t.pPr?.runProperties,e),o=A(t.rPr,e),s=a(l,o);return {tcPr:t.tcPr,rPr:s}}function M(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let r={},i=e.tcPr,t=n.tcPr;if(i||t){let l={...i??{},...t??{}};(i?.borders||t?.borders)&&(l.borders={...i?.borders??{},...t?.borders??{}}),(i?.shading||t?.shading)&&(l.shading={...i?.shading??{},...t?.shading??{}}),(i?.margins||t?.margins)&&(l.margins={...i?.margins??{},...t?.margins??{}}),r.tcPr=l;}return r.rPr=a(e.rPr,n.rPr),r}function ye(e){let n=new Map,r=e.rows.length,i=new Map;for(let t=0;t<r;t++){let l=e.rows[t],o=0;for(let s=0;s<l.cells.length;s++){let f=l.cells[s],p=f.formatting?.gridSpan??1,c=f.formatting?.vMerge,d=`${t}-${o}`;if(c==="restart")i.set(o,t),n.set(d,{rowSpan:1,skip:false});else if(c==="continue"){let m=i.get(o);if(m!==void 0){let u=`${m}-${o}`,F=n.get(u);F&&F.rowSpan++;}n.set(d,{rowSpan:1,skip:true});}else i.delete(o),n.set(d,{rowSpan:1,skip:false});o+=p;}}return n}function K(e,n,r){let i=ye(e),t=e.columnWidths,l=t?.reduce((P,S)=>P+S,0)??0,o=e.formatting?.styleId,s=e.formatting?.look,f=o?n?.getStyle(o):void 0,p=n?.getDefaultTableStyle(),c=e.formatting?.borders??f?.tblPr?.borders??p?.tblPr?.borders,d=e.formatting?.cellMargins??f?.tblPr?.cellMargins??p?.tblPr?.cellMargins??void 0,m=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,u={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,floating:e.formatting?.floating,cellMargins:m,look:e.formatting?.look,_originalFormatting:e.formatting||void 0},F={wholeTable:x(n,o,"wholeTable"),firstRow:x(n,o,"firstRow"),lastRow:x(n,o,"lastRow"),firstCol:x(n,o,"firstCol"),lastCol:x(n,o,"lastCol"),band1Horz:x(n,o,"band1Horz"),band2Horz:x(n,o,"band2Horz"),band1Vert:x(n,o,"band1Vert"),band2Vert:x(n,o,"band2Vert"),nwCell:x(n,o,"nwCell"),neCell:x(n,o,"neCell"),swCell:x(n,o,"swCell"),seCell:x(n,o,"seCell")},k=s?.noHBand!==true,v=s?.noVBand!==true,N=0,R=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((S,w)=>S+(w.formatting?.gridSpan??1),0))),h=e.rows.map((P,S)=>{let w=S===0&&!!s?.firstRow,C=S===R-1&&!!s?.lastRow,I=k&&!w&&!C?N%2===0?F.band1Horz:F.band2Horz:void 0;return k&&!w&&!C&&N++,Fe(P,n,w,t,l,F,I,v,s,c,S,R,B,i,m,r)});return b$1.node("table",u,h)}function Fe(e,n,r,i,t,l,o,s,f,p,c,d,m,u,F,k){let v={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0},N=e.cells.length,R=c===0,B=c===(d??1)-1,h=e.formatting?.conditionalFormat,P=h?.firstRow??R,S=h?.lastRow??B,w=m??N,C=0,I=[];for(let J=0;J<e.cells.length;J++){let Y=e.cells[J],L=Y.formatting?.gridSpan??1,me=`${c??0}-${C}`,oe=u?.get(me),he=oe?.skip??false,ge=oe?.rowSpan??1,re;if(i&&t&&t>0){let W=0;for(let z=0;z<L&&C+z<i.length;z++)W+=i[C+z];re=Math.round(W/t*100);}if(C+=L,he)continue;let ie=C-L===0,le=C===w,T=Y.formatting?.conditionalFormat,G=T?.firstRow??P,Q=T?.lastRow??S,O=T?.firstColumn??ie,V=T?.lastColumn??le,$;if(s){let W=f?.firstColumn?1:0,z=C-L-W;z>=0&&!(f?.lastColumn&&V)&&!(f?.firstColumn&&O)&&($=z%2===0?l?.band1Vert:l?.band2Vert);}T?.oddVBand?$=l?.band1Vert:T?.evenVBand&&($=l?.band2Vert);let H=o;h?.oddHBand?H=l?.band1Horz:h?.evenHBand&&(H=l?.band2Horz),T?.oddHBand?H=l?.band1Horz:T?.evenHBand&&(H=l?.band2Horz);let g=l?.wholeTable;g=M(g,H),g=M(g,$),G&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(g=M(g,l?.firstRow)),Q&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(g=M(g,l?.lastRow)),O&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.firstCol)),V&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.lastCol)),G&&O&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.nwCell)),G&&V&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.neCell)),Q&&O&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.swCell)),Q&&V&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.seCell)),I.push(Ce(Y,n,r,re,g,p,R,B,ie,le,ge,F,k));}return b$1.node("tableRow",v,I)}var we=["top","bottom","left","right","insideH","insideV"];function xe(e,n){if(!e)return e;let r;for(let i of we){let t=e[i];if(!t?.color?.themeColor||t.color.auto)continue;let l=b$3(t.color,n);l&&(r??(r={...e}),r[i]={...t,color:{rgb:l}});}return r??e}function Ce(e,n,r,i,t,l,o,s,f,p,c,d,m){let u=e.formatting,F=c??1,k=u?.width?.value,v=u?.width?.type;k===void 0&&i!==void 0&&(k=i,v="pct");let N=b$3(u?.shading?.fill??t?.tcPr?.shading?.fill,m),R=l?{top:o?l.top:l.insideH,bottom:s?l.bottom:l.insideH,left:f?l.left:l.insideV,right:p?l.right:l.insideV}:void 0,B=t?.tcPr?.borders,h=u?.borders,P=xe(R||B||h?{...R??{},...B??{},...h??{}}:void 0,m),S={colspan:u?.gridSpan??1,rowspan:F,width:k,widthType:v,verticalAlign:u?.verticalAlign,backgroundColor:N,textDirection:u?.textDirection,noWrap:u?.noWrap,borders:P,margins:u?.margins?{top:u.margins.top?.value,bottom:u.margins.bottom?.value,left:u.margins.left?.value,right:u.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:d,_originalFormatting:u||void 0,_originalResolvedFill:N},w=[];for(let I of e.content)I.type==="paragraph"?w.push(E(I,n,void 0,t?.rPr)):I.type==="table"&&w.push(K(I,n));w.length===0&&w.push(b$1.node("paragraph",{},[]));let C=r?"tableHeader":"tableCell";return b$1.node(C,S,w)}function ne(e,n){let r=Se(e),i=E(e,n),t=[],l=r.length>0&&i.content.size===0,{anchored:o,inFlow:s}=ke(r);for(let f of o)t.push(pe(f,n));l||t.push(i);for(let f of s)t.push(pe(f,n));return t}function ke(e){let n=[],r=[];for(let i of e)a$1(i)?n.push(i):r.push(i);return {anchored:n,inFlow:r}}function Se(e){let n=[];for(let r of e.content)if(r.type==="run"){for(let i of r.content)if(i.type==="shape"&&"shape"in i){let t=i.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function pe(e$1,n){let r=e$1.size?.width?e(e$1.size.width):200,i=e$1.size?.height?e(e$1.size.height):void 0,t;e$1.fill?.color?.rgb&&(t=`#${e$1.fill.color.rgb}`);let l,o,s;e$1.outline&&e$1.outline.width&&(l=Math.round(e$1.outline.width/914400*96*100)/100,e$1.outline.color?.rgb&&(o=`#${e$1.outline.color.rgb}`),s=e$1.outline.style||"solid");let f=e$1.margins?.top!=null?e(e$1.margins.top):4,p=e$1.margins?.bottom!=null?e(e$1.margins.bottom):4,c=e$1.margins?.left!=null?e(e$1.margins.left):7,d=e$1.margins?.right!=null?e(e$1.margins.right):7,m=[];for(let u of e$1.content)m.push(E(u,n));return m.length===0&&m.push(b$1.node("paragraph",{},[])),b$1.node("textBox",{width:r,height:i,textBoxId:e$1.id,fillColor:t,outlineWidth:l,outlineColor:o,outlineStyle:s,marginTop:f,marginBottom:p,marginLeft:c,marginRight:d,...b$2(e$1)},m)}function it(e,n){let r=e.package.document.content,i=[],t=e.package.theme??null,l=n?.styles?b(n.styles):null;for(let o of r)if(o.type==="paragraph")i.push(...ne(o,l)),ue(o)&&i.push(b$1.node("pageBreak"));else if(o.type==="table"){let s=K(o,l,t);i.push(s);}return i.length===0&&i.push(b$1.node("paragraph",{},[])),b$1.node("doc",null,i)}function Re(e,n){let r=[],i=n?.styles?b(n.styles):null,t=n?.theme??null;for(let l of e)l.type==="paragraph"?r.push(...ne(l,i)):l.type==="table"&&r.push(K(l,i,t));return r.length===0&&r.push(b$1.node("paragraph",{},[])),b$1.node("doc",null,r)}function lt(e,n){return Re(e,n)}function st(){return b$1.node("doc",null,[b$1.node("paragraph",{},[])])}export{it as a,Re as b,lt as c,st as d};
1
+ import {a as a$1,b as b$2}from'./chunk-LBKMYD3M.mjs';import {b}from'./chunk-NBLJPT54.mjs';import {b as b$4}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-ILJUDEZ5.mjs';import {b as b$1}from'./chunk-NMSU4MWP.mjs';import {b as b$3}from'./chunk-67LVRQIR.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function _(e){if(!e)return [];let n=[];return e.bold&&n.push(b$1.mark("bold")),e.italic&&n.push(b$1.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(b$1.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(b$1.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(b$1.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade})),e.highlight&&e.highlight!=="none"&&n.push(b$1.mark("highlight",{color:e.highlight})),e.fontSize&&n.push(b$1.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(b$1.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(b$1.mark("superscript")):e.vertAlign==="subscript"&&n.push(b$1.mark("subscript")),e.allCaps&&n.push(b$1.mark("allCaps")),e.smallCaps&&n.push(b$1.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(b$1.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(b$1.mark("emboss")),e.imprint&&n.push(b$1.mark("imprint")),e.shadow&&n.push(b$1.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(b$1.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(b$1.mark("textOutline")),e.hidden&&n.push(b$1.mark("hidden")),e.rtl&&n.push(b$1.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(b$1.mark("textEffect",{effect:e.effect})),n}function A(e,n){if(!e)return;if(!n)return e;let r=n.resolveRunStyle(e.styleId);return r?a(r,e):e}function ee(e,n){let r="",i,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let f of s.content)f.type==="text"&&(r+=f.text);!i&&s.formatting&&(i=s.formatting);}}let l=a(n,i),o=_(l);return b$1.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:r,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,o)}function te(e){return b$1.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function q(e,n,r){let i=[],t=e.formatting?.styleId?r?.getRunStyleOwnProperties(e.formatting.styleId):void 0,l=a(a(n,t),e.formatting),o=_(l);for(let s of e.content){let f=fe(s,o);i.push(...f);}return i}function fe(e,n){switch(e.type){case "text":return e.text?[b$1.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[b$1.node("hardBreak",null,void 0,n)]:[];case "tab":return [b$1.node("tab",null,void 0,n)];case "drawing":return e.image?[Te(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[be(t)]}case "footnoteRef":let r=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [b$1.text(e.id.toString(),[...n,r])];case "endnoteRef":let i=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [b$1.text(e.id.toString(),[...n,i])];default:return []}}function Te(e$1){let n=e$1.size?.width?e(e$1.size.width):void 0,r=e$1.size?.height?e(e$1.size.height):void 0,i=e$1.wrap.type,t=e$1.wrap.wrapText,l=e$1.position?.horizontal?.alignment,o;i==="inline"||i==="topAndBottom"?o="none":i==="square"||i==="tight"||i==="through"?t==="left"?o="right":t==="right"||l==="left"?o="left":l==="right"?o="right":o="none":o="none";let s="inline";i==="inline"?s="inline":i==="topAndBottom"?s="block":b$4(i)||o&&o!=="none"?s="float":s="block";let f;if(e$1.transform){let P=[];e$1.transform.rotation&&P.push(`rotate(${e$1.transform.rotation}deg)`),e$1.transform.flipH&&P.push("scaleX(-1)"),e$1.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(f=P.join(" "));}let p=e$1.wrap.distT?e(e$1.wrap.distT):void 0,c=e$1.wrap.distB?e(e$1.wrap.distB):void 0,d=e$1.wrap.distL?e(e$1.wrap.distL):void 0,m=e$1.wrap.distR?e(e$1.wrap.distR):void 0,u;e$1.position&&(u={horizontal:e$1.position.horizontal?{relativeTo:e$1.position.horizontal.relativeTo,posOffset:e$1.position.horizontal.posOffset,align:e$1.position.horizontal.alignment}:void 0,vertical:e$1.position.vertical?{relativeTo:e$1.position.vertical.relativeTo,posOffset:e$1.position.vertical.posOffset,align:e$1.position.vertical.alignment}:void 0});let F,k,v;if(e$1.outline&&e$1.outline.width){F=Math.round(e$1.outline.width/914400*96*100)/100,e$1.outline.color?.rgb&&(k=`#${e$1.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};v=e$1.outline.style&&P[e$1.outline.style]||"solid";}let N=e$1.padding?.top?e(e$1.padding.top):void 0,R=e$1.padding?.bottom?e(e$1.padding.bottom):void 0,B=e$1.padding?.left?e(e$1.padding.left):void 0,h=e$1.padding?.right?e(e$1.padding.right):void 0;return b$1.node("image",{src:e$1.src||"",alt:e$1.alt,title:e$1.title,width:n,height:r,rId:e$1.rId,wrapType:i,displayMode:s,cssFloat:o,transform:f,distTop:p,distBottom:c,distLeft:d,distRight:m,position:u,borderWidth:F,borderColor:k,borderStyle:v,wrapText:t,hlinkHref:e$1.hlinkHref,cropTop:e$1.crop?.top,cropRight:e$1.crop?.right,cropBottom:e$1.crop?.bottom,cropLeft:e$1.crop?.left,opacity:e$1.opacity,effectExtentTop:N,effectExtentBottom:R,effectExtentLeft:B,effectExtentRight:h,layoutInCell:e$1.layoutInCell,allowOverlap:e$1.allowOverlap})}function j(e,n,r){let i=[],t=e.href||(e.anchor?`#${e.anchor}`:""),l=b$1.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let o of e.children)if(o.type==="run"){let s=o.formatting?.styleId?r?.getRunStyleOwnProperties(o.formatting.styleId):void 0,f=a(a(n,s),o.formatting),c=[..._(f),l];for(let d of o.content)i.push(...fe(d,c));}return i}function be(e$1){let n=e$1.size?.width?e(e$1.size.width):100,r=e$1.size?.height?e(e$1.size.height):80,i,t="solid",l,o,s;if(e$1.fill&&(t=e$1.fill.type,e$1.fill.color?.rgb&&(i=`#${e$1.fill.color.rgb}`),e$1.fill.type==="gradient"&&e$1.fill.gradient)){let m=e$1.fill.gradient;l=m.type,o=m.angle,s=JSON.stringify(m.stops.map(u=>({position:u.position,color:u.color.rgb?`#${u.color.rgb}`:"#000000"})));}let f,p,c;e$1.outline&&(e$1.outline.width&&(f=Math.round(e$1.outline.width/914400*96*100)/100),e$1.outline.color?.rgb&&(p=`#${e$1.outline.color.rgb}`),c=e$1.outline.style||"solid");let d;if(e$1.transform){let m=[];e$1.transform.rotation&&m.push(`rotate(${e$1.transform.rotation}deg)`),e$1.transform.flipH&&m.push("scaleX(-1)"),e$1.transform.flipV&&m.push("scaleY(-1)"),m.length>0&&(d=m.join(" "));}return b$1.node("shape",{shapeType:e$1.shapeType||"rect",shapeId:e$1.id,width:n,height:r,fillColor:i,fillType:t,gradientType:l,gradientAngle:o,gradientStops:s,outlineWidth:f,outlineColor:p,outlineStyle:c,transform:d})}function E(e,n,r,i){let t=Pe(e,n),l=[],o,s=new Set,f;n&&(f=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let p=a(f,i);for(let c of e.content){if(c.type==="commentRangeStart")s.add(c.id);else if(c.type==="commentRangeEnd")s.delete(c.id);else if(c.type==="run"){let d=q(c,p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="hyperlink"){let d=j(c,p,n);l.push(...d);}else if(c.type==="simpleField"||c.type==="complexField"){let d=ee(c,p);d&&l.push(d);}else if(c.type==="inlineSdt"){let d=ce(c,p,n);d&&l.push(d);}else if(c.type==="insertion"){let d=X(c,"insertion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="deletion"){let d=X(c,"deletion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="moveFrom"){let d=X(c,"deletion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="moveTo"){let d=X(c,"insertion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="mathEquation"){let d=te(c);d&&l.push(d);}c.type==="bookmarkStart"&&(o||(o=[]),o.push({id:c.id,name:c.name}));}return o&&(t.bookmarks=o),b$1.node("paragraph",t,l)}function D(e,n){if(n.size===0)return e;let r=[...n][0],i=b$1.marks.comment.create({commentId:r});return e.map(t=>t.isText?t.mark(i.addToSet(t.marks)):t)}function X(e,n,r,i){let t=[];for(let o of e.content)o.type==="run"?t.push(...q(o,r,i)):o.type==="hyperlink"&&t.push(...j(o,r,i));let l=b$1.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null});return t.map(o=>o.isText?o.mark(l.addToSet(o.marks)):o)}function Pe(e,n){let r=e.formatting,i=r?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:i,numPr:r?.numPr,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:r||void 0};if(n){let l=n.resolveParagraphStyle(i),o=l.paragraphFormatting,s=l.runFormatting;t.alignment=r?.alignment??o?.alignment,t.spaceBefore=r?.spaceBefore??o?.spaceBefore,t.spaceAfter=r?.spaceAfter??o?.spaceAfter,t.lineSpacing=r?.lineSpacing??o?.lineSpacing,t.lineSpacingRule=r?.lineSpacingRule??o?.lineSpacingRule,r?.spacingExplicit&&(t.spacingExplicit=r.spacingExplicit),t.indentLeft=r?.indentLeft??o?.indentLeft,t.indentRight=r?.indentRight??o?.indentRight,t.indentFirstLine=r?.indentFirstLine??o?.indentFirstLine,t.hangingIndent=r?.hangingIndent??o?.hangingIndent,t.borders=r?.borders??o?.borders,t.shading=r?.shading??o?.shading,t.tabs=r?.tabs??o?.tabs,t.pageBreakBefore=r?.pageBreakBefore??o?.pageBreakBefore,t.keepNext=r?.keepNext??o?.keepNext,t.keepLines=r?.keepLines??o?.keepLines,t.contextualSpacing=r?.contextualSpacing??o?.contextualSpacing,t.outlineLevel=r?.outlineLevel??o?.outlineLevel,t.bidi=r?.bidi??o?.bidi;let f=n.getDefaultCharacterStyle()?.rPr,p=f?a(s,f):s,c=A(r?.runProperties,n);t.defaultTextFormatting=a(p,c),!r?.numPr&&o?.numPr&&o.numPr.numId!==0&&(t.numPr=o.numPr);}else t.alignment=r?.alignment,t.spaceBefore=r?.spaceBefore,t.spaceAfter=r?.spaceAfter,t.lineSpacing=r?.lineSpacing,t.lineSpacingRule=r?.lineSpacingRule,r?.spacingExplicit&&(t.spacingExplicit=r.spacingExplicit),t.indentLeft=r?.indentLeft,t.indentRight=r?.indentRight,t.indentFirstLine=r?.indentFirstLine,t.hangingIndent=r?.hangingIndent,t.borders=r?.borders,t.shading=r?.shading,t.tabs=r?.tabs,t.pageBreakBefore=r?.pageBreakBefore,t.keepNext=r?.keepNext,t.keepLines=r?.keepLines,t.outlineLevel=r?.outlineLevel,t.bidi=r?.bidi,t.defaultTextFormatting=A(r?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let l=e.sectionProperties.sectionStart;(l==="nextPage"||l==="continuous"||l==="oddPage"||l==="evenPage")&&(t.sectionBreakType=l);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),t}function ce(e,n,r){let i=e.properties,t=[];for(let l of e.content)if(l.type==="run"){let o=q(l,n,r);t.push(...o);}else if(l.type==="hyperlink"){let o=j(l,n,r);t.push(...o);}else if(l.type==="simpleField"||l.type==="complexField"){let o=ee(l,n);o&&t.push(o);}else if(l.type==="inlineSdt"){let o=ce(l,n,r);o&&t.push(o);}else if(l.type==="mathEquation"){let o=te(l);o&&t.push(o);}return b$1.node("sdt",{sdtType:i.sdtType,alias:i.alias??null,tag:i.tag??null,lock:i.lock??null,placeholder:i.placeholder??null,showingPlaceholder:i.showingPlaceholder??false,dateFormat:i.dateFormat??null,listItems:i.listItems?JSON.stringify(i.listItems):null,checked:i.checked??null},t.length>0?t:void 0)}function ue(e){function n(i){return i.type==="break"&&i.breakType==="page"}function r(i){if(i.type==="run"){for(let t of i.content)if(n(t))return true;return false}if(i.type==="hyperlink"){for(let t of i.children)if(t.type==="run"&&r(t))return true;return false}if(i.type==="insertion"||i.type==="deletion"){let t=i;for(let l of t.content)if(r(l))return true;return false}return false}for(let i of e.content)if(r(i))return true;return false}function x(e,n,r){if(!e||!n)return;let i=e.getStyle(n);if(!i?.tblStylePr)return;let t=i.tblStylePr.find(f=>f.type===r);if(!t)return;let l=A(t.pPr?.runProperties,e),o=A(t.rPr,e),s=a(l,o);return {tcPr:t.tcPr,rPr:s}}function M(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let r={},i=e.tcPr,t=n.tcPr;if(i||t){let l={...i??{},...t??{}};(i?.borders||t?.borders)&&(l.borders={...i?.borders??{},...t?.borders??{}}),(i?.shading||t?.shading)&&(l.shading={...i?.shading??{},...t?.shading??{}}),(i?.margins||t?.margins)&&(l.margins={...i?.margins??{},...t?.margins??{}}),r.tcPr=l;}return r.rPr=a(e.rPr,n.rPr),r}function ye(e){let n=new Map,r=e.rows.length,i=new Map;for(let t=0;t<r;t++){let l=e.rows[t],o=0;for(let s=0;s<l.cells.length;s++){let f=l.cells[s],p=f.formatting?.gridSpan??1,c=f.formatting?.vMerge,d=`${t}-${o}`;if(c==="restart")i.set(o,t),n.set(d,{rowSpan:1,skip:false});else if(c==="continue"){let m=i.get(o);if(m!==void 0){let u=`${m}-${o}`,F=n.get(u);F&&F.rowSpan++;}n.set(d,{rowSpan:1,skip:true});}else i.delete(o),n.set(d,{rowSpan:1,skip:false});o+=p;}}return n}function K(e,n,r){let i=ye(e),t=e.columnWidths,l=t?.reduce((P,S)=>P+S,0)??0,o=e.formatting?.styleId,s=e.formatting?.look,f=o?n?.getStyle(o):void 0,p=n?.getDefaultTableStyle(),c=e.formatting?.borders??f?.tblPr?.borders??p?.tblPr?.borders,d=e.formatting?.cellMargins??f?.tblPr?.cellMargins??p?.tblPr?.cellMargins??void 0,m=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,u={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,floating:e.formatting?.floating,cellMargins:m,look:e.formatting?.look,_originalFormatting:e.formatting||void 0},F={wholeTable:x(n,o,"wholeTable"),firstRow:x(n,o,"firstRow"),lastRow:x(n,o,"lastRow"),firstCol:x(n,o,"firstCol"),lastCol:x(n,o,"lastCol"),band1Horz:x(n,o,"band1Horz"),band2Horz:x(n,o,"band2Horz"),band1Vert:x(n,o,"band1Vert"),band2Vert:x(n,o,"band2Vert"),nwCell:x(n,o,"nwCell"),neCell:x(n,o,"neCell"),swCell:x(n,o,"swCell"),seCell:x(n,o,"seCell")},k=s?.noHBand!==true,v=s?.noVBand!==true,N=0,R=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((S,w)=>S+(w.formatting?.gridSpan??1),0))),h=e.rows.map((P,S)=>{let w=S===0&&!!s?.firstRow,C=S===R-1&&!!s?.lastRow,I=k&&!w&&!C?N%2===0?F.band1Horz:F.band2Horz:void 0;return k&&!w&&!C&&N++,Fe(P,n,w,t,l,F,I,v,s,c,S,R,B,i,m,r)});return b$1.node("table",u,h)}function Fe(e,n,r,i,t,l,o,s,f,p,c,d,m,u,F,k){let v={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0},N=e.cells.length,R=c===0,B=c===(d??1)-1,h=e.formatting?.conditionalFormat,P=h?.firstRow??R,S=h?.lastRow??B,w=m??N,C=0,I=[];for(let J=0;J<e.cells.length;J++){let Y=e.cells[J],L=Y.formatting?.gridSpan??1,me=`${c??0}-${C}`,oe=u?.get(me),he=oe?.skip??false,ge=oe?.rowSpan??1,re;if(i&&t&&t>0){let W=0;for(let z=0;z<L&&C+z<i.length;z++)W+=i[C+z];re=Math.round(W/t*100);}if(C+=L,he)continue;let ie=C-L===0,le=C===w,T=Y.formatting?.conditionalFormat,G=T?.firstRow??P,Q=T?.lastRow??S,O=T?.firstColumn??ie,V=T?.lastColumn??le,$;if(s){let W=f?.firstColumn?1:0,z=C-L-W;z>=0&&!(f?.lastColumn&&V)&&!(f?.firstColumn&&O)&&($=z%2===0?l?.band1Vert:l?.band2Vert);}T?.oddVBand?$=l?.band1Vert:T?.evenVBand&&($=l?.band2Vert);let H=o;h?.oddHBand?H=l?.band1Horz:h?.evenHBand&&(H=l?.band2Horz),T?.oddHBand?H=l?.band1Horz:T?.evenHBand&&(H=l?.band2Horz);let g=l?.wholeTable;g=M(g,H),g=M(g,$),G&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(g=M(g,l?.firstRow)),Q&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(g=M(g,l?.lastRow)),O&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.firstCol)),V&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.lastCol)),G&&O&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.nwCell)),G&&V&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.neCell)),Q&&O&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.swCell)),Q&&V&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.seCell)),I.push(Ce(Y,n,r,re,g,p,R,B,ie,le,ge,F,k));}return b$1.node("tableRow",v,I)}var we=["top","bottom","left","right","insideH","insideV"];function xe(e,n){if(!e)return e;let r;for(let i of we){let t=e[i];if(!t?.color?.themeColor||t.color.auto)continue;let l=b$3(t.color,n);l&&(r??(r={...e}),r[i]={...t,color:{rgb:l}});}return r??e}function Ce(e,n,r,i,t,l,o,s,f,p,c,d,m){let u=e.formatting,F=c??1,k=u?.width?.value,v=u?.width?.type;k===void 0&&i!==void 0&&(k=i,v="pct");let N=b$3(u?.shading?.fill??t?.tcPr?.shading?.fill,m),R=l?{top:o?l.top:l.insideH,bottom:s?l.bottom:l.insideH,left:f?l.left:l.insideV,right:p?l.right:l.insideV}:void 0,B=t?.tcPr?.borders,h=u?.borders,P=xe(R||B||h?{...R??{},...B??{},...h??{}}:void 0,m),S={colspan:u?.gridSpan??1,rowspan:F,width:k,widthType:v,verticalAlign:u?.verticalAlign,backgroundColor:N,textDirection:u?.textDirection,noWrap:u?.noWrap,borders:P,margins:u?.margins?{top:u.margins.top?.value,bottom:u.margins.bottom?.value,left:u.margins.left?.value,right:u.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:d,_originalFormatting:u||void 0,_originalResolvedFill:N},w=[];for(let I of e.content)I.type==="paragraph"?w.push(E(I,n,void 0,t?.rPr)):I.type==="table"&&w.push(K(I,n));w.length===0&&w.push(b$1.node("paragraph",{},[]));let C=r?"tableHeader":"tableCell";return b$1.node(C,S,w)}function ne(e,n){let r=Se(e),i=E(e,n),t=[],l=r.length>0&&i.content.size===0,{anchored:o,inFlow:s}=ke(r);for(let f of o)t.push(pe(f,n));l||t.push(i);for(let f of s)t.push(pe(f,n));return t}function ke(e){let n=[],r=[];for(let i of e)a$1(i)?n.push(i):r.push(i);return {anchored:n,inFlow:r}}function Se(e){let n=[];for(let r of e.content)if(r.type==="run"){for(let i of r.content)if(i.type==="shape"&&"shape"in i){let t=i.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function pe(e$1,n){let r=e$1.size?.width?e(e$1.size.width):200,i=e$1.size?.height?e(e$1.size.height):void 0,t;e$1.fill?.color?.rgb&&(t=`#${e$1.fill.color.rgb}`);let l,o,s;e$1.outline&&e$1.outline.width&&(l=Math.round(e$1.outline.width/914400*96*100)/100,e$1.outline.color?.rgb&&(o=`#${e$1.outline.color.rgb}`),s=e$1.outline.style||"solid");let f=e$1.margins?.top!=null?e(e$1.margins.top):4,p=e$1.margins?.bottom!=null?e(e$1.margins.bottom):4,c=e$1.margins?.left!=null?e(e$1.margins.left):7,d=e$1.margins?.right!=null?e(e$1.margins.right):7,m=[];for(let u of e$1.content)m.push(E(u,n));return m.length===0&&m.push(b$1.node("paragraph",{},[])),b$1.node("textBox",{width:r,height:i,textBoxId:e$1.id,fillColor:t,outlineWidth:l,outlineColor:o,outlineStyle:s,marginTop:f,marginBottom:p,marginLeft:c,marginRight:d,...b$2(e$1)},m)}function it(e,n){let r=e.package.document.content,i=[],t=e.package.theme??null,l=n?.styles?b(n.styles):null;for(let o of r)if(o.type==="paragraph")i.push(...ne(o,l)),ue(o)&&i.push(b$1.node("pageBreak"));else if(o.type==="table"){let s=K(o,l,t);i.push(s);}return i.length===0&&i.push(b$1.node("paragraph",{},[])),b$1.node("doc",null,i)}function Re(e,n){let r=[],i=n?.styles?b(n.styles):null,t=n?.theme??null;for(let l of e)l.type==="paragraph"?r.push(...ne(l,i)):l.type==="table"&&r.push(K(l,i,t));return r.length===0&&r.push(b$1.node("paragraph",{},[])),b$1.node("doc",null,r)}function lt(e,n){return Re(e,n)}function st(){return b$1.node("doc",null,[b$1.node("paragraph",{},[])])}export{it as a,Re as b,lt as c,st as d};
@@ -1 +1 @@
1
- import {a}from'./chunk-JKVXID22.mjs';var e=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();export{j as A,q as B,w as C,z as D,g as a,l as b,u as c,x as d,C as e,f,S as g,L as h,b as i,y as j,v as k,A as l,I as m,h as n,R as o,T as p,P as q,B as r,k as s,E as t,F as u,H as v,J as w,N as x,O as y,M as z};
1
+ import {a}from'./chunk-NMSU4MWP.mjs';var e=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();export{j as A,q as B,w as C,z as D,g as a,l as b,u as c,x as d,C as e,f,S as g,L as h,b as i,y as j,v as k,A as l,I as m,h as n,R as o,T as p,P as q,B as r,k as s,E as t,F as u,H as v,J as w,N as x,O as y,M as z};
@@ -0,0 +1 @@
1
+ import {a as a$1,b}from'./chunk-7E5VBRDL.mjs';import {J as J$1}from'./chunk-3GNIP6IX.mjs';import {a,b as b$1,o}from'./chunk-67LVRQIR.mjs';import {i,j as j$1,k}from'./chunk-VW22RZ6C.mjs';function f(e){return e/1440*96}function x(e,i,r){if(!r||i<=r)return {width:e,height:i};let n=r/i;return {width:Math.round(e*n),height:r}}var E=0;function h(){return `block-${++E}`}function U(){E=0;}function B(e,i){let r={};for(let n of e)switch(n.type.name){case "bold":r.bold=true;break;case "italic":r.italic=true;break;case "underline":{let t=n.attrs;if(t.style||t.color){let a$1=t.color?a(t.color,i):void 0;r.underline={style:t.style,color:a$1};}else r.underline=true;break}case "strike":r.strike=true;break;case "textColor":{let t=n.attrs;(t.themeColor||t.rgb)&&(r.color=a({rgb:t.rgb,themeColor:t.themeColor,themeTint:t.themeTint,themeShade:t.themeShade},i));break}case "highlight":r.highlight=o(n.attrs.color);break;case "fontSize":{let t=n.attrs;r.fontSize=t.size/2;break}case "fontFamily":{let t=n.attrs;r.fontFamily=t.ascii||t.hAnsi;break}case "characterSpacing":{let t=n.attrs;t.spacing!=null&&t.spacing!==0&&(r.letterSpacing=f(t.spacing)),t.position!=null&&t.position!==0&&(r.positionPx=j$1(t.position)),t.scale!=null&&t.scale!==100&&(r.horizontalScale=t.scale),t.kerning!=null&&t.kerning>0&&(r.kerningMinPt=k(t.kerning));break}case "allCaps":r.allCaps=true;break;case "smallCaps":r.smallCaps=true;break;case "emboss":r.emboss=true;break;case "imprint":r.imprint=true;break;case "textShadow":r.textShadow=true;break;case "textOutline":r.textOutline=true;break;case "hidden":r.hidden=true;break;case "rtl":r.rtl=true;break;case "textEffect":{let t=n.attrs.effect;(t==="blinkBackground"||t==="lights"||t==="antsBlack"||t==="antsRed"||t==="shimmer"||t==="sparkle")&&(r.textEffect=t);break}case "emphasisMark":{let t=n.attrs.type;t==="dot"||t==="comma"||t==="circle"||t==="underDot"?r.emphasisMark=t:r.emphasisMark="dot";break}case "superscript":r.superscript=true;break;case "subscript":r.subscript=true;break;case "hyperlink":{let t=n.attrs;r.hyperlink={href:t.href,tooltip:t.tooltip};break}case "footnoteRef":{let t=n.attrs,a=typeof t.id=="string"?parseInt(t.id,10):t.id;t.noteType==="endnote"?r.endnoteRefId=a:r.footnoteRefId=a;break}case "comment":{let t=n.attrs.commentId;t&&(r.commentIds||(r.commentIds=[]),r.commentIds.push(t));break}case "insertion":r.isInsertion=true,r.changeAuthor=n.attrs.author,r.changeDate=n.attrs.date,r.changeRevisionId=n.attrs.revisionId;break;case "deletion":r.isDeletion=true,r.changeAuthor=n.attrs.author,r.changeDate=n.attrs.date,r.changeRevisionId=n.attrs.revisionId;break}return r}function $(e){let i=e.defaultTextFormatting;if(!i)return {};let r={};if(i.fontFamily){let n=i.fontFamily.ascii||i.fontFamily.hAnsi;n&&(r.fontFamily=n);}return i.fontSize!=null&&(r.fontSize=i.fontSize/2),r}function L(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function N(e,i,r){let n=[],t=i+1,a=r.theme,s=$(e.attrs),c=e.attrs.styleId,m=typeof c=="string"&&/^TOC\d*$/i.test(c);function p(u,o){if(u.isText&&u.text){let l=B(u.marks,a);m&&L(l);let d={kind:"text",text:u.text,...s,...l,pmStart:o,pmEnd:o+u.nodeSize};n.push(d);}else if(u.type.name==="hardBreak")n.push({kind:"lineBreak",pmStart:o,pmEnd:o+u.nodeSize});else if(u.type.name==="tab"){let l=B(u.marks,a),d={kind:"tab",...s,...l,pmStart:o,pmEnd:o+u.nodeSize};n.push(d);}else if(u.type.name==="image"){let l=u.attrs,d=x(l.width||100,l.height||100,r.pageContentHeight),g={kind:"image",src:l.src,width:d.width,height:d.height,alt:l.alt,transform:l.transform,wrapType:l.wrapType,displayMode:l.displayMode,cssFloat:l.cssFloat,distTop:l.distTop,distBottom:l.distBottom,distLeft:l.distLeft,distRight:l.distRight,position:l.position,cropTop:l.cropTop,cropRight:l.cropRight,cropBottom:l.cropBottom,cropLeft:l.cropLeft,opacity:l.opacity,pmStart:o,pmEnd:o+u.nodeSize};n.push(g);}else if(u.type.name==="field"){let l=u.attrs.fieldType,d=l==="PAGE"?"PAGE":l==="NUMPAGES"?"NUMPAGES":l==="DATE"?"DATE":l==="TIME"?"TIME":"OTHER",g=B(u.marks,a);m&&L(g),n.push({kind:"field",fieldType:d,fallback:u.attrs.displayText||"",...s,...g,pmStart:o,pmEnd:o+u.nodeSize});}else if(u.type.name==="math"){let l=u.attrs.plainText||"[equation]";n.push({kind:"text",text:l,italic:true,fontFamily:"Cambria Math",pmStart:o,pmEnd:o+u.nodeSize});}else if(u.type.name==="sdt"){let l=o+1;u.forEach((d,g)=>{p(d,l+g);});}}return e.forEach((u,o)=>{p(u,t+o);}),n}function Y(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 S(e,i$1){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let r={style:G[e.style]||"solid",width:Y(e.size??0),color:e.color?a(e.color,i$1):"#000000"};return e.space!==void 0&&(r.space=i(e.space)),r}function O(e,i){let r=e.borders;if(!r)return;let n={},t=["top","bottom","left","right"];for(let a of t){let s=r[a],c=s?S(s,i):void 0;n[a]=c??{width:0,style:"none"};}return Object.keys(n).length>0?n:void 0}function j(e,i){let r=[];for(let n=0;n<=i;n+=1){let t=e[n]??0;if(t<=0)break;r.push(t);}return r.length===0?"1.":`${r.join(".")}.`}var V=[[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 D(e,i){if(e<=0)return "";let r=e,n="";for(let[t,a]of V)for(;r>=t;)n+=a,r-=t;return i?n:n.toLowerCase()}function H(e,i){if(e<=0)return "";let r=e,n="";for(;r>0;){let t=(r-1)%26;n=String.fromCharCode(65+t)+n,r=Math.floor((r-1)/26);}return i?n:n.toLowerCase()}function q(e,i){if(e<=0)return "";switch(i){case "upperRoman":return D(e,true);case "lowerRoman":return D(e,false);case "upperLetter":return H(e,true);case "lowerLetter":return H(e,false);case "decimalZero":return e<10?`0${e}`:String(e);case "none":return "";default:return String(e)}}function W(e,i,r){return e.replace(/%(\d)([.):\]])?/g,(n,t,a="")=>{let s=parseInt(t,10)-1;if(s<0)return "";let c=i[s]??0,m=r?.[s]??"decimal",p=q(c,m);return p?p+a:""})}function X(e,i,r){let n=e.numPr;if(!n)return null;let t=n.numId;if(t==null||t===0)return null;if(e.listIsBullet)return J$1(e.listMarker||"");let a=n.ilvl??0,s=e.listAbstractNumId??t,c=i.get(s)??new Array(9).fill(0),m=`${t}:${a}`;r.has(m)||(r.add(m),e.listStartOverride!=null&&(c[a]=e.listStartOverride-1)),c[a]=(c[a]??0)+1;for(let p=a+1;p<c.length;p+=1)c[p]=0;return i.set(s,c),e.listMarker&&e.listMarker.includes("%")?W(e.listMarker,c,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:j(c,a)}var K="Calibri",Z=11;function A(e,i,r,n){let t={};if(e.alignment){let o=e.alignment;o==="both"||o==="distribute"?t.alignment="justify":o==="left"?t.alignment="left":o==="center"?t.alignment="center":o==="right"&&(t.alignment="right");}(e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(t.spacing={},e.spaceBefore!=null&&(t.spacing.before=f(e.spaceBefore)),e.spaceAfter!=null&&(t.spacing.after=f(e.spaceAfter)),e.lineSpacing!=null&&(e.lineSpacingRule==="exact"||e.lineSpacingRule==="atLeast"?(t.spacing.line=f(e.lineSpacing),t.spacing.lineUnit="px",t.spacing.lineRule=e.lineSpacingRule):(t.spacing.line=e.lineSpacing/240,t.spacing.lineUnit="multiplier",t.spacing.lineRule="auto"))),e.spacingExplicit&&(t.spacingExplicit=e.spacingExplicit);let a=e.indentLeft,s=e.indentFirstLine,c=e.hangingIndent;if(e.numPr?.numId&&a==null&&(a=((e.numPr.ilvl??0)+1)*720,s==null&&(s=-360,c=true)),(a!=null||e.indentRight!=null||s!=null)&&(t.indent={},a!=null&&(t.indent.left=f(a)),e.indentRight!=null&&(t.indent.right=f(e.indentRight)),s!=null&&(c?t.indent.hanging=Math.abs(f(s)):t.indent.firstLine=f(s))),e.styleId&&(t.styleId=e.styleId),e.borders){let o=e.borders;t.borders={};let l=d=>d?S(d,i):void 0;o.top&&(t.borders.top=l(o.top)),o.bottom&&(t.borders.bottom=l(o.bottom)),o.left&&(t.borders.left=l(o.left)),o.right&&(t.borders.right=l(o.right)),o.between&&(t.borders.between=l(o.between)),o.bar&&(t.borders.bar=l(o.bar)),!t.borders.top&&!t.borders.bottom&&!t.borders.left&&!t.borders.right&&!t.borders.between&&!t.borders.bar&&delete t.borders;}let m=b$1(e.shading?.fill,i);m&&(t.shading=`#${m}`),e.tabs&&e.tabs.length>0&&(t.tabs=e.tabs.map(o=>({val:J(o.alignment),pos:o.position,leader:o.leader}))),e.pageBreakBefore&&(t.pageBreakBefore=true),e.keepNext&&(t.keepNext=true),e.keepLines&&(t.keepLines=true),e.contextualSpacing&&(t.contextualSpacing=true),e.bidi&&(t.bidi=true),e.styleId&&(t.styleId=e.styleId),e.numPr&&(t.numPr={numId:e.numPr.numId,ilvl:e.numPr.ilvl});let p=r&&n?X(e,r,n):null;p!=null?t.listMarker=p:e.listMarker&&(t.listMarker=e.listMarker),e.listIsBullet!=null&&(t.listIsBullet=e.listIsBullet),e.listMarkerHidden&&(t.listMarkerHidden=true),e.listMarkerFontFamily&&(t.listMarkerFontFamily=e.listMarkerFontFamily),e.listMarkerFontSize&&(t.listMarkerFontSize=e.listMarkerFontSize);let u=e.defaultTextFormatting;return u&&(u.fontSize!=null&&(t.defaultFontSize=u.fontSize/2),u.fontFamily&&(t.defaultFontFamily=u.fontFamily.ascii||u.fontFamily.hAnsi)),t}function J(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 F(e,i,r){let n=e.attrs,t=N(e,i,r),a=A(n,r.theme,r.listCounters,r.listSeenNumIds);return {kind:"paragraph",id:h(),runs:t,attrs:a,pmStart:i,pmEnd:i+e.nodeSize}}function Q(e,i,r,n){let t=[],a=i+1;e.forEach(d=>{d.type.name==="paragraph"?t.push(F(d,a,r)):d.type.name==="table"&&t.push(_(d,a,r)),a+=d.nodeSize;});let s=e.attrs,c=s.width,m=s.widthType,p=c&&(!m||m==="dxa"||m==="auto")?f(c):void 0,u=s.margins,o=(d,g)=>{if(d!=null){let b=f(d);if(b>0)return b}if(g!=null){let b=f(g);if(b>=0)return b}return 0},l={top:o(u?.top,n?.top),right:o(u?.right,n?.right),bottom:o(u?.bottom,n?.bottom),left:o(u?.left,n?.left)};return {id:h(),blocks:t,colSpan:s.colspan,rowSpan:s.rowspan,width:p,widthValue:c,widthType:m,verticalAlign:s.verticalAlign,background:s.backgroundColor?`#${s.backgroundColor}`:void 0,borders:O(s,r.theme),padding:l,noWrap:s.noWrap||void 0}}function ee(e,i,r,n){let t=[],a=i+1;e.forEach(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&t.push(Q(c,a,r,n)),a+=c.nodeSize;});let s=e.attrs;return {id:h(),cells:t,height:s.height?f(s.height):void 0,heightRule:s.heightRule??void 0,isHeader:s.isHeader}}function _(e,i,r){let n=[],t=i+1,a=e.attrs.cellMargins;e.forEach(b=>{b.type.name==="tableRow"&&n.push(ee(b,t,r,a)),t+=b.nodeSize;});let c=e.attrs.columnWidths?.map(f),m=e.attrs.width,p=e.attrs.widthType;if(!c&&n.length>0){let w=n[0].cells.map(T=>T.width);w.every(T=>T!==void 0&&T>0)&&(c=w);}let u=e.attrs.justification,o=e.attrs._originalFormatting,l=o?.indent?.value&&o.indent.type==="dxa"?f(o.indent.value):void 0,d=e.attrs.floating,g=d?{horzAnchor:d.horzAnchor,vertAnchor:d.vertAnchor,tblpX:d.tblpX!==void 0?f(d.tblpX):void 0,tblpXSpec:d.tblpXSpec,tblpY:d.tblpY!==void 0?f(d.tblpY):void 0,tblpYSpec:d.tblpYSpec,topFromText:d.topFromText!==void 0?f(d.topFromText):void 0,bottomFromText:d.bottomFromText!==void 0?f(d.bottomFromText):void 0,leftFromText:d.leftFromText!==void 0?f(d.leftFromText):void 0,rightFromText:d.rightFromText!==void 0?f(d.rightFromText):void 0}:void 0;return {kind:"table",id:h(),rows:n,columnWidths:c,width:m,widthType:p,justification:u,indent:l,floating:g,pmStart:i,pmEnd:i+e.nodeSize}}function te(e,i,r){let n=e.attrs,t=n.wrapType,a=t==="behind"||t==="inFront",s=x(n.width||100,n.height||100,r);return {kind:"image",id:h(),src:n.src,width:s.width,height:s.height,alt:n.alt,transform:n.transform,anchor:a?{isAnchored:true,offsetH:n.distLeft,offsetV:n.distTop,behindDoc:t==="behind"}:void 0,hlinkHref:n.hlinkHref,pmStart:i,pmEnd:i+e.nodeSize}}function ne(e,i,r){let n=e.attrs,t=[];return e.forEach((a,s)=>{if(a.type.name==="paragraph"){let c=F(a,i+1+s,r);t.push(c);}}),{kind:"textBox",id:h(),width:n.width??b,height:n.height??void 0,fillColor:n.fillColor,outlineWidth:n.outlineWidth,outlineColor:n.outlineColor,outlineStyle:n.outlineStyle,margins:{top:n.marginTop??a$1.top,bottom:n.marginBottom??a$1.bottom,left:n.marginLeft??a$1.left,right:n.marginRight??a$1.right},content:t,displayMode:n.displayMode,cssFloat:n.cssFloat,wrapType:n.wrapType,wrapText:n.wrapText,anchorTarget:n.anchorTarget,position:n.position,distTop:n.distTop,distBottom:n.distBottom,distLeft:n.distLeft,distRight:n.distRight,pmStart:i,pmEnd:i+e.nodeSize}}function ye(e,i={}){let r={...i,defaultFont:i.defaultFont??K,defaultSize:i.defaultSize??Z},n=[],t=0,a={top:1440,bottom:1440,left:1440,right:1440};return r.listCounters||(r.listCounters=new Map),r.listSeenNumIds||(r.listSeenNumIds=new Set),e.forEach((s,c)=>{let m=t+c;switch(s.type.name){case "paragraph":{let p=F(s,m,r),u=s.attrs;n.push(p);let o=u._sectionProperties;if(o||u.sectionBreakType){let l={kind:"sectionBreak",id:h(),type:o?.sectionStart??u.sectionBreakType};if(o){if((o.pageWidth!==void 0||o.pageHeight!==void 0)&&(l.pageSize={w:f(o.pageWidth??12240),h:f(o.pageHeight??15840)}),o.marginTop!==void 0||o.marginBottom!==void 0||o.marginLeft!==void 0||o.marginRight!==void 0){let g={top:o.marginTop??a.top,bottom:o.marginBottom??a.bottom,left:o.marginLeft??a.left,right:o.marginRight??a.right};l.margins={top:f(g.top),bottom:f(g.bottom),left:f(g.left),right:f(g.right)},a=g;}let d=o.columnCount??1;if(d>1){let g={count:d,gap:f(o.columnSpace??720),equalWidth:o.equalWidth??true,separator:o.separator};l.columns=g;}}n.push(l);}}break;case "table":n.push(_(s,m,r));break;case "image":n.push(te(s,m,r.pageContentHeight));break;case "textBox":n.push(ne(s,m,r));break;case "horizontalRule":case "pageBreak":{let p={kind:"pageBreak",id:h(),pmStart:m,pmEnd:m+s.nodeSize};n.push(p);break}}}),n}export{U as a,S as b,W as c,ye as d};
@@ -1 +1 @@
1
- 'use strict';var chunk2KHWHVTA_js=require('./chunk-2KHWHVTA.js'),chunkSUXJX72X_js=require('./chunk-SUXJX72X.js'),prosemirrorState=require('prosemirror-state');function M(e){let{$from:t}=e.selection,o=null,i=null,a=null,l=-1,n=-1;for(let r=t.depth;r>0;r--){let u=t.node(r);if(u.type.name==="tableCell"||u.type.name==="tableHeader"){a=u;let p=t.node(r-1);if(p?.type.name==="tableRow"){let m=0;p.forEach((f,b,g)=>{if(n===-1){if(g===t.index(r-1)){n=m;return}m+=f.attrs.colspan||1;}});}}else if(u.type.name==="tableRow")t.node(r-1)?.type.name==="table"&&(l=t.index(r-1));else if(u.type.name==="table"){o=u,i=t.before(r);break}}return !o||i==null||!a||l<0||n<0?null:{table:o,tablePos:i,cell:a,row:l,col:n,rowspan:a.attrs.rowspan||1,colspan:a.attrs.colspan||1}}function k(e){let t=[],o=[],i=0;for(let a=0;a<e.childCount;a++){let l=e.child(a),n=0;l.forEach(r=>{for(;t[a]?.[n];)n++;let u=r.attrs.rowspan||1,p=r.attrs.colspan||1;o.push({data:r,row:a,col:n,rowspan:u,colspan:p});for(let m=a;m<a+u;m++){let f=t[m]??[];t[m]=f;for(let b=n;b<n+p;b++)f[b]=true;}n+=p,i=Math.max(i,n);});}return {anchors:o,totalCols:i}}function B(e,t,o,i,a){let l={...e.attrs},n=a.reduce((p,m)=>p+m,0),r=chunk2KHWHVTA_js.a(a,t,o),u=o!==(e.attrs.colspan||1)||i!==(e.attrs.rowspan||1);return l.colspan=o,l.rowspan=i,l.colwidth=null,n>0&&(l.width=Math.round(r/n*5e3),l.widthType="pct"),u&&(l._originalFormatting=null),l}function D(e,t,o,i){let a=t+1;for(let l=0;l<e.childCount;l++){let n=e.child(l),r=a+1,u=0;for(let p=0;p<n.childCount;p++){let m=n.child(p);if(l===o&&u===i)return r;u+=m.attrs.colspan||1,r+=m.nodeSize;}a+=n.nodeSize;}return null}function O(e,t){let o=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(o/Math.max(t,1)))}function j(e){let t=M(e);return t?{...chunk2KHWHVTA_js.e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function V(e,t,o,i,a,l){if(o<1||i<1)return false;let n=M(e);if(!n||!t)return false;let r=n;if(a!=null&&l!=null&&(a!==n.row||l!==n.col)){let{anchors:c}=k(n.table),d=c.find(x=>x.row===a&&x.col===l);if(!d)return false;r={...n,cell:d.data,row:d.row,col:d.col,rowspan:d.rowspan,colspan:d.colspan};}if(o<r.rowspan||i<r.colspan||o===1&&i===1)return false;let{anchors:u,totalCols:p}=k(r.table),m=O(r.table,p),f=chunk2KHWHVTA_js.b(m,r.col,r.colspan,i),b=u.find(c=>c.row===r.row&&c.col===r.col);if(!b)return false;let g=chunk2KHWHVTA_js.c(u,b,o,i,r.table.childCount,c=>{if(c)return b.data;let d=b.data.type.schema.nodes.paragraph.create(),x=B(b.data,0,1,1,f);return b.data.type.create(x,d)}),T=r.row+r.rowspan,y=Array.from({length:g.newRowCount},(c,d)=>d<T?{...r.table.child(d)?.attrs??{}}:d<r.row+o?{...r.table.child(T-1)?.attrs??{}}:{...r.table.child(d-g.deltaRows)?.attrs??{}}),C=Array.from({length:g.newRowCount},()=>[]);g.anchors.sort((c,d)=>c.row===d.row?c.col-d.col:c.row-d.row).forEach(c=>{let d=B(c.data,c.col,c.colspan,c.rowspan,f);C[c.row].push(c.data.type.create(d,c.data.content));});let z=C.map((c,d)=>r.table.type.schema.nodes.tableRow.create(y[d],c)),F=r.table.type.create({...r.table.attrs,columnWidths:f},z),h=e.tr.replaceWith(r.tablePos,r.tablePos+r.table.nodeSize,F),w=h.doc.nodeAt(r.tablePos);if(w){let c=D(w,r.tablePos,r.row,r.col);c!=null&&(h=h.setSelection(prosemirrorState.TextSelection.near(h.doc.resolve(c+1))));}return t(h.scrollIntoView()),true}var s=chunkSUXJX72X_js.a.getCommands();function J(e,t){return s.insertTable(e,t)}function $(e,t){return s.addRowAbove()(e,t)}function q(e,t){return s.addRowBelow()(e,t)}function G(e,t){return s.deleteRow()(e,t)}function K(e,t){return s.addColumnLeft()(e,t)}function Q(e,t){return s.addColumnRight()(e,t)}function X(e,t){return s.deleteColumn()(e,t)}function Y(e,t){return s.deleteTable()(e,t)}function Z(e,t){return s.selectTable()(e,t)}function ee(e,t){return s.selectRow()(e,t)}function te(e,t){return s.selectColumn()(e,t)}function re(e,t){return s.mergeCells()(e,t)}function oe(e,t){return s.splitCell()(e,t)}function ne(e,t,o){return s.setCellBorder(e,t,o)}function ae(e,t){return s.setTableBorders(e,t)}function le(e,t){return s.removeTableBorders()(e,t)}function ie(e,t,o){return s.setAllTableBorders(o)(e,t)}function se(e,t,o){return s.setOutsideTableBorders(o)(e,t)}function ce(e,t,o){return s.setInsideTableBorders(o)(e,t)}function de(e){return s.setCellVerticalAlign(e)}function ue(e){return s.setCellMargins(e)}function pe(e){return s.setCellTextDirection(e)}function me(){return s.toggleNoWrap()}function fe(e,t){return s.setRowHeight(e,t)}function be(){return s.toggleHeaderRow()}function ge(){return s.distributeColumns()}function Ce(){return s.autoFitContents()}function Te(e){return s.setTableProperties(e)}function he(e){return s.applyTableStyle(e)}function ye(e){return s.setCellFillColor(e)}function xe(e){return s.setTableBorderColor(e)}function Se(e){return s.setTableBorderWidth(e)}var we=chunkSUXJX72X_js.a.getCommands();function ve(e,t,o){return we.setImageWrapType(e,t,o)}function Ee(e){return (t,o)=>{let{from:i,to:a,empty:l}=t.selection;if(l)return false;let n=t.schema.marks.comment;if(!n)return false;if(o){let r=t.tr.addMark(i,a,n.create({commentId:e}));o(r);}return true}}function Ae(e){return (t,o)=>{let i=t.schema.marks.comment;if(!i)return false;if(o){let a=t.tr;t.doc.descendants((l,n)=>{if(l.isText)for(let r of l.marks)r.type===i&&r.attrs.commentId===e&&a.removeMark(n,n+l.nodeSize,r);}),a.steps.length>0&&o(a);}return true}}function I(e,t,o){return (i,a)=>{let l=i.schema.marks.insertion,n=i.schema.marks.deletion;if(!l&&!n)return false;let r=o==="accept"?l:n,u=o==="accept"?n:l;if(a){let p=i.tr,m=[];i.doc.nodesBetween(e,t,(f,b)=>{if(!f.isText)return;let g=b+f.nodeSize,T=Math.max(e,b),y=Math.min(t,g);u&&f.marks.some(C=>C.type===u)&&m.push({from:T,to:y}),r&&f.marks.some(C=>C.type===r)&&p.removeMark(T,y,r);});for(let f of m.reverse())p.delete(f.from,f.to);p.steps.length>0&&a(p);}return true}}function P(e,t){return I(e,t,"accept")}function W(e,t){return I(e,t,"reject")}function Re(){return (e,t)=>P(0,e.doc.content.size)(e,t)}function ke(){return (e,t)=>W(0,e.doc.content.size)(e,t)}function L(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(a)return false;if(l.isText&&!(n+l.nodeSize<=t)){for(let r of l.marks)if(r.type===o||r.type===i)return a={from:Math.max(n,t),to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"},false}}),!a&&t>0?L(e,0):a}function N(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(l.isText){if(n>=t)return false;for(let r of l.marks)(r.type===o||r.type===i)&&(a={from:n,to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"});}}),!a&&t<e.doc.content.size?N(e,e.doc.content.size):a}exports.A=be;exports.B=ge;exports.C=Ce;exports.D=Te;exports.E=he;exports.F=ye;exports.G=xe;exports.H=Se;exports.I=ve;exports.J=Ee;exports.K=Ae;exports.L=P;exports.M=W;exports.N=Re;exports.O=ke;exports.P=L;exports.Q=N;exports.a=j;exports.b=V;exports.c=J;exports.d=$;exports.e=q;exports.f=G;exports.g=K;exports.h=Q;exports.i=X;exports.j=Y;exports.k=Z;exports.l=ee;exports.m=te;exports.n=re;exports.o=oe;exports.p=ne;exports.q=ae;exports.r=le;exports.s=ie;exports.t=se;exports.u=ce;exports.v=de;exports.w=ue;exports.x=pe;exports.y=me;exports.z=fe;
1
+ 'use strict';var chunk2KHWHVTA_js=require('./chunk-2KHWHVTA.js'),chunkOLKDLRJ4_js=require('./chunk-OLKDLRJ4.js'),prosemirrorState=require('prosemirror-state');function M(e){let{$from:t}=e.selection,o=null,i=null,a=null,l=-1,n=-1;for(let r=t.depth;r>0;r--){let u=t.node(r);if(u.type.name==="tableCell"||u.type.name==="tableHeader"){a=u;let p=t.node(r-1);if(p?.type.name==="tableRow"){let m=0;p.forEach((f,b,g)=>{if(n===-1){if(g===t.index(r-1)){n=m;return}m+=f.attrs.colspan||1;}});}}else if(u.type.name==="tableRow")t.node(r-1)?.type.name==="table"&&(l=t.index(r-1));else if(u.type.name==="table"){o=u,i=t.before(r);break}}return !o||i==null||!a||l<0||n<0?null:{table:o,tablePos:i,cell:a,row:l,col:n,rowspan:a.attrs.rowspan||1,colspan:a.attrs.colspan||1}}function k(e){let t=[],o=[],i=0;for(let a=0;a<e.childCount;a++){let l=e.child(a),n=0;l.forEach(r=>{for(;t[a]?.[n];)n++;let u=r.attrs.rowspan||1,p=r.attrs.colspan||1;o.push({data:r,row:a,col:n,rowspan:u,colspan:p});for(let m=a;m<a+u;m++){let f=t[m]??[];t[m]=f;for(let b=n;b<n+p;b++)f[b]=true;}n+=p,i=Math.max(i,n);});}return {anchors:o,totalCols:i}}function B(e,t,o,i,a){let l={...e.attrs},n=a.reduce((p,m)=>p+m,0),r=chunk2KHWHVTA_js.a(a,t,o),u=o!==(e.attrs.colspan||1)||i!==(e.attrs.rowspan||1);return l.colspan=o,l.rowspan=i,l.colwidth=null,n>0&&(l.width=Math.round(r/n*5e3),l.widthType="pct"),u&&(l._originalFormatting=null),l}function D(e,t,o,i){let a=t+1;for(let l=0;l<e.childCount;l++){let n=e.child(l),r=a+1,u=0;for(let p=0;p<n.childCount;p++){let m=n.child(p);if(l===o&&u===i)return r;u+=m.attrs.colspan||1,r+=m.nodeSize;}a+=n.nodeSize;}return null}function O(e,t){let o=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(o/Math.max(t,1)))}function j(e){let t=M(e);return t?{...chunk2KHWHVTA_js.e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function V(e,t,o,i,a,l){if(o<1||i<1)return false;let n=M(e);if(!n||!t)return false;let r=n;if(a!=null&&l!=null&&(a!==n.row||l!==n.col)){let{anchors:c}=k(n.table),d=c.find(x=>x.row===a&&x.col===l);if(!d)return false;r={...n,cell:d.data,row:d.row,col:d.col,rowspan:d.rowspan,colspan:d.colspan};}if(o<r.rowspan||i<r.colspan||o===1&&i===1)return false;let{anchors:u,totalCols:p}=k(r.table),m=O(r.table,p),f=chunk2KHWHVTA_js.b(m,r.col,r.colspan,i),b=u.find(c=>c.row===r.row&&c.col===r.col);if(!b)return false;let g=chunk2KHWHVTA_js.c(u,b,o,i,r.table.childCount,c=>{if(c)return b.data;let d=b.data.type.schema.nodes.paragraph.create(),x=B(b.data,0,1,1,f);return b.data.type.create(x,d)}),T=r.row+r.rowspan,y=Array.from({length:g.newRowCount},(c,d)=>d<T?{...r.table.child(d)?.attrs??{}}:d<r.row+o?{...r.table.child(T-1)?.attrs??{}}:{...r.table.child(d-g.deltaRows)?.attrs??{}}),C=Array.from({length:g.newRowCount},()=>[]);g.anchors.sort((c,d)=>c.row===d.row?c.col-d.col:c.row-d.row).forEach(c=>{let d=B(c.data,c.col,c.colspan,c.rowspan,f);C[c.row].push(c.data.type.create(d,c.data.content));});let z=C.map((c,d)=>r.table.type.schema.nodes.tableRow.create(y[d],c)),F=r.table.type.create({...r.table.attrs,columnWidths:f},z),h=e.tr.replaceWith(r.tablePos,r.tablePos+r.table.nodeSize,F),w=h.doc.nodeAt(r.tablePos);if(w){let c=D(w,r.tablePos,r.row,r.col);c!=null&&(h=h.setSelection(prosemirrorState.TextSelection.near(h.doc.resolve(c+1))));}return t(h.scrollIntoView()),true}var s=chunkOLKDLRJ4_js.a.getCommands();function J(e,t){return s.insertTable(e,t)}function $(e,t){return s.addRowAbove()(e,t)}function q(e,t){return s.addRowBelow()(e,t)}function G(e,t){return s.deleteRow()(e,t)}function K(e,t){return s.addColumnLeft()(e,t)}function Q(e,t){return s.addColumnRight()(e,t)}function X(e,t){return s.deleteColumn()(e,t)}function Y(e,t){return s.deleteTable()(e,t)}function Z(e,t){return s.selectTable()(e,t)}function ee(e,t){return s.selectRow()(e,t)}function te(e,t){return s.selectColumn()(e,t)}function re(e,t){return s.mergeCells()(e,t)}function oe(e,t){return s.splitCell()(e,t)}function ne(e,t,o){return s.setCellBorder(e,t,o)}function ae(e,t){return s.setTableBorders(e,t)}function le(e,t){return s.removeTableBorders()(e,t)}function ie(e,t,o){return s.setAllTableBorders(o)(e,t)}function se(e,t,o){return s.setOutsideTableBorders(o)(e,t)}function ce(e,t,o){return s.setInsideTableBorders(o)(e,t)}function de(e){return s.setCellVerticalAlign(e)}function ue(e){return s.setCellMargins(e)}function pe(e){return s.setCellTextDirection(e)}function me(){return s.toggleNoWrap()}function fe(e,t){return s.setRowHeight(e,t)}function be(){return s.toggleHeaderRow()}function ge(){return s.distributeColumns()}function Ce(){return s.autoFitContents()}function Te(e){return s.setTableProperties(e)}function he(e){return s.applyTableStyle(e)}function ye(e){return s.setCellFillColor(e)}function xe(e){return s.setTableBorderColor(e)}function Se(e){return s.setTableBorderWidth(e)}var we=chunkOLKDLRJ4_js.a.getCommands();function ve(e,t,o){return we.setImageWrapType(e,t,o)}function Ee(e){return (t,o)=>{let{from:i,to:a,empty:l}=t.selection;if(l)return false;let n=t.schema.marks.comment;if(!n)return false;if(o){let r=t.tr.addMark(i,a,n.create({commentId:e}));o(r);}return true}}function Ae(e){return (t,o)=>{let i=t.schema.marks.comment;if(!i)return false;if(o){let a=t.tr;t.doc.descendants((l,n)=>{if(l.isText)for(let r of l.marks)r.type===i&&r.attrs.commentId===e&&a.removeMark(n,n+l.nodeSize,r);}),a.steps.length>0&&o(a);}return true}}function I(e,t,o){return (i,a)=>{let l=i.schema.marks.insertion,n=i.schema.marks.deletion;if(!l&&!n)return false;let r=o==="accept"?l:n,u=o==="accept"?n:l;if(a){let p=i.tr,m=[];i.doc.nodesBetween(e,t,(f,b)=>{if(!f.isText)return;let g=b+f.nodeSize,T=Math.max(e,b),y=Math.min(t,g);u&&f.marks.some(C=>C.type===u)&&m.push({from:T,to:y}),r&&f.marks.some(C=>C.type===r)&&p.removeMark(T,y,r);});for(let f of m.reverse())p.delete(f.from,f.to);p.steps.length>0&&a(p);}return true}}function P(e,t){return I(e,t,"accept")}function W(e,t){return I(e,t,"reject")}function Re(){return (e,t)=>P(0,e.doc.content.size)(e,t)}function ke(){return (e,t)=>W(0,e.doc.content.size)(e,t)}function L(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(a)return false;if(l.isText&&!(n+l.nodeSize<=t)){for(let r of l.marks)if(r.type===o||r.type===i)return a={from:Math.max(n,t),to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"},false}}),!a&&t>0?L(e,0):a}function N(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(l.isText){if(n>=t)return false;for(let r of l.marks)(r.type===o||r.type===i)&&(a={from:n,to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"});}}),!a&&t<e.doc.content.size?N(e,e.doc.content.size):a}exports.A=be;exports.B=ge;exports.C=Ce;exports.D=Te;exports.E=he;exports.F=ye;exports.G=xe;exports.H=Se;exports.I=ve;exports.J=Ee;exports.K=Ae;exports.L=P;exports.M=W;exports.N=Re;exports.O=ke;exports.P=L;exports.Q=N;exports.a=j;exports.b=V;exports.c=J;exports.d=$;exports.e=q;exports.f=G;exports.g=K;exports.h=Q;exports.i=X;exports.j=Y;exports.k=Z;exports.l=ee;exports.m=te;exports.n=re;exports.o=oe;exports.p=ne;exports.q=ae;exports.r=le;exports.s=ie;exports.t=se;exports.u=ce;exports.v=de;exports.w=ue;exports.x=pe;exports.y=me;exports.z=fe;
@@ -1 +1 @@
1
- import {x,D}from'./chunk-ITVXBQGR.mjs';var O=30,F=200,y=24,R=10,B=10,C=24;function N(_){let{mouseX:n,mouseY:l,pagesContainer:d,target:L,hfEditMode:m,edgeProximity:r=O}=_,T=`.${x.table}`,H=`.${x.row}`,p=`.${x.cell}`,h=`.${D.header}`,M=`.${D.footer}`,E=t=>{let o=!!t.closest(h),e=!!t.closest(M);return !o&&!e?!m:o?m==="header":m==="footer"},c=L.closest(T);if(c&&!E(c)&&(c=null),!c){let t=d.querySelectorAll(T);for(let o of Array.from(t)){if(!E(o))continue;let e=o.getBoundingClientRect(),s=n>=e.left-r&&n<e.left,A=l>=e.top-r&&l<e.top,P=n>=e.left-r&&n<=e.right,I=l>=e.top-r&&l<=e.bottom;if(s&&I||A&&P){c=o;break}}}if(!c)return null;let i=c.getBoundingClientRect(),b=n<i.left+r&&n>=i.left-r,g=l<i.top+r&&l>=i.top-r;if(!b&&!g)return null;let u=c.querySelectorAll(`:scope > ${H}`);if(u.length===0)return null;let S=t=>t&&Number(t.dataset.pmStart)||0;if(b)for(let t=0;t<u.length;t++){let o=u[t].getBoundingClientRect();if(l>=o.top&&l<=o.bottom){let e=u[t].querySelector(p),s=S(e);if(!s)break;return {type:"row",clientX:i.left-y,clientY:o.top+o.height/2-R,cellPmPos:s}}}if(g){let t=u[0].querySelectorAll(`:scope > ${p}`);for(let o=0;o<t.length;o++){let e=t[o].getBoundingClientRect();if(n>=e.left&&n<=e.right){let s=S(t[o]);if(!s)break;return {type:"column",clientX:e.left+e.width/2-B,clientY:i.top-C,cellPmPos:s}}}}return null}export{O as a,F as b,N as c};
1
+ import {x,D}from'./chunk-BTOBVF4I.mjs';var O=30,F=200,y=24,R=10,B=10,C=24;function N(_){let{mouseX:n,mouseY:l,pagesContainer:d,target:L,hfEditMode:m,edgeProximity:r=O}=_,T=`.${x.table}`,H=`.${x.row}`,p=`.${x.cell}`,h=`.${D.header}`,M=`.${D.footer}`,E=t=>{let o=!!t.closest(h),e=!!t.closest(M);return !o&&!e?!m:o?m==="header":m==="footer"},c=L.closest(T);if(c&&!E(c)&&(c=null),!c){let t=d.querySelectorAll(T);for(let o of Array.from(t)){if(!E(o))continue;let e=o.getBoundingClientRect(),s=n>=e.left-r&&n<e.left,A=l>=e.top-r&&l<e.top,P=n>=e.left-r&&n<=e.right,I=l>=e.top-r&&l<=e.bottom;if(s&&I||A&&P){c=o;break}}}if(!c)return null;let i=c.getBoundingClientRect(),b=n<i.left+r&&n>=i.left-r,g=l<i.top+r&&l>=i.top-r;if(!b&&!g)return null;let u=c.querySelectorAll(`:scope > ${H}`);if(u.length===0)return null;let S=t=>t&&Number(t.dataset.pmStart)||0;if(b)for(let t=0;t<u.length;t++){let o=u[t].getBoundingClientRect();if(l>=o.top&&l<=o.bottom){let e=u[t].querySelector(p),s=S(e);if(!s)break;return {type:"row",clientX:i.left-y,clientY:o.top+o.height/2-R,cellPmPos:s}}}if(g){let t=u[0].querySelectorAll(`:scope > ${p}`);for(let o=0;o<t.length;o++){let e=t[o].getBoundingClientRect();if(n>=e.left&&n<=e.right){let s=S(t[o]);if(!s)break;return {type:"column",clientX:e.left+e.width/2-B,clientY:i.top-C,cellPmPos:s}}}}return null}export{O as a,F as b,N as c};
@@ -1 +1 @@
1
- 'use strict';var chunkSUXJX72X_js=require('./chunk-SUXJX72X.js');var e=chunkSUXJX72X_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 chunkOLKDLRJ4_js=require('./chunk-OLKDLRJ4.js');var e=chunkOLKDLRJ4_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 +1 @@
1
- import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-JKVXID22.mjs';import {TextSelection}from'prosemirror-state';function M(e){let{$from:t}=e.selection,o=null,i=null,a=null,l=-1,n=-1;for(let r=t.depth;r>0;r--){let u=t.node(r);if(u.type.name==="tableCell"||u.type.name==="tableHeader"){a=u;let p=t.node(r-1);if(p?.type.name==="tableRow"){let m=0;p.forEach((f,b,g)=>{if(n===-1){if(g===t.index(r-1)){n=m;return}m+=f.attrs.colspan||1;}});}}else if(u.type.name==="tableRow")t.node(r-1)?.type.name==="table"&&(l=t.index(r-1));else if(u.type.name==="table"){o=u,i=t.before(r);break}}return !o||i==null||!a||l<0||n<0?null:{table:o,tablePos:i,cell:a,row:l,col:n,rowspan:a.attrs.rowspan||1,colspan:a.attrs.colspan||1}}function k(e){let t=[],o=[],i=0;for(let a=0;a<e.childCount;a++){let l=e.child(a),n=0;l.forEach(r=>{for(;t[a]?.[n];)n++;let u=r.attrs.rowspan||1,p=r.attrs.colspan||1;o.push({data:r,row:a,col:n,rowspan:u,colspan:p});for(let m=a;m<a+u;m++){let f=t[m]??[];t[m]=f;for(let b=n;b<n+p;b++)f[b]=true;}n+=p,i=Math.max(i,n);});}return {anchors:o,totalCols:i}}function B(e,t,o,i,a){let l={...e.attrs},n=a.reduce((p,m)=>p+m,0),r=a$1(a,t,o),u=o!==(e.attrs.colspan||1)||i!==(e.attrs.rowspan||1);return l.colspan=o,l.rowspan=i,l.colwidth=null,n>0&&(l.width=Math.round(r/n*5e3),l.widthType="pct"),u&&(l._originalFormatting=null),l}function D(e,t,o,i){let a=t+1;for(let l=0;l<e.childCount;l++){let n=e.child(l),r=a+1,u=0;for(let p=0;p<n.childCount;p++){let m=n.child(p);if(l===o&&u===i)return r;u+=m.attrs.colspan||1,r+=m.nodeSize;}a+=n.nodeSize;}return null}function O(e,t){let o=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(o/Math.max(t,1)))}function j(e$1){let t=M(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function V(e,t,o,i,a,l){if(o<1||i<1)return false;let n=M(e);if(!n||!t)return false;let r=n;if(a!=null&&l!=null&&(a!==n.row||l!==n.col)){let{anchors:c}=k(n.table),d=c.find(x=>x.row===a&&x.col===l);if(!d)return false;r={...n,cell:d.data,row:d.row,col:d.col,rowspan:d.rowspan,colspan:d.colspan};}if(o<r.rowspan||i<r.colspan||o===1&&i===1)return false;let{anchors:u,totalCols:p}=k(r.table),m=O(r.table,p),f=b(m,r.col,r.colspan,i),b$1=u.find(c=>c.row===r.row&&c.col===r.col);if(!b$1)return false;let g=c(u,b$1,o,i,r.table.childCount,c=>{if(c)return b$1.data;let d=b$1.data.type.schema.nodes.paragraph.create(),x=B(b$1.data,0,1,1,f);return b$1.data.type.create(x,d)}),T=r.row+r.rowspan,y=Array.from({length:g.newRowCount},(c,d)=>d<T?{...r.table.child(d)?.attrs??{}}:d<r.row+o?{...r.table.child(T-1)?.attrs??{}}:{...r.table.child(d-g.deltaRows)?.attrs??{}}),C=Array.from({length:g.newRowCount},()=>[]);g.anchors.sort((c,d)=>c.row===d.row?c.col-d.col:c.row-d.row).forEach(c=>{let d=B(c.data,c.col,c.colspan,c.rowspan,f);C[c.row].push(c.data.type.create(d,c.data.content));});let z=C.map((c,d)=>r.table.type.schema.nodes.tableRow.create(y[d],c)),F=r.table.type.create({...r.table.attrs,columnWidths:f},z),h=e.tr.replaceWith(r.tablePos,r.tablePos+r.table.nodeSize,F),w=h.doc.nodeAt(r.tablePos);if(w){let c=D(w,r.tablePos,r.row,r.col);c!=null&&(h=h.setSelection(TextSelection.near(h.doc.resolve(c+1))));}return t(h.scrollIntoView()),true}var s=a.getCommands();function J(e,t){return s.insertTable(e,t)}function $(e,t){return s.addRowAbove()(e,t)}function q(e,t){return s.addRowBelow()(e,t)}function G(e,t){return s.deleteRow()(e,t)}function K(e,t){return s.addColumnLeft()(e,t)}function Q(e,t){return s.addColumnRight()(e,t)}function X(e,t){return s.deleteColumn()(e,t)}function Y(e,t){return s.deleteTable()(e,t)}function Z(e,t){return s.selectTable()(e,t)}function ee(e,t){return s.selectRow()(e,t)}function te(e,t){return s.selectColumn()(e,t)}function re(e,t){return s.mergeCells()(e,t)}function oe(e,t){return s.splitCell()(e,t)}function ne(e,t,o){return s.setCellBorder(e,t,o)}function ae(e,t){return s.setTableBorders(e,t)}function le(e,t){return s.removeTableBorders()(e,t)}function ie(e,t,o){return s.setAllTableBorders(o)(e,t)}function se(e,t,o){return s.setOutsideTableBorders(o)(e,t)}function ce(e,t,o){return s.setInsideTableBorders(o)(e,t)}function de(e){return s.setCellVerticalAlign(e)}function ue(e){return s.setCellMargins(e)}function pe(e){return s.setCellTextDirection(e)}function me(){return s.toggleNoWrap()}function fe(e,t){return s.setRowHeight(e,t)}function be(){return s.toggleHeaderRow()}function ge(){return s.distributeColumns()}function Ce(){return s.autoFitContents()}function Te(e){return s.setTableProperties(e)}function he(e){return s.applyTableStyle(e)}function ye(e){return s.setCellFillColor(e)}function xe(e){return s.setTableBorderColor(e)}function Se(e){return s.setTableBorderWidth(e)}var we=a.getCommands();function ve(e,t,o){return we.setImageWrapType(e,t,o)}function Ee(e){return (t,o)=>{let{from:i,to:a,empty:l}=t.selection;if(l)return false;let n=t.schema.marks.comment;if(!n)return false;if(o){let r=t.tr.addMark(i,a,n.create({commentId:e}));o(r);}return true}}function Ae(e){return (t,o)=>{let i=t.schema.marks.comment;if(!i)return false;if(o){let a=t.tr;t.doc.descendants((l,n)=>{if(l.isText)for(let r of l.marks)r.type===i&&r.attrs.commentId===e&&a.removeMark(n,n+l.nodeSize,r);}),a.steps.length>0&&o(a);}return true}}function I(e,t,o){return (i,a)=>{let l=i.schema.marks.insertion,n=i.schema.marks.deletion;if(!l&&!n)return false;let r=o==="accept"?l:n,u=o==="accept"?n:l;if(a){let p=i.tr,m=[];i.doc.nodesBetween(e,t,(f,b)=>{if(!f.isText)return;let g=b+f.nodeSize,T=Math.max(e,b),y=Math.min(t,g);u&&f.marks.some(C=>C.type===u)&&m.push({from:T,to:y}),r&&f.marks.some(C=>C.type===r)&&p.removeMark(T,y,r);});for(let f of m.reverse())p.delete(f.from,f.to);p.steps.length>0&&a(p);}return true}}function P(e,t){return I(e,t,"accept")}function W(e,t){return I(e,t,"reject")}function Re(){return (e,t)=>P(0,e.doc.content.size)(e,t)}function ke(){return (e,t)=>W(0,e.doc.content.size)(e,t)}function L(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(a)return false;if(l.isText&&!(n+l.nodeSize<=t)){for(let r of l.marks)if(r.type===o||r.type===i)return a={from:Math.max(n,t),to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"},false}}),!a&&t>0?L(e,0):a}function N(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(l.isText){if(n>=t)return false;for(let r of l.marks)(r.type===o||r.type===i)&&(a={from:n,to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"});}}),!a&&t<e.doc.content.size?N(e,e.doc.content.size):a}export{be as A,ge as B,Ce as C,Te as D,he as E,ye as F,xe as G,Se as H,ve as I,Ee as J,Ae as K,P as L,W as M,Re as N,ke as O,L as P,N as Q,j as a,V as b,J as c,$ as d,q as e,G as f,K as g,Q as h,X as i,Y as j,Z as k,ee as l,te as m,re as n,oe as o,ne as p,ae as q,le as r,ie as s,se as t,ce as u,de as v,ue as w,pe as x,me as y,fe as z};
1
+ import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-NMSU4MWP.mjs';import {TextSelection}from'prosemirror-state';function M(e){let{$from:t}=e.selection,o=null,i=null,a=null,l=-1,n=-1;for(let r=t.depth;r>0;r--){let u=t.node(r);if(u.type.name==="tableCell"||u.type.name==="tableHeader"){a=u;let p=t.node(r-1);if(p?.type.name==="tableRow"){let m=0;p.forEach((f,b,g)=>{if(n===-1){if(g===t.index(r-1)){n=m;return}m+=f.attrs.colspan||1;}});}}else if(u.type.name==="tableRow")t.node(r-1)?.type.name==="table"&&(l=t.index(r-1));else if(u.type.name==="table"){o=u,i=t.before(r);break}}return !o||i==null||!a||l<0||n<0?null:{table:o,tablePos:i,cell:a,row:l,col:n,rowspan:a.attrs.rowspan||1,colspan:a.attrs.colspan||1}}function k(e){let t=[],o=[],i=0;for(let a=0;a<e.childCount;a++){let l=e.child(a),n=0;l.forEach(r=>{for(;t[a]?.[n];)n++;let u=r.attrs.rowspan||1,p=r.attrs.colspan||1;o.push({data:r,row:a,col:n,rowspan:u,colspan:p});for(let m=a;m<a+u;m++){let f=t[m]??[];t[m]=f;for(let b=n;b<n+p;b++)f[b]=true;}n+=p,i=Math.max(i,n);});}return {anchors:o,totalCols:i}}function B(e,t,o,i,a){let l={...e.attrs},n=a.reduce((p,m)=>p+m,0),r=a$1(a,t,o),u=o!==(e.attrs.colspan||1)||i!==(e.attrs.rowspan||1);return l.colspan=o,l.rowspan=i,l.colwidth=null,n>0&&(l.width=Math.round(r/n*5e3),l.widthType="pct"),u&&(l._originalFormatting=null),l}function D(e,t,o,i){let a=t+1;for(let l=0;l<e.childCount;l++){let n=e.child(l),r=a+1,u=0;for(let p=0;p<n.childCount;p++){let m=n.child(p);if(l===o&&u===i)return r;u+=m.attrs.colspan||1,r+=m.nodeSize;}a+=n.nodeSize;}return null}function O(e,t){let o=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(o/Math.max(t,1)))}function j(e$1){let t=M(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function V(e,t,o,i,a,l){if(o<1||i<1)return false;let n=M(e);if(!n||!t)return false;let r=n;if(a!=null&&l!=null&&(a!==n.row||l!==n.col)){let{anchors:c}=k(n.table),d=c.find(x=>x.row===a&&x.col===l);if(!d)return false;r={...n,cell:d.data,row:d.row,col:d.col,rowspan:d.rowspan,colspan:d.colspan};}if(o<r.rowspan||i<r.colspan||o===1&&i===1)return false;let{anchors:u,totalCols:p}=k(r.table),m=O(r.table,p),f=b(m,r.col,r.colspan,i),b$1=u.find(c=>c.row===r.row&&c.col===r.col);if(!b$1)return false;let g=c(u,b$1,o,i,r.table.childCount,c=>{if(c)return b$1.data;let d=b$1.data.type.schema.nodes.paragraph.create(),x=B(b$1.data,0,1,1,f);return b$1.data.type.create(x,d)}),T=r.row+r.rowspan,y=Array.from({length:g.newRowCount},(c,d)=>d<T?{...r.table.child(d)?.attrs??{}}:d<r.row+o?{...r.table.child(T-1)?.attrs??{}}:{...r.table.child(d-g.deltaRows)?.attrs??{}}),C=Array.from({length:g.newRowCount},()=>[]);g.anchors.sort((c,d)=>c.row===d.row?c.col-d.col:c.row-d.row).forEach(c=>{let d=B(c.data,c.col,c.colspan,c.rowspan,f);C[c.row].push(c.data.type.create(d,c.data.content));});let z=C.map((c,d)=>r.table.type.schema.nodes.tableRow.create(y[d],c)),F=r.table.type.create({...r.table.attrs,columnWidths:f},z),h=e.tr.replaceWith(r.tablePos,r.tablePos+r.table.nodeSize,F),w=h.doc.nodeAt(r.tablePos);if(w){let c=D(w,r.tablePos,r.row,r.col);c!=null&&(h=h.setSelection(TextSelection.near(h.doc.resolve(c+1))));}return t(h.scrollIntoView()),true}var s=a.getCommands();function J(e,t){return s.insertTable(e,t)}function $(e,t){return s.addRowAbove()(e,t)}function q(e,t){return s.addRowBelow()(e,t)}function G(e,t){return s.deleteRow()(e,t)}function K(e,t){return s.addColumnLeft()(e,t)}function Q(e,t){return s.addColumnRight()(e,t)}function X(e,t){return s.deleteColumn()(e,t)}function Y(e,t){return s.deleteTable()(e,t)}function Z(e,t){return s.selectTable()(e,t)}function ee(e,t){return s.selectRow()(e,t)}function te(e,t){return s.selectColumn()(e,t)}function re(e,t){return s.mergeCells()(e,t)}function oe(e,t){return s.splitCell()(e,t)}function ne(e,t,o){return s.setCellBorder(e,t,o)}function ae(e,t){return s.setTableBorders(e,t)}function le(e,t){return s.removeTableBorders()(e,t)}function ie(e,t,o){return s.setAllTableBorders(o)(e,t)}function se(e,t,o){return s.setOutsideTableBorders(o)(e,t)}function ce(e,t,o){return s.setInsideTableBorders(o)(e,t)}function de(e){return s.setCellVerticalAlign(e)}function ue(e){return s.setCellMargins(e)}function pe(e){return s.setCellTextDirection(e)}function me(){return s.toggleNoWrap()}function fe(e,t){return s.setRowHeight(e,t)}function be(){return s.toggleHeaderRow()}function ge(){return s.distributeColumns()}function Ce(){return s.autoFitContents()}function Te(e){return s.setTableProperties(e)}function he(e){return s.applyTableStyle(e)}function ye(e){return s.setCellFillColor(e)}function xe(e){return s.setTableBorderColor(e)}function Se(e){return s.setTableBorderWidth(e)}var we=a.getCommands();function ve(e,t,o){return we.setImageWrapType(e,t,o)}function Ee(e){return (t,o)=>{let{from:i,to:a,empty:l}=t.selection;if(l)return false;let n=t.schema.marks.comment;if(!n)return false;if(o){let r=t.tr.addMark(i,a,n.create({commentId:e}));o(r);}return true}}function Ae(e){return (t,o)=>{let i=t.schema.marks.comment;if(!i)return false;if(o){let a=t.tr;t.doc.descendants((l,n)=>{if(l.isText)for(let r of l.marks)r.type===i&&r.attrs.commentId===e&&a.removeMark(n,n+l.nodeSize,r);}),a.steps.length>0&&o(a);}return true}}function I(e,t,o){return (i,a)=>{let l=i.schema.marks.insertion,n=i.schema.marks.deletion;if(!l&&!n)return false;let r=o==="accept"?l:n,u=o==="accept"?n:l;if(a){let p=i.tr,m=[];i.doc.nodesBetween(e,t,(f,b)=>{if(!f.isText)return;let g=b+f.nodeSize,T=Math.max(e,b),y=Math.min(t,g);u&&f.marks.some(C=>C.type===u)&&m.push({from:T,to:y}),r&&f.marks.some(C=>C.type===r)&&p.removeMark(T,y,r);});for(let f of m.reverse())p.delete(f.from,f.to);p.steps.length>0&&a(p);}return true}}function P(e,t){return I(e,t,"accept")}function W(e,t){return I(e,t,"reject")}function Re(){return (e,t)=>P(0,e.doc.content.size)(e,t)}function ke(){return (e,t)=>W(0,e.doc.content.size)(e,t)}function L(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(a)return false;if(l.isText&&!(n+l.nodeSize<=t)){for(let r of l.marks)if(r.type===o||r.type===i)return a={from:Math.max(n,t),to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"},false}}),!a&&t>0?L(e,0):a}function N(e,t){let o=e.schema.marks.insertion,i=e.schema.marks.deletion;if(!o&&!i)return null;let a=null;return e.doc.descendants((l,n)=>{if(l.isText){if(n>=t)return false;for(let r of l.marks)(r.type===o||r.type===i)&&(a={from:n,to:n+l.nodeSize,type:r.type===o?"insertion":"deletion"});}}),!a&&t<e.doc.content.size?N(e,e.doc.content.size):a}export{be as A,ge as B,Ce as C,Te as D,he as E,ye as F,xe as G,Se as H,ve as I,Ee as J,Ae as K,P as L,W as M,Re as N,ke as O,L as P,N as Q,j as a,V as b,J as c,$ as d,q as e,G as f,K as g,Q as h,X as i,Y as j,Z as k,ee as l,te as m,re as n,oe as o,ne as p,ae as q,le as r,ie as s,se as t,ce as u,de as v,ue as w,pe as x,me as y,fe as z};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js');var Xt=1440,q=96,ft=Xt/q,ht=11,gt="Calibri",Yt=1,jt=.8,Gt=.2,z=null;function $(){if(!z){let t=typeof document<"u"?document.createElement("canvas"):null;if(!t)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(z=t.getContext("2d"),!z)throw new Error("Failed to get 2D context from canvas")}return z}function Kt(){z=null;}var ct=new Map;function mt(t){let e=ct.get(t);if(e===void 0){let i=chunkN3Y5BUKV_js.a(t);e={cssFallback:i.cssFallback,singleLineRatio:i.singleLineRatio},ct.set(t,e);}return e}function Vt(t){return mt(t).cssFallback}function D(t){let e=[];t.italic&&e.push("italic"),t.bold&&e.push("bold");let i=t.fontSize??ht,n=W(i);e.push(`${n}px`);let r=t.fontFamily??gt;return e.push(Vt(r)),e.join(" ")}function A(t){let e=t.fontSize??ht,i=t.fontFamily??gt,n=W(e),r=n*jt,o=n*Gt,u=n*Yt;try{let g=$();g.font=D(t);let c=g.measureText("Hg");typeof c.actualBoundingBoxAscent=="number"&&typeof c.actualBoundingBoxDescent=="number"&&(r=c.actualBoundingBoxAscent,o=c.actualBoundingBoxDescent);}catch{}u=Math.max(u,r+o);let f=mt(i).singleLineRatio;return {fontSize:e,ascent:r,descent:o,lineHeight:u,fontFamily:i,singleLineRatio:f}}function S(t,e){if(!t)return 0;let i=$();i.font=D(e);let r=i.measureText(t).width;return e.letterSpacing&&t.length>1&&(r+=e.letterSpacing*(t.length-1)),r}function qt(t,e){let i=S(t,e),n=A(e);return {width:i,height:n.ascent+n.descent,ascent:n.ascent,descent:n.descent}}function J(t,e){let i=A(e);if(!t)return {width:0,charWidths:[],metrics:i};let n=$();n.font=D(e);let r=e.letterSpacing??0,o=[],u=0;for(let f=0;f<t.length;f++){let g=t[f],b=n.measureText(g).width;r&&f<t.length-1&&(b+=r),o.push(b),u+=b;}return {width:u,charWidths:o,metrics:i}}function Jt(t,e){if(e.length===0||t<=0)return 0;let i=0;for(let n=0;n<e.length;n++){let r=e[n],o=i+r/2;if(t<=o)return n;i+=r;}return e.length}function Qt(t,e){if(t<=0||e.length===0)return 0;let i=Math.min(t,e.length),n=0;for(let r=0;r<i;r++)n+=e[r];return n}function te(t){return t/ft}function ee(t){return Math.round(t*ft)}function W(t){return t*q/72}function dt(t){return t*72/q}function ne(t){return W(t/2)}function ie(t){return dt(t)*2}function re(t,e){return t.map(i=>{let n=i.x-i.distLeft,r=i.x+i.width+i.distRight,o=i.y-i.distTop,u=i.y+i.height+i.distBottom,f=0,g=0,c,b=i.wrapText??"bothSides";b==="right"?f=Q(r):b==="left"?g=tt(n,e):b==="largest"?{leftMargin:f,rightMargin:g}=le(n,r,e):oe(n,r,e)?c=se(n,r,e):i.side==="left"?f=Q(r):g=tt(n,e);let p=nt(f,g,e);return {leftMargin:p.leftMargin,rightMargin:p.rightMargin,topY:o,bottomY:u,segments:c}})}function et(t,e){return t.segments?.reduce((n,r)=>n+r.availableWidth,0)??e-t.leftMargin-t.rightMargin}function N(t,e,i,n){if(!i||i.length===0)return {leftMargin:0,rightMargin:0};let r=0,o=0,u,f=n+t,g=f+e;for(let c of i)if(!(g<=c.topY||f>=c.bottomY)){if(c.segments?.length){u=u?ae(u,c.segments):c.segments;continue}r=Math.max(r,c.leftMargin),o=Math.max(o,c.rightMargin);}return {leftMargin:r,rightMargin:o,segments:u}}function ae(t,e){let i=[];for(let n of t)for(let r of e){let o=Math.max(n.leftOffset,r.leftOffset),u=Math.min(n.leftOffset+n.availableWidth,r.leftOffset+r.availableWidth);u>o&&i.push({leftOffset:o,availableWidth:u-o});}return i}function oe(t,e,i){return t>0&&e<i}function se(t,e,i){return [{leftOffset:0,availableWidth:Math.max(0,t)},{leftOffset:Math.max(0,e),availableWidth:Math.max(0,i-e)}].filter(n=>n.availableWidth>1)}function le(t,e,i){let n=Math.max(0,t);return Math.max(0,i-e)>=n?{leftMargin:Q(e),rightMargin:0}:{leftMargin:0,rightMargin:tt(t,i)}}function Q(t){return Math.max(0,t)}function tt(t,e){return Math.max(0,e-t)}function it(t){return t/1440*96}function rt(t){return t/96*1440}function ue(t){let{explicitStops:e=[],defaultTabInterval:i=720,leftIndent:n=0}=t,r=e.filter(p=>p.val!=="clear").filter(p=>p.pos>=n),o=e.filter(p=>p.val==="clear").map(p=>p.pos),u=r.reduce((p,R)=>Math.max(p,R.pos),0),f=[...r];n>0&&!r.some(p=>p.pos<=n)&&(o.some(R=>Math.abs(R-n)<20)||f.push({val:"start",pos:n,leader:"none"}));let c=u>0?Math.max(u,n):n,b=n+14400;for(;c<b;){c+=i;let p=r.some(H=>Math.abs(H.pos-c)<20),R=o.some(H=>Math.abs(H-c)<20),Y=n>0&&Math.abs(c-n)<20;!p&&!R&&!Y&&f.push({val:"start",pos:c,leader:"none"});}return f.sort((p,R)=>p.pos-R.pos)}function pt(t,e,i={}){let{defaultTabInterval:n=720}=e,r=rt(t),u=ue(e).find(c=>c.pos>r);if(!u){let c=it(n),b=c-t%c;return b<=0&&(b=c),{width:b,alignment:"default"}}let g=it(u.pos)-t;if(u.val==="center")g-=(i.followingWidth??0)/2;else if(u.val==="end")g-=i.followingWidth??0;else if(u.val==="decimal")g-=i.decimalPrefixWidth??0;else if(u.val==="bar")return {width:0,leader:u.leader,alignment:"bar"};if(g<1){let c=it(n),b=c-t%c;return b<=0&&(b=c),{width:b,alignment:"default"}}return {width:g,leader:u.leader,alignment:u.val}}var y=11,O="Calibri",ce=1.15,X=1,k=.5;function bt(t,e,i,n=false){let r=1,o=t.length,u=0;for(;r<=o;){let f=r+o>>>1;S(t.slice(0,f),e)<=i?(u=f,r=f+1):o=f-1;}return n&&u===0?1:u}function Z(t){return {fontFamily:t.fontFamily??O,fontSize:t.fontSize??y,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function Ft(t,e,i){let n=W(t),r=i?.ascent??n*.8,o=i?.descent??n*.2,u=i?.singleLineRatio??1.15,f=n*u,g;if(e?.lineRule==="exact"&&e.line!==void 0)g=e.line;else if(e?.lineRule==="atLeast"&&e.line!==void 0){let c=f*X;g=Math.max(e.line,c);}else e?.line!==void 0&&e?.lineUnit==="multiplier"?g=f*e.line:e?.line!==void 0&&e?.lineUnit==="px"?g=e.line:g=f*X;return {ascent:r,descent:o,lineHeight:g}}function xt(t,e,i){let n=A({fontSize:t,fontFamily:i??O}),r=Ft(t,e,n),o=e?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let u=W(t),f=Math.max(r.lineHeight,u*ce);if(f!==r.lineHeight)return {...r,lineHeight:f}}return r}function U(t){return t.kind==="text"}function Tt(t){return t.kind==="tab"}function Mt(t){return t.kind==="image"}function Ct(t){return t.kind==="lineBreak"}function St(t){return t.kind==="field"}function fe(t){return !t.text||t.text.replace(/\u00a0/g," ").trim().length===0}function he(t,e){let i=0;for(let n=e+1;n<t.length;n++){let r=t[n];if(Tt(r)||Ct(r))break;if(U(r))i+=S(r.text||"",Z(r));else if(St(r)){let o={fontFamily:r.fontFamily??O,fontSize:r.fontSize??y,bold:r.bold,italic:r.italic};i+=S(r.fallback||"1",o);}else Mt(r)&&(i+=r.width||0);}return i}function ge(t){let e=[];for(let i=0;i<t.length;i++){let n=t[i];(n===" "||n==="-"||n===" ")&&e.push(i+1);}return e}function nt(t,e,i){let n=Math.max(1,i),r=Math.max(0,t),o=Math.max(0,e);return r>=n||o>=n||r+o>=n?{leftMargin:0,rightMargin:0}:{leftMargin:r,rightMargin:o}}function Rt(t,e,i){let n=t.runs,r=t.attrs,o=r?.spacing,u=i?.floatingZones,f=i?.paragraphYOffset??0,g=r?.indent,c=g?.left??0,b=g?.right??0,p=(g?.firstLine??0)-(g?.hanging??0),R=Math.max(1,e-c-b),Y=Math.max(1,R-p),H=0,Zt=W(y)*X,B=N(0,Zt,u,f),Bt=Math.max(1,et(B,Y)),C=[];if(n.length===0){if(r?.suppressEmptyParagraphHeight)return C.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:C,totalHeight:0};let s=r?.defaultFontSize??y,l=r?.defaultFontFamily??O,m=xt(s,o,l);C.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...m});let h=m.lineHeight;return o?.before&&(h+=o.before),o?.after&&(h+=o.after),{kind:"paragraph",lines:C,totalHeight:h}}if(n.length===1&&U(n[0])&&fe(n[0])){let s=n[0],l=s.fontSize??r?.defaultFontSize??y,m=s.fontFamily??r?.defaultFontFamily??O,h=xt(l,o,m);C.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...h});let d=h.lineHeight;return o?.before&&(d+=o.before),o?.after&&(d+=o.after),{kind:"paragraph",lines:C,totalHeight:d}}let a={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:y,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:Bt,leftOffset:B.leftMargin,rightOffset:B.rightMargin,segmentZones:B.segments},ot=()=>{let s=Ft(a.maxFontSize,o,a.maxFontMetrics),l={...s};if(a.maxImageHeightPx>l.lineHeight){let h=a.maxImageHeightPx,d=l.descent;l.lineHeight=h+d*2,l.ascent=h+d;}let m={fromRun:a.fromRun,fromChar:a.fromChar,toRun:a.toRun,toChar:a.toChar,width:a.width,...l};a.leftOffset>0&&(m.leftOffset=a.leftOffset),a.rightOffset>0&&(m.rightOffset=a.rightOffset),a.segmentZones?.length&&(m.segments=$t(m,a.segmentZones)),C.push(m),H+=s.lineHeight;},$t=(s,l)=>{let m=l[0],h=l[1];if(!m)return;if(!h||s.width<=m.availableWidth+k)return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:s.toChar,width:s.width,leftOffset:m.leftOffset,availableWidth:m.availableWidth}];if(s.fromRun!==s.toRun)return;let d=n[s.fromRun];if(!d||!U(d))return;let P=d,x=P.text.slice(s.fromChar,s.toChar),T=Z(P),F=bt(x,T,m.availableWidth);if(F<=0||F>=x.length)return;let w=s.fromChar+F,M=x.slice(0,F),G=x.slice(F);return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:w,width:S(M,T),leftOffset:m.leftOffset,availableWidth:m.availableWidth},{fromRun:s.fromRun,fromChar:w,toRun:s.toRun,toChar:s.toChar,width:S(G,T),leftOffset:h.leftOffset,availableWidth:h.availableWidth}]},L=(s,l)=>{ot();let m=W(y)*X,h=N(H,m,u,f),d=Math.max(1,et(h,R));a={fromRun:s,fromChar:l,toRun:s,toChar:l,width:0,maxFontSize:y,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:d,leftOffset:h.leftMargin,rightOffset:h.rightMargin,segmentZones:h.segments};},_=s=>{let l=s.fontSize??y;(!a.maxFontMetrics||l>a.maxFontSize)&&(a.maxFontSize=l,a.maxFontMetrics=A(s));};for(let s=0;s<n.length;s++){let l=n[s];if(Ct(l)){a.toRun=s,a.toChar=0,L(s+1,0);continue}if(Tt(l)){let m=Z(l);_(m);let h=he(n,s),d=a.width+(a.leftOffset??0),P=C.length===0,x=c+(P?p:0)+d,T={explicitStops:r?.tabs,leftIndent:rt(c)},F=pt(x,T,{followingWidth:h}).width;if(d+F>a.availableWidth+k){let w=a.availableWidth-d-h;w>1&&(F=w);}a.width+F>a.availableWidth+k&&(L(s,0),_(m)),a.width+=F,a.toRun=s,a.toChar=1;continue}if(Mt(l)){let m=l.wrapType,h=l.displayMode==="float"||chunkJFZIXFRC_js.c(m);if(l.position&&h){a.toRun=s,a.toChar=1;continue}if(m==="topAndBottom"||l.displayMode==="block"){a.width>0&&L(s,0);let x=l.height,T=l.distTop??6,F=l.distBottom??6;a.toRun=s,a.toChar=1,a.maxImageHeightPx=x+T+F,L(s+1,0);continue}let d=l.width,P=l.height;P>a.maxImageHeightPx&&(a.maxImageHeightPx=P),a.width+d>a.availableWidth+k&&L(s,0),a.width+=d,a.toRun=s,a.toChar=1;continue}if(St(l)){let m=l.fallback||"1",h={fontFamily:l.fontFamily??O,fontSize:l.fontSize??y,bold:l.bold,italic:l.italic};_(h);let d=S(m,h);a.width>0&&a.width+d>a.availableWidth+k&&(L(s,0),_(h)),a.width+=d,a.toRun=s,a.toChar=1;continue}if(U(l)){let m=l,h=m.text,d=Z(m);if(_(d),!h||h.length===0){a.toRun=s,a.toChar=0;continue}let P=ge(h),x=0;for(;x<h.length;){let T=h.length;for(let M of P)if(M>x){T=M;break}let F=h.slice(x,T),w=S(F,d);if(w>a.availableWidth+k){let M=0;for(;M<F.length;){let G=a.availableWidth-a.width+k,Dt=F.slice(M),K=bt(Dt,d,G);if(K===0){if(a.width>0){L(s,x+M),_(d);continue}K=1;}let V=M+K,Nt=F.slice(M,V),Ut=S(Nt,d);a.width+=Ut,a.toRun=s,a.toChar=x+V,M=V,M<F.length&&(L(s,x+M),_(d));}x=T;continue}a.width>0&&a.width+w>a.availableWidth+k&&(L(s,x),_(d)),a.width+=w,a.toRun=s,a.toChar=T,x=T;}}}ot();let st=C.reduce((s,l)=>s+l.lineHeight,0);r?.listMarker&&!r?.listMarkerHidden&&(g?.hanging??0)===0&&C.length>0&&(st+=C[0].lineHeight);let j=st;return o?.before&&(j+=o.before),o?.after&&(j+=o.after),{kind:"paragraph",lines:C,totalHeight:j}}function me(t,e){return t.map(i=>Rt(i,e))}function de(t){let e=Z(t);return J(t.text,e).charWidths}var yt=2e4,v=new Map;function Lt(t,e,i){return `${t}|${e}|${i||0}`}function Pt(){for(;v.size>yt;){let t=v.keys().next().value;if(t===void 0)break;v.delete(t);}}function pe(t,e,i=0){let n=Lt(t,e,i),r=v.get(n);if(r!==void 0)return v.delete(n),v.set(n,r),r.width}function be(t,e,i,n){let r=Lt(t,e,i);v.set(r,{width:n}),Pt();}function wt(){v.clear();}function xe(t){!Number.isFinite(t)||t<=0||(yt=t,Pt());}function Wt(){return v.size}var Fe=1e3,vt=Fe,E=new Map;function Et(t,e,i=false,n=false){return `${t}|${e}|${i}|${n}`}function It(){for(;E.size>vt;){let t=E.keys().next().value;if(t===void 0)break;E.delete(t);}}function Te(t,e,i=false,n=false){let r=Et(t,e,i,n),o=E.get(r);if(o!==void 0)return E.delete(r),E.set(r,o),o}function Me(t,e,i,n,r){let o=Et(t,e,i,n);E.set(o,r),It();}function _t(){E.clear();}function Ce(t){!Number.isFinite(t)||t<=0||(vt=t,It());}function kt(){return E.size}var Se=5e3,Ht=Se,I=new Map;function at(t){let e=[];for(let n of t.runs)n.kind==="text"?e.push(`t:${n.text}|${n.fontFamily}|${n.fontSize}|${n.bold}|${n.italic}`):n.kind==="tab"?e.push(`tab:${n.width}`):n.kind==="image"?e.push(`img:${n.width}x${n.height}`):n.kind==="lineBreak"&&e.push("br");let i=t.attrs;if(i){i.alignment&&e.push(`align:${i.alignment}`),i.indent&&e.push(`indent:${i.indent.left}|${i.indent.right}|${i.indent.firstLine}|${i.indent.hanging}`),i.spacing&&e.push(`spacing:${i.spacing.before}|${i.spacing.after}|${i.spacing.line}|${i.spacing.lineRule}`),i.defaultFontSize!=null&&e.push(`dfs:${i.defaultFontSize}`),i.defaultFontFamily!=null&&e.push(`dff:${i.defaultFontFamily}`);let n=i.borders;if(n){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";e.push(`bdr:${r(n.top)}|${r(n.bottom)}|${r(n.left)}|${r(n.right)}`);}i.suppressEmptyParagraphHeight&&e.push("sup");}return e.join("||")}function At(){for(;I.size>Ht;){let t=I.keys().next().value;if(t===void 0)break;I.delete(t);}}function Re(t,e){let i=at(t),n=I.get(i);if(n!==void 0&&n.maxWidth===e)return I.delete(i),I.set(i,n),n.measure}function ye(t,e,i){let n=at(t);I.set(n,{measure:i,maxWidth:e}),At();}function Ot(){I.clear();}function Le(t){!Number.isFinite(t)||t<=0||(Ht=t,At());}function zt(){return I.size}function Pe(){wt(),_t(),Ot();}function we(){return Wt()+kt()+zt()}exports.A=Wt;exports.B=Te;exports.C=Me;exports.D=_t;exports.E=Ce;exports.F=kt;exports.G=at;exports.H=Re;exports.I=ye;exports.J=Ot;exports.K=Le;exports.L=zt;exports.M=Pe;exports.N=we;exports.a=$;exports.b=Kt;exports.c=D;exports.d=A;exports.e=S;exports.f=qt;exports.g=J;exports.h=Jt;exports.i=Qt;exports.j=te;exports.k=ee;exports.l=W;exports.m=dt;exports.n=ne;exports.o=ie;exports.p=re;exports.q=N;exports.r=pt;exports.s=nt;exports.t=Rt;exports.u=me;exports.v=de;exports.w=pe;exports.x=be;exports.y=wt;exports.z=xe;
@@ -1 +1 @@
1
- import {f,b,c,d,e,a,p,m as m$1}from'./chunk-4EHBV73E.mjs';import {g,i,k,l,m}from'./chunk-ZYESB4KC.mjs';import {o}from'./chunk-6LOYA7G5.mjs';function W(t,r){let e=j(r),s=new RegExp(`<w:p[\\s][^>]*w14:paraId="${e}"`,"g"),o=[],i;for(;(i=s.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,r){let e=W(t,r);return e?t.substring(e.start,e.end):null}function Y(t){let r=0,e=/<w:p[\s>]/g,s;for(;(s=e.exec(t))!==null;){let o=s.index,i=t[o+4];(i===">"||i===" ")&&r++;}return r}function B(t){let r=new Map,e=/w14:paraId="([^"]+)"/g,s;for(;(s=e.exec(t))!==null;){let o=s[1];r.set(o,(r.get(o)||0)+1);}return r}function V(t,r,e){if(e.size===0)return {safe:true};let s=B(t),o=B(r);for(let n of e){let a=s.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 e){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(r);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function H(t,r,e){if(e.size===0)return t;if(!V(t,r,e).safe)return null;let o=[];for(let l of e){let n=W(t,l);if(!n)return null;let a=L(r,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){for(let r of t)if(r.type==="paragraph"){for(let e of r.content)if(e.type==="run"){for(let s of e.content)if(s.type==="drawing"&&s.image?.src?.startsWith("data:")&&!s.image?.rId)return true}else if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true}else if(r.type==="table"){for(let e of r.rows)for(let s of e.cells)if(Z(s.content))return true}return false}async function nt(t,r,e$1){let{changedParaIds:s,structuralChange:o$1,hasUntrackedChanges:i$1}=e$1;if(o$1||i$1||!r)return null;let l$1=t.package.document.content;if(Z(l$1))return null;let n=t.package.document.comments,a$1=n&&n.length>0,f$1=f(t);try{let u=await(await import('jszip')).default.loadAsync(r),c$1=new Map;if(s.size>0){let d=u.file("word/document.xml");if(!d)return null;let p=await d.async("text"),y=g(t),g$1=H(p,y,s);if(!g$1)return null;c$1.set("word/document.xml",g$1);}if(a$1){let{xml:d$1,paraInfos:p}=i(n);c$1.set("word/comments.xml",d$1);let y=k(p);y&&c$1.set("word/commentsExtended.xml",y);let g=l(p);g&&c$1.set("word/commentsIds.xml",g);let I=m(p,n);I&&c$1.set("word/commentsExtensible.xml",I);let S=u.file("[Content_Types].xml");if(S){let m=c$1.get("[Content_Types].xml")??await S.async("text"),x=!1,C=[["/word/comments.xml",b],["/word/commentsExtended.xml",c],["/word/commentsIds.xml",d],["/word/commentsExtensible.xml",e]];for(let[h,b]of C)m.includes(h)||(m=m.replace("</Types>",`<Override PartName="${h}" ContentType="${b}"/></Types>`),x=!0);x&&c$1.set("[Content_Types].xml",m);}let T="word/_rels/document.xml.rels",N=u.file(T);if(N){let m=c$1.get(T)??await N.async("text"),x=!1,C=[["comments.xml",o.comments],["commentsExtended.xml",o.commentsExtended],["commentsIds.xml",o.commentsIds],["commentsExtensible.xml",o.commentsExtensible]];for(let[h,b]of C)if(!m.includes(h)){let J=a(m);m=m.replace("</Relationships>",`<Relationship Id="rId${J+1}" Type="${b}" Target="${h}"/></Relationships>`),x=!0;}x&&c$1.set(T,m);}}for(let[d,p]of f$1)c$1.set(d,p);let P=u.file("docProps/core.xml");if(P){let d=await P.async("text");c$1.set("docProps/core.xml",p(d,{updateModifiedDate:!0}));}return await m$1(u,c$1)}catch{return null}}export{V as a,H as b,nt as c};
1
+ import {f,b,c,d,e,a,p,m as m$1}from'./chunk-UCZVMHB5.mjs';import {g,i,k,l,m}from'./chunk-LDKESXXK.mjs';import {o}from'./chunk-6LOYA7G5.mjs';function W(t,r){let e=j(r),s=new RegExp(`<w:p[\\s][^>]*w14:paraId="${e}"`,"g"),o=[],i;for(;(i=s.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,r){let e=W(t,r);return e?t.substring(e.start,e.end):null}function Y(t){let r=0,e=/<w:p[\s>]/g,s;for(;(s=e.exec(t))!==null;){let o=s.index,i=t[o+4];(i===">"||i===" ")&&r++;}return r}function B(t){let r=new Map,e=/w14:paraId="([^"]+)"/g,s;for(;(s=e.exec(t))!==null;){let o=s[1];r.set(o,(r.get(o)||0)+1);}return r}function V(t,r,e){if(e.size===0)return {safe:true};let s=B(t),o=B(r);for(let n of e){let a=s.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 e){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(r);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function H(t,r,e){if(e.size===0)return t;if(!V(t,r,e).safe)return null;let o=[];for(let l of e){let n=W(t,l);if(!n)return null;let a=L(r,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){for(let r of t)if(r.type==="paragraph"){for(let e of r.content)if(e.type==="run"){for(let s of e.content)if(s.type==="drawing"&&s.image?.src?.startsWith("data:")&&!s.image?.rId)return true}else if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true}else if(r.type==="table"){for(let e of r.rows)for(let s of e.cells)if(Z(s.content))return true}return false}async function nt(t,r,e$1){let{changedParaIds:s,structuralChange:o$1,hasUntrackedChanges:i$1}=e$1;if(o$1||i$1||!r)return null;let l$1=t.package.document.content;if(Z(l$1))return null;let n=t.package.document.comments,a$1=n&&n.length>0,f$1=f(t);try{let u=await(await import('jszip')).default.loadAsync(r),c$1=new Map;if(s.size>0){let d=u.file("word/document.xml");if(!d)return null;let p=await d.async("text"),y=g(t),g$1=H(p,y,s);if(!g$1)return null;c$1.set("word/document.xml",g$1);}if(a$1){let{xml:d$1,paraInfos:p}=i(n);c$1.set("word/comments.xml",d$1);let y=k(p);y&&c$1.set("word/commentsExtended.xml",y);let g=l(p);g&&c$1.set("word/commentsIds.xml",g);let I=m(p,n);I&&c$1.set("word/commentsExtensible.xml",I);let S=u.file("[Content_Types].xml");if(S){let m=c$1.get("[Content_Types].xml")??await S.async("text"),x=!1,C=[["/word/comments.xml",b],["/word/commentsExtended.xml",c],["/word/commentsIds.xml",d],["/word/commentsExtensible.xml",e]];for(let[h,b]of C)m.includes(h)||(m=m.replace("</Types>",`<Override PartName="${h}" ContentType="${b}"/></Types>`),x=!0);x&&c$1.set("[Content_Types].xml",m);}let T="word/_rels/document.xml.rels",N=u.file(T);if(N){let m=c$1.get(T)??await N.async("text"),x=!1,C=[["comments.xml",o.comments],["commentsExtended.xml",o.commentsExtended],["commentsIds.xml",o.commentsIds],["commentsExtensible.xml",o.commentsExtensible]];for(let[h,b]of C)if(!m.includes(h)){let J=a(m);m=m.replace("</Relationships>",`<Relationship Id="rId${J+1}" Type="${b}" Target="${h}"/></Relationships>`),x=!0;}x&&c$1.set(T,m);}}for(let[d,p]of f$1)c$1.set(d,p);let P=u.file("docProps/core.xml");if(P){let d=await P.async("text");c$1.set("docProps/core.xml",p(d,{updateModifiedDate:!0}));}return await m$1(u,c$1)}catch{return null}}export{V as a,H as b,nt as c};
@@ -1 +1 @@
1
- 'use strict';var chunkBD4CYYFB_js=require('./chunk-BD4CYYFB.js'),chunk44RUAQA2_js=require('./chunk-44RUAQA2.js'),chunkTZJUO3NW_js=require('./chunk-TZJUO3NW.js'),chunkHVZMO3BU_js=require('./chunk-HVZMO3BU.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function N(e,t,a){if(!(!e||e<=0)){if(t==="pct")return a*e/5e3;if(!t||t==="dxa"||t==="auto")return chunk4Q2IP5FW_js.c(e)}}function q(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((a,o)=>a+Math.max(1,o.colSpan??1),0)))}function J(e,t,a){if(t<=0)return [];let o=a>0?a/t:0;if(e.length===0)return Array(t).fill(o);let n=e.slice(0,t),r=t-n.length;if(r>0){let u=n.filter(g=>g>0),c=u.length>0?u.reduce((g,h)=>g+h,0)/u.length:o;n=n.concat(Array(r).fill(c));}let s=n.reduce((u,c)=>u+(c>0?c:0),0),i=n.filter(u=>u<=0).length;if(s<=0)return Array(t).fill(o);if(i===0)return n;let l=Math.max(0,a-s),f=l>0?l/i:s/Math.max(1,t-i);return n.map(u=>u>0?u:f)}function K(e,t){if(e.pages.length===0)return null;let a=e.pageGap??0,o=0,n=null,r=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=o,u=f+l;if(t.y>=f&&t.y<u)return {pageIndex:s,page:i,pageY:t.y-f};let c=f+l/2,g=Math.abs(t.y-c);g<r&&(r=g,n=s),o=u+a;}if(n!==null){let s=e.pages[n],i=D(e,n);return {pageIndex:n,page:s,pageY:Math.max(0,Math.min(t.y-i,s.size?.h??e.pageSize.h))}}return null}function D(e,t){let a=e.pageGap??0,o=0;for(let n=0;n<t&&n<e.pages.length;n++){let s=e.pages[n].size?.h??e.pageSize.h;o+=s+a;}return o}function Ie(e,t){return K(e,{y:t})?.pageIndex??null}function Q(e,t){return e.findIndex(a=>a.id===t)}function Be(e,t){let a=0;for(let o=e.fromLine;o<e.toLine&&o<t.lines.length;o++)a+=t.lines[o].lineHeight;return a}function ce(e,t,a,o){let n=[...e.page.fragments].sort((r,s)=>{let i=r.y-s.y;return Math.abs(i)>.5?i:r.x-s.x});for(let r of n){let s=Q(t,r.blockId);if(s===-1)continue;let i=t[s],l=a[s];if(!i||!l)continue;let f;if(r.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Be(r,l);}else if(r.kind==="table")f=r.height;else if(r.kind==="image")f=r.height;else continue;let u=o.x>=r.x&&o.x<=r.x+r.width,c=o.y>=r.y&&o.y<=r.y+f;if(u&&c)return {fragment:r,block:i,measure:l,pageIndex:e.pageIndex,localX:o.x-r.x,localY:o.y-r.y}}return null}function Re(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="image")continue;let r=Q(t,n.blockId);if(r===-1)continue;let s=t[r],i=a[r];if(!s||!i)continue;let l=o.x>=n.x&&o.x<=n.x+n.width,f=o.y>=n.y&&o.y<=n.y+n.height;if(l&&f)return {fragment:n,block:s,measure:i,pageIndex:e.pageIndex,localX:o.x-n.x,localY:o.y-n.y}}return null}function ue(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="table")continue;let r=n,s=o.x>=r.x&&o.x<=r.x+r.width,i=o.y>=r.y&&o.y<=r.y+r.height;if(!s||!i)continue;let l=Q(t,r.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,g=u,h=o.x-r.x,x=o.y-r.y,d=r.headerRowCount??0,p=d>0&&r.continuesFromPrev?chunk44RUAQA2_js.r(g,d):0,m=0,b=-1;if(g.rows.length===0||c.rows.length===0)continue;if(p>0&&x<p){let T=0;for(let w=0;w<d&&w<g.rows.length;w++){let E=g.rows[w];if(x>=T&&x<T+E.height){b=w;break}T+=E.height;}b===-1&&(b=0);}else {let T=x-p;for(let w=r.fromRow;w<r.toRow&&w<g.rows.length;w++){let E=g.rows[w];if(T>=m&&T<m+E.height){b=w;break}m+=E.height;}}if(b===-1&&(b=Math.min(r.toRow-1,g.rows.length-1),b<r.fromRow))continue;let k=g.rows[b],F=c.rows[b];if(!k||!F)continue;let P=0,M=-1;if(k.cells.length===0||F.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let w=k.cells[T];if(h>=P&&h<P+w.width){M=T;break}P+=w.width;}if(M===-1&&(M=k.cells.length-1,M<0))continue;let H=k.cells[M],R=F.cells[M];if(!H||!R)continue;let y=0;if(p>0&&b<d)for(let T=0;T<b;T++)y+=g.rows[T]?.height??0;else {y=p;for(let T=r.fromRow;T<b;T++)y+=g.rows[T]?.height??0;}let I=0;for(let T=0;T<M;T++)I+=k.cells[T]?.width??0;let C,S;if(R.blocks&&R.blocks.length>0){let T=R.blocks[0],w=H.blocks[0];T.kind==="paragraph"&&w?.kind==="paragraph"&&(C=T,S=w);}let _=h-I,L=x-y;return {fragment:r,block:c,measure:g,pageIndex:e.pageIndex,rowIndex:b,colIndex:M,cellBlock:C,cellMeasure:S,cellLocalX:Math.max(0,_),cellLocalY:Math.max(0,L)}}return null}function Se(e,t,a,o){let n={pageHit:null,fragmentHit:null,tableCellHit:null};if(n.pageHit=K(e,o),!n.pageHit)return n;let r=D(e,n.pageHit.pageIndex),s={x:o.x,y:o.y-r};return n.fragmentHit=ce(n.pageHit,t,a,s),n.fragmentHit?.fragment.kind==="table"&&(n.tableCellHit=ue(n.pageHit,t,a,s)),n}function Le(e){if(e.pages.length===0)return 0;let t=e.pageGap??0,a=0;for(let o=0;o<e.pages.length;o++){let n=e.pages[o];a+=n.size?.h??e.pageSize.h,o<e.pages.length-1&&(a+=t);}return a}function Ee(e,t){return D(e,t)}function Ce(e,t){if(t<0||t>=e.pages.length)return null;let a=D(e,t),n=e.pages[t].size?.h??e.pageSize.h;return {top:a,bottom:a+n}}function Z(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function fe(e,t){let a=[];for(let o=t.fromRun;o<=t.toRun&&o<e.runs.length;o++){let n=e.runs[o];if(n){if(n.kind==="tab"||n.kind==="image"||n.kind==="lineBreak"){a.push(n);continue}if(n.kind==="text"){let r=n.text??"",s=o===t.fromRun,i=o===t.toRun;if(s||i){let l=s?t.fromChar:0,f=i?t.toChar:r.length,u=r.slice(l,f);u.length>0&&a.push({...n,text:u});}else a.push(n);}}}return a}function ge(e,t){let a,o,n=e.pmStart??0,r=0;for(let s=0;s<e.runs.length&&s<=t.toRun;s++){let i=e.runs[s];i&&(s<t.fromRun?i.kind==="text"?r+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(r+=1):s===t.fromRun&&(r+=t.fromChar,a=n+r,i.kind==="text"&&(r=t.fromChar)));}if(a!==void 0){let s=0;for(let i=t.fromRun;i<=t.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===t.fromRun?t.fromChar:0,c=i===t.toRun?t.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}o=a+s;}return {pmStart:a,pmEnd:o}}function _e(e,t,a,o){let n=0;for(let r=a;r<o&&r<e.lines.length;r++){let i=e.lines[r].lineHeight;if(t>=n&&t<n+i)return r;n+=i;}return o>a?Math.min(o-1,e.lines.length-1):null}function Ae(e,t,a,o){let{pmStart:n,pmEnd:r}=ge(e,t);if(n===void 0||r===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(o-t.width)/2):s==="right"&&(i=Math.max(0,o-t.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:n};let f=fe(e,t);if(f.length===0)return {charOffset:0,pmPosition:n};let u=0,c=0;for(let h of f){if(h.kind==="tab"){let x=h.width??48,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h.kind==="image"){let x=h.width,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h.kind==="lineBreak"){if(l>=u)return {charOffset:c,pmPosition:n+c};c+=1;continue}if(h.kind==="text"){let x=h.text??"";if(x.length===0)continue;let d=Z(h),p=chunkTZJUO3NW_js.g(x,d),m=u+p.width;if(l<=m){let b=l-u,k=chunkTZJUO3NW_js.h(b,p.charWidths),F=c+k;return {charOffset:F,pmPosition:n+F}}u=m,c+=x.length;}}return {charOffset:r-n,pmPosition:r}}function $(e){let{fragment:t,block:a,measure:o,localX:n,localY:r}=e;if(t.kind!=="paragraph"||a.kind!=="paragraph"||o.kind!=="paragraph")return null;let s=t,i=a,l=o,f=_e(l,r,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let k=s.fromLine;k<f;k++)c+=l.lines[k]?.lineHeight??0;let g=i.attrs?.indent,h=g?.left??0,x=g?.right??0,d=Math.max(0,t.width-h-x),p=n-h,{charOffset:m,pmPosition:b}=Ae(i,u,p,d);return {pmPosition:b,charOffset:m,lineIndex:f}}function he(e){let{cellBlock:t,cellMeasure:a,cellLocalX:o,cellLocalY:n}=e;if(!t||!a)return null;let r={fragment:{kind:"paragraph",blockId:t.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:t,measure:a,pageIndex:e.pageIndex,localX:o,localY:n};return $(r)?.pmPosition??null}function De(e,t){if(t)return he(t);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?$(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function de(e,t,a,o){let n=e.pmStart??0,r=e.pmEnd??n;if(a<n||a>r)return null;let s=a-n;for(let i=0;i<t.lines.length;i++){let l=t.lines[i],{pmStart:f,pmEnd:u}=ge(e,l);if(f===void 0||u===void 0)continue;let c=f-n,g=u-n;if(s>=c&&s<=g){let h=s-c,x=fe(e,l),d=0,p=0;for(let m of x)if(m.kind==="tab"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+(m.width??48),lineIndex:i};d+=m.width??48,p+=1;}else if(m.kind==="image"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+m.width,lineIndex:i};d+=m.width,p+=1;}else if(m.kind==="lineBreak"){if(h<=p)return {x:d,lineIndex:i};p+=1;}else if(m.kind==="text"){let b=m.text??"";if(h<=p+b.length){let P=h-p,M=Z(m),H=chunkTZJUO3NW_js.g(b.slice(0,P),M);return {x:d+H.width,lineIndex:i}}let k=Z(m),F=chunkTZJUO3NW_js.g(b,k);d+=F.width,p+=b.length;}return {x:d,lineIndex:i}}}return null}function Oe(e,t,a,o,n,r,s){let i=de(e,t,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,g=Math.max(0,r-u-c),h=t.lines[i.lineIndex];if(!h)return null;let x=0;l==="center"?x=Math.max(0,(g-h.width)/2):l==="right"&&(x=Math.max(0,g-h.width));let d=0;for(let p=s;p<i.lineIndex;p++)d+=t.lines[p]?.lineHeight??0;return {x:o+u+x+i.x,y:n+d,height:h.lineHeight}}function me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ee(e,t){return e.findIndex(a=>a.id===t)}function G(e,t){let o=(e.pmStart??0)+1,n=0,r;for(let l=0;l<e.runs.length&&l<=t.toRun;l++){let f=e.runs[l];if(f){if(l<t.fromRun)f.kind==="text"?n+=(f.text??"").length:n+=1;else if(l===t.fromRun){n+=t.fromChar,r=o+n;break}}}r===void 0&&(r=o);let s=0;for(let l=t.fromRun;l<=t.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===t.fromRun?t.fromChar:0,g=l===t.toRun?t.toChar:u.length;s+=g-c;}else s+=1;}let i=r+s;return {pmStart:r,pmEnd:i}}function pe(e,t,a,o){let n=[];for(let r=0;r<t.lines.length;r++){let s=t.lines[r],i=G(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<o&&n.push({line:s,index:r});}return n}function v(e,t,a){let o=G(e,t);return o.pmStart===void 0?0:Math.max(0,a-o.pmStart)}function z(e,t,a,o){let n=0,r=0;for(let s=t.fromRun;s<=t.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="image"){let l=i.width;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="lineBreak"){if(a<=r)return n;r+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===t.fromRun,u=s===t.toRun,c=f?t.fromChar:0,g=u?t.toChar:l.length,h=l.slice(c,g);if(r+h.length>=a){let p=a-r,m=me(i),b=chunkTZJUO3NW_js.g(h.slice(0,p),m);return n+b.width}let x=me(i),d=chunkTZJUO3NW_js.g(h,x);n+=d.width,r+=h.length;}}}return n}function W(e,t){let a=0;for(let o=0;o<t&&o<e.lines.length;o++)a+=e.lines[o].lineHeight;return a}function Xe(e,t,a,o,n){if(o===n)return [];let r=Math.min(o,n),s=Math.max(o,n),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=D(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=h,p=x,m=c,b=pe(d,p,r,s);for(let{line:k,index:F}of b){if(F<m.fromLine||F>=m.toLine)continue;let P=G(d,k);if(P.pmStart===void 0||P.pmEnd===void 0)continue;let M=Math.max(P.pmStart,r),H=Math.min(P.pmEnd,s);if(M>=H)continue;let R=v(d,k,M),y=v(d,k,H),B=d.attrs?.indent,I=B?.left??0,C=B?.right??0,S=Math.max(0,c.width-I-C),_=z(d,k,R),L=z(d,k,y),T=d.attrs?.alignment??"left",w=0;T==="center"?w=Math.max(0,(S-k.width)/2):T==="right"&&(w=Math.max(0,S-k.width));let E=W(p,F)-W(p,m.fromLine),A=c.x+I+w+Math.min(_,L),V=Math.max(1,Math.abs(L-_)),Y=c.y+E;i.push({x:A,y:Y+u,width:V,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="table"||!x||x.kind!=="table")continue;let d=h,p=x,m=c,b=m.headerRowCount??0,F=b>0&&m.continuesFromPrev?chunk44RUAQA2_js.r(p,b):0;for(let P=m.fromRow;P<m.toRow&&P<d.rows.length;P++){let M=d.rows[P],H=p.rows[P];if(!M||!H)continue;let R=0;for(let y=0;y<M.cells.length;y++){let B=M.cells[y],I=H.cells[y];if(!(!B||!I)){for(let C=0;C<B.blocks.length;C++){let S=B.blocks[C],_=I.blocks[C];if(!S||S.kind!=="paragraph"||!_||_.kind!=="paragraph")continue;let L=S,T=_,w=pe(L,T,r,s),E=0;for(let{line:A,index:V}of w){let Y=G(L,A);if(Y.pmStart===void 0||Y.pmEnd===void 0)continue;let te=Math.max(Y.pmStart,r),ne=Math.min(Y.pmEnd,s);if(te>=ne)continue;let Me=v(L,A,te),ye=v(L,A,ne),re=z(L,A,Me,I.width),oe=z(L,A,ye,I.width),He=W(T,V);i.push({x:m.x+R+Math.min(re,oe),y:m.y+F+E+He+u,width:Math.max(1,Math.abs(oe-re)),height:A.lineHeight,pageIndex:l});}E+=T.totalHeight;}R+=I.width;}}F+=H.height;}}if(c.kind==="image"){let g=c.pmStart??0;(c.pmEnd??g+1)>r&&g<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ye(e,t,a,o){for(let n=0;n<e.pages.length;n++){let r=e.pages[n],s=D(e,n);for(let i of r.fragments){if(i.kind==="paragraph"){let l=ee(t,i.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,g=u,h=i,x=c.pmStart??0,d=c.pmEnd??x;if(o<x||o>d)continue;for(let p=h.fromLine;p<h.toLine;p++){let m=g.lines[p];if(!m)continue;let b=G(c,m);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&o>=b.pmStart&&o<=b.pmEnd){let k=v(c,m,o),F=c.attrs?.indent,P=F?.left??0,M=F?.right??0,H=Math.max(0,i.width-P-M),R=z(c,m,k),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(H-m.width)/2):y==="right"&&(B=Math.max(0,H-m.width));let I=W(g,p)-W(g,h.fromLine);return {x:i.x+P+B+R,y:i.y+I+s,height:m.lineHeight,pageIndex:n}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(o>=l&&o<=f){let u=o===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:n}}}}}return null}function ve(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function ze(e){let t=new Map;for(let a of e){let o=t.get(a.pageIndex)??[];o.push(a),t.set(a.pageIndex,o);}return t}function We(e){if(e.kind!=="paragraph")return false;let t=e.attrs;return t?!!(t.borders?.top||t.borders?.bottom||t.spacingExplicit?.before||t.spacingExplicit?.after):false}function xe(e){return be(e)}function be(e){let t=new Set;for(let a=1;a<e.length;a++){let o=e[a-1],n=e[a];o.kind==="table"&&n.kind==="paragraph"&&(n.runs.length>0||We(n)||t.add(a));}return e.map((a,o)=>{if(a.kind==="table")return Ge(a);if(a.kind!=="paragraph")return a;let n=t.has(o),r=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!r?.before,f=i&&!r?.after,u=l||f;if(!u&&!n)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),n&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function Ge(e){let t=false,a=e.rows.map(o=>{let n=false,r=o.cells.map(s=>{let i=be(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(n=true,{...s,blocks:i}):s});return n?(t=true,{...o,cells:r}):o});return t?{...e,rows:a}:e}function Ue(e){return e?.align??e?.alignment}function ke(e,t,a,o){let n=o.section==="header"?o.margins.header??48:o.pageSize.h-(o.margins.footer??48)-a,r=e.position?.vertical;if(!r)return t;let s=Ue(r),i=r.posOffset!==void 0?chunk4Q2IP5FW_js.e(r.posOffset):void 0;if(r.relativeTo==="page"){if(i!==void 0)return i-n;if(s==="top")return -n;if(s==="bottom")return o.pageSize.h-e.height-n;if(s==="center")return (o.pageSize.h-e.height)/2-n}if(r.relativeTo==="margin"){let l=o.margins.top,f=o.pageSize.h-o.margins.top-o.margins.bottom;if(i!==void 0)return l+i-n;if(s==="top")return l-n;if(s==="bottom")return l+f-e.height-n;if(s==="center")return l+(f-e.height)/2-n}return i!==void 0?t+i:t}function Te(e,t,a,o){let n=0,r=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=t[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;n=Math.min(n,u),r=Math.max(r,c);for(let g of l.runs){if(g.kind!=="image"||!g.position)continue;let h=ke(g,u,a,o);n=Math.min(n,h),r=Math.max(r,h+g.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}}}return {visualTop:n,visualBottom:r}}function Ne(e,t,a,o){if(!e||!e.content||e.content.length===0)return;let n=chunkHVZMO3BU_js.b(e.content,{styles:o.styles??void 0,theme:o.theme??null}),r=chunkBD4CYYFB_js.d(n,{theme:o.theme??void 0});if(r.length===0)return;let s=xe(r),i=o.measureBlocks(s,t),l=i.reduce((c,g)=>g.kind==="paragraph"||g.kind==="table"?c+g.totalHeight:g.kind==="image"||g.kind==="textBox"?c+g.height:c,0),{visualTop:f,visualBottom:u}=Te(r,i,l,a);return {blocks:s,measures:i,height:l,visualTop:f,visualBottom:u}}var Pe=7,Fe=0;function we(e,t){if(e.kind!=="paragraph"||t.kind!=="paragraph")return "totalHeight"in t?t.totalHeight:"height"in t?t.height:0;let a=e.runs.filter(i=>i.kind!=="text"||i.text.length>0);if(!(t.lines.length===1&&a.length>0&&a.every(i=>i.kind==="image")))return t.totalHeight;let n=a.reduce((i,l)=>l.kind==="image"?Math.max(i,l.height):i,0),r=e.attrs?.spacing?.before??0,s=e.attrs?.spacing?.after??0;return r+n+s}function Ve(e){let t=e?.borders?.top?.width??0,a=e?.borders?.bottom?.width??0;return t+a}function je(e,t,a){let o=e.columnWidths??[],n=N(e.width,e.widthType,t),r=q(e),s=n??t;if(e.rows.length>0&&(o=J(o,r,s)),o.length>0&&n){let c=o.reduce((g,h)=>g+h,0);if(c>0&&Math.abs(c-n)>1){let g=n/c;o=o.map(h=>h*g);}}let i=new Map;for(let c=0;c<e.rows.length;c++){let g=e.rows[c];if(!g)continue;let h=0,x=i.get(c)??new Set;for(;x.has(h);)h++;for(let d of g.cells){let p=d.colSpan??1,m=d.rowSpan??1;if(m>1)for(let b=c+1;b<c+m;b++){i.has(b)||i.set(b,new Set);let k=i.get(b);for(let F=0;F<p;F++)k.add(h+F);}for(h+=p;x.has(h);)h++;}}let l=e.rows.map((c,g)=>{let h=0,x=i.get(g)??new Set;for(;x.has(h);)h++;return {cells:c.cells.map(d=>{let p=d.colSpan??1,m=0;for(let P=0;P<p&&h+P<o.length;P++)m+=o[h+P]??0;for(m===0&&(m=(d.width&&d.width>0?d.width:N(d.widthValue,d.widthType,s))??100),h+=p;x.has(h);)h++;let b=d.padding?.left??Pe,k=d.padding?.right??Pe,F=Math.max(1,m-b-k);return {blocks:d.blocks.map(P=>a(P,F)),width:m,height:0,colSpan:d.colSpan,rowSpan:d.rowSpan}}),height:0}});for(let c=0;c<l.length;c++){let g=l[c],h=e.rows[c]?.cells,x=0,d=0;for(let k=0;k<g.cells.length;k++){let F=g.cells[k],P=h?.[k],M=0;for(let y=0;y<F.blocks.length;y++){let B=P?.blocks[y],I=F.blocks[y];!B||!I||(M+=we(B,I));}F.height=M;let H=P?.padding?.top??Fe,R=P?.padding?.bottom??Fe;F.height+=H+R,x=Math.max(x,F.height),d=Math.max(d,Ve(P));}let p=e.rows[c],m=p?.height,b=p?.heightRule;m&&b==="exact"?g.height=m:m?g.height=Math.max(x+d,m):g.height=x+d;}let f=l.reduce((c,g)=>c+g.height,0),u=o.reduce((c,g)=>c+g,0)||n||t;return {kind:"table",rows:l,columnWidths:o,totalWidth:u,totalHeight:f}}var qe=816,Je=1056,Ke=96,Qe=48;function O(e){return Math.round(e/1440*96)}function Ze(e){return {w:e?.pageWidth?O(e.pageWidth):816,h:e?.pageHeight?O(e.pageHeight):1056}}function $e(e){return {top:e?.marginTop?O(e.marginTop):96,right:e?.marginRight?O(e.marginRight):96,bottom:e?.marginBottom?O(e.marginBottom):96,left:e?.marginLeft?O(e.marginLeft):96,header:e?.headerDistance?O(e.headerDistance):48,footer:e?.footerDistance?O(e.footerDistance):48}}function et(e,t){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let o=e.package.headers,n=e.package.footers,r=null,s=null,i=null,l=null;if(o&&t?.headerReferences){let f=t.headerReferences.find(c=>c.type==="default");f?.rId&&(r=o.get(f.rId)??null);let u=t.headerReferences.find(c=>c.type==="first");u?.rId&&(i=o.get(u.rId)??null);}if(n&&t?.footerReferences){let f=t.footerReferences.find(c=>c.type==="default");f?.rId&&(s=n.get(f.rId)??null);let u=t.footerReferences.find(c=>c.type==="first");u?.rId&&(l=n.get(u.rId)??null);}return t?.titlePg||(!r&&i&&(r=i),!s&&l&&(s=l)),{header:r,footer:s,firstHeader:i,firstFooter:l}}exports.A=we;exports.B=je;exports.C=qe;exports.D=Je;exports.E=Ke;exports.F=Qe;exports.G=Ze;exports.H=$e;exports.I=et;exports.a=N;exports.b=q;exports.c=J;exports.d=K;exports.e=D;exports.f=Ie;exports.g=ce;exports.h=Re;exports.i=ue;exports.j=Se;exports.k=Le;exports.l=Ee;exports.m=Ce;exports.n=$;exports.o=he;exports.p=De;exports.q=de;exports.r=Oe;exports.s=Xe;exports.t=Ye;exports.u=ve;exports.v=ze;exports.w=xe;exports.x=ke;exports.y=Te;exports.z=Ne;
1
+ 'use strict';var chunkTYYOBPNK_js=require('./chunk-TYYOBPNK.js'),chunk44RUAQA2_js=require('./chunk-44RUAQA2.js'),chunkBKHQA6JJ_js=require('./chunk-BKHQA6JJ.js'),chunkWZP6ZHBR_js=require('./chunk-WZP6ZHBR.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function N(e,t,a){if(!(!e||e<=0)){if(t==="pct")return a*e/5e3;if(!t||t==="dxa"||t==="auto")return chunk4Q2IP5FW_js.c(e)}}function q(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((a,o)=>a+Math.max(1,o.colSpan??1),0)))}function J(e,t,a){if(t<=0)return [];let o=a>0?a/t:0;if(e.length===0)return Array(t).fill(o);let n=e.slice(0,t),r=t-n.length;if(r>0){let u=n.filter(g=>g>0),c=u.length>0?u.reduce((g,h)=>g+h,0)/u.length:o;n=n.concat(Array(r).fill(c));}let s=n.reduce((u,c)=>u+(c>0?c:0),0),i=n.filter(u=>u<=0).length;if(s<=0)return Array(t).fill(o);if(i===0)return n;let l=Math.max(0,a-s),f=l>0?l/i:s/Math.max(1,t-i);return n.map(u=>u>0?u:f)}function K(e,t){if(e.pages.length===0)return null;let a=e.pageGap??0,o=0,n=null,r=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=o,u=f+l;if(t.y>=f&&t.y<u)return {pageIndex:s,page:i,pageY:t.y-f};let c=f+l/2,g=Math.abs(t.y-c);g<r&&(r=g,n=s),o=u+a;}if(n!==null){let s=e.pages[n],i=D(e,n);return {pageIndex:n,page:s,pageY:Math.max(0,Math.min(t.y-i,s.size?.h??e.pageSize.h))}}return null}function D(e,t){let a=e.pageGap??0,o=0;for(let n=0;n<t&&n<e.pages.length;n++){let s=e.pages[n].size?.h??e.pageSize.h;o+=s+a;}return o}function Ie(e,t){return K(e,{y:t})?.pageIndex??null}function Q(e,t){return e.findIndex(a=>a.id===t)}function Be(e,t){let a=0;for(let o=e.fromLine;o<e.toLine&&o<t.lines.length;o++)a+=t.lines[o].lineHeight;return a}function ce(e,t,a,o){let n=[...e.page.fragments].sort((r,s)=>{let i=r.y-s.y;return Math.abs(i)>.5?i:r.x-s.x});for(let r of n){let s=Q(t,r.blockId);if(s===-1)continue;let i=t[s],l=a[s];if(!i||!l)continue;let f;if(r.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Be(r,l);}else if(r.kind==="table")f=r.height;else if(r.kind==="image")f=r.height;else continue;let u=o.x>=r.x&&o.x<=r.x+r.width,c=o.y>=r.y&&o.y<=r.y+f;if(u&&c)return {fragment:r,block:i,measure:l,pageIndex:e.pageIndex,localX:o.x-r.x,localY:o.y-r.y}}return null}function Re(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="image")continue;let r=Q(t,n.blockId);if(r===-1)continue;let s=t[r],i=a[r];if(!s||!i)continue;let l=o.x>=n.x&&o.x<=n.x+n.width,f=o.y>=n.y&&o.y<=n.y+n.height;if(l&&f)return {fragment:n,block:s,measure:i,pageIndex:e.pageIndex,localX:o.x-n.x,localY:o.y-n.y}}return null}function ue(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="table")continue;let r=n,s=o.x>=r.x&&o.x<=r.x+r.width,i=o.y>=r.y&&o.y<=r.y+r.height;if(!s||!i)continue;let l=Q(t,r.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,g=u,h=o.x-r.x,x=o.y-r.y,d=r.headerRowCount??0,p=d>0&&r.continuesFromPrev?chunk44RUAQA2_js.r(g,d):0,m=0,b=-1;if(g.rows.length===0||c.rows.length===0)continue;if(p>0&&x<p){let T=0;for(let w=0;w<d&&w<g.rows.length;w++){let E=g.rows[w];if(x>=T&&x<T+E.height){b=w;break}T+=E.height;}b===-1&&(b=0);}else {let T=x-p;for(let w=r.fromRow;w<r.toRow&&w<g.rows.length;w++){let E=g.rows[w];if(T>=m&&T<m+E.height){b=w;break}m+=E.height;}}if(b===-1&&(b=Math.min(r.toRow-1,g.rows.length-1),b<r.fromRow))continue;let k=g.rows[b],F=c.rows[b];if(!k||!F)continue;let P=0,M=-1;if(k.cells.length===0||F.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let w=k.cells[T];if(h>=P&&h<P+w.width){M=T;break}P+=w.width;}if(M===-1&&(M=k.cells.length-1,M<0))continue;let H=k.cells[M],R=F.cells[M];if(!H||!R)continue;let y=0;if(p>0&&b<d)for(let T=0;T<b;T++)y+=g.rows[T]?.height??0;else {y=p;for(let T=r.fromRow;T<b;T++)y+=g.rows[T]?.height??0;}let I=0;for(let T=0;T<M;T++)I+=k.cells[T]?.width??0;let C,S;if(R.blocks&&R.blocks.length>0){let T=R.blocks[0],w=H.blocks[0];T.kind==="paragraph"&&w?.kind==="paragraph"&&(C=T,S=w);}let _=h-I,L=x-y;return {fragment:r,block:c,measure:g,pageIndex:e.pageIndex,rowIndex:b,colIndex:M,cellBlock:C,cellMeasure:S,cellLocalX:Math.max(0,_),cellLocalY:Math.max(0,L)}}return null}function Se(e,t,a,o){let n={pageHit:null,fragmentHit:null,tableCellHit:null};if(n.pageHit=K(e,o),!n.pageHit)return n;let r=D(e,n.pageHit.pageIndex),s={x:o.x,y:o.y-r};return n.fragmentHit=ce(n.pageHit,t,a,s),n.fragmentHit?.fragment.kind==="table"&&(n.tableCellHit=ue(n.pageHit,t,a,s)),n}function Le(e){if(e.pages.length===0)return 0;let t=e.pageGap??0,a=0;for(let o=0;o<e.pages.length;o++){let n=e.pages[o];a+=n.size?.h??e.pageSize.h,o<e.pages.length-1&&(a+=t);}return a}function Ee(e,t){return D(e,t)}function Ce(e,t){if(t<0||t>=e.pages.length)return null;let a=D(e,t),n=e.pages[t].size?.h??e.pageSize.h;return {top:a,bottom:a+n}}function Z(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function fe(e,t){let a=[];for(let o=t.fromRun;o<=t.toRun&&o<e.runs.length;o++){let n=e.runs[o];if(n){if(n.kind==="tab"||n.kind==="image"||n.kind==="lineBreak"){a.push(n);continue}if(n.kind==="text"){let r=n.text??"",s=o===t.fromRun,i=o===t.toRun;if(s||i){let l=s?t.fromChar:0,f=i?t.toChar:r.length,u=r.slice(l,f);u.length>0&&a.push({...n,text:u});}else a.push(n);}}}return a}function ge(e,t){let a,o,n=e.pmStart??0,r=0;for(let s=0;s<e.runs.length&&s<=t.toRun;s++){let i=e.runs[s];i&&(s<t.fromRun?i.kind==="text"?r+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(r+=1):s===t.fromRun&&(r+=t.fromChar,a=n+r,i.kind==="text"&&(r=t.fromChar)));}if(a!==void 0){let s=0;for(let i=t.fromRun;i<=t.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===t.fromRun?t.fromChar:0,c=i===t.toRun?t.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}o=a+s;}return {pmStart:a,pmEnd:o}}function _e(e,t,a,o){let n=0;for(let r=a;r<o&&r<e.lines.length;r++){let i=e.lines[r].lineHeight;if(t>=n&&t<n+i)return r;n+=i;}return o>a?Math.min(o-1,e.lines.length-1):null}function Ae(e,t,a,o){let{pmStart:n,pmEnd:r}=ge(e,t);if(n===void 0||r===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(o-t.width)/2):s==="right"&&(i=Math.max(0,o-t.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:n};let f=fe(e,t);if(f.length===0)return {charOffset:0,pmPosition:n};let u=0,c=0;for(let h of f){if(h.kind==="tab"){let x=h.width??48,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h.kind==="image"){let x=h.width,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h.kind==="lineBreak"){if(l>=u)return {charOffset:c,pmPosition:n+c};c+=1;continue}if(h.kind==="text"){let x=h.text??"";if(x.length===0)continue;let d=Z(h),p=chunkBKHQA6JJ_js.g(x,d),m=u+p.width;if(l<=m){let b=l-u,k=chunkBKHQA6JJ_js.h(b,p.charWidths),F=c+k;return {charOffset:F,pmPosition:n+F}}u=m,c+=x.length;}}return {charOffset:r-n,pmPosition:r}}function $(e){let{fragment:t,block:a,measure:o,localX:n,localY:r}=e;if(t.kind!=="paragraph"||a.kind!=="paragraph"||o.kind!=="paragraph")return null;let s=t,i=a,l=o,f=_e(l,r,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let k=s.fromLine;k<f;k++)c+=l.lines[k]?.lineHeight??0;let g=i.attrs?.indent,h=g?.left??0,x=g?.right??0,d=Math.max(0,t.width-h-x),p=n-h,{charOffset:m,pmPosition:b}=Ae(i,u,p,d);return {pmPosition:b,charOffset:m,lineIndex:f}}function he(e){let{cellBlock:t,cellMeasure:a,cellLocalX:o,cellLocalY:n}=e;if(!t||!a)return null;let r={fragment:{kind:"paragraph",blockId:t.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:t,measure:a,pageIndex:e.pageIndex,localX:o,localY:n};return $(r)?.pmPosition??null}function De(e,t){if(t)return he(t);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?$(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function de(e,t,a,o){let n=e.pmStart??0,r=e.pmEnd??n;if(a<n||a>r)return null;let s=a-n;for(let i=0;i<t.lines.length;i++){let l=t.lines[i],{pmStart:f,pmEnd:u}=ge(e,l);if(f===void 0||u===void 0)continue;let c=f-n,g=u-n;if(s>=c&&s<=g){let h=s-c,x=fe(e,l),d=0,p=0;for(let m of x)if(m.kind==="tab"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+(m.width??48),lineIndex:i};d+=m.width??48,p+=1;}else if(m.kind==="image"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+m.width,lineIndex:i};d+=m.width,p+=1;}else if(m.kind==="lineBreak"){if(h<=p)return {x:d,lineIndex:i};p+=1;}else if(m.kind==="text"){let b=m.text??"";if(h<=p+b.length){let P=h-p,M=Z(m),H=chunkBKHQA6JJ_js.g(b.slice(0,P),M);return {x:d+H.width,lineIndex:i}}let k=Z(m),F=chunkBKHQA6JJ_js.g(b,k);d+=F.width,p+=b.length;}return {x:d,lineIndex:i}}}return null}function Oe(e,t,a,o,n,r,s){let i=de(e,t,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,g=Math.max(0,r-u-c),h=t.lines[i.lineIndex];if(!h)return null;let x=0;l==="center"?x=Math.max(0,(g-h.width)/2):l==="right"&&(x=Math.max(0,g-h.width));let d=0;for(let p=s;p<i.lineIndex;p++)d+=t.lines[p]?.lineHeight??0;return {x:o+u+x+i.x,y:n+d,height:h.lineHeight}}function me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ee(e,t){return e.findIndex(a=>a.id===t)}function G(e,t){let o=(e.pmStart??0)+1,n=0,r;for(let l=0;l<e.runs.length&&l<=t.toRun;l++){let f=e.runs[l];if(f){if(l<t.fromRun)f.kind==="text"?n+=(f.text??"").length:n+=1;else if(l===t.fromRun){n+=t.fromChar,r=o+n;break}}}r===void 0&&(r=o);let s=0;for(let l=t.fromRun;l<=t.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===t.fromRun?t.fromChar:0,g=l===t.toRun?t.toChar:u.length;s+=g-c;}else s+=1;}let i=r+s;return {pmStart:r,pmEnd:i}}function pe(e,t,a,o){let n=[];for(let r=0;r<t.lines.length;r++){let s=t.lines[r],i=G(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<o&&n.push({line:s,index:r});}return n}function v(e,t,a){let o=G(e,t);return o.pmStart===void 0?0:Math.max(0,a-o.pmStart)}function z(e,t,a,o){let n=0,r=0;for(let s=t.fromRun;s<=t.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="image"){let l=i.width;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="lineBreak"){if(a<=r)return n;r+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===t.fromRun,u=s===t.toRun,c=f?t.fromChar:0,g=u?t.toChar:l.length,h=l.slice(c,g);if(r+h.length>=a){let p=a-r,m=me(i),b=chunkBKHQA6JJ_js.g(h.slice(0,p),m);return n+b.width}let x=me(i),d=chunkBKHQA6JJ_js.g(h,x);n+=d.width,r+=h.length;}}}return n}function W(e,t){let a=0;for(let o=0;o<t&&o<e.lines.length;o++)a+=e.lines[o].lineHeight;return a}function Xe(e,t,a,o,n){if(o===n)return [];let r=Math.min(o,n),s=Math.max(o,n),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=D(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=h,p=x,m=c,b=pe(d,p,r,s);for(let{line:k,index:F}of b){if(F<m.fromLine||F>=m.toLine)continue;let P=G(d,k);if(P.pmStart===void 0||P.pmEnd===void 0)continue;let M=Math.max(P.pmStart,r),H=Math.min(P.pmEnd,s);if(M>=H)continue;let R=v(d,k,M),y=v(d,k,H),B=d.attrs?.indent,I=B?.left??0,C=B?.right??0,S=Math.max(0,c.width-I-C),_=z(d,k,R),L=z(d,k,y),T=d.attrs?.alignment??"left",w=0;T==="center"?w=Math.max(0,(S-k.width)/2):T==="right"&&(w=Math.max(0,S-k.width));let E=W(p,F)-W(p,m.fromLine),A=c.x+I+w+Math.min(_,L),V=Math.max(1,Math.abs(L-_)),Y=c.y+E;i.push({x:A,y:Y+u,width:V,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="table"||!x||x.kind!=="table")continue;let d=h,p=x,m=c,b=m.headerRowCount??0,F=b>0&&m.continuesFromPrev?chunk44RUAQA2_js.r(p,b):0;for(let P=m.fromRow;P<m.toRow&&P<d.rows.length;P++){let M=d.rows[P],H=p.rows[P];if(!M||!H)continue;let R=0;for(let y=0;y<M.cells.length;y++){let B=M.cells[y],I=H.cells[y];if(!(!B||!I)){for(let C=0;C<B.blocks.length;C++){let S=B.blocks[C],_=I.blocks[C];if(!S||S.kind!=="paragraph"||!_||_.kind!=="paragraph")continue;let L=S,T=_,w=pe(L,T,r,s),E=0;for(let{line:A,index:V}of w){let Y=G(L,A);if(Y.pmStart===void 0||Y.pmEnd===void 0)continue;let te=Math.max(Y.pmStart,r),ne=Math.min(Y.pmEnd,s);if(te>=ne)continue;let Me=v(L,A,te),ye=v(L,A,ne),re=z(L,A,Me,I.width),oe=z(L,A,ye,I.width),He=W(T,V);i.push({x:m.x+R+Math.min(re,oe),y:m.y+F+E+He+u,width:Math.max(1,Math.abs(oe-re)),height:A.lineHeight,pageIndex:l});}E+=T.totalHeight;}R+=I.width;}}F+=H.height;}}if(c.kind==="image"){let g=c.pmStart??0;(c.pmEnd??g+1)>r&&g<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ye(e,t,a,o){for(let n=0;n<e.pages.length;n++){let r=e.pages[n],s=D(e,n);for(let i of r.fragments){if(i.kind==="paragraph"){let l=ee(t,i.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,g=u,h=i,x=c.pmStart??0,d=c.pmEnd??x;if(o<x||o>d)continue;for(let p=h.fromLine;p<h.toLine;p++){let m=g.lines[p];if(!m)continue;let b=G(c,m);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&o>=b.pmStart&&o<=b.pmEnd){let k=v(c,m,o),F=c.attrs?.indent,P=F?.left??0,M=F?.right??0,H=Math.max(0,i.width-P-M),R=z(c,m,k),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(H-m.width)/2):y==="right"&&(B=Math.max(0,H-m.width));let I=W(g,p)-W(g,h.fromLine);return {x:i.x+P+B+R,y:i.y+I+s,height:m.lineHeight,pageIndex:n}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(o>=l&&o<=f){let u=o===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:n}}}}}return null}function ve(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function ze(e){let t=new Map;for(let a of e){let o=t.get(a.pageIndex)??[];o.push(a),t.set(a.pageIndex,o);}return t}function We(e){if(e.kind!=="paragraph")return false;let t=e.attrs;return t?!!(t.borders?.top||t.borders?.bottom||t.spacingExplicit?.before||t.spacingExplicit?.after):false}function xe(e){return be(e)}function be(e){let t=new Set;for(let a=1;a<e.length;a++){let o=e[a-1],n=e[a];o.kind==="table"&&n.kind==="paragraph"&&(n.runs.length>0||We(n)||t.add(a));}return e.map((a,o)=>{if(a.kind==="table")return Ge(a);if(a.kind!=="paragraph")return a;let n=t.has(o),r=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!r?.before,f=i&&!r?.after,u=l||f;if(!u&&!n)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),n&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function Ge(e){let t=false,a=e.rows.map(o=>{let n=false,r=o.cells.map(s=>{let i=be(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(n=true,{...s,blocks:i}):s});return n?(t=true,{...o,cells:r}):o});return t?{...e,rows:a}:e}function Ue(e){return e?.align??e?.alignment}function ke(e,t,a,o){let n=o.section==="header"?o.margins.header??48:o.pageSize.h-(o.margins.footer??48)-a,r=e.position?.vertical;if(!r)return t;let s=Ue(r),i=r.posOffset!==void 0?chunk4Q2IP5FW_js.e(r.posOffset):void 0;if(r.relativeTo==="page"){if(i!==void 0)return i-n;if(s==="top")return -n;if(s==="bottom")return o.pageSize.h-e.height-n;if(s==="center")return (o.pageSize.h-e.height)/2-n}if(r.relativeTo==="margin"){let l=o.margins.top,f=o.pageSize.h-o.margins.top-o.margins.bottom;if(i!==void 0)return l+i-n;if(s==="top")return l-n;if(s==="bottom")return l+f-e.height-n;if(s==="center")return l+(f-e.height)/2-n}return i!==void 0?t+i:t}function Te(e,t,a,o){let n=0,r=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=t[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;n=Math.min(n,u),r=Math.max(r,c);for(let g of l.runs){if(g.kind!=="image"||!g.position)continue;let h=ke(g,u,a,o);n=Math.min(n,h),r=Math.max(r,h+g.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}}}return {visualTop:n,visualBottom:r}}function Ne(e,t,a,o){if(!e||!e.content||e.content.length===0)return;let n=chunkWZP6ZHBR_js.b(e.content,{styles:o.styles??void 0,theme:o.theme??null}),r=chunkTYYOBPNK_js.d(n,{theme:o.theme??void 0});if(r.length===0)return;let s=xe(r),i=o.measureBlocks(s,t),l=i.reduce((c,g)=>g.kind==="paragraph"||g.kind==="table"?c+g.totalHeight:g.kind==="image"||g.kind==="textBox"?c+g.height:c,0),{visualTop:f,visualBottom:u}=Te(r,i,l,a);return {blocks:s,measures:i,height:l,visualTop:f,visualBottom:u}}var Pe=7,Fe=0;function we(e,t){if(e.kind!=="paragraph"||t.kind!=="paragraph")return "totalHeight"in t?t.totalHeight:"height"in t?t.height:0;let a=e.runs.filter(i=>i.kind!=="text"||i.text.length>0);if(!(t.lines.length===1&&a.length>0&&a.every(i=>i.kind==="image")))return t.totalHeight;let n=a.reduce((i,l)=>l.kind==="image"?Math.max(i,l.height):i,0),r=e.attrs?.spacing?.before??0,s=e.attrs?.spacing?.after??0;return r+n+s}function Ve(e){let t=e?.borders?.top?.width??0,a=e?.borders?.bottom?.width??0;return t+a}function je(e,t,a){let o=e.columnWidths??[],n=N(e.width,e.widthType,t),r=q(e),s=n??t;if(e.rows.length>0&&(o=J(o,r,s)),o.length>0&&n){let c=o.reduce((g,h)=>g+h,0);if(c>0&&Math.abs(c-n)>1){let g=n/c;o=o.map(h=>h*g);}}let i=new Map;for(let c=0;c<e.rows.length;c++){let g=e.rows[c];if(!g)continue;let h=0,x=i.get(c)??new Set;for(;x.has(h);)h++;for(let d of g.cells){let p=d.colSpan??1,m=d.rowSpan??1;if(m>1)for(let b=c+1;b<c+m;b++){i.has(b)||i.set(b,new Set);let k=i.get(b);for(let F=0;F<p;F++)k.add(h+F);}for(h+=p;x.has(h);)h++;}}let l=e.rows.map((c,g)=>{let h=0,x=i.get(g)??new Set;for(;x.has(h);)h++;return {cells:c.cells.map(d=>{let p=d.colSpan??1,m=0;for(let P=0;P<p&&h+P<o.length;P++)m+=o[h+P]??0;for(m===0&&(m=(d.width&&d.width>0?d.width:N(d.widthValue,d.widthType,s))??100),h+=p;x.has(h);)h++;let b=d.padding?.left??Pe,k=d.padding?.right??Pe,F=Math.max(1,m-b-k);return {blocks:d.blocks.map(P=>a(P,F)),width:m,height:0,colSpan:d.colSpan,rowSpan:d.rowSpan}}),height:0}});for(let c=0;c<l.length;c++){let g=l[c],h=e.rows[c]?.cells,x=0,d=0;for(let k=0;k<g.cells.length;k++){let F=g.cells[k],P=h?.[k],M=0;for(let y=0;y<F.blocks.length;y++){let B=P?.blocks[y],I=F.blocks[y];!B||!I||(M+=we(B,I));}F.height=M;let H=P?.padding?.top??Fe,R=P?.padding?.bottom??Fe;F.height+=H+R,x=Math.max(x,F.height),d=Math.max(d,Ve(P));}let p=e.rows[c],m=p?.height,b=p?.heightRule;m&&b==="exact"?g.height=m:m?g.height=Math.max(x+d,m):g.height=x+d;}let f=l.reduce((c,g)=>c+g.height,0),u=o.reduce((c,g)=>c+g,0)||n||t;return {kind:"table",rows:l,columnWidths:o,totalWidth:u,totalHeight:f}}var qe=816,Je=1056,Ke=96,Qe=48;function O(e){return Math.round(e/1440*96)}function Ze(e){return {w:e?.pageWidth?O(e.pageWidth):816,h:e?.pageHeight?O(e.pageHeight):1056}}function $e(e){return {top:e?.marginTop?O(e.marginTop):96,right:e?.marginRight?O(e.marginRight):96,bottom:e?.marginBottom?O(e.marginBottom):96,left:e?.marginLeft?O(e.marginLeft):96,header:e?.headerDistance?O(e.headerDistance):48,footer:e?.footerDistance?O(e.footerDistance):48}}function et(e,t){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let o=e.package.headers,n=e.package.footers,r=null,s=null,i=null,l=null;if(o&&t?.headerReferences){let f=t.headerReferences.find(c=>c.type==="default");f?.rId&&(r=o.get(f.rId)??null);let u=t.headerReferences.find(c=>c.type==="first");u?.rId&&(i=o.get(u.rId)??null);}if(n&&t?.footerReferences){let f=t.footerReferences.find(c=>c.type==="default");f?.rId&&(s=n.get(f.rId)??null);let u=t.footerReferences.find(c=>c.type==="first");u?.rId&&(l=n.get(u.rId)??null);}return t?.titlePg||(!r&&i&&(r=i),!s&&l&&(s=l)),{header:r,footer:s,firstHeader:i,firstFooter:l}}exports.A=we;exports.B=je;exports.C=qe;exports.D=Je;exports.E=Ke;exports.F=Qe;exports.G=Ze;exports.H=$e;exports.I=et;exports.a=N;exports.b=q;exports.c=J;exports.d=K;exports.e=D;exports.f=Ie;exports.g=ce;exports.h=Re;exports.i=ue;exports.j=Se;exports.k=Le;exports.l=Ee;exports.m=Ce;exports.n=$;exports.o=he;exports.p=De;exports.q=de;exports.r=Oe;exports.s=Xe;exports.t=Ye;exports.u=ve;exports.v=ze;exports.w=xe;exports.x=ke;exports.y=Te;exports.z=Ne;