@eigenpal/docx-editor-core 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.mts +4 -4
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-3HLRRK6N.mjs +2 -0
- package/dist/{chunk-COV4LHQ7.js → chunk-4272FQ2E.js} +1 -1
- package/dist/chunk-47SKD7QB.mjs +4 -0
- package/dist/chunk-4DCTKHS5.js +1 -0
- package/dist/{chunk-3SJQRYO7.js → chunk-4HNEXEGS.js} +1 -1
- package/dist/chunk-4U2S3WV2.js +1 -0
- package/dist/{chunk-3HENAL6V.mjs → chunk-5EP47PMQ.mjs} +1 -1
- package/dist/{chunk-T4O4PFJD.mjs → chunk-6ENZQGYR.mjs} +1 -1
- package/dist/chunk-7EU6E64E.mjs +1 -0
- package/dist/chunk-A7C3DGQA.mjs +1 -0
- package/dist/chunk-B6FA4MJ5.mjs +1 -0
- package/dist/chunk-BJSG6TEG.js +1 -0
- package/dist/chunk-BMP2OSXE.js +1 -0
- package/dist/{chunk-NPFFCPZ6.js → chunk-DEQFU56O.js} +1 -1
- package/dist/chunk-DFDL337G.js +4 -0
- package/dist/chunk-DKUHG27E.js +1 -0
- package/dist/{chunk-WWVIVYX6.mjs → chunk-DU5TWD2W.mjs} +1 -1
- package/dist/chunk-DUVSDFRG.js +2 -0
- package/dist/{chunk-TV6JLFY5.js → chunk-DUXHJ6QP.js} +1 -1
- package/dist/{chunk-TE2AF7FM.js → chunk-FETIBXTH.js} +1 -1
- package/dist/chunk-GLPOVLZD.mjs +1 -0
- package/dist/{chunk-M7KTKPGO.mjs → chunk-HEJJXAXN.mjs} +1 -1
- package/dist/chunk-HQ76VZAN.mjs +1 -0
- package/dist/{chunk-WYFK4QOF.mjs → chunk-ICNIAAH7.mjs} +1 -1
- package/dist/{chunk-5WINQXA3.js → chunk-ILPNMG7Q.js} +1 -1
- package/dist/{chunk-TDYWEVAE.js → chunk-K7NSOCSY.js} +1 -1
- package/dist/{chunk-6KM4VW4L.js → chunk-KEDY4GFG.js} +3 -3
- package/dist/chunk-KNY7SXPJ.mjs +1 -0
- package/dist/{chunk-SKBHY5MK.mjs → chunk-KPWWI5UW.mjs} +1 -1
- package/dist/chunk-LVUL7O27.js +1 -0
- package/dist/{chunk-O2643IUW.js → chunk-LW5OFHSW.js} +2 -2
- package/dist/chunk-MWOHCSZE.js +1 -0
- package/dist/chunk-NKIDBERV.js +1 -0
- package/dist/chunk-NN2EJIO7.mjs +1 -0
- package/dist/{chunk-QUM4DFRE.mjs → chunk-O4RCQNUW.mjs} +1 -1
- package/dist/chunk-O5L4BZCZ.mjs +1 -0
- package/dist/chunk-OSTMAXZZ.mjs +1 -0
- package/dist/{chunk-PYDX4MOT.mjs → chunk-OWGY46IW.mjs} +1 -1
- package/dist/chunk-PGWY6UFK.js +1 -0
- package/dist/chunk-PJEB3ZWG.mjs +3 -0
- package/dist/{chunk-GB7RICH6.js → chunk-PM4KDJJ2.js} +1 -1
- package/dist/chunk-Q2VALXEU.js +3 -0
- package/dist/chunk-QCPISGPW.mjs +1 -0
- package/dist/{chunk-CBKJOPOW.mjs → chunk-QRBFMR7Z.mjs} +1 -1
- package/dist/chunk-RRJKF2XI.mjs +1 -0
- package/dist/chunk-SHZOAUHB.mjs +1 -0
- package/dist/chunk-TT3ILFZC.js +1 -0
- package/dist/chunk-TXAB4I4M.mjs +2 -0
- package/dist/chunk-UC7JW66O.mjs +1 -0
- package/dist/chunk-VMBCUUZM.mjs +1 -0
- package/dist/chunk-WTIN6QHX.js +1 -0
- package/dist/{chunk-P7HWOJC5.js → chunk-WVY2UXAK.js} +1 -1
- package/dist/chunk-XCTYXYEU.js +1 -0
- package/dist/{chunk-WXSGCEBZ.js → chunk-XCXQWCV2.js} +1 -1
- package/dist/{chunk-M3UL6EUU.mjs → chunk-YSBX4LFA.mjs} +2 -2
- package/dist/chunk-YUHOVME2.js +1 -0
- package/dist/{content-BlWiORm-.d.mts → content-BEFz1zcs.d.mts} +2 -2
- package/dist/{content-eG_Rtl0l.d.ts → content-DNcMlHU0.d.ts} +2 -2
- package/dist/{contentControlValues-CO7pUqOf.d.ts → contentControlValues-2pV4M4kG.d.ts} +1 -1
- package/dist/{contentControlValues-DfYN9BZ8.d.mts → contentControlValues-CKWIIkkr.d.mts} +1 -1
- package/dist/core-plugins.d.mts +2 -2
- package/dist/core-plugins.d.ts +2 -2
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +7 -7
- package/dist/core.d.ts +7 -7
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/docx/index.d.mts +2 -2
- package/dist/docx/index.d.ts +2 -2
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +2 -2
- package/dist/docx/parser.d.ts +2 -2
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +2 -2
- package/dist/docx/rezip.d.ts +2 -2
- package/dist/docx/serializer/index.d.mts +3 -3
- package/dist/docx/serializer/index.d.ts +3 -3
- package/dist/editor/index.d.mts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/executor-FHL5D4CB.js +1 -0
- package/dist/executor-FL6XGVP3.mjs +1 -0
- package/dist/{fontLoader-C6VvBUVB.d.ts → fontLoader-CH12AtFF.d.ts} +1 -1
- package/dist/{fontLoader-3MFD_Hj2.d.mts → fontLoader-D3X2Qgb_.d.mts} +1 -1
- package/dist/{headerFooterLayout-bdHWlU6g.d.ts → headerFooterLayout-BdGTU0IA.d.ts} +31 -16
- package/dist/{headerFooterLayout-DJb-dV7X.d.mts → headerFooterLayout-D5-u-IsD.d.mts} +31 -16
- package/dist/headless.d.mts +5 -5
- package/dist/headless.d.ts +5 -5
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/clickToPositionDom.js +1 -1
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +67 -5
- package/dist/layout-bridge/index.d.ts +67 -5
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +2 -2
- package/dist/layout-bridge/measuring/index.d.ts +2 -2
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.d.mts +2 -2
- package/dist/layout-bridge/toFlowBlocks.d.ts +2 -2
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +2 -2
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +2 -2
- package/dist/layout-engine/types.d.ts +2 -2
- package/dist/layout-painter/index.d.mts +3 -3
- package/dist/layout-painter/index.d.ts +3 -3
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +3 -3
- package/dist/layout-painter/renderPage.d.ts +3 -3
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +2 -2
- package/dist/managers/AutoSaveManager.d.ts +2 -2
- package/dist/managers/TableSelectionManager.d.mts +2 -2
- package/dist/managers/TableSelectionManager.d.ts +2 -2
- package/dist/managers/types.d.mts +2 -2
- package/dist/managers/types.d.ts +2 -2
- package/dist/mcp-cli.mjs +22 -22
- package/dist/mcp.d.mts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +7 -7
- package/dist/mcp.mjs +1 -1
- package/dist/{nodes-RfTS-NSv.d.mts → nodes-5w_QaI3g.d.mts} +13 -1
- package/dist/{nodes-BJef4KFW.d.ts → nodes-qQdZtu3Z.d.ts} +13 -1
- package/dist/prosemirror/applyFormatting.d.mts +34 -4
- package/dist/prosemirror/applyFormatting.d.ts +34 -4
- package/dist/prosemirror/applyFormatting.js +1 -1
- package/dist/prosemirror/applyFormatting.mjs +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +2 -1
- package/dist/prosemirror/commands/index.d.ts +2 -1
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/commands/sectionBreak.d.mts +25 -0
- package/dist/prosemirror/commands/sectionBreak.d.ts +25 -0
- package/dist/prosemirror/commands/sectionBreak.js +1 -0
- package/dist/prosemirror/commands/sectionBreak.mjs +1 -0
- package/dist/prosemirror/commentIdAllocator.d.mts +2 -2
- package/dist/prosemirror/commentIdAllocator.d.ts +2 -2
- package/dist/prosemirror/commentOps.d.mts +2 -2
- package/dist/prosemirror/commentOps.d.ts +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +2 -2
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/index.d.mts +4 -4
- package/dist/prosemirror/index.d.ts +4 -4
- package/dist/prosemirror/index.js +2 -2
- package/dist/prosemirror/index.mjs +2 -2
- package/dist/prosemirror/plugins/index.d.mts +2 -2
- package/dist/prosemirror/plugins/index.d.ts +2 -2
- package/dist/prosemirror/plugins/index.js +1 -1
- package/dist/prosemirror/plugins/index.mjs +1 -1
- package/dist/prosemirror/queries.d.mts +2 -2
- package/dist/prosemirror/queries.d.ts +2 -2
- package/dist/prosemirror/schema/index.d.mts +3 -3
- package/dist/prosemirror/schema/index.d.ts +3 -3
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +2 -2
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +2 -2
- package/dist/{sectionPropertiesSerializer-S8J1V9mb.d.ts → sectionPropertiesSerializer-BJSNK-Wl.d.ts} +1 -1
- package/dist/{sectionPropertiesSerializer-C8XCmzE4.d.mts → sectionPropertiesSerializer-DI3OIQ1j.d.mts} +1 -1
- package/dist/types/content.d.mts +2 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/content.js +1 -1
- package/dist/types/content.mjs +1 -1
- package/dist/types/document.d.mts +3 -3
- package/dist/types/document.d.ts +3 -3
- package/dist/types/document.js +1 -1
- package/dist/types/document.mjs +1 -1
- package/dist/utils/cardStyles.js +1 -1
- package/dist/utils/cardStyles.mjs +1 -1
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/comments.d.ts +2 -2
- package/dist/utils/index.d.mts +37 -4
- package/dist/utils/index.d.ts +37 -4
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/utils/stylePreview.d.mts +83 -0
- package/dist/utils/stylePreview.d.ts +83 -0
- package/dist/utils/stylePreview.js +1 -0
- package/dist/utils/stylePreview.mjs +1 -0
- package/dist/utils/units.d.mts +7 -1
- package/dist/utils/units.d.ts +7 -1
- package/dist/utils/units.js +1 -1
- package/dist/utils/units.mjs +1 -1
- package/dist/{variableDetector-CN9_pUR_.d.mts → variableDetector-7xBsshP0.d.mts} +1 -1
- package/dist/{variableDetector-o4Rb2Csy.d.ts → variableDetector-Bv5Tm0D-.d.ts} +1 -1
- package/dist/{watermark-DAcnAs_J.d.mts → watermark-D90356ZM.d.mts} +7 -1
- package/dist/{watermark-DAcnAs_J.d.ts → watermark-D90356ZM.d.ts} +7 -1
- package/package.json +17 -1
- package/dist/chunk-4Q2IP5FW.js +0 -1
- package/dist/chunk-4RQAAKQI.mjs +0 -1
- package/dist/chunk-5HA66FH4.mjs +0 -1
- package/dist/chunk-7OW3VCZE.mjs +0 -1
- package/dist/chunk-AA6D2C6R.js +0 -4
- package/dist/chunk-AMJNIGO2.mjs +0 -2
- package/dist/chunk-BHBOAP6Z.js +0 -3
- package/dist/chunk-BTSL4AYY.js +0 -1
- package/dist/chunk-C45EFOVP.js +0 -1
- package/dist/chunk-CUY2THAO.mjs +0 -1
- package/dist/chunk-DKKTY56Q.js +0 -1
- package/dist/chunk-DZ3FN3JI.js +0 -2
- package/dist/chunk-ENIWJBS7.mjs +0 -2
- package/dist/chunk-EZNVVB63.mjs +0 -1
- package/dist/chunk-GKAXYZCE.mjs +0 -1
- package/dist/chunk-IGYHDSM7.mjs +0 -1
- package/dist/chunk-L6ZRNW7Y.mjs +0 -1
- package/dist/chunk-LJ2TB6CY.js +0 -1
- package/dist/chunk-MOKKS75W.mjs +0 -3
- package/dist/chunk-ND33YQGU.js +0 -1
- package/dist/chunk-QXSDGNJ4.js +0 -1
- package/dist/chunk-RT52EYG3.mjs +0 -4
- package/dist/chunk-SHYNWAW6.mjs +0 -1
- package/dist/chunk-SNTAAXXA.mjs +0 -1
- package/dist/chunk-TAQTZAVZ.js +0 -1
- package/dist/chunk-UKMKGIME.js +0 -1
- package/dist/chunk-UXPY65AC.js +0 -1
- package/dist/chunk-VOCHZNOF.mjs +0 -1
- package/dist/chunk-VW22RZ6C.mjs +0 -1
- package/dist/chunk-WQRWRWSK.js +0 -1
- package/dist/chunk-YHXVNJK5.mjs +0 -1
- package/dist/chunk-ZETEPB7I.js +0 -1
- package/dist/executor-DZAMMQ35.js +0 -1
- package/dist/executor-ZCJRLT3Z.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkNKIDBERV_js=require('./chunk-NKIDBERV.js'),chunkXCTYXYEU_js=require('./chunk-XCTYXYEU.js'),chunkDKUHG27E_js=require('./chunk-DKUHG27E.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function be(e,n){let i=e.floating;if(!i)return false;let r=chunkXCTYXYEU_js.f(e,n),t=0;i.tblpX!==void 0?t=i.tblpX:i.tblpXSpec?i.tblpXSpec==="left"||i.tblpXSpec==="inside"?t=0:i.tblpXSpec==="right"||i.tblpXSpec==="outside"?t=n-r:i.tblpXSpec==="center"&&(t=(n-r)/2):e.justification==="center"?t=(n-r)/2:e.justification==="right"&&(t=n-r);let o=i.leftFromText??0,l=i.rightFromText??0,a=t-o,s=n-(t+r)-l;return a<chunkXCTYXYEU_js.E&&s<chunkXCTYXYEU_js.E}function We(e,n,i){for(let r=0;r<e.length;r++){let t=e[r];t.kind==="table"&&t.floating&&be(t,n[r]??i)&&(e[r]={...t,floating:void 0});}}function ne(e,n){if(e.pages.length===0)return null;let i=e.pageGap??0,r=0,t=null,o=1/0;for(let l=0;l<e.pages.length;l++){let a=e.pages[l],s=a.size?.h??e.pageSize.h,f=r,u=f+s;if(n.y>=f&&n.y<u)return {pageIndex:l,page:a,pageY:n.y-f};let c=f+s/2,g=Math.abs(n.y-c);g<o&&(o=g,t=l),r=u+i;}if(t!==null){let l=e.pages[t],a=A(e,t);return {pageIndex:t,page:l,pageY:Math.max(0,Math.min(n.y-a,l.size?.h??e.pageSize.h))}}return null}function A(e,n){let i=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let l=e.pages[t].size?.h??e.pageSize.h;r+=l+i;}return r}function Ge(e,n){return ne(e,{y:n})?.pageIndex??null}function oe(e,n){return e.findIndex(i=>i.id===n)}function Ve(e,n){let i=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)i+=n.lines[r].lineHeight;return i}function xe(e,n,i,r){let t=[...e.page.fragments].sort((o,l)=>{let a=o.y-l.y;return Math.abs(a)>.5?a:o.x-l.x});for(let o of t){let l=oe(n,o.blockId);if(l===-1)continue;let a=n[l],s=i[l];if(!a||!s)continue;let f;if(o.kind==="paragraph"){if(a.kind!=="paragraph"||s.kind!=="paragraph")continue;f=Ve(o,s);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:a,measure:s,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function Ue(e,n,i,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=oe(n,t.blockId);if(o===-1)continue;let l=n[o],a=i[o];if(!l||!a)continue;let s=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(s&&f)return {fragment:t,block:l,measure:a,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function Te(e,n,i,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,l=r.x>=o.x&&r.x<=o.x+o.width,a=r.y>=o.y&&r.y<=o.y+o.height;if(!l||!a)continue;let s=oe(n,o.blockId);if(s===-1)continue;let f=n[s],u=i[s];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,g=u,h=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,m=d>0&&o.continuesFromPrev?chunkXCTYXYEU_js.Y(g,d):0,p=0,b=-1;if(g.rows.length===0||c.rows.length===0)continue;if(m>0&&x<m){let F=0;for(let w=0;w<d&&w<g.rows.length;w++){let L=g.rows[w];if(x>=F&&x<F+L.height){b=w;break}F+=L.height;}b===-1&&(b=0);}else {let F=x-m;for(let w=o.fromRow;w<o.toRow&&w<g.rows.length;w++){let L=g.rows[w];if(F>=p&&F<p+L.height){b=w;break}p+=L.height;}}if(b===-1&&(b=Math.min(o.toRow-1,g.rows.length-1),b<o.fromRow))continue;let k=g.rows[b],H=c.rows[b];if(!k||!H)continue;let M=0,T=-1;if(k.cells.length===0||H.cells.length===0)continue;for(let F=0;F<k.cells.length;F++){let w=k.cells[F];if(h>=M&&h<M+w.width){T=F;break}M+=w.width;}if(T===-1&&(T=k.cells.length-1,T<0))continue;let P=k.cells[T],S=H.cells[T];if(!P||!S)continue;let y=0;if(m>0&&b<d)for(let F=0;F<b;F++)y+=g.rows[F]?.height??0;else {y=m;for(let F=o.fromRow;F<b;F++)y+=g.rows[F]?.height??0;}let R=0;for(let F=0;F<T;F++)R+=k.cells[F]?.width??0;let X,I;if(S.blocks&&S.blocks.length>0){let F=S.blocks[0],w=P.blocks[0];F.kind==="paragraph"&&w?.kind==="paragraph"&&(X=F,I=w);}let E=h-R,C=x-y;return {fragment:o,block:c,measure:g,pageIndex:e.pageIndex,rowIndex:b,colIndex:T,cellBlock:X,cellMeasure:I,cellLocalX:Math.max(0,E),cellLocalY:Math.max(0,C)}}return null}function $e(e,n,i,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=ne(e,r),!t.pageHit)return t;let o=A(e,t.pageHit.pageIndex),l={x:r.x,y:r.y-o};return t.fragmentHit=xe(t.pageHit,n,i,l),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=Te(t.pageHit,n,i,l)),t}function qe(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,i=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];i+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(i+=n);}return i}function je(e,n){return A(e,n)}function Je(e,n){if(n<0||n>=e.pages.length)return null;let i=A(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:i,bottom:i+t}}function re(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ke(e,n){let i=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){i.push(t);continue}if(t.kind==="text"){let o=t.text??"",l=r===n.fromRun,a=r===n.toRun;if(l||a){let s=l?n.fromChar:0,f=a?n.toChar:o.length,u=o.slice(s,f);u.length>0&&i.push({...t,text:u});}else i.push(t);}}}return i}function Fe(e,n){let i,r,t=e.pmStart??0,o=0;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let a=e.runs[l];a&&(l<n.fromRun?a.kind==="text"?o+=(a.text??"").length:(a.kind==="tab"||a.kind==="lineBreak"||a.kind==="image")&&(o+=1):l===n.fromRun&&(o+=n.fromChar,i=t+o,a.kind==="text"&&(o=n.fromChar)));}if(i!==void 0){let l=0;for(let a=n.fromRun;a<=n.toRun&&a<e.runs.length;a++){let s=e.runs[a];if(s)if(s.kind==="text"){let f=s.text??"",u=a===n.fromRun?n.fromChar:0,c=a===n.toRun?n.toChar:f.length;l+=c-u;}else (s.kind==="tab"||s.kind==="lineBreak"||s.kind==="image")&&(l+=1);}r=i+l;}return {pmStart:i,pmEnd:r}}function Ke(e,n,i,r){let t=0;for(let o=i;o<r&&o<e.lines.length;o++){let a=e.lines[o].lineHeight;if(n>=t&&n<t+a)return o;t+=a;}return r>i?Math.min(r-1,e.lines.length-1):null}function Qe(e,n,i,r){let{pmStart:t,pmEnd:o}=Fe(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let l=e.attrs?.alignment??"left",a=0;l==="center"?a=Math.max(0,(r-n.width)/2):l==="right"&&(a=Math.max(0,r-n.width));let s=Math.max(0,i-a);if(s<=0)return {charOffset:0,pmPosition:t};let f=ke(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let h of f){if(h.kind==="tab"){let x=h.width??48,d=u+x;if(s<=d){let m=u+x/2;return s<m?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(h.kind==="image"){let x=h.width,d=u+x;if(s<=d){let m=u+x/2;return s<m?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(h.kind==="lineBreak"){if(s>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(h.kind==="text"){let x=h.text??"";if(x.length===0)continue;let d=re(h),m=chunkXCTYXYEU_js.m(x,d),p=u+m.width;if(s<=p){let b=s-u,k=chunkXCTYXYEU_js.n(b,m.charWidths),H=c+k;return {charOffset:H,pmPosition:t+H}}u=p,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function ie(e){let{fragment:n,block:i,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||i.kind!=="paragraph"||r.kind!=="paragraph")return null;let l=n,a=i,s=r,f=Ke(s,o,l.fromLine,l.toLine);if(f===null)return null;let u=s.lines[f];if(!u)return null;let c=0;for(let k=l.fromLine;k<f;k++)c+=s.lines[k]?.lineHeight??0;let g=a.attrs?.indent,h=g?.left??0,x=g?.right??0,d=Math.max(0,n.width-h-x),m=t-h,{charOffset:p,pmPosition:b}=Qe(a,u,m,d);return {pmPosition:b,charOffset:p,lineIndex:f}}function Me(e){let{cellBlock:n,cellMeasure:i,cellLocalX:r,cellLocalY:t}=e;if(!n||!i)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:i.lines.reduce((a,s)=>Math.max(a,s.width),100),fromLine:0,toLine:i.lines.length,height:i.totalHeight},block:n,measure:i,pageIndex:e.pageIndex,localX:r,localY:t};return ie(o)?.pmPosition??null}function Ze(e,n){if(n)return Me(n);if(!e)return null;let{fragment:i}=e;return i.kind==="paragraph"?ie(e)?.pmPosition??null:i.kind==="image"?i.pmStart??null:null}function ye(e,n,i,r){let t=e.pmStart??0,o=e.pmEnd??t;if(i<t||i>o)return null;let l=i-t;for(let a=0;a<n.lines.length;a++){let s=n.lines[a],{pmStart:f,pmEnd:u}=Fe(e,s);if(f===void 0||u===void 0)continue;let c=f-t,g=u-t;if(l>=c&&l<=g){let h=l-c,x=ke(e,s),d=0,m=0;for(let p of x)if(p.kind==="tab"){if(h<=m+1)return h<=m?{x:d,lineIndex:a}:{x:d+(p.width??48),lineIndex:a};d+=p.width??48,m+=1;}else if(p.kind==="image"){if(h<=m+1)return h<=m?{x:d,lineIndex:a}:{x:d+p.width,lineIndex:a};d+=p.width,m+=1;}else if(p.kind==="lineBreak"){if(h<=m)return {x:d,lineIndex:a};m+=1;}else if(p.kind==="text"){let b=p.text??"";if(h<=m+b.length){let M=h-m,T=re(p),P=chunkXCTYXYEU_js.m(b.slice(0,M),T);return {x:d+P.width,lineIndex:a}}let k=re(p),H=chunkXCTYXYEU_js.m(b,k);d+=H.width,m+=b.length;}return {x:d,lineIndex:a}}}return null}function et(e,n,i,r,t,o,l){let a=ye(e,n,i);if(!a)return null;let s=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,g=Math.max(0,o-u-c),h=n.lines[a.lineIndex];if(!h)return null;let x=0;s==="center"?x=Math.max(0,(g-h.width)/2):s==="right"&&(x=Math.max(0,g-h.width));let d=0;for(let m=l;m<a.lineIndex;m++)d+=n.lines[m]?.lineHeight??0;return {x:r+u+x+a.x,y:t+d,height:h.lineHeight}}function tt(e,n,i={}){let r=i.scope??"body",t=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${t} .layout-table-cell`,l=e.querySelectorAll(`.${t} .layout-table-cell-selected`);for(let c of Array.from(l))c.classList.remove("layout-table-cell-selected");let a=n.selection;if(!("$anchorCell"in a&&typeof a.forEachCell=="function")||!a.forEachCell)return;let f=[];a.forEachCell((c,g)=>{f.push([g,g+c.nodeSize]);});let u=e.querySelectorAll(o);for(let c of Array.from(u)){let g=c,h=g.dataset.pmStart;if(h===void 0)continue;let x=Number(h);for(let[d,m]of f)if(x>=d&&x<m){g.classList.add("layout-table-cell-selected");break}}}function He(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ae(e,n){return e.findIndex(i=>i.id===n)}function V(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let f=e.runs[s];if(f){if(s<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(s===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let l=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let f=e.runs[s];if(f)if(f.kind==="text"){let u=f.text??"",c=s===n.fromRun?n.fromChar:0,g=s===n.toRun?n.toChar:u.length;l+=g-c;}else l+=1;}let a=o+l;return {pmStart:o,pmEnd:a}}function we(e,n,i,r){let t=[];for(let o=0;o<n.lines.length;o++){let l=n.lines[o],a=V(e,l);a.pmStart===void 0||a.pmEnd===void 0||a.pmEnd>i&&a.pmStart<r&&t.push({line:l,index:o});}return t}function W(e,n,i){let r=V(e,n);return r.pmStart===void 0?0:Math.max(0,i-r.pmStart)}function G(e,n,i,r){let t=0,o=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let a=e.runs[l];if(a){if(a.kind==="tab"){let s=a.width??48;if(o+1>=i)return i<=o?t:t+s;t+=s,o+=1;continue}if(a.kind==="image"){let s=a.width;if(o+1>=i)return i<=o?t:t+s;t+=s,o+=1;continue}if(a.kind==="lineBreak"){if(i<=o)return t;o+=1;continue}if(a.kind==="text"){let s=a.text??"",f=l===n.fromRun,u=l===n.toRun,c=f?n.fromChar:0,g=u?n.toChar:s.length,h=s.slice(c,g);if(o+h.length>=i){let m=i-o,p=He(a),b=chunkXCTYXYEU_js.m(h.slice(0,m),p);return t+b.width}let x=He(a),d=chunkXCTYXYEU_js.m(h,x);t+=d.width,o+=h.length;}}}return t}function J(e,n){let i=0;for(let r=0;r<n&&r<e.lines.length;r++)i+=e.lines[r].lineHeight;return i}function nt(e,n,i,r,t){if(r===t)return [];let o=Math.min(r,t),l=Math.max(r,t),a=[];for(let s=0;s<e.pages.length;s++){let f=e.pages[s],u=A(e,s);for(let c of f.fragments){if(c.kind==="paragraph"){let g=ae(n,c.blockId);if(g===-1)continue;let h=n[g],x=i[g];if(!h||h.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=h,m=x,p=c,b=we(d,m,o,l);for(let{line:k,index:H}of b){if(H<p.fromLine||H>=p.toLine)continue;let M=V(d,k);if(M.pmStart===void 0||M.pmEnd===void 0)continue;let T=Math.max(M.pmStart,o),P=Math.min(M.pmEnd,l);if(T>=P)continue;let S=W(d,k,T),y=W(d,k,P),B=d.attrs?.indent,R=B?.left??0,X=B?.right??0,I=Math.max(0,c.width-R-X),E=G(d,k,S),C=G(d,k,y),F=d.attrs?.alignment??"left",w=0;F==="center"?w=Math.max(0,(I-k.width)/2):F==="right"&&(w=Math.max(0,I-k.width));let L=J(m,H)-J(m,p.fromLine),D=c.x+R+w+Math.min(E,C),Y=Math.max(1,Math.abs(C-E)),z=c.y+L;a.push({x:D,y:z+u,width:Y,height:k.lineHeight,pageIndex:s});}}if(c.kind==="table"){let g=ae(n,c.blockId);if(g===-1)continue;let h=n[g],x=i[g];if(!h||h.kind!=="table"||!x||x.kind!=="table")continue;let d=h,m=x,p=c,b=[],k=0;for(let y=0;y<m.rows.length;y++)b.push(Math.round(k)),k+=m.rows[y]?.height??0;b.push(Math.round(k));let H=p.headerRowCount??0,M=H>0&&p.continuesFromPrev?chunkXCTYXYEU_js.Y(m,H):0,T=(b[p.fromRow]??0)+(p.topClip??0),P=p.bottomClip!==void 0?Math.round(p.height):M+((b[p.toRow]??0)-T),S=y=>M+(y-T);for(let y=p.fromRow;y<p.toRow&&y<d.rows.length;y++){let B=d.rows[y],R=m.rows[y];if(!B||!R)continue;let X=b[y]??0,I=0;for(let E=0;E<B.cells.length;E++){let C=B.cells[E],F=R.cells[E];if(!C||!F)continue;let w=C.padding?.top??0,L=chunkXCTYXYEU_js.O(C.blocks,F.blocks,w);for(let D=0;D<C.blocks.length;D++){let Y=C.blocks[D],z=F.blocks[D];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let O=Y,_e=z,Xe=L.lineTops[D]??[],Oe=we(O,_e,o,l);for(let{line:v,index:Ne}of Oe){let q=V(O,v);if(q.pmStart===void 0||q.pmEnd===void 0)continue;let se=Math.max(q.pmStart,o),ce=Math.min(q.pmEnd,l);if(se>=ce)continue;let Q=S(X+(Xe[Ne]??0));if(Q+v.lineHeight<=M||Q>=P)continue;let Ye=W(O,v,se),ze=W(O,v,ce),ue=G(O,v,Ye,F.width),fe=G(O,v,ze,F.width);a.push({x:p.x+I+Math.min(ue,fe),y:p.y+Q+u,width:Math.max(1,Math.abs(fe-ue)),height:v.lineHeight,pageIndex:s});}}I+=F.width;}}}if(c.kind==="image"){let g=c.pmStart??0;(c.pmEnd??g+1)>o&&g<l&&a.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:s});}}}return a}function ot(e,n,i,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],l=A(e,t);for(let a of o.fragments){if(a.kind==="paragraph"){let s=ae(n,a.blockId);if(s===-1)continue;let f=n[s],u=i[s];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,g=u,h=a,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let m=h.fromLine;m<h.toLine;m++){let p=g.lines[m];if(!p)continue;let b=V(c,p);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let k=W(c,p,r),H=c.attrs?.indent,M=H?.left??0,T=H?.right??0,P=Math.max(0,a.width-M-T),S=G(c,p,k),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(P-p.width)/2):y==="right"&&(B=Math.max(0,P-p.width));let R=J(g,m)-J(g,h.fromLine);return {x:a.x+M+B+S,y:a.y+R+l,height:p.lineHeight,pageIndex:t}}}}if(a.kind==="image"){let s=a.pmStart??0,f=a.pmEnd??s+1;if(r>=s&&r<=f){let u=r===s?0:a.width;return {x:a.x+u,y:a.y+l,height:a.height,pageIndex:t}}}}}return null}function rt(e){return e.length<=1?false:new Set(e.map(i=>i.pageIndex)).size>1}function it(e){let n=new Map;for(let i of e){let r=n.get(i.pageIndex)??[];r.push(i),n.set(i.pageIndex,r);}return n}function at(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function Pe(e){return Se(e)}function Se(e){let n=new Set;for(let i=1;i<e.length;i++){let r=e[i-1],t=e[i];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||at(t)||n.add(i));}return e.map((i,r)=>{if(i.kind==="table")return lt(i);if(i.kind!=="paragraph")return i;let t=n.has(r),o=i.attrs?.spacingExplicit,l=i.attrs?.spacing?.before!=null,a=i.attrs?.spacing?.after!=null,s=l&&!o?.before,f=a&&!o?.after,u=s||f;if(!u&&!t)return i;let c=i.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...i,attrs:c}})}function lt(e){let n=false,i=e.rows.map(r=>{let t=false,o=r.cells.map(l=>{let a=Se(l.blocks);return a.some((f,u)=>f!==l.blocks[u])?(t=true,{...l,blocks:a}):l});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:i}:e}function st(e){return e?.align??e?.alignment}function Be(e,n,i,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-i,o=e.position?.vertical;if(!o)return n;let l=st(o),a=o.posOffset!==void 0?chunkBJSG6TEG_js.f(o.posOffset):void 0;if(o.relativeTo==="page"){if(a!==void 0)return a-t;if(l==="top")return -t;if(l==="bottom")return r.pageSize.h-e.height-t;if(l==="center")return (r.pageSize.h-e.height)/2-t}if(o.relativeTo==="margin"){let s=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(a!==void 0)return s+a-t;if(l==="top")return s-t;if(l==="bottom")return s+f-e.height-t;if(l==="center")return s+(f-e.height)/2-t}return a!==void 0?n+a:n}function Re(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function ct(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="textBox"?e.height:0:0}function Ie(e,n,i,r){let t=0,o=0,l=0;for(let a=0;a<e.length;a++){let s=e[a],f=n[a];if(!(!s||!f)){if(s.kind==="paragraph"&&f.kind==="paragraph"){let u=l,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let g of s.runs){if(g.kind!=="image"||!g.position)continue;let h=Be(g,u,i,r);t=Math.min(t,h),o=Math.max(o,h+g.height);}l=c;}else if(s.kind==="table"&&f.kind==="table"){let u=l+f.totalHeight;t=Math.min(t,l),o=Math.max(o,u),l=u;}else if(s.kind==="image"&&f.kind==="image"){let u=l+f.height;t=Math.min(t,l),o=Math.max(o,u),l=u;}else if(s.kind==="textBox"&&f.kind==="textBox"){let u=l+f.height;t=Math.min(t,l),o=Math.max(o,u),s.displayMode!=="float"&&(l=u);}}}return {visualTop:t,visualBottom:o}}function ut(e,n,i,r){if(!e||!e.content||e.content.length===0)return;let t=chunkDKUHG27E_js.b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Ce(t,n,i,r)}function Ce(e,n,i,r){let t=chunkNKIDBERV_js.c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=Pe(t),l=r.measureBlocks(o,n),a=0,s=0;for(let c=0;c<o.length;c++){let g=ct(l[c]);a+=g,Re(o[c])&&(s+=g);}let{visualTop:f,visualBottom:u}=Ie(o,l,a,i);return {blocks:o,measures:l,height:a,flowHeight:s,visualTop:f,visualBottom:u}}var K={header:null,footer:null};function ft(){K.header=null,K.footer=null;}function Ee(e,n){let i=n.querySelectorAll(`.layout-page-${e}`);if(i.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=i[0],l=1/0;for(let c of Array.from(i)){let g=c.getBoundingClientRect(),h=Math.abs((g.top+g.bottom)/2-t);h<l&&(l=h,o=c);}let a=K[e];if(a&&a.host===o&&a.host.isConnected)return a;let s=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:s,ranged:f};return K[e]=u,u}function dt(e,n,i=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=Ee(n,i);if(!o)return null;let{host:l,spans:a}=o;for(let d of a){let m=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!(!Number.isFinite(m)||!Number.isFinite(p))&&t>=m&&t<=p){let b=l.ownerDocument.createRange(),k=l.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),H=t-m,M=k.nextNode();for(;M;){let S=M.data.length;if(H<=S){try{b.setStart(M,H),b.setEnd(M,H);let y=b.getClientRects()[0]??b.getBoundingClientRect();if(y&&y.height>0)return {top:y.top,left:y.left,height:y.height}}catch{}break}H-=S,M=k.nextNode();}let T=d.getBoundingClientRect(),P=(t-m)/Math.max(1,p-m);return {top:T.top,left:T.left+T.width*P,height:T.height}}}let s=l.querySelector(`[data-pm-start="${t}"]`);if(s){let d=s.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let m=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!Number.isFinite(m)||!Number.isFinite(p)||t<m||t>p)continue;let b=p-m;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),m=Number(u.dataset.pmEnd),p=t>=m;return {top:d.top,left:p?d.right:d.left+1,height:d.height||16}}let g=null,h=-1/0;for(let d of f){let m=Number(d.dataset.pmStart);Number.isFinite(m)&&(m>t||m>h&&(h=m,g=d));}if(g){let d=g.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=l.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function mt(e,n,i=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,l=[],a=Ee(n,i);if(!a)return l;let{host:s,spans:f}=a;for(let u of f){let c=Number(u.dataset.pmStart),g=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(g)||g<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let p=u.getBoundingClientRect();l.push({top:p.top,left:p.left,width:p.width,height:p.height});continue}let h=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?h=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(h=u.firstChild.firstChild),!h)continue;let x=Math.max(0,t-c),d=Math.min(h.length,o-c);if(x>=d)continue;let m=s.ownerDocument.createRange();m.setStart(h,x),m.setEnd(h,d);for(let p of Array.from(m.getClientRects()))l.push({top:p.top,left:p.left,width:p.width,height:p.height});}return l}function Le(e){return e?e.flowHeight??e.height:0}function gt(e){let{pageSize:n,margins:i,finalMargins:r,bodyBlocks:t,headers:o,footers:l,warn:a}=e,s=i.header??48,f=i.footer??48,u=i.top-s,c=i.bottom-f,g=Math.max(0,...(o??[]).map(Le)),h=Math.max(0,...(l??[]).map(Le)),x=g>u,d=h>c;if(!x&&!d)return {margins:i,finalMargins:r};let m=Math.max(0,n.h-24),p=false,b=M=>{let T={...M};return x&&(T.top=Math.max(M.top,s+g)),d&&(T.bottom=Math.max(M.bottom,f+h)),T.top+T.bottom>m&&(p=true,T.bottom=Math.max(0,Math.min(T.bottom,m-T.top)),T.top+T.bottom>m&&(T.top=Math.max(0,m-T.bottom))),T},k=b(i),H=b(r);if(t)for(let M of t){if(M.kind!=="sectionBreak")continue;let T=M;T.margins&&(T.margins=b(T.margins));}return p&&a&&a(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(n.h)} headerBand=${Math.round(g)} footerBand=${Math.round(h)} top=${Math.round(k.top)} bottom=${Math.round(k.bottom)}`),{margins:k,finalMargins:H}}var Ae=816,De=1056,U=96,le=48;function $(e){return Math.round(e/1440*96)}function N(e,n){return e!=null?$(e):n}function ht(e){return {w:e?.pageWidth?$(e.pageWidth):Ae,h:e?.pageHeight?$(e.pageHeight):De}}function pt(e){return {top:N(e?.marginTop,U),right:N(e?.marginRight,U),bottom:N(e?.marginBottom,U),left:N(e?.marginLeft,U),header:N(e?.headerDistance,le),footer:N(e?.footerDistance,le)}}function bt(e,n){let i={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return i;let r=e.package.headers,t=e.package.footers,o=null,l=null,a=null,s=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(a=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(l=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(s=t.get(u.rId)??null);}return n?.titlePg||(!o&&a&&(o=a),!l&&s&&(l=s)),{header:o,footer:l,firstHeader:a,firstFooter:s}}function xt(e){let n=e?.columnCount??1;if(n<=1)return;let i=$(e?.columnSpace??720);return {count:n,gap:i,equalWidth:e?.equalWidth??true,separator:e?.separator}}function ve(e){let n=e.pageSize.w-e.margins.left-e.margins.right,i=e.columns;return !i||i.count<=1?n:Math.floor((n-(i.count-1)*i.gap)/i.count)}function Tt(e,n,i){let{configs:r,breakIndices:t}=chunkXCTYXYEU_js.W(e,n,i),o=0,l=[];for(let a=0;a<e.length;a++)l.push(ve(r[o]??n)),o<t.length&&a===t[o]&&o++;return l}exports.A=ut;exports.B=Ce;exports.C=ft;exports.D=dt;exports.E=mt;exports.F=gt;exports.G=Ae;exports.H=De;exports.I=U;exports.J=le;exports.K=$;exports.L=ht;exports.M=pt;exports.N=bt;exports.O=xt;exports.P=ve;exports.Q=Tt;exports.a=be;exports.b=We;exports.c=ne;exports.d=A;exports.e=Ge;exports.f=xe;exports.g=Ue;exports.h=Te;exports.i=$e;exports.j=qe;exports.k=je;exports.l=Je;exports.m=ie;exports.n=Me;exports.o=Ze;exports.p=ye;exports.q=et;exports.r=tt;exports.s=nt;exports.t=ot;exports.u=rt;exports.v=it;exports.w=Pe;exports.x=Be;exports.y=Re;exports.z=Ie;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkAA6D2C6R_js=require('./chunk-AA6D2C6R.js'),chunkFIGLFSNR_js=require('./chunk-FIGLFSNR.js'),chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js'),He=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var He__default=/*#__PURE__*/_interopDefault(He);async function G(t){let n=await He__default.default.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:t};for(let[o,i]of Object.entries(n.files)){if(i.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await i.async("text");if(e.allXml.set(o,a),r==="word/document.xml")e.documentXml=a;else if(r==="word/styles.xml")e.stylesXml=a;else if(r==="word/theme/theme1.xml")e.themeXml=a;else if(r==="word/numbering.xml")e.numberingXml=a;else if(r==="word/fonttable.xml")e.fontTableXml=a;else if(r==="word/settings.xml")e.settingsXml=a;else if(r==="word/websettings.xml")e.webSettingsXml=a;else if(r==="word/footnotes.xml")e.footnotesXml=a;else if(r==="word/endnotes.xml")e.endnotesXml=a;else if(r==="word/comments.xml")e.commentsXml=a;else if(r==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")e.documentRels=a;else if(r==="_rels/.rels")e.packageRels=a;else if(r==="[content_types].xml")e.contentTypesXml=a;else if(r==="docprops/core.xml")e.corePropsXml=a;else if(r==="docprops/app.xml")e.appPropsXml=a;else if(r==="docprops/custom.xml")e.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;e.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;e.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await i.async("arraybuffer");e.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await i.async("arraybuffer");e.fonts.set(o,a);}}return e}function Me(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(t,n,e,o){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=true),n&&(i.themeColor=n),e&&(i.themeTint=e),o&&(i.themeShade=o),i}function W(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","color");e&&e!=="auto"&&(n.color={rgb:e});let o=chunk3R7QHNI5_js.j(t,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let i=chunk3R7QHNI5_js.j(t,"w","themeFill");i&&(n.fill=n.fill||{},n.fill.themeColor=i);let r=chunk3R7QHNI5_js.j(t,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=chunk3R7QHNI5_js.j(t,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=chunk3R7QHNI5_js.j(t,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function $(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","b");o&&(e.bold=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","bCs");i&&(e.boldCs=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","i");r&&(e.italic=chunk3R7QHNI5_js.m(r));let a=chunk3R7QHNI5_js.e(t,"w","iCs");a&&(e.italicCs=chunk3R7QHNI5_js.m(a));let c=chunk3R7QHNI5_js.e(t,"w","u");if(c){let m=chunk3R7QHNI5_js.j(c,"w","val");if(m){e.underline={style:m};let P=chunk3R7QHNI5_js.j(c,"w","color"),I=chunk3R7QHNI5_js.j(c,"w","themeColor");(P||I)&&(e.underline.color=Y(P,I,chunk3R7QHNI5_js.j(c,"w","themeTint"),chunk3R7QHNI5_js.j(c,"w","themeShade")));}}let g=chunk3R7QHNI5_js.e(t,"w","strike");g&&(e.strike=chunk3R7QHNI5_js.m(g));let d=chunk3R7QHNI5_js.e(t,"w","dstrike");d&&(e.doubleStrike=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","vertAlign");if(h){let m=chunk3R7QHNI5_js.j(h,"w","val");(m==="superscript"||m==="subscript"||m==="baseline")&&(e.vertAlign=m);}let b=chunk3R7QHNI5_js.e(t,"w","smallCaps");b&&(e.smallCaps=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","caps");u&&(e.allCaps=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","vanish");S&&(e.hidden=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","color");f&&(e.color=Y(chunk3R7QHNI5_js.j(f,"w","val"),chunk3R7QHNI5_js.j(f,"w","themeColor"),chunk3R7QHNI5_js.j(f,"w","themeTint"),chunk3R7QHNI5_js.j(f,"w","themeShade")));let y=chunk3R7QHNI5_js.e(t,"w","highlight");if(y){let m=chunk3R7QHNI5_js.j(y,"w","val");m&&(e.highlight=m);}let C=chunk3R7QHNI5_js.e(t,"w","shd");C&&(e.shading=W(C));let D=chunk3R7QHNI5_js.e(t,"w","sz");if(D){let m=chunk3R7QHNI5_js.l(D,"w","val");m!==void 0&&(e.fontSize=m);}let B=chunk3R7QHNI5_js.e(t,"w","szCs");if(B){let m=chunk3R7QHNI5_js.l(B,"w","val");m!==void 0&&(e.fontSizeCs=m);}let v=chunk3R7QHNI5_js.e(t,"w","rFonts");if(v){e.fontFamily={ascii:chunk3R7QHNI5_js.j(v,"w","ascii")??void 0,hAnsi:chunk3R7QHNI5_js.j(v,"w","hAnsi")??void 0,eastAsia:chunk3R7QHNI5_js.j(v,"w","eastAsia")??void 0,cs:chunk3R7QHNI5_js.j(v,"w","cs")??void 0};let m=chunk3R7QHNI5_js.j(v,"w","asciiTheme");m&&(e.fontFamily.asciiTheme=m,n&&!e.fontFamily.ascii&&(e.fontFamily.ascii=chunkAA6D2C6R_js.b(n,m)));let P=chunk3R7QHNI5_js.j(v,"w","hAnsiTheme");P&&(e.fontFamily.hAnsiTheme=P,n&&!e.fontFamily.hAnsi&&(e.fontFamily.hAnsi=chunkAA6D2C6R_js.b(n,P)));let I=chunk3R7QHNI5_js.j(v,"w","eastAsiaTheme");I&&(e.fontFamily.eastAsiaTheme=I,n&&!e.fontFamily.eastAsia&&(e.fontFamily.eastAsia=chunkAA6D2C6R_js.b(n,I)));let U=chunk3R7QHNI5_js.j(v,"w","cstheme");U&&(e.fontFamily.csTheme=U,n&&!e.fontFamily.cs&&(e.fontFamily.cs=chunkAA6D2C6R_js.b(n,U)));}let X=chunk3R7QHNI5_js.e(t,"w","spacing");if(X){let m=chunk3R7QHNI5_js.l(X,"w","val");m!==void 0&&(e.spacing=m);}let p=chunk3R7QHNI5_js.e(t,"w","position");if(p){let m=chunk3R7QHNI5_js.l(p,"w","val");m!==void 0&&(e.position=m);}let x=chunk3R7QHNI5_js.e(t,"w","w");if(x){let m=chunk3R7QHNI5_js.l(x,"w","val");m!==void 0&&(e.scale=m);}let F=chunk3R7QHNI5_js.e(t,"w","kern");if(F){let m=chunk3R7QHNI5_js.l(F,"w","val");m!==void 0&&(e.kerning=m);}let A=chunk3R7QHNI5_js.e(t,"w","effect");if(A){let m=chunk3R7QHNI5_js.j(A,"w","val");m&&(e.effect=m);}let k=chunk3R7QHNI5_js.e(t,"w","em");if(k){let m=chunk3R7QHNI5_js.j(k,"w","val");m&&(e.emphasisMark=m);}let M=chunk3R7QHNI5_js.e(t,"w","emboss");M&&(e.emboss=chunk3R7QHNI5_js.m(M));let R=chunk3R7QHNI5_js.e(t,"w","imprint");R&&(e.imprint=chunk3R7QHNI5_js.m(R));let V=chunk3R7QHNI5_js.e(t,"w","outline");V&&(e.outline=chunk3R7QHNI5_js.m(V));let L=chunk3R7QHNI5_js.e(t,"w","shadow");L&&(e.shadow=chunk3R7QHNI5_js.m(L));let N=chunk3R7QHNI5_js.e(t,"w","rtl");N&&(e.rtl=chunk3R7QHNI5_js.m(N));let H=chunk3R7QHNI5_js.e(t,"w","cs");H&&(e.cs=chunk3R7QHNI5_js.m(H));let _=chunk3R7QHNI5_js.e(t,"w","rStyle");if(_){let m=chunk3R7QHNI5_js.j(_,"w","val");m&&(e.styleId=m);}return Object.keys(e).length>0?e:void 0}function E(t){if(!t)return;let n=chunk3R7QHNI5_js.j(t,"w","val");if(!n)return;let e={style:n},o=chunk3R7QHNI5_js.j(t,"w","color"),i=chunk3R7QHNI5_js.j(t,"w","themeColor");(o||i)&&(e.color=Y(o,i,chunk3R7QHNI5_js.j(t,"w","themeTint"),chunk3R7QHNI5_js.j(t,"w","themeShade")));let r=chunk3R7QHNI5_js.l(t,"w","sz");r!==void 0&&(e.size=r);let a=chunk3R7QHNI5_js.l(t,"w","space");a!==void 0&&(e.space=a);let c=chunk3R7QHNI5_js.j(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let g=chunk3R7QHNI5_js.j(t,"w","frame");return g&&(e.frame=g==="1"||g==="true"),e}function je(t){if(!t)return;let n=chunk3R7QHNI5_js.f(t,"w","tab");if(n.length===0)return;let e=[];for(let o of n){let i=chunk3R7QHNI5_js.l(o,"w","pos"),r=chunk3R7QHNI5_js.j(o,"w","val");if(i!==void 0&&r){let a={position:i,alignment:r},c=chunk3R7QHNI5_js.j(o,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function K(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","jc");if(o){let p=chunk3R7QHNI5_js.j(o,"w","val");p&&(e.alignment=p);}let i=chunk3R7QHNI5_js.e(t,"w","bidi");i&&(e.bidi=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","spacing");if(r){let p=chunk3R7QHNI5_js.l(r,"w","before");p!==void 0&&(e.spaceBefore=p);let x=chunk3R7QHNI5_js.l(r,"w","after");x!==void 0&&(e.spaceAfter=x);let F=chunk3R7QHNI5_js.l(r,"w","line");F!==void 0&&(e.lineSpacing=F);let A=chunk3R7QHNI5_js.j(r,"w","lineRule");A&&(e.lineSpacingRule=A);let k=chunk3R7QHNI5_js.j(r,"w","beforeAutospacing");k&&(e.beforeAutospacing=k==="1"||k==="true");let M=chunk3R7QHNI5_js.j(r,"w","afterAutospacing");M&&(e.afterAutospacing=M==="1"||M==="true");}let a=chunk3R7QHNI5_js.e(t,"w","ind");if(a){let p=chunk3R7QHNI5_js.l(a,"w","left");p!==void 0&&(e.indentLeft=p);let x=chunk3R7QHNI5_js.l(a,"w","right");x!==void 0&&(e.indentRight=x);let F=chunk3R7QHNI5_js.l(a,"w","firstLine");F!==void 0&&(e.indentFirstLine=F);let A=chunk3R7QHNI5_js.l(a,"w","hanging");A!==void 0&&(e.indentFirstLine=-A,e.hangingIndent=true);}let c=chunk3R7QHNI5_js.e(t,"w","pBdr");if(c){let p={},x=E(chunk3R7QHNI5_js.e(c,"w","top"));x&&(p.top=x);let F=E(chunk3R7QHNI5_js.e(c,"w","bottom"));F&&(p.bottom=F);let A=E(chunk3R7QHNI5_js.e(c,"w","left"));A&&(p.left=A);let k=E(chunk3R7QHNI5_js.e(c,"w","right"));k&&(p.right=k);let M=E(chunk3R7QHNI5_js.e(c,"w","between"));M&&(p.between=M);let R=E(chunk3R7QHNI5_js.e(c,"w","bar"));R&&(p.bar=R),Object.keys(p).length>0&&(e.borders=p);}let g=chunk3R7QHNI5_js.e(t,"w","shd");g&&(e.shading=W(g));let d=chunk3R7QHNI5_js.e(t,"w","tabs");d&&(e.tabs=je(d));let h=chunk3R7QHNI5_js.e(t,"w","keepNext");h&&(e.keepNext=chunk3R7QHNI5_js.m(h));let b=chunk3R7QHNI5_js.e(t,"w","keepLines");b&&(e.keepLines=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","widowControl");u&&(e.widowControl=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","pageBreakBefore");S&&(e.pageBreakBefore=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","contextualSpacing");f&&(e.contextualSpacing=chunk3R7QHNI5_js.m(f));let y=chunk3R7QHNI5_js.e(t,"w","numPr");if(y){let p=chunk3R7QHNI5_js.e(y,"w","numId"),x=chunk3R7QHNI5_js.e(y,"w","ilvl");if(p||x){if(e.numPr={},p){let F=chunk3R7QHNI5_js.l(p,"w","val");F!==void 0&&(e.numPr.numId=F);}if(x){let F=chunk3R7QHNI5_js.l(x,"w","val");F!==void 0&&(e.numPr.ilvl=F);}}}let C=chunk3R7QHNI5_js.e(t,"w","outlineLvl");if(C){let p=chunk3R7QHNI5_js.l(C,"w","val");p!==void 0&&(e.outlineLevel=p);}let D=chunk3R7QHNI5_js.e(t,"w","pStyle");if(D){let p=chunk3R7QHNI5_js.j(D,"w","val");p&&(e.styleId=p);}let B=chunk3R7QHNI5_js.e(t,"w","suppressLineNumbers");B&&(e.suppressLineNumbers=chunk3R7QHNI5_js.m(B));let v=chunk3R7QHNI5_js.e(t,"w","suppressAutoHyphens");v&&(e.suppressAutoHyphens=chunk3R7QHNI5_js.m(v));let X=chunk3R7QHNI5_js.e(t,"w","rPr");return X&&(e.runProperties=$(X,n)),Object.keys(e).length>0?e:void 0}function j(t){if(!t)return;let n=chunk3R7QHNI5_js.l(t,"w","w"),e=chunk3R7QHNI5_js.j(t,"w","type");if(n!==void 0&&e)return {value:n,type:e}}function De(t){if(!t)return;let n={},e=E(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=E(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=E(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=E(chunk3R7QHNI5_js.e(t,"w","right"));r&&(n.right=r);let a=E(chunk3R7QHNI5_js.e(t,"w","insideH"));a&&(n.insideH=a);let c=E(chunk3R7QHNI5_js.e(t,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Ae(t){if(!t)return;let n={},e=j(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=j(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=j(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=j(chunk3R7QHNI5_js.e(t,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Le(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","val");if(e){let d=parseInt(e,16);isNaN(d)||(n.firstRow=(d&32)!==0,n.lastRow=(d&64)!==0,n.firstColumn=(d&128)!==0,n.lastColumn=(d&256)!==0,n.noHBand=(d&512)!==0,n.noVBand=(d&1024)!==0);}let o=chunk3R7QHNI5_js.j(t,"w","firstColumn");o&&(n.firstColumn=o==="1");let i=chunk3R7QHNI5_js.j(t,"w","firstRow");i&&(n.firstRow=i==="1");let r=chunk3R7QHNI5_js.j(t,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=chunk3R7QHNI5_js.j(t,"w","lastRow");a&&(n.lastRow=a==="1");let c=chunk3R7QHNI5_js.j(t,"w","noHBand");c&&(n.noHBand=c==="1");let g=chunk3R7QHNI5_js.j(t,"w","noVBand");return g&&(n.noVBand=g==="1"),Object.keys(n).length>0?n:void 0}function le(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tblW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","jc");if(i){let f=chunk3R7QHNI5_js.j(i,"w","val");(f==="left"||f==="center"||f==="right")&&(e.justification=f);}let r=chunk3R7QHNI5_js.e(t,"w","tblCellSpacing");r&&(e.cellSpacing=j(r));let a=chunk3R7QHNI5_js.e(t,"w","tblInd");a&&(e.indent=j(a));let c=chunk3R7QHNI5_js.e(t,"w","tblBorders");c&&(e.borders=De(c));let g=chunk3R7QHNI5_js.e(t,"w","tblCellMar");g&&(e.cellMargins=Ae(g));let d=chunk3R7QHNI5_js.e(t,"w","tblLayout");if(d){let f=chunk3R7QHNI5_js.j(d,"w","type");(f==="fixed"||f==="autofit")&&(e.layout=f);}let h=chunk3R7QHNI5_js.e(t,"w","tblStyle");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");f&&(e.styleId=f);}let b=chunk3R7QHNI5_js.e(t,"w","tblLook");b&&(e.look=Le(b));let u=chunk3R7QHNI5_js.e(t,"w","shd");u&&(e.shading=W(u));let S=chunk3R7QHNI5_js.e(t,"w","bidiVisual");return S&&(e.bidi=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function ce(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.e(t,"w","trHeight");if(e){n.height=j(e);let c=chunk3R7QHNI5_js.j(e,"w","hRule");c&&(n.heightRule=c);}let o=chunk3R7QHNI5_js.e(t,"w","tblHeader");o&&(n.header=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","cantSplit");i&&(n.cantSplit=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","jc");if(r){let c=chunk3R7QHNI5_js.j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=chunk3R7QHNI5_js.e(t,"w","hidden");return a&&(n.hidden=chunk3R7QHNI5_js.m(a)),Object.keys(n).length>0?n:void 0}function fe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tcW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","tcBorders");i&&(e.borders=De(i));let r=chunk3R7QHNI5_js.e(t,"w","tcMar");r&&(e.margins=Ae(r));let a=chunk3R7QHNI5_js.e(t,"w","shd");a&&(e.shading=W(a));let c=chunk3R7QHNI5_js.e(t,"w","vAlign");if(c){let f=chunk3R7QHNI5_js.j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(e.verticalAlign=f);}let g=chunk3R7QHNI5_js.e(t,"w","textDirection");if(g){let f=chunk3R7QHNI5_js.j(g,"w","val");f&&(e.textDirection=f);}let d=chunk3R7QHNI5_js.e(t,"w","gridSpan");if(d){let f=chunk3R7QHNI5_js.l(d,"w","val");f!==void 0&&(e.gridSpan=f);}let h=chunk3R7QHNI5_js.e(t,"w","vMerge");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");e.vMerge=f==="restart"?"restart":"continue";}let b=chunk3R7QHNI5_js.e(t,"w","tcFitText");b&&(e.fitText=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","noWrap");u&&(e.noWrap=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","hideMark");return S&&(e.hideMark=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function Ue(t,n){let e={styleId:chunk3R7QHNI5_js.j(t,"w","styleId")??"",type:chunk3R7QHNI5_js.j(t,"w","type")??"paragraph"},o=chunk3R7QHNI5_js.j(t,"w","default");o&&(e.default=o==="1"||o==="true");let i=chunk3R7QHNI5_js.e(t,"w","name");i&&(e.name=chunk3R7QHNI5_js.j(i,"w","val")??void 0);let r=chunk3R7QHNI5_js.e(t,"w","basedOn");r&&(e.basedOn=chunk3R7QHNI5_js.j(r,"w","val")??void 0);let a=chunk3R7QHNI5_js.e(t,"w","next");a&&(e.next=chunk3R7QHNI5_js.j(a,"w","val")??void 0);let c=chunk3R7QHNI5_js.e(t,"w","link");c&&(e.link=chunk3R7QHNI5_js.j(c,"w","val")??void 0);let g=chunk3R7QHNI5_js.e(t,"w","uiPriority");if(g){let X=chunk3R7QHNI5_js.l(g,"w","val");X!==void 0&&(e.uiPriority=X);}let d=chunk3R7QHNI5_js.e(t,"w","hidden");d&&(e.hidden=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","semiHidden");h&&(e.semiHidden=chunk3R7QHNI5_js.m(h));let b=chunk3R7QHNI5_js.e(t,"w","unhideWhenUsed");b&&(e.unhideWhenUsed=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","qFormat");u&&(e.qFormat=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","personal");S&&(e.personal=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","pPr");f&&(e.pPr=K(f,n));let y=chunk3R7QHNI5_js.e(t,"w","rPr");y&&(e.rPr=$(y,n));let C=chunk3R7QHNI5_js.e(t,"w","tblPr");C&&(e.tblPr=le(C));let D=chunk3R7QHNI5_js.e(t,"w","trPr");D&&(e.trPr=ce(D));let B=chunk3R7QHNI5_js.e(t,"w","tcPr");B&&(e.tcPr=fe(B));let v=chunk3R7QHNI5_js.f(t,"w","tblStylePr");if(v.length>0){e.tblStylePr=[];for(let X of v){let p=chunk3R7QHNI5_js.j(X,"w","type");if(p){let x={type:p},F=chunk3R7QHNI5_js.e(X,"w","pPr");F&&(x.pPr=K(F,n));let A=chunk3R7QHNI5_js.e(X,"w","rPr");A&&(x.rPr=$(A,n));let k=chunk3R7QHNI5_js.e(X,"w","tblPr");k&&(x.tblPr=le(k));let M=chunk3R7QHNI5_js.e(X,"w","trPr");M&&(x.trPr=ce(M));let R=chunk3R7QHNI5_js.e(X,"w","tcPr");R&&(x.tcPr=fe(R)),e.tblStylePr.push(x);}}}return e}function Oe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","rPrDefault");if(o){let r=chunk3R7QHNI5_js.e(o,"w","rPr");r&&(e.rPr=$(r,n));}let i=chunk3R7QHNI5_js.e(t,"w","pPrDefault");if(i){let r=chunk3R7QHNI5_js.e(i,"w","pPr");r&&(e.pPr=K(r,n));}return e.rPr||e.pPr?e:void 0}function ze(t,n){if(!n)return t;if(!t)return n?{...n}:void 0;let e={...t};for(let o of Object.keys(n)){let i=n[o];if(i!==void 0)if(o==="runProperties")e.runProperties=chunkGSKMHXHG_js.b(e.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=e[o],a=i;e[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(i)?e.tabs=[...i]:e[o]=i;}return e}function Be(t,n,e,o=new Set){if(o.has(t.styleId)||(o.add(t.styleId),!t.basedOn))return t;let i=n.get(t.basedOn);if(!i)return t;let r=Be(i,n,e,o),a={...t,pPr:ze(r.pPr,t.pPr),rPr:chunkGSKMHXHG_js.b(r.rPr,t.rPr)};return t.type==="table"&&((r.tblPr||t.tblPr)&&(a.tblPr={...r.tblPr||{},...t.tblPr||{}}),(r.trPr||t.trPr)&&(a.trPr={...r.trPr||{},...t.trPr||{}}),(r.tcPr||t.tcPr)&&(a.tcPr={...r.tcPr||{},...t.tcPr||{}})),a}function ue(t,n){let e=new Map;try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.f(o,"w","style");for(let r of i){let a=Ue(r,n);a.styleId&&e.set(a.styleId,a);}for(let[r,a]of e){let c=Be(a,e,n);e.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return e}function ke(t,n){let e={styles:[]};try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.e(o,"w","docDefaults");e.docDefaults=Oe(i,n);let r=chunk3R7QHNI5_js.e(o,"w","latentStyles");r&&(e.latentStyles={defLockedState:chunk3R7QHNI5_js.j(r,"w","defLockedState")==="1",defUIPriority:chunk3R7QHNI5_js.l(r,"w","defUIPriority"),defSemiHidden:chunk3R7QHNI5_js.j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:chunk3R7QHNI5_js.j(r,"w","defUnhideWhenUsed")==="1",defQFormat:chunk3R7QHNI5_js.j(r,"w","defQFormat")==="1",count:chunk3R7QHNI5_js.l(r,"w","count")});let a=ue(t,n);e.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return e}var Ie=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Re(t){let n=[],e;for(Ie.lastIndex=0;(e=Ie.exec(t))!==null;){let o=e[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(t){let n=[];for(let e of t)if(e.type==="paragraph"){let o=chunkAA6D2C6R_js.N(e),i=Re(o);for(let r of i)n.includes(r)||n.push(r);}else if(e.type==="table"){let o=Ee(e);for(let i of o)n.includes(i)||n.push(i);}return n}function Ee(t){let n=[];for(let e of t.rows)for(let o of e.cells)for(let i of o.content)if(i.type==="paragraph"){let r=chunkAA6D2C6R_js.N(i),a=Re(r);for(let c of a)n.includes(c)||n.push(c);}else if(i.type==="table"){let r=Ee(i);for(let a of r)n.includes(a)||n.push(a);}return n}function We(t,n){let e=[],o=[];for(let i of t)o.push(i),i.type==="paragraph"&&i.sectionProperties&&(e.push({properties:i.sectionProperties,content:o}),o=[]);return (o.length>0||e.length===0)&&e.push({properties:n??chunkAA6D2C6R_js.C(),content:o}),e}function te(t,n=null,e=null,o=null,i=null,r=null){let a={content:[]};if(!t)return a;let c=chunk3R7QHNI5_js.a(t);if(!c)return a;let g=(c.elements??[]).find(u=>u.type==="element"&&(u.name==="w:document"||u.name?.endsWith(":document")));if(!g)return a;let d=chunk3R7QHNI5_js.e(g,"w","body");if(!d)return a;a.content=chunkAA6D2C6R_js.q(d,n,e,o,i,r);let h=chunk3R7QHNI5_js.e(d,"w","sectPr");h&&(a.finalSectionProperties=chunkAA6D2C6R_js.B(h,i));let b=We(a.content,a.finalSectionProperties);return a.sections=chunkAA6D2C6R_js.D(b),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function $e(t){let n=new Map,e=chunk3R7QHNI5_js.a(t);if(!e)return n;let o=chunk3R7QHNI5_js.e(e,"w16cex","commentsExtensible")??e;for(let i of chunk3R7QHNI5_js.i(o)){if((i.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=chunk3R7QHNI5_js.j(i,"w16cex","paraId")??chunk3R7QHNI5_js.j(i,"w15","paraId")??i.attributes?.["w16cex:paraId"]??i.attributes?.["w15:paraId"],c=chunk3R7QHNI5_js.j(i,"w16cex","dateUtc")??chunk3R7QHNI5_js.j(i,"w15","dateUtc")??i.attributes?.["w16cex:dateUtc"]??i.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function _e(t){let n=new Map,e=new Map,o=chunk3R7QHNI5_js.a(t);if(!o)return {parentByParaId:n,doneByParaId:e};let i=chunk3R7QHNI5_js.e(o,"w15","commentsEx")??o;for(let r of chunk3R7QHNI5_js.i(i)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=chunk3R7QHNI5_js.j(r,"w15","paraId")??r.attributes?.["w15:paraId"],g=chunk3R7QHNI5_js.j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],d=chunk3R7QHNI5_js.j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let h=String(c).toUpperCase();g&&n.set(h,String(g).toUpperCase()),d==="1"&&e.set(h,true);}}return {parentByParaId:n,doneByParaId:e}}function Ne(t,n,e,o,i,r,a){if(!t)return [];let c=chunk3R7QHNI5_js.a(t);if(!c)return [];let g=r?$e(r):new Map,d=a?_e(a):null,h=chunk3R7QHNI5_js.e(c,"w","comments")??c,b=chunk3R7QHNI5_js.i(h),u=[],S=[];for(let f of b){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(chunk3R7QHNI5_js.j(f,"w","id")??"0",10),D=chunk3R7QHNI5_js.j(f,"w","author")??"Unknown",B=chunk3R7QHNI5_js.j(f,"w","initials"),v=B!=null?String(B):void 0,X=chunk3R7QHNI5_js.j(f,"w","date"),p=X!=null?String(X):void 0,x=chunk3R7QHNI5_js.j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??chunk3R7QHNI5_js.j(f,"w","paraId"),A=(x?g.get(String(x).toUpperCase()):void 0)??p,k=chunk3R7QHNI5_js.j(f,"w","done")??f.attributes?.["w:done"],M=k==="1"||k==="true"?true:void 0,R=chunk3R7QHNI5_js.j(f,"w16cid","parentId")??chunk3R7QHNI5_js.j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=R!=null?parseInt(String(R),10):void 0,L=[],N="";for(let H of chunk3R7QHNI5_js.i(f))if((H.name?.replace(/^.*:/,"")??"")==="p"){let m=chunkAA6D2C6R_js.O(H,n,e,null,o,i);L.push(m);let P=chunk3R7QHNI5_js.j(H,"w14","paraId")??H.attributes?.["w14:paraId"];P&&(N=String(P).toUpperCase());}M==null&&d&&N&&d.doneByParaId.get(N)&&(M=true),S.push(N),u.push({id:C,author:D,initials:v,date:A,content:L,...M!=null?{done:M}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(d&&d.parentByParaId.size>0){let f=new Map;for(let y=0;y<u.length;y++){let C=S[y];C&&f.set(C,u[y].id);}for(let y=0;y<u.length;y++){if(u[y].parentId!=null)continue;let C=S[y];if(!C)continue;let D=d.parentByParaId.get(C);if(!D)continue;let B=f.get(D);B!=null&&(u[y]={...u[y],parentId:B});}}return u}async function Ve(t,n={}){let e=t instanceof ArrayBuffer?t:await chunkQVRMX2AC_js.u(t),{onProgress:o=()=>{},preloadFonts:i=true,parseHeadersFooters:r=true,parseNotes:a=true,detectVariables:c=true}=n,g=[];try{let u=function(P,I){let U=performance.now(),oe=I(),O=performance.now()-U;return b.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe};var d=u;let h=performance.now(),b=[];async function S(P,I){let U=performance.now(),oe=await I(),O=performance.now()-U;return b.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe}o("Extracting DOCX...",0);let f=await S("unzip",()=>G(e));o("Extracted DOCX",10),o("Parsing relationships...",10);let y=u("relationships",()=>f.documentRels?chunkZ3LGMBJC_js.b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=u("theme",()=>chunkAA6D2C6R_js.a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let D=null,B;u("styles",()=>{f.stylesXml&&(D=ue(f.stylesXml,C),B=ke(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let v=u("numbering",()=>chunkH57LNDBH_js.a(f.numberingXml)),X=u("settings",()=>chunkFIGLFSNR_js.b(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let p=u("media",()=>Ze(f,y));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};u("documentBody",()=>{f.documentXml?x=te(f.documentXml,D,C,v,y,p):g.push("No document.xml found in DOCX");}),o("Parsed document body",55);let F,A;if(r){o("Parsing headers/footers...",55);let P=u("headersFooters",()=>qe(f,D,C,v,y,p));F=P.headers,A=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let k,M,R,V;if(a){o("Parsing footnotes/endnotes...",65);let P=u("footnotesEndnotes",()=>Je(f,D,C,v,y,p));k=P.footnotes,M=P.endnotes,R=P.footnoteSeparators,V=P.endnoteSeparators,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=u("comments",()=>Ne(f.commentsXml,D,C,y,p,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(x.comments=L);let N;c?(o("Detecting template variables...",75),N=u("variables",()=>ee(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),i?(o("Loading fonts...",80),await S("fonts",()=>Qe(C,B,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let _={package:{document:x,styles:B,theme:C,numbering:v.definitions,settings:X,headers:F,footers:A,footnotes:k,endnotes:M,footnoteSeparators:R,endnoteSeparators:V,relationships:y,media:p},originalBuffer:e,templateVariables:N,warnings:g.length>0?g:void 0},m=performance.now()-h;if(m>2e3){let P=b.filter(I=>I.ms>100).map(I=>`${I.stage}: ${Math.round(I.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(m)}ms`+(P?` (${P})`:""));}return o("Complete",100),_}catch(h){let b=h instanceof Error?h.message:String(h);throw console.error("[parseDocx] Failed to parse DOCX:",b,h),new Error(`Failed to parse DOCX: ${b}`)}}function Ze(t,n){let e=new Map;for(let[o,i]of t.media.entries()){let r=o.split("/").pop()||o,a=Me(o),c=new Uint8Array(i),g="";for(let S=0;S<c.length;S++)g+=String.fromCharCode(c[S]);let d=btoa(g),h=`data:${a};base64,${d}`,b={path:o,filename:r,mimeType:a,data:i,dataUrl:h};e.set(o,b);let u=o.replace(/^word\//,"");u!==o&&e.set(u,b);}return e}function ne(t,n){let e=n.toLowerCase();for(let[o,i]of t.entries())if(o.toLowerCase()===e)return i}function qe(t,n,e,o,i,r){let a=new Map,c=new Map;for(let[g,d]of i.entries())if(d.type===chunkZ3LGMBJC_js.a.header&&d.target){let h=d.target.split("/").pop()||d.target,b=ne(t.headers,h);if(b){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,y=chunkAA6D2C6R_js.r(b,"default",n,e,o,f,r);a.set(g,y);}}else if(d.type===chunkZ3LGMBJC_js.a.footer&&d.target){let h=d.target.split("/").pop()||d.target,b=ne(t.footers,h);if(b){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,y=chunkAA6D2C6R_js.s(b,"default",n,e,o,f,r);c.set(g,y);}}return {headers:a,footers:c}}function Je(t,n,e,o,i,r){let a=chunkAA6D2C6R_js.t(t.footnotesXml,n,e,o,i,r),c=chunkAA6D2C6R_js.u(t.endnotesXml,n,e,o,i,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes(),footnoteSeparators:a.footnotes.filter(chunkAA6D2C6R_js.z),endnoteSeparators:c.endnotes.filter(chunkAA6D2C6R_js.A)}}async function Qe(t,n,e){let o=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:r}=t.fontScheme;i?.latin&&o.add(i.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let i of n.styles)i.rPr?.fontFamily?.ascii&&o.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&o.add(i.rPr.fontFamily.hAnsi);if(e.content){for(let i of e.content)if(i.type==="paragraph")for(let r of i.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await chunkQVRMX2AC_js.q(Array.from(o));}catch(i){console.warn("Failed to load some fonts:",i);}}async function Et(t){return Ve(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Nt(t,n){return Ve(t,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Vt(t){let n=await G(t);if(!n.documentXml)return [];let e=te(n.documentXml);return ee(e.content)}async function Ht(t){let n=await G(t),e=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:e.length}}
|
|
1
|
+
'use strict';var chunkDFDL337G_js=require('./chunk-DFDL337G.js'),chunkFIGLFSNR_js=require('./chunk-FIGLFSNR.js'),chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js'),He=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var He__default=/*#__PURE__*/_interopDefault(He);async function G(t){let n=await He__default.default.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:t};for(let[o,i]of Object.entries(n.files)){if(i.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await i.async("text");if(e.allXml.set(o,a),r==="word/document.xml")e.documentXml=a;else if(r==="word/styles.xml")e.stylesXml=a;else if(r==="word/theme/theme1.xml")e.themeXml=a;else if(r==="word/numbering.xml")e.numberingXml=a;else if(r==="word/fonttable.xml")e.fontTableXml=a;else if(r==="word/settings.xml")e.settingsXml=a;else if(r==="word/websettings.xml")e.webSettingsXml=a;else if(r==="word/footnotes.xml")e.footnotesXml=a;else if(r==="word/endnotes.xml")e.endnotesXml=a;else if(r==="word/comments.xml")e.commentsXml=a;else if(r==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")e.documentRels=a;else if(r==="_rels/.rels")e.packageRels=a;else if(r==="[content_types].xml")e.contentTypesXml=a;else if(r==="docprops/core.xml")e.corePropsXml=a;else if(r==="docprops/app.xml")e.appPropsXml=a;else if(r==="docprops/custom.xml")e.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;e.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;e.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await i.async("arraybuffer");e.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await i.async("arraybuffer");e.fonts.set(o,a);}}return e}function Me(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(t,n,e,o){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=true),n&&(i.themeColor=n),e&&(i.themeTint=e),o&&(i.themeShade=o),i}function W(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","color");e&&e!=="auto"&&(n.color={rgb:e});let o=chunk3R7QHNI5_js.j(t,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let i=chunk3R7QHNI5_js.j(t,"w","themeFill");i&&(n.fill=n.fill||{},n.fill.themeColor=i);let r=chunk3R7QHNI5_js.j(t,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=chunk3R7QHNI5_js.j(t,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=chunk3R7QHNI5_js.j(t,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function $(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","b");o&&(e.bold=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","bCs");i&&(e.boldCs=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","i");r&&(e.italic=chunk3R7QHNI5_js.m(r));let a=chunk3R7QHNI5_js.e(t,"w","iCs");a&&(e.italicCs=chunk3R7QHNI5_js.m(a));let c=chunk3R7QHNI5_js.e(t,"w","u");if(c){let m=chunk3R7QHNI5_js.j(c,"w","val");if(m){e.underline={style:m};let P=chunk3R7QHNI5_js.j(c,"w","color"),I=chunk3R7QHNI5_js.j(c,"w","themeColor");(P||I)&&(e.underline.color=Y(P,I,chunk3R7QHNI5_js.j(c,"w","themeTint"),chunk3R7QHNI5_js.j(c,"w","themeShade")));}}let g=chunk3R7QHNI5_js.e(t,"w","strike");g&&(e.strike=chunk3R7QHNI5_js.m(g));let d=chunk3R7QHNI5_js.e(t,"w","dstrike");d&&(e.doubleStrike=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","vertAlign");if(h){let m=chunk3R7QHNI5_js.j(h,"w","val");(m==="superscript"||m==="subscript"||m==="baseline")&&(e.vertAlign=m);}let b=chunk3R7QHNI5_js.e(t,"w","smallCaps");b&&(e.smallCaps=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","caps");u&&(e.allCaps=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","vanish");S&&(e.hidden=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","color");f&&(e.color=Y(chunk3R7QHNI5_js.j(f,"w","val"),chunk3R7QHNI5_js.j(f,"w","themeColor"),chunk3R7QHNI5_js.j(f,"w","themeTint"),chunk3R7QHNI5_js.j(f,"w","themeShade")));let y=chunk3R7QHNI5_js.e(t,"w","highlight");if(y){let m=chunk3R7QHNI5_js.j(y,"w","val");m&&(e.highlight=m);}let C=chunk3R7QHNI5_js.e(t,"w","shd");C&&(e.shading=W(C));let D=chunk3R7QHNI5_js.e(t,"w","sz");if(D){let m=chunk3R7QHNI5_js.l(D,"w","val");m!==void 0&&(e.fontSize=m);}let B=chunk3R7QHNI5_js.e(t,"w","szCs");if(B){let m=chunk3R7QHNI5_js.l(B,"w","val");m!==void 0&&(e.fontSizeCs=m);}let v=chunk3R7QHNI5_js.e(t,"w","rFonts");if(v){e.fontFamily={ascii:chunk3R7QHNI5_js.j(v,"w","ascii")??void 0,hAnsi:chunk3R7QHNI5_js.j(v,"w","hAnsi")??void 0,eastAsia:chunk3R7QHNI5_js.j(v,"w","eastAsia")??void 0,cs:chunk3R7QHNI5_js.j(v,"w","cs")??void 0};let m=chunk3R7QHNI5_js.j(v,"w","asciiTheme");m&&(e.fontFamily.asciiTheme=m,n&&!e.fontFamily.ascii&&(e.fontFamily.ascii=chunkDFDL337G_js.b(n,m)));let P=chunk3R7QHNI5_js.j(v,"w","hAnsiTheme");P&&(e.fontFamily.hAnsiTheme=P,n&&!e.fontFamily.hAnsi&&(e.fontFamily.hAnsi=chunkDFDL337G_js.b(n,P)));let I=chunk3R7QHNI5_js.j(v,"w","eastAsiaTheme");I&&(e.fontFamily.eastAsiaTheme=I,n&&!e.fontFamily.eastAsia&&(e.fontFamily.eastAsia=chunkDFDL337G_js.b(n,I)));let U=chunk3R7QHNI5_js.j(v,"w","cstheme");U&&(e.fontFamily.csTheme=U,n&&!e.fontFamily.cs&&(e.fontFamily.cs=chunkDFDL337G_js.b(n,U)));}let X=chunk3R7QHNI5_js.e(t,"w","spacing");if(X){let m=chunk3R7QHNI5_js.l(X,"w","val");m!==void 0&&(e.spacing=m);}let p=chunk3R7QHNI5_js.e(t,"w","position");if(p){let m=chunk3R7QHNI5_js.l(p,"w","val");m!==void 0&&(e.position=m);}let x=chunk3R7QHNI5_js.e(t,"w","w");if(x){let m=chunk3R7QHNI5_js.l(x,"w","val");m!==void 0&&(e.scale=m);}let F=chunk3R7QHNI5_js.e(t,"w","kern");if(F){let m=chunk3R7QHNI5_js.l(F,"w","val");m!==void 0&&(e.kerning=m);}let A=chunk3R7QHNI5_js.e(t,"w","effect");if(A){let m=chunk3R7QHNI5_js.j(A,"w","val");m&&(e.effect=m);}let k=chunk3R7QHNI5_js.e(t,"w","em");if(k){let m=chunk3R7QHNI5_js.j(k,"w","val");m&&(e.emphasisMark=m);}let M=chunk3R7QHNI5_js.e(t,"w","emboss");M&&(e.emboss=chunk3R7QHNI5_js.m(M));let R=chunk3R7QHNI5_js.e(t,"w","imprint");R&&(e.imprint=chunk3R7QHNI5_js.m(R));let V=chunk3R7QHNI5_js.e(t,"w","outline");V&&(e.outline=chunk3R7QHNI5_js.m(V));let L=chunk3R7QHNI5_js.e(t,"w","shadow");L&&(e.shadow=chunk3R7QHNI5_js.m(L));let N=chunk3R7QHNI5_js.e(t,"w","rtl");N&&(e.rtl=chunk3R7QHNI5_js.m(N));let H=chunk3R7QHNI5_js.e(t,"w","cs");H&&(e.cs=chunk3R7QHNI5_js.m(H));let _=chunk3R7QHNI5_js.e(t,"w","rStyle");if(_){let m=chunk3R7QHNI5_js.j(_,"w","val");m&&(e.styleId=m);}return Object.keys(e).length>0?e:void 0}function E(t){if(!t)return;let n=chunk3R7QHNI5_js.j(t,"w","val");if(!n)return;let e={style:n},o=chunk3R7QHNI5_js.j(t,"w","color"),i=chunk3R7QHNI5_js.j(t,"w","themeColor");(o||i)&&(e.color=Y(o,i,chunk3R7QHNI5_js.j(t,"w","themeTint"),chunk3R7QHNI5_js.j(t,"w","themeShade")));let r=chunk3R7QHNI5_js.l(t,"w","sz");r!==void 0&&(e.size=r);let a=chunk3R7QHNI5_js.l(t,"w","space");a!==void 0&&(e.space=a);let c=chunk3R7QHNI5_js.j(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let g=chunk3R7QHNI5_js.j(t,"w","frame");return g&&(e.frame=g==="1"||g==="true"),e}function je(t){if(!t)return;let n=chunk3R7QHNI5_js.f(t,"w","tab");if(n.length===0)return;let e=[];for(let o of n){let i=chunk3R7QHNI5_js.l(o,"w","pos"),r=chunk3R7QHNI5_js.j(o,"w","val");if(i!==void 0&&r){let a={position:i,alignment:r},c=chunk3R7QHNI5_js.j(o,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function K(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","jc");if(o){let p=chunk3R7QHNI5_js.j(o,"w","val");p&&(e.alignment=p);}let i=chunk3R7QHNI5_js.e(t,"w","bidi");i&&(e.bidi=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","spacing");if(r){let p=chunk3R7QHNI5_js.l(r,"w","before");p!==void 0&&(e.spaceBefore=p);let x=chunk3R7QHNI5_js.l(r,"w","after");x!==void 0&&(e.spaceAfter=x);let F=chunk3R7QHNI5_js.l(r,"w","line");F!==void 0&&(e.lineSpacing=F);let A=chunk3R7QHNI5_js.j(r,"w","lineRule");A&&(e.lineSpacingRule=A);let k=chunk3R7QHNI5_js.j(r,"w","beforeAutospacing");k&&(e.beforeAutospacing=k==="1"||k==="true");let M=chunk3R7QHNI5_js.j(r,"w","afterAutospacing");M&&(e.afterAutospacing=M==="1"||M==="true");}let a=chunk3R7QHNI5_js.e(t,"w","ind");if(a){let p=chunk3R7QHNI5_js.l(a,"w","left");p!==void 0&&(e.indentLeft=p);let x=chunk3R7QHNI5_js.l(a,"w","right");x!==void 0&&(e.indentRight=x);let F=chunk3R7QHNI5_js.l(a,"w","firstLine");F!==void 0&&(e.indentFirstLine=F);let A=chunk3R7QHNI5_js.l(a,"w","hanging");A!==void 0&&(e.indentFirstLine=-A,e.hangingIndent=true);}let c=chunk3R7QHNI5_js.e(t,"w","pBdr");if(c){let p={},x=E(chunk3R7QHNI5_js.e(c,"w","top"));x&&(p.top=x);let F=E(chunk3R7QHNI5_js.e(c,"w","bottom"));F&&(p.bottom=F);let A=E(chunk3R7QHNI5_js.e(c,"w","left"));A&&(p.left=A);let k=E(chunk3R7QHNI5_js.e(c,"w","right"));k&&(p.right=k);let M=E(chunk3R7QHNI5_js.e(c,"w","between"));M&&(p.between=M);let R=E(chunk3R7QHNI5_js.e(c,"w","bar"));R&&(p.bar=R),Object.keys(p).length>0&&(e.borders=p);}let g=chunk3R7QHNI5_js.e(t,"w","shd");g&&(e.shading=W(g));let d=chunk3R7QHNI5_js.e(t,"w","tabs");d&&(e.tabs=je(d));let h=chunk3R7QHNI5_js.e(t,"w","keepNext");h&&(e.keepNext=chunk3R7QHNI5_js.m(h));let b=chunk3R7QHNI5_js.e(t,"w","keepLines");b&&(e.keepLines=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","widowControl");u&&(e.widowControl=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","pageBreakBefore");S&&(e.pageBreakBefore=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","contextualSpacing");f&&(e.contextualSpacing=chunk3R7QHNI5_js.m(f));let y=chunk3R7QHNI5_js.e(t,"w","numPr");if(y){let p=chunk3R7QHNI5_js.e(y,"w","numId"),x=chunk3R7QHNI5_js.e(y,"w","ilvl");if(p||x){if(e.numPr={},p){let F=chunk3R7QHNI5_js.l(p,"w","val");F!==void 0&&(e.numPr.numId=F);}if(x){let F=chunk3R7QHNI5_js.l(x,"w","val");F!==void 0&&(e.numPr.ilvl=F);}}}let C=chunk3R7QHNI5_js.e(t,"w","outlineLvl");if(C){let p=chunk3R7QHNI5_js.l(C,"w","val");p!==void 0&&(e.outlineLevel=p);}let D=chunk3R7QHNI5_js.e(t,"w","pStyle");if(D){let p=chunk3R7QHNI5_js.j(D,"w","val");p&&(e.styleId=p);}let B=chunk3R7QHNI5_js.e(t,"w","suppressLineNumbers");B&&(e.suppressLineNumbers=chunk3R7QHNI5_js.m(B));let v=chunk3R7QHNI5_js.e(t,"w","suppressAutoHyphens");v&&(e.suppressAutoHyphens=chunk3R7QHNI5_js.m(v));let X=chunk3R7QHNI5_js.e(t,"w","rPr");return X&&(e.runProperties=$(X,n)),Object.keys(e).length>0?e:void 0}function j(t){if(!t)return;let n=chunk3R7QHNI5_js.l(t,"w","w"),e=chunk3R7QHNI5_js.j(t,"w","type");if(n!==void 0&&e)return {value:n,type:e}}function De(t){if(!t)return;let n={},e=E(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=E(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=E(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=E(chunk3R7QHNI5_js.e(t,"w","right"));r&&(n.right=r);let a=E(chunk3R7QHNI5_js.e(t,"w","insideH"));a&&(n.insideH=a);let c=E(chunk3R7QHNI5_js.e(t,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Ae(t){if(!t)return;let n={},e=j(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=j(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=j(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=j(chunk3R7QHNI5_js.e(t,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Le(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","val");if(e){let d=parseInt(e,16);isNaN(d)||(n.firstRow=(d&32)!==0,n.lastRow=(d&64)!==0,n.firstColumn=(d&128)!==0,n.lastColumn=(d&256)!==0,n.noHBand=(d&512)!==0,n.noVBand=(d&1024)!==0);}let o=chunk3R7QHNI5_js.j(t,"w","firstColumn");o&&(n.firstColumn=o==="1");let i=chunk3R7QHNI5_js.j(t,"w","firstRow");i&&(n.firstRow=i==="1");let r=chunk3R7QHNI5_js.j(t,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=chunk3R7QHNI5_js.j(t,"w","lastRow");a&&(n.lastRow=a==="1");let c=chunk3R7QHNI5_js.j(t,"w","noHBand");c&&(n.noHBand=c==="1");let g=chunk3R7QHNI5_js.j(t,"w","noVBand");return g&&(n.noVBand=g==="1"),Object.keys(n).length>0?n:void 0}function le(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tblW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","jc");if(i){let f=chunk3R7QHNI5_js.j(i,"w","val");(f==="left"||f==="center"||f==="right")&&(e.justification=f);}let r=chunk3R7QHNI5_js.e(t,"w","tblCellSpacing");r&&(e.cellSpacing=j(r));let a=chunk3R7QHNI5_js.e(t,"w","tblInd");a&&(e.indent=j(a));let c=chunk3R7QHNI5_js.e(t,"w","tblBorders");c&&(e.borders=De(c));let g=chunk3R7QHNI5_js.e(t,"w","tblCellMar");g&&(e.cellMargins=Ae(g));let d=chunk3R7QHNI5_js.e(t,"w","tblLayout");if(d){let f=chunk3R7QHNI5_js.j(d,"w","type");(f==="fixed"||f==="autofit")&&(e.layout=f);}let h=chunk3R7QHNI5_js.e(t,"w","tblStyle");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");f&&(e.styleId=f);}let b=chunk3R7QHNI5_js.e(t,"w","tblLook");b&&(e.look=Le(b));let u=chunk3R7QHNI5_js.e(t,"w","shd");u&&(e.shading=W(u));let S=chunk3R7QHNI5_js.e(t,"w","bidiVisual");return S&&(e.bidi=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function ce(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.e(t,"w","trHeight");if(e){n.height=j(e);let c=chunk3R7QHNI5_js.j(e,"w","hRule");c&&(n.heightRule=c);}let o=chunk3R7QHNI5_js.e(t,"w","tblHeader");o&&(n.header=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","cantSplit");i&&(n.cantSplit=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","jc");if(r){let c=chunk3R7QHNI5_js.j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=chunk3R7QHNI5_js.e(t,"w","hidden");return a&&(n.hidden=chunk3R7QHNI5_js.m(a)),Object.keys(n).length>0?n:void 0}function fe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tcW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","tcBorders");i&&(e.borders=De(i));let r=chunk3R7QHNI5_js.e(t,"w","tcMar");r&&(e.margins=Ae(r));let a=chunk3R7QHNI5_js.e(t,"w","shd");a&&(e.shading=W(a));let c=chunk3R7QHNI5_js.e(t,"w","vAlign");if(c){let f=chunk3R7QHNI5_js.j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(e.verticalAlign=f);}let g=chunk3R7QHNI5_js.e(t,"w","textDirection");if(g){let f=chunk3R7QHNI5_js.j(g,"w","val");f&&(e.textDirection=f);}let d=chunk3R7QHNI5_js.e(t,"w","gridSpan");if(d){let f=chunk3R7QHNI5_js.l(d,"w","val");f!==void 0&&(e.gridSpan=f);}let h=chunk3R7QHNI5_js.e(t,"w","vMerge");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");e.vMerge=f==="restart"?"restart":"continue";}let b=chunk3R7QHNI5_js.e(t,"w","tcFitText");b&&(e.fitText=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","noWrap");u&&(e.noWrap=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","hideMark");return S&&(e.hideMark=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function Ue(t,n){let e={styleId:chunk3R7QHNI5_js.j(t,"w","styleId")??"",type:chunk3R7QHNI5_js.j(t,"w","type")??"paragraph"},o=chunk3R7QHNI5_js.j(t,"w","default");o&&(e.default=o==="1"||o==="true");let i=chunk3R7QHNI5_js.e(t,"w","name");i&&(e.name=chunk3R7QHNI5_js.j(i,"w","val")??void 0);let r=chunk3R7QHNI5_js.e(t,"w","basedOn");r&&(e.basedOn=chunk3R7QHNI5_js.j(r,"w","val")??void 0);let a=chunk3R7QHNI5_js.e(t,"w","next");a&&(e.next=chunk3R7QHNI5_js.j(a,"w","val")??void 0);let c=chunk3R7QHNI5_js.e(t,"w","link");c&&(e.link=chunk3R7QHNI5_js.j(c,"w","val")??void 0);let g=chunk3R7QHNI5_js.e(t,"w","uiPriority");if(g){let X=chunk3R7QHNI5_js.l(g,"w","val");X!==void 0&&(e.uiPriority=X);}let d=chunk3R7QHNI5_js.e(t,"w","hidden");d&&(e.hidden=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","semiHidden");h&&(e.semiHidden=chunk3R7QHNI5_js.m(h));let b=chunk3R7QHNI5_js.e(t,"w","unhideWhenUsed");b&&(e.unhideWhenUsed=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","qFormat");u&&(e.qFormat=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","personal");S&&(e.personal=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","pPr");f&&(e.pPr=K(f,n));let y=chunk3R7QHNI5_js.e(t,"w","rPr");y&&(e.rPr=$(y,n));let C=chunk3R7QHNI5_js.e(t,"w","tblPr");C&&(e.tblPr=le(C));let D=chunk3R7QHNI5_js.e(t,"w","trPr");D&&(e.trPr=ce(D));let B=chunk3R7QHNI5_js.e(t,"w","tcPr");B&&(e.tcPr=fe(B));let v=chunk3R7QHNI5_js.f(t,"w","tblStylePr");if(v.length>0){e.tblStylePr=[];for(let X of v){let p=chunk3R7QHNI5_js.j(X,"w","type");if(p){let x={type:p},F=chunk3R7QHNI5_js.e(X,"w","pPr");F&&(x.pPr=K(F,n));let A=chunk3R7QHNI5_js.e(X,"w","rPr");A&&(x.rPr=$(A,n));let k=chunk3R7QHNI5_js.e(X,"w","tblPr");k&&(x.tblPr=le(k));let M=chunk3R7QHNI5_js.e(X,"w","trPr");M&&(x.trPr=ce(M));let R=chunk3R7QHNI5_js.e(X,"w","tcPr");R&&(x.tcPr=fe(R)),e.tblStylePr.push(x);}}}return e}function Oe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","rPrDefault");if(o){let r=chunk3R7QHNI5_js.e(o,"w","rPr");r&&(e.rPr=$(r,n));}let i=chunk3R7QHNI5_js.e(t,"w","pPrDefault");if(i){let r=chunk3R7QHNI5_js.e(i,"w","pPr");r&&(e.pPr=K(r,n));}return e.rPr||e.pPr?e:void 0}function ze(t,n){if(!n)return t;if(!t)return n?{...n}:void 0;let e={...t};for(let o of Object.keys(n)){let i=n[o];if(i!==void 0)if(o==="runProperties")e.runProperties=chunkGSKMHXHG_js.b(e.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=e[o],a=i;e[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(i)?e.tabs=[...i]:e[o]=i;}return e}function Be(t,n,e,o=new Set){if(o.has(t.styleId)||(o.add(t.styleId),!t.basedOn))return t;let i=n.get(t.basedOn);if(!i)return t;let r=Be(i,n,e,o),a={...t,pPr:ze(r.pPr,t.pPr),rPr:chunkGSKMHXHG_js.b(r.rPr,t.rPr)};return t.type==="table"&&((r.tblPr||t.tblPr)&&(a.tblPr={...r.tblPr||{},...t.tblPr||{}}),(r.trPr||t.trPr)&&(a.trPr={...r.trPr||{},...t.trPr||{}}),(r.tcPr||t.tcPr)&&(a.tcPr={...r.tcPr||{},...t.tcPr||{}})),a}function ue(t,n){let e=new Map;try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.f(o,"w","style");for(let r of i){let a=Ue(r,n);a.styleId&&e.set(a.styleId,a);}for(let[r,a]of e){let c=Be(a,e,n);e.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return e}function ke(t,n){let e={styles:[]};try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.e(o,"w","docDefaults");e.docDefaults=Oe(i,n);let r=chunk3R7QHNI5_js.e(o,"w","latentStyles");r&&(e.latentStyles={defLockedState:chunk3R7QHNI5_js.j(r,"w","defLockedState")==="1",defUIPriority:chunk3R7QHNI5_js.l(r,"w","defUIPriority"),defSemiHidden:chunk3R7QHNI5_js.j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:chunk3R7QHNI5_js.j(r,"w","defUnhideWhenUsed")==="1",defQFormat:chunk3R7QHNI5_js.j(r,"w","defQFormat")==="1",count:chunk3R7QHNI5_js.l(r,"w","count")});let a=ue(t,n);e.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return e}var Ie=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Re(t){let n=[],e;for(Ie.lastIndex=0;(e=Ie.exec(t))!==null;){let o=e[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(t){let n=[];for(let e of t)if(e.type==="paragraph"){let o=chunkDFDL337G_js.N(e),i=Re(o);for(let r of i)n.includes(r)||n.push(r);}else if(e.type==="table"){let o=Ee(e);for(let i of o)n.includes(i)||n.push(i);}return n}function Ee(t){let n=[];for(let e of t.rows)for(let o of e.cells)for(let i of o.content)if(i.type==="paragraph"){let r=chunkDFDL337G_js.N(i),a=Re(r);for(let c of a)n.includes(c)||n.push(c);}else if(i.type==="table"){let r=Ee(i);for(let a of r)n.includes(a)||n.push(a);}return n}function We(t,n){let e=[],o=[];for(let i of t)o.push(i),i.type==="paragraph"&&i.sectionProperties&&(e.push({properties:i.sectionProperties,content:o}),o=[]);return (o.length>0||e.length===0)&&e.push({properties:n??chunkDFDL337G_js.C(),content:o}),e}function te(t,n=null,e=null,o=null,i=null,r=null){let a={content:[]};if(!t)return a;let c=chunk3R7QHNI5_js.a(t);if(!c)return a;let g=(c.elements??[]).find(u=>u.type==="element"&&(u.name==="w:document"||u.name?.endsWith(":document")));if(!g)return a;let d=chunk3R7QHNI5_js.e(g,"w","body");if(!d)return a;a.content=chunkDFDL337G_js.q(d,n,e,o,i,r);let h=chunk3R7QHNI5_js.e(d,"w","sectPr");h&&(a.finalSectionProperties=chunkDFDL337G_js.B(h,i));let b=We(a.content,a.finalSectionProperties);return a.sections=chunkDFDL337G_js.D(b),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function $e(t){let n=new Map,e=chunk3R7QHNI5_js.a(t);if(!e)return n;let o=chunk3R7QHNI5_js.e(e,"w16cex","commentsExtensible")??e;for(let i of chunk3R7QHNI5_js.i(o)){if((i.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=chunk3R7QHNI5_js.j(i,"w16cex","paraId")??chunk3R7QHNI5_js.j(i,"w15","paraId")??i.attributes?.["w16cex:paraId"]??i.attributes?.["w15:paraId"],c=chunk3R7QHNI5_js.j(i,"w16cex","dateUtc")??chunk3R7QHNI5_js.j(i,"w15","dateUtc")??i.attributes?.["w16cex:dateUtc"]??i.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function _e(t){let n=new Map,e=new Map,o=chunk3R7QHNI5_js.a(t);if(!o)return {parentByParaId:n,doneByParaId:e};let i=chunk3R7QHNI5_js.e(o,"w15","commentsEx")??o;for(let r of chunk3R7QHNI5_js.i(i)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=chunk3R7QHNI5_js.j(r,"w15","paraId")??r.attributes?.["w15:paraId"],g=chunk3R7QHNI5_js.j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],d=chunk3R7QHNI5_js.j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let h=String(c).toUpperCase();g&&n.set(h,String(g).toUpperCase()),d==="1"&&e.set(h,true);}}return {parentByParaId:n,doneByParaId:e}}function Ne(t,n,e,o,i,r,a){if(!t)return [];let c=chunk3R7QHNI5_js.a(t);if(!c)return [];let g=r?$e(r):new Map,d=a?_e(a):null,h=chunk3R7QHNI5_js.e(c,"w","comments")??c,b=chunk3R7QHNI5_js.i(h),u=[],S=[];for(let f of b){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(chunk3R7QHNI5_js.j(f,"w","id")??"0",10),D=chunk3R7QHNI5_js.j(f,"w","author")??"Unknown",B=chunk3R7QHNI5_js.j(f,"w","initials"),v=B!=null?String(B):void 0,X=chunk3R7QHNI5_js.j(f,"w","date"),p=X!=null?String(X):void 0,x=chunk3R7QHNI5_js.j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??chunk3R7QHNI5_js.j(f,"w","paraId"),A=(x?g.get(String(x).toUpperCase()):void 0)??p,k=chunk3R7QHNI5_js.j(f,"w","done")??f.attributes?.["w:done"],M=k==="1"||k==="true"?true:void 0,R=chunk3R7QHNI5_js.j(f,"w16cid","parentId")??chunk3R7QHNI5_js.j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=R!=null?parseInt(String(R),10):void 0,L=[],N="";for(let H of chunk3R7QHNI5_js.i(f))if((H.name?.replace(/^.*:/,"")??"")==="p"){let m=chunkDFDL337G_js.O(H,n,e,null,o,i);L.push(m);let P=chunk3R7QHNI5_js.j(H,"w14","paraId")??H.attributes?.["w14:paraId"];P&&(N=String(P).toUpperCase());}M==null&&d&&N&&d.doneByParaId.get(N)&&(M=true),S.push(N),u.push({id:C,author:D,initials:v,date:A,content:L,...M!=null?{done:M}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(d&&d.parentByParaId.size>0){let f=new Map;for(let y=0;y<u.length;y++){let C=S[y];C&&f.set(C,u[y].id);}for(let y=0;y<u.length;y++){if(u[y].parentId!=null)continue;let C=S[y];if(!C)continue;let D=d.parentByParaId.get(C);if(!D)continue;let B=f.get(D);B!=null&&(u[y]={...u[y],parentId:B});}}return u}async function Ve(t,n={}){let e=t instanceof ArrayBuffer?t:await chunkQVRMX2AC_js.u(t),{onProgress:o=()=>{},preloadFonts:i=true,parseHeadersFooters:r=true,parseNotes:a=true,detectVariables:c=true}=n,g=[];try{let u=function(P,I){let U=performance.now(),oe=I(),O=performance.now()-U;return b.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe};var d=u;let h=performance.now(),b=[];async function S(P,I){let U=performance.now(),oe=await I(),O=performance.now()-U;return b.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe}o("Extracting DOCX...",0);let f=await S("unzip",()=>G(e));o("Extracted DOCX",10),o("Parsing relationships...",10);let y=u("relationships",()=>f.documentRels?chunkZ3LGMBJC_js.b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=u("theme",()=>chunkDFDL337G_js.a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let D=null,B;u("styles",()=>{f.stylesXml&&(D=ue(f.stylesXml,C),B=ke(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let v=u("numbering",()=>chunkH57LNDBH_js.a(f.numberingXml)),X=u("settings",()=>chunkFIGLFSNR_js.b(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let p=u("media",()=>Ze(f,y));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};u("documentBody",()=>{f.documentXml?x=te(f.documentXml,D,C,v,y,p):g.push("No document.xml found in DOCX");}),o("Parsed document body",55);let F,A;if(r){o("Parsing headers/footers...",55);let P=u("headersFooters",()=>qe(f,D,C,v,y,p));F=P.headers,A=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let k,M,R,V;if(a){o("Parsing footnotes/endnotes...",65);let P=u("footnotesEndnotes",()=>Je(f,D,C,v,y,p));k=P.footnotes,M=P.endnotes,R=P.footnoteSeparators,V=P.endnoteSeparators,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=u("comments",()=>Ne(f.commentsXml,D,C,y,p,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(x.comments=L);let N;c?(o("Detecting template variables...",75),N=u("variables",()=>ee(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),i?(o("Loading fonts...",80),await S("fonts",()=>Qe(C,B,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let _={package:{document:x,styles:B,theme:C,numbering:v.definitions,settings:X,headers:F,footers:A,footnotes:k,endnotes:M,footnoteSeparators:R,endnoteSeparators:V,relationships:y,media:p},originalBuffer:e,templateVariables:N,warnings:g.length>0?g:void 0},m=performance.now()-h;if(m>2e3){let P=b.filter(I=>I.ms>100).map(I=>`${I.stage}: ${Math.round(I.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(m)}ms`+(P?` (${P})`:""));}return o("Complete",100),_}catch(h){let b=h instanceof Error?h.message:String(h);throw console.error("[parseDocx] Failed to parse DOCX:",b,h),new Error(`Failed to parse DOCX: ${b}`)}}function Ze(t,n){let e=new Map;for(let[o,i]of t.media.entries()){let r=o.split("/").pop()||o,a=Me(o),c=new Uint8Array(i),g="";for(let S=0;S<c.length;S++)g+=String.fromCharCode(c[S]);let d=btoa(g),h=`data:${a};base64,${d}`,b={path:o,filename:r,mimeType:a,data:i,dataUrl:h};e.set(o,b);let u=o.replace(/^word\//,"");u!==o&&e.set(u,b);}return e}function ne(t,n){let e=n.toLowerCase();for(let[o,i]of t.entries())if(o.toLowerCase()===e)return i}function qe(t,n,e,o,i,r){let a=new Map,c=new Map;for(let[g,d]of i.entries())if(d.type===chunkZ3LGMBJC_js.a.header&&d.target){let h=d.target.split("/").pop()||d.target,b=ne(t.headers,h);if(b){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,y=chunkDFDL337G_js.r(b,"default",n,e,o,f,r);a.set(g,y);}}else if(d.type===chunkZ3LGMBJC_js.a.footer&&d.target){let h=d.target.split("/").pop()||d.target,b=ne(t.footers,h);if(b){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,y=chunkDFDL337G_js.s(b,"default",n,e,o,f,r);c.set(g,y);}}return {headers:a,footers:c}}function Je(t,n,e,o,i,r){let a=chunkDFDL337G_js.t(t.footnotesXml,n,e,o,i,r),c=chunkDFDL337G_js.u(t.endnotesXml,n,e,o,i,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes(),footnoteSeparators:a.footnotes.filter(chunkDFDL337G_js.z),endnoteSeparators:c.endnotes.filter(chunkDFDL337G_js.A)}}async function Qe(t,n,e){let o=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:r}=t.fontScheme;i?.latin&&o.add(i.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let i of n.styles)i.rPr?.fontFamily?.ascii&&o.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&o.add(i.rPr.fontFamily.hAnsi);if(e.content){for(let i of e.content)if(i.type==="paragraph")for(let r of i.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await chunkQVRMX2AC_js.q(Array.from(o));}catch(i){console.warn("Failed to load some fonts:",i);}}async function Et(t){return Ve(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Nt(t,n){return Ve(t,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Vt(t){let n=await G(t);if(!n.documentXml)return [];let e=te(n.documentXml);return ee(e.content)}async function Ht(t){let n=await G(t),e=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:e.length}}
|
|
2
2
|
exports.a=Ve;exports.b=Et;exports.c=Nt;exports.d=Vt;exports.e=Ht;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkFIGLFSNR_js=require('./chunk-FIGLFSNR.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function ee(e,t,n,r){let o=e-t-n,i=(r.count-1)*r.gap;return (o-i)/r.count}function me(e){let t={...e.pageSize},n={...e.margins},r=e.columns??{count:1,gap:0},o=false,i,s,a=[],l=[];function u(){return t.h-n.bottom}function c(){return u()-n.top}function g(){return t.w-n.left-n.right}if(c()<=0)throw new Error(`Paginator: page size and margins yield no content area (pageSize=${Math.round(t.w)}x${Math.round(t.h)} margins top=${Math.round(n.top)} bottom=${Math.round(n.bottom)} left=${Math.round(n.left)} right=${Math.round(n.right)})`);let d=ee(t.w,n.left,n.right,r),S=n.top;function P(h){return n.left+h*(d+r.gap)}function M(){(i||s)&&(i&&(t=i),s&&(n=s),i=void 0,s=void 0,d=ee(t.w,n.left,n.right,r));let h=a.length+1,F=n.top,v=u(),m=e.footnoteReservedHeights?.get(h)??0,p=v-m,x={number:h,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:m>0?m:void 0,columns:r.count>1?{...r}:void 0},b={page:x,cursorY:F,columnIndex:0,topMargin:F,contentBottom:p,trailingSpacing:0};return a.push(x),l.push(b),S=F,e.onNewPage&&e.onNewPage(b),b}function B(){return l.length===0?M():l[l.length-1]}function T(h){return h.contentBottom-h.cursorY}function I(h,F){let v=F||B();return T(v)>=h}function w(h){return h.columnIndex<r.count-1?(h.columnIndex+=1,h.cursorY=S,h.trailingSpacing=0,h):M()}function C(h){let F=B(),v=Number.isFinite(h)&&h>0?h:0;for(;!I(v,F);){let m=F.contentBottom-F.topMargin;if(v>m)return o||(o=true,console.warn(`Paginator: fragment height ${v.toFixed(0)}px exceeds page content height ${m.toFixed(0)}px; placing with overflow.`)),F.cursorY!==F.topMargin&&(F=w(F)),F;F=w(F);}return F}function R(h,F,v=0,m=0){let p=Math.max(v,B().trailingSpacing),x=p+F,b=C(x),y=p,_=P(b.columnIndex),k=b.cursorY+y;return h.x=_,h.y=k,b.page.fragments.push(h),b.cursorY=k+F,b.trailingSpacing=m,{state:b,x:_,y:k}}function f(){if(l.length>0){let h=l[l.length-1];if(h.page.fragments.length===0&&h.cursorY===h.topMargin)return h}return M()}function L(){let h=B();return w(h)}function W(h){r=h,d=ee(t.w,n.left,n.right,r);let F=B();F.page.columns=r.count>1?{...r}:void 0,S=F.cursorY,F.columnIndex=0;}function H(h,F,v=true){if(!v){i=h?{...h}:i,s=F?{...F}:s;return}if(h&&(t={...h}),F&&(n={...F}),c()<=0)throw new Error("Paginator: section page size and margins yield no content area");d=ee(t.w,n.left,n.right,r),i=void 0,s=void 0;}return {pages:a,states:l,get columnWidth(){return d},get columns(){return {...r}},getCurrentState:B,getAvailableHeight:()=>T(B()),getContentWidth:g,fits:h=>I(h),ensureFits:C,addFragment:R,forcePageBreak:f,forceColumnBreak:L,getColumnX:P,updateColumns:W,updatePageLayout:H}}function pe(e){let t=new Map,n=new Set;for(let r=0;r<e.length;r++){if(n.has(r))continue;let o=e[r];if(o.kind!=="paragraph"||!o.attrs?.keepNext)continue;let s=[r],a=r;for(let c=r+1;c<e.length;c++){let g=e[c];if(g.kind==="sectionBreak"||g.kind==="pageBreak"||g.kind==="columnBreak"||g.kind!=="paragraph")break;if(g.attrs?.keepNext)s.push(c),a=c,n.add(c);else break}let l=a+1,u=-1;if(l<e.length){let c=e[l];c.kind!=="sectionBreak"&&c.kind!=="pageBreak"&&c.kind!=="columnBreak"&&(u=l);}t.set(r,{startIndex:r,endIndex:a,memberIndices:s,anchorIndex:u});}return t}function de(e,t,n){let r=0;for(let o of e.memberIndices){let i=t[o],s=n[o];if(i.kind!=="paragraph"||s.kind!=="paragraph")continue;let a=i,l=s,u=a.attrs?.spacing?.before??0;r+=u,r+=l.totalHeight;let c=a.attrs?.spacing?.after??0;r+=c;}if(e.anchorIndex!==-1){let o=n[e.anchorIndex];if(o?.kind==="paragraph"){let i=o;i.lines.length>0&&(r+=i.lines[0].lineHeight);}}return r}function he(e){let t=new Set;for(let n of e.values())for(let r=1;r<n.memberIndices.length;r++)t.add(n.memberIndices[r]);return t}function at(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function be(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function $(e){return e.displayMode==="float"||chunkJFZIXFRC_js.a(e.wrapType)||e.wrapType==="topAndBottom"}function st(e){return $(e)&&e.wrapType==="topAndBottom"}function lt(e){return $(e)&&!chunkJFZIXFRC_js.b(e.wrapType)&&e.wrapType!=="topAndBottom"}function Le(e,t,n){if(!(!e||e<=0)){if(t==="pct")return n*e/5e3;if(!t||t==="dxa"||t==="auto")return chunkBJSG6TEG_js.d(e)}}function ke(e){let t=new Map,n=[];for(let r=0;r<e.rows.length;r++){let o=e.rows[r]?.cells??[],i=t.get(r)??new Set,s=0;for(;i.has(s);)s++;for(let a=0;a<o.length;a++){let l=o[a];if(!l)continue;let u=l.colSpan??1,c=l.rowSpan??1;if(n.push({rowIndex:r,cellIndex:a,columnIndex:s,colSpan:u,rowSpan:c}),c>1)for(let g=r+1;g<r+c;g++){t.has(g)||t.set(g,new Set);let d=t.get(g);for(let S=0;S<u;S++)d.add(s+S);}for(s+=u;i.has(s);)s++;}}return n}function ut(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((n,r)=>n+Math.max(1,r.colSpan??1),0)))}function ct(e,t,n){if(t<=0)return [];let r=n>0?n/t:0;if(e.length===0)return Array(t).fill(r);let o=e.slice(0,t),i=t-o.length;if(i>0){let c=o.filter(d=>d>0),g=c.length>0?c.reduce((d,S)=>d+S,0)/c.length:r;o=o.concat(Array(i).fill(g));}let s=o.reduce((c,g)=>c+(g>0?g:0),0),a=o.filter(c=>c<=0).length;if(s<=0)return Array(t).fill(r);if(a===0)return o;let l=Math.max(0,n-s),u=l>0?l/a:s/Math.max(1,t-a);return o.map(c=>c>0?c:u)}function ft(e,t){let n=e.columnWidths??[],r=Le(e.width,e.widthType,t),o=ut(e),i=r??t;if(e.rows.length>0&&(n=ct(n,o,i)),n.length>0&&r){let s=n.reduce((a,l)=>a+l,0);if(s>0&&Math.abs(s-r)>1){let a=r/s;n=n.map(l=>l*a);}}return n}function on(e,t){let n=ft(e,t),r=Le(e.width,e.widthType,t);return n.reduce((o,i)=>o+i,0)||r||t}function Ie(e,t,n){let r=[],o=[],i=n,s=0,a=t?.length??0;for(let l=0;l<a;l++){let u=t[l],c=e?.[l];if(c?.kind==="paragraph"&&u?.kind==="paragraph"){let g=c.attrs?.spacing;i+=Math.max(s,g?.before??0);let d=[];for(let S of u.lines)i+=S.floatSkipBefore??0,d.push(i),i+=S.lineHeight,o.push(i);r.push(d),s=g?.after??0;}else u&&"totalHeight"in u&&typeof u.totalHeight=="number"?(i+=s+u.totalHeight,r.push([]),o.push(i),s=0):r.push([]);}return {lineTops:r,flatBottoms:o,contentHeight:i-n+s}}function ve(e,t){let n=t.rows.length,r=[],o=0;for(let a=0;a<n;a++)r.push(o),o+=t.rows[a]?.height??0;r.push(o);let i=ke(e),s=[];for(let a=0;a<n;a++){let l=t.rows[a]?.height??0,u=new Set;u.add(l);for(let c of i){if(c.rowIndex>a||c.rowIndex+c.rowSpan-1<a)continue;let g=e.rows[c.rowIndex]?.cells?.[c.cellIndex],d=t.rows[c.rowIndex]?.cells?.[c.cellIndex];if(!g||!d)continue;let S=g.padding?.top??0,{flatBottoms:P}=Ie(g.blocks,d.blocks,S),M=r[a]-r[c.rowIndex];for(let B of P){let T=B-M;T>0&&T<l&&u.add(T);}}s.push([...u].sort((c,g)=>c-g));}return {rowTops:r,breakOffsets:s}}function Ee(e,t,n,r){let o=e.breakOffsets[t];if(!o||o.length===0)return 0;let i=n+r,s=0;for(let a of o)if(!(a<=n))if(a<=i)s=a-n;else break;return s}var gt=1440,xe=96,He=gt/xe,Ae=11,ze="Calibri",mt=1,pt=.8,dt=.2,j=null;function Se(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function gn(){j=null;}var We=new Map;function Oe(e){let t=We.get(e);if(t===void 0){let n=chunkN3Y5BUKV_js.a(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},We.set(e,t);}return t}function ht(e){return Oe(e).cssFallback}function Me(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??Ae,r=Y(n);t.push(`${r}px`);let o=e.fontFamily??ze;return t.push(ht(o)),t.join(" ")}function V(e){let t=e.fontSize??Ae,n=e.fontFamily??ze,r=Y(t),o=r*pt,i=r*dt,s=r*mt;try{let l=Se();l.font=Me(e);let u=l.measureText("Hg");typeof u.actualBoundingBoxAscent=="number"&&typeof u.actualBoundingBoxDescent=="number"&&(o=u.actualBoundingBoxAscent,i=u.actualBoundingBoxDescent);}catch{}s=Math.max(s,o+i);let a=Oe(n).singleLineRatio;return {fontSize:t,ascent:o,descent:i,lineHeight:s,fontFamily:n,singleLineRatio:a}}function z(e,t){if(!e)return 0;let n=Se();n.font=Me(t);let o=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(o+=t.letterSpacing*(e.length-1)),o}function mn(e,t){let n=z(e,t),r=V(t);return {width:n,height:r.ascent+r.descent,ascent:r.ascent,descent:r.descent}}function _e(e,t){let n=V(t);if(!e)return {width:0,charWidths:[],metrics:n};let r=Se();r.font=Me(t);let o=t.letterSpacing??0,i=[],s=0;for(let a=0;a<e.length;a++){let l=e[a],c=r.measureText(l).width;o&&a<e.length-1&&(c+=o),i.push(c),s+=c;}return {width:s,charWidths:i,metrics:n}}function pn(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let r=0;r<t.length;r++){let o=t[r],i=n+o/2;if(e<=i)return r;n+=o;}return t.length}function dn(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),r=0;for(let o=0;o<n;o++)r+=t[o];return r}function hn(e){return e/He}function bn(e){return Math.round(e*He)}function Y(e){return e*xe/72}function bt(e){return e*72/xe}function xn(e){return Y(e/2)}function Sn(e){return bt(e)*2}function Te(e){return e/1440*96}function ye(e){return e/96*1440}function xt(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:r=0}=e,o=t.filter(g=>g.val!=="clear").filter(g=>g.pos>=r),i=t.filter(g=>g.val==="clear").map(g=>g.pos),s=o.reduce((g,d)=>Math.max(g,d.pos),0),a=[...o];r>0&&!o.some(g=>g.pos<=r)&&(i.some(d=>Math.abs(d-r)<20)||a.push({val:"start",pos:r,leader:"none"}));let u=s>0?Math.max(s,r):r,c=r+14400;for(;u<c;){u+=n;let g=o.some(P=>Math.abs(P.pos-u)<20),d=i.some(P=>Math.abs(P-u)<20),S=r>0&&Math.abs(u-r)<20;!g&&!d&&!S&&a.push({val:"start",pos:u,leader:"none"});}return a.sort((g,d)=>g.pos-d.pos)}function Ne(e,t,n={}){let{defaultTabInterval:r=720}=t,o=ye(e),s=xt(t).find(u=>u.pos>o);if(!s){let u=Te(r),c=u-e%u;return c<=0&&(c=u),{width:c,alignment:"default"}}let l=Te(s.pos)-e;if(s.val==="center")l-=(n.followingWidth??0)/2;else if(s.val==="end")l-=n.followingWidth??0;else if(s.val==="decimal")l-=n.decimalPrefixWidth??0;else if(s.val==="bar")return {width:0,leader:s.leader,alignment:"bar"};if(l<1){let u=Te(r),c=u-e%u;return c<=0&&(c=u),{width:c,alignment:"default"}}return {width:l,leader:s.leader,alignment:s.val}}var St="Calibri",Mt=11;function Tt(e){let t=e.attrs,n=e.runs?.find(i=>i.kind==="text"),r=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??St,o=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??Mt;return {fontFamily:r,fontSize:o}}function Ye(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,r=n?.hanging??0;if(r>0)return r;let{fontFamily:o,fontSize:i}=Tt(e),s={fontFamily:o,fontSize:i},a=z(t.listMarker,s),l=t.listMarkerSuffix??"tab";if(l==="nothing")return a;if(l==="space")return a+z(" ",s);let u=n?.left??0,c=n?.firstLine??0,g=u+c,d=g+a,S=(t.tabs??[]).filter(T=>T.val!=="clear"&&T.val!=="bar").map(T=>chunkIMKU4O3P_js.a(T.pos)).filter(T=>T>=d).sort((T,I)=>T-I)[0],P=chunkIMKU4O3P_js.a(t.defaultTabStopTwips??chunkFIGLFSNR_js.a),M=P>0?(Math.floor(d/P)+1)*P:void 0,B;return S!==void 0&&M!==void 0?B=Math.min(S,M):B=S??M,B===void 0?a+Y(i)*.5:B-g}var D=11,X="Calibri",yt=1.15,ne=1,Z=.5;function De(e,t,n,r=false){let o=1,i=e.length,s=0;for(;o<=i;){let a=o+i>>>1;z(e.slice(0,a),t)<=n?(s=a,o=a+1):i=a-1;}return r&&s===0?1:s}function q(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Ue(e,t,n){let r=Y(e),o=n?.ascent??r*.8,i=n?.descent??r*.2,s=n?.singleLineRatio??1.15,a=r*s,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let u=a*ne;l=Math.max(t.line,u);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=a*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=a*ne;return {ascent:o,descent:i,lineHeight:l}}function Ze(e,t,n){let r=V({fontSize:e,fontFamily:n??X}),o=Ue(e,t,r),i=t?.lineRule??"auto";if(i==="auto"||i==="atLeast"){let s=Y(e),a=Math.max(o.lineHeight,s*yt);if(a!==o.lineHeight)return {...o,lineHeight:a}}return o}function te(e){return e.kind==="text"}function Xe(e){return e.kind==="tab"}function Ge(e){return e.kind==="image"}function Ke(e){return e.kind==="lineBreak"}function $e(e){return e.kind==="field"}function Pt(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function Ft(e,t){let n=0;for(let r=t+1;r<e.length;r++){let o=e[r];if(Xe(o)||Ke(o))break;if(te(o))n+=z(o.text||"",q(o));else if($e(o)){let i={fontFamily:o.fontFamily??X,fontSize:o.fontSize??D,bold:o.bold,italic:o.italic};n+=z(o.fallback||"1",i);}else Ge(o)&&(n+=o.width||0);}return n}function Bt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];(r===" "||r==="-"||r===" ")&&t.push(n+1);}return t}function je(e,t,n){let r=Math.max(1,n),o=Math.max(0,e),i=Math.max(0,t);return o>=r||i>=r||o+i>=r?{leftMargin:0,rightMargin:0}:{leftMargin:o,rightMargin:i}}function wt(e,t,n){let r=e.runs,o=e.attrs,i=o?.spacing,s=n?.floatingZones,a=n?.paragraphYOffset??0,l=o?.indent,u=l?.left??0,c=l?.right??0,g=(l?.firstLine??0)-(l?.hanging??0),d=Math.max(1,t-u-c),S=(l?.hanging??0)===0?Ye(e):0,P=Math.max(1,d-g-S),M=0,B=0,T=Y(D)*ne,I=(m,p)=>{if(!s||s.length===0)return;let x=a+M,b=Ve(x,m,s,p,U)-x;b>0&&(M+=b,B+=b);};I(T,P);let w=oe(M,T,s,a),C=Math.max(1,re(w,P)),R=[];if(r.length===0){if(o?.suppressEmptyParagraphHeight)return R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:R,totalHeight:0};let m=o?.defaultFontSize??D,p=o?.defaultFontFamily??X,x=Ze(m,i,p);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...x});let b=x.lineHeight;return i?.before&&(b+=i.before),i?.after&&(b+=i.after),{kind:"paragraph",lines:R,totalHeight:b}}if(r.length===1&&te(r[0])&&Pt(r[0])){let m=r[0],p=m.fontSize??o?.defaultFontSize??D,x=m.fontFamily??o?.defaultFontFamily??X,b=Ze(p,i,x);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...b});let y=b.lineHeight;return i?.before&&(y+=i.before),i?.after&&(y+=i.after),{kind:"paragraph",lines:R,totalHeight:y}}let f={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:w.leftMargin,rightOffset:w.rightMargin,segmentZones:w.segments},L=()=>{let m=Ue(f.maxFontSize,i,f.maxFontMetrics),p={...m};if(f.maxImageHeightPx>p.lineHeight){let b=f.maxImageHeightPx,y=p.descent;f.fromRun===f.toRun?(p.lineHeight=b+y*2,p.ascent=b+y):(p.lineHeight=b+y,p.ascent=b);}let x={fromRun:f.fromRun,fromChar:f.fromChar,toRun:f.toRun,toChar:f.toChar,width:f.width,...p};f.leftOffset>0&&(x.leftOffset=f.leftOffset),f.rightOffset>0&&(x.rightOffset=f.rightOffset),f.segmentZones?.length&&(x.segments=W(x,f.segmentZones)),B>0&&(x.floatSkipBefore=B,B=0),R.push(x),M+=m.lineHeight;},W=(m,p)=>{let x=p[0],b=p[1];if(!x)return;if(!b||m.width<=x.availableWidth+Z)return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:m.toChar,width:m.width,leftOffset:x.leftOffset,availableWidth:x.availableWidth}];if(m.fromRun!==m.toRun)return;let y=r[m.fromRun];if(!y||!te(y))return;let _=y,k=_.text.slice(m.fromChar,m.toChar),O=q(_),E=De(k,O,x.availableWidth);if(E<=0||E>=k.length)return;let N=m.fromChar+E,A=k.slice(0,E),K=k.slice(E);return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:N,width:z(A,O),leftOffset:x.leftOffset,availableWidth:x.availableWidth},{fromRun:m.fromRun,fromChar:N,toRun:m.toRun,toChar:m.toChar,width:z(K,O),leftOffset:b.leftOffset,availableWidth:b.availableWidth}]},H=(m,p)=>{L();let x=Y(D)*ne;I(x,d);let b=oe(M,x,s,a),y=Math.max(1,re(b,d));f={fromRun:m,fromChar:p,toRun:m,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:y,leftOffset:b.leftMargin,rightOffset:b.rightMargin,segmentZones:b.segments};},h=m=>{let p=m.fontSize??D;(!f.maxFontMetrics||p>f.maxFontSize)&&(f.maxFontSize=p,f.maxFontMetrics=V(m));};for(let m=0;m<r.length;m++){let p=r[m];if(Ke(p)){f.toRun=m,f.toChar=0,H(m+1,0);continue}if(Xe(p)){let x=q(p);h(x);let b=Ft(r,m),y=f.width+(f.leftOffset??0),_=R.length===0,k=u+(_?g:0)+y,O={explicitStops:o?.tabs,leftIndent:ye(u)},E=Ne(k,O,{followingWidth:b}).width;if(y+E>f.availableWidth+Z){let N=f.availableWidth-y-b;N>1&&(E=N);}f.width+E>f.availableWidth+Z&&(H(m,0),h(x)),f.width+=E,f.toRun=m,f.toChar=1;continue}if(Ge(p)){let x=p.wrapType,b=p.displayMode==="float"||chunkJFZIXFRC_js.c(x);if(p.position&&b){f.toRun=m,f.toChar=1;continue}if(x==="topAndBottom"||p.displayMode==="block"){f.width>0&&H(m,0);let N=p.height,A=p.distTop??6,K=p.distBottom??6;f.toRun=m,f.toChar=1,f.maxImageHeightPx=N+A+K,H(m+1,0);continue}let y=p.width,_=p.height;f.width+y>f.availableWidth+Z&&H(m,0);let k=y>0&&y>f.availableWidth?f.availableWidth/y:1,E=_*k+(p.distTop??0)+(p.distBottom??0);E>f.maxImageHeightPx&&(f.maxImageHeightPx=E),f.width+=y,f.toRun=m,f.toChar=1;continue}if($e(p)){let x=p.fallback||"1",b={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};h(b);let y=z(x,b);f.width>0&&f.width+y>f.availableWidth+Z&&(H(m,0),h(b)),f.width+=y,f.toRun=m,f.toChar=1;continue}if(te(p)){let x=p,b=x.text,y=q(x);if(h(y),!b||b.length===0){f.toRun=m,f.toChar=0;continue}let _=Bt(b),k=0;for(;k<b.length;){let O=b.length;for(let A of _)if(A>k){O=A;break}let E=b.slice(k,O),N=z(E,y);if(N>f.availableWidth+Z){let A=0;for(;A<E.length;){let K=f.availableWidth-f.width+Z,rt=E.slice(A),se=De(rt,y,K);if(se===0){if(f.width>0){H(m,k+A),h(y);continue}se=1;}let le=A+se,ot=E.slice(A,le),it=z(ot,y);f.width+=it,f.toRun=m,f.toChar=k+le,A=le,A<E.length&&(H(m,k+A),h(y));}k=O;continue}f.width>0&&f.width+N>f.availableWidth+Z&&(H(m,k),h(y)),f.width+=N,f.toRun=m,f.toChar=O,k=O;}}}L();let v=R.reduce((m,p)=>m+p.lineHeight+(p.floatSkipBefore??0),0);return i?.before&&(v+=i.before),i?.after&&(v+=i.after),{kind:"paragraph",lines:R,totalHeight:v}}function vn(e,t){return e.map(n=>wt(n,t))}function En(e){let t=q(e);return _e(e.text,t).charWidths}function An(e,t){return e.map(n=>{let r=n.x-n.distLeft,o=n.x+n.width+n.distRight,i=n.y-n.distTop,s=n.y+n.height+n.distBottom;if(n.wrapType==="topAndBottom")return {leftMargin:0,rightMargin:0,topY:i,bottomY:s,fullWidthBlock:true};let a=0,l=0,u,c=n.wrapText??"bothSides";c==="right"?a=Pe(o):c==="left"?l=Fe(r,t):c==="largest"?{leftMargin:a,rightMargin:l}=kt(r,o,t):Rt(r,o,t)?u=Lt(r,o,t):n.side==="left"?a=Pe(o):l=Fe(r,t);let g=je(a,l,t);return {leftMargin:g.leftMargin,rightMargin:g.rightMargin,topY:i,bottomY:s,segments:u}})}function re(e,t){return e.segments?.reduce((r,o)=>r+o.availableWidth,0)??t-e.leftMargin-e.rightMargin}function oe(e,t,n,r){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let o=0,i=0,s,a=r+e,l=a+t;for(let u of n)if(!(l<=u.topY||a>=u.bottomY)){if(u.fullWidthBlock)return {leftMargin:0,rightMargin:0,segments:[{leftOffset:0,availableWidth:0}]};if(u.segments?.length){s=s?Ct(s,u.segments):u.segments;continue}o=Math.max(o,u.leftMargin),i=Math.max(i,u.rightMargin);}return {leftMargin:o,rightMargin:i,segments:s}}function Ve(e,t,n,r,o){if(!n||n.length===0)return e;let i=e;for(let s=0;s<n.length+2;s++){let a=oe(i,t,n,0);if(re(a,r)>=o)return i;let u=i+t,c=1/0;for(let g of n)u<=g.topY||i>=g.bottomY||g.bottomY>i&&g.bottomY<c&&(c=g.bottomY);if(!Number.isFinite(c)||c<=i)return i;i=c;}return i}function Ct(e,t){let n=[];for(let r of e)for(let o of t){let i=Math.max(r.leftOffset,o.leftOffset),s=Math.min(r.leftOffset+r.availableWidth,o.leftOffset+o.availableWidth);s>i&&n.push({leftOffset:i,availableWidth:s-i});}return n}var U=24;function Rt(e,t,n){return e>U&&t+U<n}function Lt(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(r=>r.availableWidth>1)}function kt(e,t,n){let r=Math.max(0,e);return Math.max(0,n-t)>=r?{leftMargin:Pe(t),rightMargin:0}:{leftMargin:0,rightMargin:Fe(e,n)}}function Pe(e){return Math.max(0,e)}function Fe(e,t){return Math.max(0,t-e)}function It(e,t){return e==null||!Number.isFinite(e)?0:Math.max(0,Math.min(t,e))}function ie(e,t,n){if(e)return e.kind==="text"?typeof e.pmStart=="number"?e.pmStart+It(t,e.text.length):n==="end"?e.pmEnd:void 0:n==="end"?typeof e.pmEnd=="number"?e.pmEnd:typeof e.pmStart=="number"?e.pmStart+1:void 0:e.pmStart}function qe(e,t,n,r){if(t.lines.length===0||n>=r)return {pmStart:e.pmStart,pmEnd:e.pmEnd};let o=t.lines[n],i=t.lines[r-1],s=o?e.runs[o.fromRun]:void 0,a=i?e.runs[i.toRun]:void 0,l=n===0?e.pmStart??ie(s,o?.fromChar??0,"start"):ie(s,o?.fromChar??0,"start"),u=r>=t.lines.length?e.pmEnd??ie(a,i?.toChar??0,"end"):ie(a,i?.toChar??0,"end");return l==null&&(l=e.pmStart),u==null&&(u=e.pmEnd),l!=null&&u!=null&&u<=l&&(u=l+1),{pmStart:l,pmEnd:u}}function Je(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function J(e){let t=e.attrs?.spacing?.before??0;return Je(e)&&!e.attrs?.spacingExplicit?.before?0:t}function Q(e){let t=e.attrs?.spacing?.after??0;return Je(e)&&!e.attrs?.spacingExplicit?.after?0:t}function vt(e,t,n,r){let o=0,i=false;for(let s=n;s<r;s++){let a=e[s],l=t[s];if(a.kind==="paragraph"&&l.kind==="paragraph"){o+=J(a)+l.totalHeight+Q(a),i=i||l.lines.length>0;continue}if(a.kind!=="sectionBreak")return null}return i?o:null}function Et(e,t){let n=e.columns;if(n.count<=1||!Number.isFinite(t)||t<=0)return;let r=e.getCurrentState(),o=r.cursorY,i=r.contentBottom-o;if(i<=0||t>i*n.count)return;let s=Math.ceil(t/n.count);s<=0||s>=i||(r.contentBottom=o+s);}function Qe({blocks:e,measures:t,paginator:n,start:r,end:o}){let i=vt(e,t,r,o);i!==null&&Et(n,i);}var et={count:1,gap:0};function Wt(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...et},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function Ht(e,t){return t.count>1}function ae(e){return e?{count:e.count,gap:e.gap}:{...et}}function At(e,t,n){let r={...t},o=e.type??"continuous",i=e.margins,s=e.pageSize,a=e.orientation;i&&(typeof i.top=="number"&&(r.pendingTopMargin=Math.max(0,i.top)),typeof i.bottom=="number"&&(r.pendingBottomMargin=Math.max(0,i.bottom)),typeof i.left=="number"&&(r.pendingLeftMargin=Math.max(0,i.left)),typeof i.right=="number"&&(r.pendingRightMargin=Math.max(0,i.right))),s&&(r.pendingPageSize={w:s.w,h:s.h}),a&&(r.pendingOrientation=a);let l=Ht((e.margins,void 0),r.activeColumns);switch(o){case "nextPage":return r.pendingColumns=ae(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:r};case "evenPage":return r.pendingColumns=ae(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:r};case "oddPage":return r.pendingColumns=ae(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:r};default:return l?(r.pendingColumns=ae(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:r}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:r}}}function zt(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function Ot(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function _t(e){return e.pendingPageSize??e.activePageSize}function Nt(e){return e.pendingColumns??e.activeColumns}function Yt(e,t){for(let n=0;n<e.pages.length;n++)for(let r of e.pages[n].fragments){if(r.pmStart==null)continue;let o=r.pmStart,i=r.pmEnd??o+1;if(t>=o&&t<i)return n}return null}var Dt={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},tt={count:1,gap:0};function Zt(e,t,n){let r=[],o=[],i=t;for(let s=0;s<e.length;s++){if(e[s].kind!=="sectionBreak")continue;let a=e[s],l={pageSize:a.pageSize??i.pageSize,margins:a.margins??i.margins,columns:a.columns};r.push(l),o.push(s),i=l;}return r.push(n),{configs:r,breakIndices:o}}function nt(e){for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n.kind!=="paragraph"||r.kind!=="paragraph")continue;let o=n.attrs,i=r.attrs;o?.contextualSpacing&&i?.contextualSpacing&&o.styleId&&o.styleId===i.styleId&&(o.spacing&&(o.spacing={...o.spacing,after:0}),i.spacing&&(i.spacing={...i.spacing,before:0}));}for(let t of e)if(t.kind==="table")for(let n of t.rows)for(let r of n.cells)nt(r.blocks);}function Qn(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let r=n.pageSize??Dt,o={top:n.margins?.top??G.top,right:n.margins?.right??G.right,bottom:n.margins?.bottom??G.bottom,left:n.margins?.left??G.left,header:n.margins?.header??n.margins?.top??G.top,footer:n.margins?.footer??n.margins?.bottom??G.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let i={...o},s=n.finalPageSize??r,a=n.finalMargins??i;if(r.w-i.left-i.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let u={pageSize:r,margins:i,columns:n.columns},c={pageSize:s,margins:a,columns:n.columns},{configs:g,breakIndices:d}=Zt(e,u,c),S=[...d.map(w=>e[w].type),n.bodyBreakType],P=g[0]??u,M=me({pageSize:P.pageSize,margins:P.margins,columns:P.columns??tt,footnoteReservedHeights:n.footnoteReservedHeights});nt(e);let B=pe(e),T=he(B),I=0;for(let w=0;w<e.length;w++){let C=e[w],R=t[w];be(C)&&M.forcePageBreak();let f=B.get(w);if(f&&!T.has(w)){let L=de(f,e,t),W=M.getCurrentState(),H=M.getAvailableHeight(),h=W.contentBottom-W.topMargin;L<=h&&L>H&&W.page.fragments.length>0&&M.forcePageBreak();}switch(C.kind){case "paragraph":Ut(C,R,M,M.getContentWidth());break;case "table":C.floating?$t(C,R,M,M.getContentWidth()):Kt(C,R,M);break;case "image":jt(C,R,M);break;case "textBox":qt(C,R,M);break;case "pageBreak":M.forcePageBreak();break;case "columnBreak":M.forceColumnBreak();break;case "sectionBreak":{let L=S[I+1]??S[I],W=g[I+1]??P;Jt(C,M,W,L),d[I+1]===void 0&&(L??"nextPage")==="continuous"&&(W.columns?.count??1)>1&&Qe({blocks:e,measures:t,paginator:M,start:w+1,end:e.length}),I++;break}default:chunkDROCYKAR_js.c(C,"runLayoutPipeline");}}return M.pages.length===0&&M.getCurrentState(),{pageSize:r,pages:M.pages,columns:n.columns,pageGap:n.pageGap}}function Ut(e,t,n,r){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let o=t.lines;if(o.length===0){let l=J(e),u=Q(e),c=n.getCurrentState(),g={kind:"paragraph",blockId:e.id,x:n.getColumnX(c.columnIndex),y:c.cursorY+l,width:r,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(g,0,l,u);return}let i=J(e),s=Q(e),a=0;for(;a<o.length;){let l=n.getCurrentState(),u=a===0?Math.max(i,l.trailingSpacing):0,c=n.getAvailableHeight()-u,g=0,d=0;for(let C=a;C<o.length;C++){let R=o[C].lineHeight+(o[C].floatSkipBefore??0),f=g+R;if(f<=c||d===0)g=f,d++;else break}let S=a===0,P=a+d>=o.length,M=S?i:0,B=P?s:0,T=qe(e,t,a,a+d),I={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:r,height:g,fromLine:a,toLine:a+d,pmStart:T.pmStart,pmEnd:T.pmEnd,continuesFromPrev:!S,continuesOnNext:!P},w=n.addFragment(I,g,M,B);I.y=w.y,a+=d,a<o.length&&n.ensureFits(o[a].lineHeight);}}function Xt(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function Gt(e,t){let n=0;for(let r=0;r<t&&r<e.rows.length;r++)n+=e.rows[r].height;return n}function Kt(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let r=t.rows;if(r.length===0)return;let o=Xt(e),i=Gt(t,o),s=ve(e,t),a=0,l=0;for(;a<r.length;){let u=n.getCurrentState(),c=a===0&&l===0,g=c?u.trailingSpacing:0,d=!c&&o>0?i:0,S=n.getAvailableHeight()-g-d,P=a,M=l,B=0,T=a,I=l,w=a,C,R=false;for(;T<r.length;){let F=r[T].height,v=T===P?I:0,m=F-v;if(B+m<=S){B+=m,T+=1,w=T;continue}let p=S-B,x=e.rows[T]?.cantSplit?0:Ee(s,T,v,p);x>0?(B+=x,w=T+1,C=v+x,R=true):w>P||(B+=m,w=T+1);break}let f=d+B,L=w===r.length&&!R,W=n.getColumnX(u.columnIndex);e.justification==="center"?W=W+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?W=W+n.columnWidth-t.totalWidth:e.indent&&(W+=e.indent);let H={kind:"table",blockId:e.id,x:W,y:0,width:t.totalWidth,height:f,fromRow:P,toRow:w,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!c,continuesOnNext:!L,headerRowCount:!c&&o>0?o:void 0,topClip:M>0?M:void 0,bottomClip:C},h=n.addFragment(H,f,0,0);if(H.y=h.y,H.x=W,R?(a=w-1,l=C??0):(a=w,l=0),a<r.length){let F=(o>0?i:0)+(r[a].height-l);n.ensureFits(F);}}}function $t(e,t,n,r){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let o=n.getCurrentState(),i=e.floating,s=o.page,a=s.margins,l=t.totalWidth,u=t.totalHeight,c=s.size.h-a.top-a.bottom,g=a.left,d=a.top;i?.horzAnchor==="page"&&(g=0),i?.vertAnchor==="page"&&(d=0),i?.vertAnchor==="text"&&(d=o.cursorY);let S=n.getColumnX(o.columnIndex);if(i?.tblpX!==void 0)S=g+i.tblpX;else if(i?.tblpXSpec){let L=i.tblpXSpec;L==="left"||L==="inside"?S=g:L==="right"||L==="outside"?S=g+r-l:L==="center"&&(S=g+(r-l)/2);}else e.justification==="center"?S=g+(r-l)/2:e.justification==="right"&&(S=g+r-l);let P=o.cursorY,M=false;if(i?.tblpY!==void 0)P=d+i.tblpY,M=true;else if(i?.tblpYSpec){M=true;let L=i.tblpYSpec;L==="top"?P=d:L==="bottom"?P=d+c-u:L==="center"&&(P=d+(c-u)/2);}M||(P=n.ensureFits(u).cursorY);let B=a.left,T=a.left+r-l;Number.isFinite(T)&&(S=Math.max(B,Math.min(S,T)));let I={kind:"table",blockId:e.id,x:S,y:P,width:l,height:u,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};o.page.fragments.push(I);let w=i?.leftFromText??0,C=i?.rightFromText??0,R=S-a.left-w,f=a.left+r-(S+l)-C;if(R<U&&f<U){let L=P+u+(i?.bottomFromText??0);L>o.cursorY&&(o.cursorY=L);}}function jt(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Vt(e,t,n);return}let r=n.ensureFits(t.height),o={kind:"image",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},i=n.addFragment(o,t.height,0,0);o.y=i.y;}function Vt(e,t,n){let r=n.getCurrentState(),o=e.anchor,i=o.offsetH??n.getColumnX(r.columnIndex),s=o.offsetV??r.cursorY,a={kind:"image",blockId:e.id,x:i,y:s,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:o.behindDoc?-1:1};r.page.fragments.push(a);}function qt(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if($(e)){let s=n.getCurrentState(),a={kind:"textBox",blockId:e.id,x:n.getColumnX(s.columnIndex),y:s.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};s.page.fragments.push(a);return}let r=n.ensureFits(t.height),o={kind:"textBox",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},i=n.addFragment(o,t.height,0,0);o.y=i.y;}function Jt(e,t,n,r){switch(r??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":{let i=t.getCurrentState().page.size,s=n.pageSize;s!=null&&(Math.round(s.w)!==Math.round(i.w)||Math.round(s.h)!==Math.round(i.h))?(t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak()):t.updatePageLayout(n.pageSize,n.margins,false);break}}t.updateColumns(n.columns??tt);}exports.A=vn;exports.B=En;exports.C=An;exports.D=oe;exports.E=U;exports.F=me;exports.G=pe;exports.H=de;exports.I=he;exports.J=at;exports.K=be;exports.L=$;exports.M=st;exports.N=lt;exports.O=Ie;exports.P=Wt;exports.Q=At;exports.R=zt;exports.S=Ot;exports.T=_t;exports.U=Nt;exports.V=Yt;exports.W=Zt;exports.X=Qn;exports.Y=Gt;exports.a=Le;exports.b=ke;exports.c=ut;exports.d=ct;exports.e=ft;exports.f=on;exports.g=Se;exports.h=gn;exports.i=Me;exports.j=V;exports.k=z;exports.l=mn;exports.m=_e;exports.n=pn;exports.o=dn;exports.p=hn;exports.q=bn;exports.r=Y;exports.s=bt;exports.t=xn;exports.u=Sn;exports.v=Ne;exports.w=Tt;exports.x=Ye;exports.y=je;exports.z=wt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunk2KHWHVTA_js=require('./chunk-2KHWHVTA.js'),chunkND33YQGU_js=require('./chunk-ND33YQGU.js'),chunk7HANRHHL_js=require('./chunk-7HANRHHL.js'),prosemirrorState=require('prosemirror-state');function _(e){let{$from:t}=e.selection,n=null,r=null,s=null,a=-1,o=-1;for(let i=t.depth;i>0;i--){let c=t.node(i);if(c.type.name==="tableCell"||c.type.name==="tableHeader"){s=c;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(o===-1){if(S===t.index(i-1)){o=b;return}b+=h.attrs.colspan||1;}});}}else if(c.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(a=t.index(i-1));else if(c.type.name==="table"){n=c,r=t.before(i);break}}return !n||r==null||!s||a<0||o<0?null:{table:n,tablePos:r,cell:s,row:a,col:o,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let a=e.child(s),o=0;a.forEach(i=>{for(;t[s]?.[o];)o++;let c=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:o,rowspan:c,colspan:l});for(let b=s;b<s+c;b++){let h=t[b]??[];t[b]=h;for(let y=o;y<o+l;y++)h[y]=true;}o+=l,r=Math.max(r,o);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let a={...e.attrs},o=s.reduce((l,b)=>l+b,0),i=chunk2KHWHVTA_js.a(s,t,n),c=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return a.colspan=n,a.rowspan=r,a.colwidth=null,o>0&&(a.width=Math.round(i/o*5e3),a.widthType="pct"),c&&(a._originalFormatting=null),a}function Y(e,t,n,r){let s=t+1;for(let a=0;a<e.childCount;a++){let o=e.child(a),i=s+1,c=0;for(let l=0;l<o.childCount;l++){let b=o.child(l);if(a===n&&c===r)return i;c+=b.attrs.colspan||1,i+=b.nodeSize;}s+=o.nodeSize;}return null}function q(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function Q(e){let t=_(e);return t?{...chunk2KHWHVTA_js.e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Z(e,t,n,r,s,a){if(n<1||r<1)return false;let o=_(e);if(!o||!t)return false;let i=o;if(s!=null&&a!=null&&(s!==o.row||a!==o.col)){let{anchors:p}=H(o.table),g=p.find(T=>T.row===s&&T.col===a);if(!g)return false;i={...o,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:c,totalCols:l}=H(i.table),b=q(i.table,l),h=chunk2KHWHVTA_js.b(b,i.col,i.colspan,r),y=c.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=chunk2KHWHVTA_js.c(c,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),d=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,d),C=f.doc.nodeAt(i.tablePos);if(C){let p=Y(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(prosemirrorState.TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=chunkND33YQGU_js.a.getCommands();function re(e,t){return m.insertTable(e,t)}function ne(e,t){return m.addRowAbove()(e,t)}function oe(e,t){return m.addRowBelow()(e,t)}function ae(e,t){return m.deleteRow()(e,t)}function ie(e,t){return m.addColumnLeft()(e,t)}function se(e,t){return m.addColumnRight()(e,t)}function le(e,t){return m.deleteColumn()(e,t)}function ce(e,t){return m.deleteTable()(e,t)}function de(e,t){return m.selectTable()(e,t)}function ue(e,t){return m.selectRow()(e,t)}function pe(e,t){return m.selectColumn()(e,t)}function me(e,t){return m.mergeCells()(e,t)}function fe(e,t){return m.splitCell()(e,t)}function ge(e,t,n){return m.setCellBorder(e,t,n)}function be(e,t){return m.setTableBorders(e,t)}function he(e,t){return m.removeTableBorders()(e,t)}function ye(e,t,n){return m.setAllTableBorders(n)(e,t)}function Ce(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function Te(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Se(e){return m.setCellVerticalAlign(e)}function ke(e){return m.setCellMargins(e)}function ve(e){return m.setCellTextDirection(e)}function xe(){return m.toggleNoWrap()}function we(e,t){return m.setRowHeight(e,t)}function Ie(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function Ae(){return m.autoFitContents()}function Ee(e){return m.setTableProperties(e)}function Me(e){return m.applyTableStyle(e)}function Re(e){return m.setCellFillColor(e)}function Ne(e){return m.setTableBorderColor(e)}function Be(e){return m.setTableBorderWidth(e)}var Fe=chunkND33YQGU_js.a.getCommands();function O(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),a=chunk7HANRHHL_js.i(e),o=e.schema.marks.insertion;return a&&o&&s.addMark(r,r+n.nodeSize,o.create({revisionId:a.revisionId,author:a.author,date:a.date})),t(s.scrollIntoView()),true}var V=612;function We(e,t,n){let r=n?.maxWidth??V,s=new FileReader;s.onload=()=>{let a=s.result,o=new Image;o.onload=()=>{let i=o.naturalWidth,c=o.naturalHeight;i>r&&(c=Math.round(c*(r/i)),i=r);let l=e.state.schema.nodes.image.create({src:a,alt:t.name,width:i,height:c,rId:`rId_img_${Date.now()}_${Math.round(Math.random()*1e9)}`,wrapType:"inline",displayMode:"inline"});O(e.state,e.dispatch,l,e.state.selection.from),e.focus(),n?.onInserted?.();},o.onerror=()=>n?.onError?.(new Error("Failed to decode image")),o.src=a;},s.onerror=()=>n?.onError?.(s.error),s.readAsDataURL(t);}function De(e,t,n){return Fe.setImageWrapType(e,t,n)}function Le(e){return (t,n)=>{let{from:r,to:s,empty:a}=t.selection;if(a)return false;let o=t.schema.marks.comment;if(!o)return false;if(n){let i=t.tr.addMark(r,s,o.create({commentId:e}));n(i);}return true}}function ze(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((a,o)=>{if(a.isText)for(let i of a.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(o,o+a.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function $(e,t,n){return (r,s)=>{let a=r.schema.marks.insertion,o=r.schema.marks.deletion;if(!a&&!o)return false;let i=n==="accept"?a:o,c=n==="accept"?o:a;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);c&&h.marks.some(k=>k.type===c)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function He(e,t){return $(e,t,"accept")}function je(e,t){return $(e,t,"reject")}function U(e){let t=new Set,n=[],r=o=>{typeof o=="number"&&!t.has(o)&&(t.add(o),n.push(o));},s=e.schema.marks.insertion,a=e.schema.marks.deletion;return e.doc.descendants(o=>{if(o.type.name==="paragraph"){r(o.attrs.pPrIns?.revisionId),r(o.attrs.pPrDel?.revisionId);let i=o.attrs.pPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableRow"){r(o.attrs.trIns?.revisionId),r(o.attrs.trDel?.revisionId);let i=o.attrs.trPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableCell"||o.type.name==="tableHeader"){let i=o.attrs.cellMarker;r(i?.info?.revisionId);let c=o.attrs.tcPrChange;if(Array.isArray(c))for(let l of c)r(l.info.id);}if(o.type.name==="table"){let i=o.attrs.tblPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.isInline)for(let i of o.marks)(s&&i.type===s||a&&i.type===a)&&r(i.attrs.revisionId);}),n}function _e(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"accept")(r,s);return true}}function Oe(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"reject")(r,s);return true}}function G(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(s)return false;if(a.isInline&&!(o+a.nodeSize<=t)){for(let i of a.marks)if(i.type===n||i.type===r)return s={from:Math.max(o,t),to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?G(e,0):s}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrIns,o=r.attrs.pPrDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function $e(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrChange;Array.isArray(a)&&a.forEach((o,i)=>{!o?.info||typeof o.info.id!="number"||o.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:o.previousFormatting,current:o.currentFormatting});});}),n}function Ue(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((a,o)=>{if(a.isInline){for(let i of a.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let c=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===c&&l.to===o?l.to=o+a.nodeSize:n.push({from:o,to:o+a.nodeSize,markName:c});}}}),n}function Ge(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,a=e.doc.nodeAt(s);!a||a.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...a.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Xe(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let a=s.slice();a.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:a.length>0?a:null});}function Je(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let a of s)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let a=r.attrs.trIns,o=r.attrs.trDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ye(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let a=r.attrs.cellMarker;a?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:a.kind});}),n}function M(e,t){return (n,r)=>{let s=Ve(n,e),a=Ue(n,e),o=$e(n,e),i=Ke(n,e),c=Ye(n,e);if(s.length===0&&a.length===0&&o.length===0&&i.length===0&&c.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(chunk7HANRHHL_js.g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...a].sort((u,d)=>d.from-u.from);for(let u of y){let d=u.markName==="insertion";if(t==="accept"&&!d||t==="reject"&&d)l.delete(u.from,u.to);else {let C=d?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,d)=>d.pos-u.pos);for(let u of S){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=d+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,d,u.kind):(N(l,d,u.kind),Ge(l,d));}else N(l,d,u.kind);}let x=[...o].sort((u,d)=>d.pos-u.pos);for(let u of x){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Je(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(d,void 0,{...g,pPrChange:T.length>0?T:null});}else Xe(l,d,p);}let w=[...c].sort((u,d)=>d.pos-u.pos);for(let u of w){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(d,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,d)=>d.pos-u.pos);for(let u of k){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(d+1),I=v.node(v.depth-1),P=v.before(v.depth-1);if(I?.type.name==="table"&&I.childCount>1)l.delete(d,d+f.nodeSize);else if(I?.type.name==="table")if(l.doc.resolve(P).parent.childCount===1){let J=l.doc.type.schema.nodes.paragraph;l.replaceWith(P,P+I.nodeSize,J.create());}else l.delete(P,P+I.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(d,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(d,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function qe(e){return M(e,"accept")}function Qe(e){return M(e,"reject")}function X(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(a.isInline){if(o>=t)return false;for(let i of a.marks)(i.type===n||i.type===r)&&(s={from:o,to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?X(e,e.doc.content.size):s}function Ze(e){return e.doc.attrs.watermark??null}function et(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}exports.A=Ie;exports.B=Pe;exports.C=Ae;exports.D=Ee;exports.E=Me;exports.F=Re;exports.G=Ne;exports.H=Be;exports.I=O;exports.J=V;exports.K=We;exports.L=De;exports.M=Le;exports.N=ze;exports.O=He;exports.P=je;exports.Q=_e;exports.R=Oe;exports.S=G;exports.T=qe;exports.U=Qe;exports.V=X;exports.W=Ze;exports.X=et;exports.a=Q;exports.b=Z;exports.c=re;exports.d=ne;exports.e=oe;exports.f=ae;exports.g=ie;exports.h=se;exports.i=le;exports.j=ce;exports.k=de;exports.l=ue;exports.m=pe;exports.n=me;exports.o=fe;exports.p=ge;exports.q=be;exports.r=he;exports.s=ye;exports.t=Ce;exports.u=Te;exports.v=Se;exports.w=ke;exports.x=ve;exports.y=xe;exports.z=we;
|
|
1
|
+
'use strict';var chunk2KHWHVTA_js=require('./chunk-2KHWHVTA.js'),chunk4U2S3WV2_js=require('./chunk-4U2S3WV2.js'),chunk7HANRHHL_js=require('./chunk-7HANRHHL.js'),prosemirrorState=require('prosemirror-state');function _(e){let{$from:t}=e.selection,n=null,r=null,s=null,a=-1,o=-1;for(let i=t.depth;i>0;i--){let c=t.node(i);if(c.type.name==="tableCell"||c.type.name==="tableHeader"){s=c;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(o===-1){if(S===t.index(i-1)){o=b;return}b+=h.attrs.colspan||1;}});}}else if(c.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(a=t.index(i-1));else if(c.type.name==="table"){n=c,r=t.before(i);break}}return !n||r==null||!s||a<0||o<0?null:{table:n,tablePos:r,cell:s,row:a,col:o,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let a=e.child(s),o=0;a.forEach(i=>{for(;t[s]?.[o];)o++;let c=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:o,rowspan:c,colspan:l});for(let b=s;b<s+c;b++){let h=t[b]??[];t[b]=h;for(let y=o;y<o+l;y++)h[y]=true;}o+=l,r=Math.max(r,o);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let a={...e.attrs},o=s.reduce((l,b)=>l+b,0),i=chunk2KHWHVTA_js.a(s,t,n),c=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return a.colspan=n,a.rowspan=r,a.colwidth=null,o>0&&(a.width=Math.round(i/o*5e3),a.widthType="pct"),c&&(a._originalFormatting=null),a}function Y(e,t,n,r){let s=t+1;for(let a=0;a<e.childCount;a++){let o=e.child(a),i=s+1,c=0;for(let l=0;l<o.childCount;l++){let b=o.child(l);if(a===n&&c===r)return i;c+=b.attrs.colspan||1,i+=b.nodeSize;}s+=o.nodeSize;}return null}function q(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function Q(e){let t=_(e);return t?{...chunk2KHWHVTA_js.e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Z(e,t,n,r,s,a){if(n<1||r<1)return false;let o=_(e);if(!o||!t)return false;let i=o;if(s!=null&&a!=null&&(s!==o.row||a!==o.col)){let{anchors:p}=H(o.table),g=p.find(T=>T.row===s&&T.col===a);if(!g)return false;i={...o,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:c,totalCols:l}=H(i.table),b=q(i.table,l),h=chunk2KHWHVTA_js.b(b,i.col,i.colspan,r),y=c.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=chunk2KHWHVTA_js.c(c,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),d=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,d),C=f.doc.nodeAt(i.tablePos);if(C){let p=Y(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(prosemirrorState.TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=chunk4U2S3WV2_js.a.getCommands();function re(e,t){return m.insertTable(e,t)}function ne(e,t){return m.addRowAbove()(e,t)}function oe(e,t){return m.addRowBelow()(e,t)}function ae(e,t){return m.deleteRow()(e,t)}function ie(e,t){return m.addColumnLeft()(e,t)}function se(e,t){return m.addColumnRight()(e,t)}function le(e,t){return m.deleteColumn()(e,t)}function ce(e,t){return m.deleteTable()(e,t)}function de(e,t){return m.selectTable()(e,t)}function ue(e,t){return m.selectRow()(e,t)}function pe(e,t){return m.selectColumn()(e,t)}function me(e,t){return m.mergeCells()(e,t)}function fe(e,t){return m.splitCell()(e,t)}function ge(e,t,n){return m.setCellBorder(e,t,n)}function be(e,t){return m.setTableBorders(e,t)}function he(e,t){return m.removeTableBorders()(e,t)}function ye(e,t,n){return m.setAllTableBorders(n)(e,t)}function Ce(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function Te(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Se(e){return m.setCellVerticalAlign(e)}function ke(e){return m.setCellMargins(e)}function ve(e){return m.setCellTextDirection(e)}function xe(){return m.toggleNoWrap()}function we(e,t){return m.setRowHeight(e,t)}function Ie(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function Ae(){return m.autoFitContents()}function Ee(e){return m.setTableProperties(e)}function Me(e){return m.applyTableStyle(e)}function Re(e){return m.setCellFillColor(e)}function Ne(e){return m.setTableBorderColor(e)}function Be(e){return m.setTableBorderWidth(e)}var Fe=chunk4U2S3WV2_js.a.getCommands();function O(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),a=chunk7HANRHHL_js.i(e),o=e.schema.marks.insertion;return a&&o&&s.addMark(r,r+n.nodeSize,o.create({revisionId:a.revisionId,author:a.author,date:a.date})),t(s.scrollIntoView()),true}var V=612;function We(e,t,n){let r=n?.maxWidth??V,s=new FileReader;s.onload=()=>{let a=s.result,o=new Image;o.onload=()=>{let i=o.naturalWidth,c=o.naturalHeight;i>r&&(c=Math.round(c*(r/i)),i=r);let l=e.state.schema.nodes.image.create({src:a,alt:t.name,width:i,height:c,rId:`rId_img_${Date.now()}_${Math.round(Math.random()*1e9)}`,wrapType:"inline",displayMode:"inline"});O(e.state,e.dispatch,l,e.state.selection.from),e.focus(),n?.onInserted?.();},o.onerror=()=>n?.onError?.(new Error("Failed to decode image")),o.src=a;},s.onerror=()=>n?.onError?.(s.error),s.readAsDataURL(t);}function De(e,t,n){return Fe.setImageWrapType(e,t,n)}function Le(e){return (t,n)=>{let{from:r,to:s,empty:a}=t.selection;if(a)return false;let o=t.schema.marks.comment;if(!o)return false;if(n){let i=t.tr.addMark(r,s,o.create({commentId:e}));n(i);}return true}}function ze(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((a,o)=>{if(a.isText)for(let i of a.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(o,o+a.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function $(e,t,n){return (r,s)=>{let a=r.schema.marks.insertion,o=r.schema.marks.deletion;if(!a&&!o)return false;let i=n==="accept"?a:o,c=n==="accept"?o:a;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);c&&h.marks.some(k=>k.type===c)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function He(e,t){return $(e,t,"accept")}function je(e,t){return $(e,t,"reject")}function U(e){let t=new Set,n=[],r=o=>{typeof o=="number"&&!t.has(o)&&(t.add(o),n.push(o));},s=e.schema.marks.insertion,a=e.schema.marks.deletion;return e.doc.descendants(o=>{if(o.type.name==="paragraph"){r(o.attrs.pPrIns?.revisionId),r(o.attrs.pPrDel?.revisionId);let i=o.attrs.pPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableRow"){r(o.attrs.trIns?.revisionId),r(o.attrs.trDel?.revisionId);let i=o.attrs.trPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableCell"||o.type.name==="tableHeader"){let i=o.attrs.cellMarker;r(i?.info?.revisionId);let c=o.attrs.tcPrChange;if(Array.isArray(c))for(let l of c)r(l.info.id);}if(o.type.name==="table"){let i=o.attrs.tblPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.isInline)for(let i of o.marks)(s&&i.type===s||a&&i.type===a)&&r(i.attrs.revisionId);}),n}function _e(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"accept")(r,s);return true}}function Oe(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"reject")(r,s);return true}}function G(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(s)return false;if(a.isInline&&!(o+a.nodeSize<=t)){for(let i of a.marks)if(i.type===n||i.type===r)return s={from:Math.max(o,t),to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?G(e,0):s}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrIns,o=r.attrs.pPrDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function $e(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrChange;Array.isArray(a)&&a.forEach((o,i)=>{!o?.info||typeof o.info.id!="number"||o.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:o.previousFormatting,current:o.currentFormatting});});}),n}function Ue(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((a,o)=>{if(a.isInline){for(let i of a.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let c=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===c&&l.to===o?l.to=o+a.nodeSize:n.push({from:o,to:o+a.nodeSize,markName:c});}}}),n}function Ge(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,a=e.doc.nodeAt(s);!a||a.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...a.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Xe(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let a=s.slice();a.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:a.length>0?a:null});}function Je(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let a of s)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let a=r.attrs.trIns,o=r.attrs.trDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ye(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let a=r.attrs.cellMarker;a?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:a.kind});}),n}function M(e,t){return (n,r)=>{let s=Ve(n,e),a=Ue(n,e),o=$e(n,e),i=Ke(n,e),c=Ye(n,e);if(s.length===0&&a.length===0&&o.length===0&&i.length===0&&c.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(chunk7HANRHHL_js.g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...a].sort((u,d)=>d.from-u.from);for(let u of y){let d=u.markName==="insertion";if(t==="accept"&&!d||t==="reject"&&d)l.delete(u.from,u.to);else {let C=d?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,d)=>d.pos-u.pos);for(let u of S){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=d+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,d,u.kind):(N(l,d,u.kind),Ge(l,d));}else N(l,d,u.kind);}let x=[...o].sort((u,d)=>d.pos-u.pos);for(let u of x){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Je(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(d,void 0,{...g,pPrChange:T.length>0?T:null});}else Xe(l,d,p);}let w=[...c].sort((u,d)=>d.pos-u.pos);for(let u of w){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(d,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,d)=>d.pos-u.pos);for(let u of k){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(d+1),I=v.node(v.depth-1),P=v.before(v.depth-1);if(I?.type.name==="table"&&I.childCount>1)l.delete(d,d+f.nodeSize);else if(I?.type.name==="table")if(l.doc.resolve(P).parent.childCount===1){let J=l.doc.type.schema.nodes.paragraph;l.replaceWith(P,P+I.nodeSize,J.create());}else l.delete(P,P+I.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(d,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(d,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function qe(e){return M(e,"accept")}function Qe(e){return M(e,"reject")}function X(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(a.isInline){if(o>=t)return false;for(let i of a.marks)(i.type===n||i.type===r)&&(s={from:o,to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?X(e,e.doc.content.size):s}function Ze(e){return e.doc.attrs.watermark??null}function et(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}exports.A=Ie;exports.B=Pe;exports.C=Ae;exports.D=Ee;exports.E=Me;exports.F=Re;exports.G=Ne;exports.H=Be;exports.I=O;exports.J=V;exports.K=We;exports.L=De;exports.M=Le;exports.N=ze;exports.O=He;exports.P=je;exports.Q=_e;exports.R=Oe;exports.S=G;exports.T=qe;exports.U=Qe;exports.V=X;exports.W=Ze;exports.X=et;exports.a=Q;exports.b=Z;exports.c=re;exports.d=ne;exports.e=oe;exports.f=ae;exports.g=ie;exports.h=se;exports.i=le;exports.j=ce;exports.k=de;exports.l=ue;exports.m=pe;exports.n=me;exports.o=fe;exports.p=ge;exports.q=be;exports.r=he;exports.s=ye;exports.t=Ce;exports.u=Te;exports.v=Se;exports.w=ke;exports.x=ve;exports.y=xe;exports.z=we;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f}from'./chunk-CGJ6S3AH.mjs';import {a}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f}from'./chunk-CGJ6S3AH.mjs';import {a}from'./chunk-5EP47PMQ.mjs';function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
|
|
2
2
|
Returns variable names without braces, along with their locations (body, headers, footers, etc.).
|
|
3
3
|
Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
|
|
4
4
|
The variable can later be substituted with actual values using docx_apply_template.
|
|
5
|
-
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-
|
|
5
|
+
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-FL6XGVP3.mjs'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
|
|
6
6
|
Replaces all {variable} placeholders with the corresponding values provided.
|
|
7
7
|
Preserves all formatting (fonts, styles, colors, tables).
|
|
8
8
|
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=b$1(e.buffer,n,{nullGetter:t?"keep":"empty"}),a$1=await a(r.buffer);return e.document=a$1,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkXCTYXYEU_js=require('./chunk-XCTYXYEU.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function Ge(e){return !chunkJFZIXFRC_js.b(e.wrapType)&&e.wrapType!=="topAndBottom"}function _e(e){return e.wrapType==="behind"}function De(e){return chunkJFZIXFRC_js.a(e.wrapType)?true:e.displayMode==="float"}function X(e){return chunkJFZIXFRC_js.b(e.wrapType)||e.wrapType==="topAndBottom"?false:chunkJFZIXFRC_js.c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function Xe(e){return e==="left"?"right":e==="right"?"left":"bothSides"}function Ve(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Ue(e,n,t,i){let{x:r,side:o}=be(e,t,i),g=j(e,n,i);return {x:r,y:g,side:o}}function N(e,n,t){return j(e,n,t)}function be(e,n,t){let i=e.position?.horizontal;if(!i)return e.cssFloat==="right"?{x:n-e.width,side:"right"}:{x:0,side:"left"};let r=xe(i.relativeTo,n,t);if(i.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(i.align==="left")return {x:r.base,side:"left"};if(i.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(i.posOffset!==void 0){let o=r.base+chunkBJSG6TEG_js.f(i.posOffset);return {x:o,side:o>n/2?"right":"left"}}return {x:r.base,side:"left"}}function xe(e,n,t){let i=t?.pageWidth??0,r=t?.marginLeft??0;switch(e){case "page":return {base:-r,size:i};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:n,size:r};case "character":return {base:0,size:0};default:return {base:0,size:n}}}function j(e,n,t){let i=e.position?.vertical;if(!i)return n;let r=Te(i.relativeTo,n,t);return i.align==="top"?r.base:i.align==="center"?r.size?r.base+(r.size-e.height)/2:n:i.align==="bottom"?r.size?r.base+r.size-e.height:n:i.posOffset!==void 0?r.base+chunkBJSG6TEG_js.f(i.posOffset):i.relativeTo==="paragraph"||i.relativeTo==="line"?n:r.base}function Te(e,n,t){let i=t?.pageHeight??0,r=t?.marginTop??0,o=t?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:n,size:0};case "page":return {base:-r,size:i};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:o,size:r};default:return {base:0,size:o}}}var V=7,U=0;function ye(e,n){if(e.kind!=="paragraph"||n.kind!=="paragraph")return "totalHeight"in n?n.totalHeight:"height"in n?n.height:0;let t=e.runs.filter(c=>c.kind!=="text"||c.text.length>0);if(!(n.lines.length===1&&t.length>0&&t.every(c=>c.kind==="image")))return n.totalHeight;let r=t.reduce((c,p)=>p.kind==="image"?Math.max(c,p.height):c,0),o=e.attrs?.spacing?.before??0,g=e.attrs?.spacing?.after??0;return o+r+g}function K(e){let n=e?.borders?.top?.width??0,t=e?.borders?.bottom?.width??0;return n+t}function q(e,n,t){let i=chunkXCTYXYEU_js.a(e.width,e.widthType,n),r=i??n,o=chunkXCTYXYEU_js.e(e,n),g=new Map;for(let l of chunkXCTYXYEU_js.b(e))g.set(`${l.rowIndex}-${l.cellIndex}`,l.columnIndex);let c=e.rows.map((l,s)=>({cells:l.cells.map((u,a)=>{let h=u.colSpan??1,m=g.get(`${s}-${a}`)??0,d=0;for(let b=0;b<h&&m+b<o.length;b++)d+=o[m+b]??0;d===0&&(d=(u.width&&u.width>0?u.width:chunkXCTYXYEU_js.a(u.widthValue,u.widthType,r))??100);let F=u.padding?.left??V,M=u.padding?.right??V,T=Math.max(1,d-F-M);return {blocks:u.blocks.map(b=>t(b,T)),width:d,height:0,colSpan:u.colSpan,rowSpan:u.rowSpan}}),height:0})),p=[];for(let l=0;l<c.length;l++){let s=c[l],u=e.rows[l]?.cells,a=0,h=0;for(let M=0;M<s.cells.length;M++){let T=s.cells[M],b=u?.[M],B=0,R=0;for(let I=0;I<T.blocks.length;I++){let z=b?.blocks[I],H=T.blocks[I];if(!z||!H)continue;let me=ye(z,H),Z=z.kind==="paragraph"?z.attrs?.spacing:void 0,E=Z?.before??0,O=Z?.after??0;B+=Math.max(R,E)+(me-E-O),R=O;}B+=R,T.height=B;let fe=b?.padding?.top??U,de=b?.padding?.bottom??U;T.height+=fe+de,(T.rowSpan??1)<=1&&(a=Math.max(a,T.height)),h=Math.max(h,K(b));}let m=e.rows[l],d=m?.height,F=m?.heightRule;p[l]=F==="exact"&&!!d,d&&F==="exact"?s.height=d:d?s.height=Math.max(a+h,d):s.height=a+h;}let y=c.map(l=>l.height);for(let l=0;l<c.length;l++){let s=e.rows[l]?.cells,u=c[l]?.cells;if(!(!s||!u))for(let a=0;a<s.length;a++){let h=s[a]?.rowSpan??1;if(h<=1)continue;let m=Math.min(l+h-1,c.length-1),d=(u[a]?.height??0)+K(s[a]),F=0;for(let b=l;b<=m;b++)F+=y[b]??0;let M=d-F;if(M<=0)continue;let T=m;for(;T>l&&p[T];)T--;p[T]||(c[T].height+=M);}}let x=c.reduce((l,s)=>l+s.height,0),f=o.reduce((l,s)=>l+s,0)||i||n;return {kind:"table",rows:c,columnWidths:o,totalWidth:f,totalHeight:x}}var Fe=4;function Me(e,n,t,i){let r=Array.isArray(n)?n[0]??0:n,o=Pe(e,r,t,i),g=o.filter(a=>a.isMarginRelative),c=o.filter(a=>!a.isMarginRelative),p=new Map;for(let a of g){let h=p.get(a.topY)??[];h.push(a),p.set(a.topY,h);}let y=Ae(c,Fe),x=[];J(y,x),J(Array.from(p.values()),x);let f=new Map;for(let a of x){let h=a.fullWidthBlock&&a.isMarginRelative?0:a.anchorBlockIndex,m=f.get(h)??[],{anchorBlockIndex:d,isMarginRelative:F,...M}=a;m.push(M),f.set(h,m);}let l=new Set(f.keys()),s=0,u=[];return e.map((a,h)=>{l.has(h)&&(s=0,u=f.get(h)??[]);let m=u.length>0?u:void 0,d=Array.isArray(n)?n[h]??r:n,F=t(a,d,m,s);return "totalHeight"in F&&(a.kind==="table"&&a.floating||(s+=F.totalHeight)),F})}function Pe(e,n,t,i){let r=[];for(let o=0;o<e.length;o++){let g=e[o];switch(g.kind){case "paragraph":we(g,o,n,r);break;case "table":ve(g,o,n,t,r);break;case "textBox":Ce(g,o,n,r,i);break}}return r}function Q(e,n,t,i,r,o){let g=0,c=0,p=e?.horizontal;if(p?.align==="left")g=t+r;else if(p?.align==="right")c=t+i;else if(p?.posOffset!==void 0){let y=chunkBJSG6TEG_js.f(p.posOffset);y<o/2?g=y+t+r:c=o-y+i;}else n==="left"?g=t+r:n==="right"&&(c=t+i);return chunkXCTYXYEU_js.y(g,c,o)}function W(e){let n=e?.vertical?.relativeTo;return n==="margin"||n==="page"}function we(e,n,t,i){for(let r of e.runs){if(r.kind!=="image")continue;let o=r;if(!X(o))continue;let g=o.distTop??0,c=o.distBottom??0,p=o.distLeft??12,y=o.distRight??12,x=0,f=o.position?.vertical;f?.align==="top"&&f.relativeTo==="margin"?x=0:f?.posOffset!==void 0&&(x=chunkBJSG6TEG_js.f(f.posOffset));let l=x+o.height,{leftMargin:s,rightMargin:u}=Q(o.position,o.cssFloat,o.width,p,y,t);(s>0||u>0)&&i.push({leftMargin:s,rightMargin:u,topY:x-g,bottomY:l+c,anchorBlockIndex:n,isMarginRelative:W(o.position)});}}function ve(e,n,t,i,r){let o=e.floating;if(!o)return;let g=q(e,t,i),c=g.totalWidth,p=g.totalHeight,y=o.leftFromText??12,x=o.rightFromText??12,f=o.topFromText??0,l=o.bottomFromText??0,s=0;o.tblpX!==void 0?s=o.tblpX:o.tblpXSpec?o.tblpXSpec==="left"||o.tblpXSpec==="inside"?s=0:o.tblpXSpec==="right"||o.tblpXSpec==="outside"?s=t-c:o.tblpXSpec==="center"&&(s=(t-c)/2):e.justification==="center"?s=(t-c)/2:e.justification==="right"&&(s=t-c);let u=0,a=0;s<t/2?u=s+c+x:a=t-s+y,{leftMargin:u,rightMargin:a}=chunkXCTYXYEU_js.y(u,a,t);let h=o.tblpY??0,m=h+p;r.push({leftMargin:u,rightMargin:a,topY:h-f,bottomY:m+l,anchorBlockIndex:n});}function Ce(e,n,t,i,r){if(!chunkXCTYXYEU_js.L(e)||chunkJFZIXFRC_js.b(e.wrapType))return;let o=e.width??0,g=e.height??0;if(o<=0||g<=0)return;let c=e.distTop??0,p=e.distBottom??0,y=e.distLeft??12,x=e.distRight??12;if(e.wrapType==="topAndBottom"){let a=N({height:g,position:e.position},0,r),h=a+g+p;if(h<=0)return;i.push({leftMargin:0,rightMargin:0,topY:Math.max(0,a-c),bottomY:h,anchorBlockIndex:n,isMarginRelative:W(e.position),fullWidthBlock:true});return}let f=0;e.position?.vertical?.posOffset!==void 0&&(f=chunkBJSG6TEG_js.f(e.position.vertical.posOffset));let l=f+g,{leftMargin:s,rightMargin:u}=Q(e.position,e.cssFloat,o,y,x,t);s<=0&&u<=0||i.push({leftMargin:s,rightMargin:u,topY:f-c,bottomY:l+p,anchorBlockIndex:n,isMarginRelative:W(e.position)});}function Ae(e,n){let t=[];for(let i of e){let r=t.find(o=>o.some(g=>Math.abs(g.anchorBlockIndex-i.anchorBlockIndex)<=n&&i.topY<g.bottomY&&i.bottomY>g.topY));r?r.push(i):t.push([i]);}return t}function J(e,n){for(let t of e){let i=Math.min(...t.map(r=>r.anchorBlockIndex));for(let r of t)n.push({...r,anchorBlockIndex:i});}}var ee=2e4,P=new Map;function te(e,n,t){return `${e}|${n}|${t||0}`}function ne(){for(;P.size>ee;){let e=P.keys().next().value;if(e===void 0)break;P.delete(e);}}function Ie(e,n,t=0){let i=te(e,n,t),r=P.get(i);if(r!==void 0)return P.delete(i),P.set(i,r),r.width}function ze(e,n,t,i){let r=te(e,n,t);P.set(r,{width:i}),ne();}function ie(){P.clear();}function ke(e){!Number.isFinite(e)||e<=0||(ee=e,ne());}function re(){return P.size}var Be=1e3,oe=Be,w=new Map;function ae(e,n,t=false,i=false){return `${e}|${n}|${t}|${i}`}function se(){for(;w.size>oe;){let e=w.keys().next().value;if(e===void 0)break;w.delete(e);}}function Re(e,n,t=false,i=false){let r=ae(e,n,t,i),o=w.get(r);if(o!==void 0)return w.delete(r),w.set(r,o),o}function Se(e,n,t,i,r){let o=ae(e,n,t,i);w.set(o,r),se();}function ce(){w.clear();}function We(e){!Number.isFinite(e)||e<=0||(oe=e,se());}function le(){return w.size}var $e=5e3,ge=$e,v=new Map;function $(e){let n=[];for(let i of e.runs)i.kind==="text"?n.push(`t:${i.text}|${i.fontFamily}|${i.fontSize}|${i.bold}|${i.italic}`):i.kind==="tab"?n.push(`tab:${i.width}`):i.kind==="image"?n.push(`img:${i.width}x${i.height}`):i.kind==="lineBreak"&&n.push("br");let t=e.attrs;if(t){t.alignment&&n.push(`align:${t.alignment}`),t.indent&&n.push(`indent:${t.indent.left}|${t.indent.right}|${t.indent.firstLine}|${t.indent.hanging}`),t.spacing&&n.push(`spacing:${t.spacing.before}|${t.spacing.after}|${t.spacing.line}|${t.spacing.lineRule}`),t.defaultFontSize!=null&&n.push(`dfs:${t.defaultFontSize}`),t.defaultFontFamily!=null&&n.push(`dff:${t.defaultFontFamily}`);let i=t.borders;if(i){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";n.push(`bdr:${r(i.top)}|${r(i.bottom)}|${r(i.left)}|${r(i.right)}`);}t.suppressEmptyParagraphHeight&&n.push("sup"),t.pPrIns&&n.push(`pins:${t.pPrIns.revisionId}`),t.pPrDel&&n.push(`pdel:${t.pPrDel.revisionId}`);}return n.join("||")}function ue(){for(;v.size>ge;){let e=v.keys().next().value;if(e===void 0)break;v.delete(e);}}function He(e,n){let t=$(e),i=v.get(t);if(i!==void 0&&i.maxWidth===n)return v.delete(t),v.set(t,i),i.measure}function Ze(e,n,t){let i=$(e);v.set(i,{measure:t,maxWidth:n}),ue();}function he(){v.clear();}function Ee(e){!Number.isFinite(e)||e<=0||(ge=e,ue());}function pe(){return v.size}function Oe(){ie(),ce(),he();}function Ye(){return re()+le()+pe()}exports.A=pe;exports.B=Oe;exports.C=Ye;exports.a=Ge;exports.b=_e;exports.c=De;exports.d=X;exports.e=Xe;exports.f=Ve;exports.g=Ue;exports.h=N;exports.i=ye;exports.j=q;exports.k=Me;exports.l=Ie;exports.m=ze;exports.n=ie;exports.o=ke;exports.p=re;exports.q=Re;exports.r=Se;exports.s=ce;exports.t=We;exports.u=le;exports.v=$;exports.w=He;exports.x=Ze;exports.y=he;exports.z=Ee;
|
|
@@ -2,7 +2,7 @@ import { P as ParagraphFormatting, T as TextFormatting, a as TableFormatting, b
|
|
|
2
2
|
import { WrapType } from './docx/wrapTypes.mjs';
|
|
3
3
|
import { B as BorderSpec, C as ColorValue, T as ThemeColorSlot } from './colors-C3vA7HUU.mjs';
|
|
4
4
|
import { N as NumberFormat, c as ListRendering } from './lists-CyGxd5Y2.mjs';
|
|
5
|
-
import { W as Watermark } from './watermark-
|
|
5
|
+
import { W as Watermark } from './watermark-D90356ZM.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Hyperlinks (`w:hyperlink`), bookmark markers (`w:bookmarkStart`/`End`),
|
|
@@ -1315,4 +1315,4 @@ interface Run {
|
|
|
1315
1315
|
content: RunContent[];
|
|
1316
1316
|
}
|
|
1317
1317
|
|
|
1318
|
-
export type {
|
|
1318
|
+
export type { ImagePosition as $, Column as A, BlockContent as B, Comment as C, DocumentBody as D, Endnote as E, Footnote as F, ComplexField as G, Hyperlink as H, Image as I, DrawingContent as J, EndnotePosition as K, EndnoteProperties as L, MoveFrom as M, Field as N, FieldCharContent as O, Paragraph as P, FieldType as Q, RunPropertyChange as R, SectionProperties as S, Table as T, FooterReference as U, FootnotePosition as V, FootnoteProperties as W, HeaderFooterType as X, HeaderReference as Y, ImageCrop as Z, ImagePadding as _, RevisionInfo as a, ImageSize as a0, ImageTransform as a1, ImageWrap as a2, InlineSdt as a3, InstrTextContent as a4, LineNumberRestart as a5, MathEquation as a6, MoveFromRangeEnd as a7, MoveFromRangeStart as a8, MoveToRangeEnd as a9, MoveToRangeStart as aa, NoBreakHyphenContent as ab, NoteNumberRestart as ac, NoteRefMarkContent as ad, NoteReferenceContent as ae, PageOrientation as af, PropertyChangeInfo as ag, Section as ah, SectionStart as ai, SeparatorContent as aj, Shape as ak, ShapeContent as al, ShapeFill as am, ShapeOutline as an, ShapeTextBody as ao, ShapeType as ap, SimpleField as aq, SoftHyphenContent as ar, SymbolContent as as, TabContent as at, TableStructuralChangeInfo as au, TextBox as av, VerticalAlign as aw, CellMarker as ax, ParagraphPropertyChange as b, TablePropertyChange as c, TableCellPropertyChange as d, TableRowPropertyChange as e, CommentRangeEnd as f, CommentRangeStart as g, Deletion as h, Insertion as i, MoveTo as j, ParagraphContent as k, Run as l, RunContent as m, TableCell as n, TableRow as o, TextContent as p, TrackedChangeInfo as q, TrackedRunChange as r, SdtType as s, SdtProperties as t, SdtDataBinding as u, BlockSdt as v, BreakContent as w, HeaderFooter as x, BookmarkEnd as y, BookmarkStart as z };
|
|
@@ -2,7 +2,7 @@ import { P as ParagraphFormatting, T as TextFormatting, a as TableFormatting, b
|
|
|
2
2
|
import { WrapType } from './docx/wrapTypes.js';
|
|
3
3
|
import { B as BorderSpec, C as ColorValue, T as ThemeColorSlot } from './colors-C3vA7HUU.js';
|
|
4
4
|
import { N as NumberFormat, c as ListRendering } from './lists-Bn29SzeS.js';
|
|
5
|
-
import { W as Watermark } from './watermark-
|
|
5
|
+
import { W as Watermark } from './watermark-D90356ZM.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Hyperlinks (`w:hyperlink`), bookmark markers (`w:bookmarkStart`/`End`),
|
|
@@ -1315,4 +1315,4 @@ interface Run {
|
|
|
1315
1315
|
content: RunContent[];
|
|
1316
1316
|
}
|
|
1317
1317
|
|
|
1318
|
-
export type {
|
|
1318
|
+
export type { ImagePosition as $, Column as A, BlockContent as B, Comment as C, DocumentBody as D, Endnote as E, Footnote as F, ComplexField as G, Hyperlink as H, Image as I, DrawingContent as J, EndnotePosition as K, EndnoteProperties as L, MoveFrom as M, Field as N, FieldCharContent as O, Paragraph as P, FieldType as Q, RunPropertyChange as R, SectionProperties as S, Table as T, FooterReference as U, FootnotePosition as V, FootnoteProperties as W, HeaderFooterType as X, HeaderReference as Y, ImageCrop as Z, ImagePadding as _, RevisionInfo as a, ImageSize as a0, ImageTransform as a1, ImageWrap as a2, InlineSdt as a3, InstrTextContent as a4, LineNumberRestart as a5, MathEquation as a6, MoveFromRangeEnd as a7, MoveFromRangeStart as a8, MoveToRangeEnd as a9, MoveToRangeStart as aa, NoBreakHyphenContent as ab, NoteNumberRestart as ac, NoteRefMarkContent as ad, NoteReferenceContent as ae, PageOrientation as af, PropertyChangeInfo as ag, Section as ah, SectionStart as ai, SeparatorContent as aj, Shape as ak, ShapeContent as al, ShapeFill as am, ShapeOutline as an, ShapeTextBody as ao, ShapeType as ap, SimpleField as aq, SoftHyphenContent as ar, SymbolContent as as, TabContent as at, TableStructuralChangeInfo as au, TextBox as av, VerticalAlign as aw, CellMarker as ax, ParagraphPropertyChange as b, TablePropertyChange as c, TableCellPropertyChange as d, TableRowPropertyChange as e, CommentRangeEnd as f, CommentRangeStart as g, Deletion as h, Insertion as i, MoveTo as j, ParagraphContent as k, Run as l, RunContent as m, TableCell as n, TableRow as o, TextContent as p, TrackedChangeInfo as q, TrackedRunChange as r, SdtType as s, SdtProperties as t, SdtDataBinding as u, BlockSdt as v, BreakContent as w, HeaderFooter as x, BookmarkEnd as y, BookmarkStart as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from './types/document.js';
|
|
2
|
-
import {
|
|
2
|
+
import { s as SdtType, t as SdtProperties, u as SdtDataBinding, D as DocumentBody, v as BlockSdt, B as BlockContent } from './content-DNcMlHU0.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Content-control (SDT) addressing for the document model.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from './types/document.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { s as SdtType, t as SdtProperties, u as SdtDataBinding, D as DocumentBody, v as BlockSdt, B as BlockContent } from './content-BEFz1zcs.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Content-control (SDT) addressing for the document model.
|
package/dist/core-plugins.d.mts
CHANGED
|
@@ -31,9 +31,9 @@ import './types/document.mjs';
|
|
|
31
31
|
import './colors-C3vA7HUU.mjs';
|
|
32
32
|
import './formatting-DFtuRFQY.mjs';
|
|
33
33
|
import './lists-CyGxd5Y2.mjs';
|
|
34
|
-
import './content-
|
|
34
|
+
import './content-BEFz1zcs.mjs';
|
|
35
35
|
import './docx/wrapTypes.mjs';
|
|
36
|
-
import './watermark-
|
|
36
|
+
import './watermark-D90356ZM.mjs';
|
|
37
37
|
import './styles-Dqec8Aw6.mjs';
|
|
38
38
|
import './types/agentApi.mjs';
|
|
39
39
|
|
package/dist/core-plugins.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ import './types/document.js';
|
|
|
31
31
|
import './colors-C3vA7HUU.js';
|
|
32
32
|
import './formatting-JhqWT_XM.js';
|
|
33
33
|
import './lists-Bn29SzeS.js';
|
|
34
|
-
import './content-
|
|
34
|
+
import './content-DNcMlHU0.js';
|
|
35
35
|
import './docx/wrapTypes.js';
|
|
36
|
-
import './watermark-
|
|
36
|
+
import './watermark-D90356ZM.js';
|
|
37
37
|
import './styles-gEujs7j6.js';
|
|
38
38
|
import './types/agentApi.js';
|
|
39
39
|
|
package/dist/core-plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkKEDY4GFG_js=require('./chunk-KEDY4GFG.js');require('./chunk-U4UCHBZ7.js'),require('./chunk-ESI4BSBF.js');var chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js');require('./chunk-WVY2UXAK.js'),require('./chunk-DFDL337G.js'),require('./chunk-FIGLFSNR.js'),require('./chunk-QVRMX2AC.js'),require('./chunk-LW5OFHSW.js'),require('./chunk-Z3LGMBJC.js'),require('./chunk-BJSG6TEG.js'),require('./chunk-GSKMHXHG.js'),require('./chunk-H57LNDBH.js'),require('./chunk-3R7QHNI5.js'),require('./chunk-DC7S76ZX.js');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkKEDY4GFG_js.b}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkKEDY4GFG_js.a}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunk4BFNWPKW_js.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});
|
package/dist/core-plugins.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-
|
|
1
|
+
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-YSBX4LFA.mjs';import'./chunk-ARHPXIBJ.mjs';import'./chunk-CGJ6S3AH.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';import'./chunk-5EP47PMQ.mjs';import'./chunk-47SKD7QB.mjs';import'./chunk-MOCGHQ4A.mjs';import'./chunk-CDBKFBC2.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import'./chunk-QYUPLKLP.mjs';
|