@eigenpal/docx-editor-core 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/agent/index.js +1 -1
  2. package/dist/agent/index.mjs +1 -1
  3. package/dist/chunk-3GNIP6IX.mjs +4 -0
  4. package/dist/chunk-7UTXBQKF.mjs +1 -0
  5. package/dist/{chunk-CKXAHSJQ.js → chunk-AFMMYLPX.js} +2 -2
  6. package/dist/{chunk-J7ULKGU2.mjs → chunk-AGNZEOVL.mjs} +1 -1
  7. package/dist/chunk-BD4CYYFB.js +1 -0
  8. package/dist/{chunk-6ILFFGGS.js → chunk-C6GSFUV2.js} +1 -1
  9. package/dist/chunk-DN36K5JU.mjs +1 -0
  10. package/dist/{chunk-CWAP26GB.js → chunk-DV6IEOP5.js} +3 -3
  11. package/dist/{chunk-23CP3TOP.js → chunk-GH5N36F7.js} +1 -1
  12. package/dist/chunk-GNPLUGUG.mjs +1 -0
  13. package/dist/chunk-HVZMO3BU.js +1 -0
  14. package/dist/chunk-ITVXBQGR.mjs +1 -0
  15. package/dist/{chunk-S7IKPRC3.js → chunk-KSYEBTYE.js} +1 -1
  16. package/dist/{chunk-ZRZ2VRQQ.mjs → chunk-LDAOONXZ.mjs} +1 -1
  17. package/dist/{chunk-36VIYQHD.mjs → chunk-N3GIC2UI.mjs} +1 -1
  18. package/dist/{chunk-FC6QL3E6.js → chunk-NFYCMDM5.js} +1 -1
  19. package/dist/chunk-P3AXSRLG.mjs +1 -0
  20. package/dist/chunk-PK4PDRTA.js +1 -0
  21. package/dist/{chunk-VKTCTMIO.mjs → chunk-R7RR6M4A.mjs} +1 -1
  22. package/dist/{chunk-BGC7QKP5.mjs → chunk-RSMS6OTE.mjs} +1 -1
  23. package/dist/chunk-TZJUO3NW.js +1 -0
  24. package/dist/chunk-YE357WVA.js +1 -0
  25. package/dist/core-plugins.js +1 -1
  26. package/dist/core-plugins.mjs +1 -1
  27. package/dist/core.d.mts +1 -1
  28. package/dist/core.d.ts +1 -1
  29. package/dist/core.js +1 -1
  30. package/dist/core.mjs +1 -1
  31. package/dist/docx/index.js +1 -1
  32. package/dist/docx/index.mjs +1 -1
  33. package/dist/docx/parser.js +1 -1
  34. package/dist/docx/parser.mjs +1 -1
  35. package/dist/headless.js +1 -1
  36. package/dist/headless.mjs +1 -1
  37. package/dist/layout-bridge/index.d.mts +1 -1
  38. package/dist/layout-bridge/index.d.ts +1 -1
  39. package/dist/layout-bridge/index.js +1 -1
  40. package/dist/layout-bridge/index.mjs +1 -1
  41. package/dist/layout-bridge/measuring/index.d.mts +17 -1
  42. package/dist/layout-bridge/measuring/index.d.ts +17 -1
  43. package/dist/layout-bridge/measuring/index.js +1 -1
  44. package/dist/layout-bridge/measuring/index.mjs +1 -1
  45. package/dist/layout-bridge/tableInsertHover.js +1 -1
  46. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  47. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  48. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  49. package/dist/layout-engine/types.d.mts +8 -4
  50. package/dist/layout-engine/types.d.ts +8 -4
  51. package/dist/layout-painter/index.js +1 -1
  52. package/dist/layout-painter/index.mjs +1 -1
  53. package/dist/layout-painter/renderPage.d.mts +7 -0
  54. package/dist/layout-painter/renderPage.d.ts +7 -0
  55. package/dist/layout-painter/renderPage.js +1 -1
  56. package/dist/layout-painter/renderPage.mjs +1 -1
  57. package/dist/mcp-cli.mjs +15 -15
  58. package/dist/mcp.js +2 -2
  59. package/dist/mcp.mjs +1 -1
  60. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  61. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  62. package/dist/prosemirror/conversion/index.js +1 -1
  63. package/dist/prosemirror/conversion/index.mjs +1 -1
  64. package/dist/prosemirror/index.js +1 -1
  65. package/dist/prosemirror/index.mjs +1 -1
  66. package/package.json +1 -1
  67. package/dist/chunk-4AJYHCPB.js +0 -2
  68. package/dist/chunk-7GHQ4YCJ.mjs +0 -1
  69. package/dist/chunk-BWHUD2XC.mjs +0 -4
  70. package/dist/chunk-DY2MJCSV.js +0 -1
  71. package/dist/chunk-G6Y4UZMJ.mjs +0 -1
  72. package/dist/chunk-LMF2ELOB.js +0 -1
  73. package/dist/chunk-N27FJQTG.js +0 -1
  74. package/dist/chunk-UIROUI5I.mjs +0 -1
  75. package/dist/chunk-UOFQYE2L.mjs +0 -1
  76. package/dist/chunk-V7BKPX67.mjs +0 -2
  77. package/dist/chunk-Y7JZPBBW.js +0 -1
@@ -1,2 +1,2 @@
1
- import {a,L,K as K$1,p as p$2,q,r,s,I,b}from'./chunk-BWHUD2XC.mjs';import {p,l as l$1}from'./chunk-Y5HZAMND.mjs';import {a as a$2}from'./chunk-ILJUDEZ5.mjs';import {c,f,j,e,m,l,p as p$1,o,a as a$1,i}from'./chunk-6LOYA7G5.mjs';import Xe from'jszip';async function G(e){let n=await Xe.loadAsync(e),t={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:e};for(let[o,s]of Object.entries(n.files)){if(s.dir)continue;let i=o.toLowerCase();if(i.endsWith(".xml")||i.endsWith(".rels")){let a=await s.async("text");if(t.allXml.set(o,a),i==="word/document.xml")t.documentXml=a;else if(i==="word/styles.xml")t.stylesXml=a;else if(i==="word/theme/theme1.xml")t.themeXml=a;else if(i==="word/numbering.xml")t.numberingXml=a;else if(i==="word/fonttable.xml")t.fontTableXml=a;else if(i==="word/settings.xml")t.settingsXml=a;else if(i==="word/websettings.xml")t.webSettingsXml=a;else if(i==="word/footnotes.xml")t.footnotesXml=a;else if(i==="word/endnotes.xml")t.endnotesXml=a;else if(i==="word/comments.xml")t.commentsXml=a;else if(i==="word/commentsextensible.xml")t.commentsExtensibleXml=a;else if(i==="word/commentsextended.xml")t.commentsExtendedXml=a;else if(i==="word/_rels/document.xml.rels")t.documentRels=a;else if(i==="_rels/.rels")t.packageRels=a;else if(i==="[content_types].xml")t.contentTypesXml=a;else if(i==="docprops/core.xml")t.corePropsXml=a;else if(i==="docprops/app.xml")t.appPropsXml=a;else if(i==="docprops/custom.xml")t.customPropsXml=a;else if(i.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;t.headers.set(c,a);}else if(i.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;t.footers.set(c,a);}}else if(i.startsWith("word/media/")){let a=await s.async("arraybuffer");t.media.set(o,a);}else if(i.startsWith("word/fonts/")){let a=await s.async("arraybuffer");t.fonts.set(o,a);}}return t}function be(e){switch(e.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 K(e,n,t,o){let s={};return e&&e!=="auto"?s.rgb=e:e==="auto"&&(s.auto=true),n&&(s.themeColor=n),t&&(s.themeTint=t),o&&(s.themeShade=o),s}function W(e){if(!e)return;let n={},t=j(e,"w","color");t&&t!=="auto"&&(n.color={rgb:t});let o=j(e,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let s=j(e,"w","themeFill");s&&(n.fill=n.fill||{},n.fill.themeColor=s);let i=j(e,"w","themeFillTint");i&&n.fill&&(n.fill.themeTint=i);let a=j(e,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j(e,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function z(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","b");o&&(t.bold=m(o));let s=e(e$1,"w","bCs");s&&(t.boldCs=m(s));let i=e(e$1,"w","i");i&&(t.italic=m(i));let a=e(e$1,"w","iCs");a&&(t.italicCs=m(a));let c=e(e$1,"w","u");if(c){let g=j(c,"w","val");if(g){t.underline={style:g};let E=j(c,"w","color"),k=j(c,"w","themeColor");(E||k)&&(t.underline.color=K(E,k,j(c,"w","themeTint"),j(c,"w","themeShade")));}}let d=e(e$1,"w","strike");d&&(t.strike=m(d));let u=e(e$1,"w","dstrike");u&&(t.doubleStrike=m(u));let m$1=e(e$1,"w","vertAlign");if(m$1){let g=j(m$1,"w","val");(g==="superscript"||g==="subscript"||g==="baseline")&&(t.vertAlign=g);}let h=e(e$1,"w","smallCaps");h&&(t.smallCaps=m(h));let p=e(e$1,"w","caps");p&&(t.allCaps=m(p));let x=e(e$1,"w","vanish");x&&(t.hidden=m(x));let f=e(e$1,"w","color");f&&(t.color=K(j(f,"w","val"),j(f,"w","themeColor"),j(f,"w","themeTint"),j(f,"w","themeShade")));let b$1=e(e$1,"w","highlight");if(b$1){let g=j(b$1,"w","val");g&&(t.highlight=g);}let C=e(e$1,"w","shd");C&&(t.shading=W(C));let X=e(e$1,"w","sz");if(X){let g=l(X,"w","val");g!==void 0&&(t.fontSize=g);}let D=e(e$1,"w","szCs");if(D){let g=l(D,"w","val");g!==void 0&&(t.fontSizeCs=g);}let N=e(e$1,"w","rFonts");if(N){t.fontFamily={ascii:j(N,"w","ascii")??void 0,hAnsi:j(N,"w","hAnsi")??void 0,eastAsia:j(N,"w","eastAsia")??void 0,cs:j(N,"w","cs")??void 0};let g=j(N,"w","asciiTheme");g&&(t.fontFamily.asciiTheme=g,n&&!t.fontFamily.ascii&&(t.fontFamily.ascii=b(n,g)));let E=j(N,"w","hAnsiTheme");E&&(t.fontFamily.hAnsiTheme=E,n&&!t.fontFamily.hAnsi&&(t.fontFamily.hAnsi=b(n,E)));let k=j(N,"w","eastAsiaTheme");k&&(t.fontFamily.eastAsiaTheme=k,n&&!t.fontFamily.eastAsia&&(t.fontFamily.eastAsia=b(n,k)));let ne=j(N,"w","cstheme");ne&&(t.fontFamily.csTheme=ne,n&&!t.fontFamily.cs&&(t.fontFamily.cs=b(n,ne)));}let T=e(e$1,"w","spacing");if(T){let g=l(T,"w","val");g!==void 0&&(t.spacing=g);}let y=e(e$1,"w","position");if(y){let g=l(y,"w","val");g!==void 0&&(t.position=g);}let S=e(e$1,"w","w");if(S){let g=l(S,"w","val");g!==void 0&&(t.scale=g);}let F=e(e$1,"w","kern");if(F){let g=l(F,"w","val");g!==void 0&&(t.kerning=g);}let M=e(e$1,"w","effect");if(M){let g=j(M,"w","val");g&&(t.effect=g);}let L=e(e$1,"w","em");if(L){let g=j(L,"w","val");g&&(t.emphasisMark=g);}let I=e(e$1,"w","emboss");I&&(t.emboss=m(I));let A=e(e$1,"w","imprint");A&&(t.imprint=m(A));let V=e(e$1,"w","outline");V&&(t.outline=m(V));let U=e(e$1,"w","shadow");U&&(t.shadow=m(U));let j$1=e(e$1,"w","rtl");j$1&&(t.rtl=m(j$1));let P=e(e$1,"w","cs");P&&(t.cs=m(P));let B=e(e$1,"w","rStyle");if(B){let g=j(B,"w","val");g&&(t.styleId=g);}return Object.keys(t).length>0?t:void 0}function R(e){if(!e)return;let n=j(e,"w","val");if(!n)return;let t={style:n},o=j(e,"w","color"),s=j(e,"w","themeColor");(o||s)&&(t.color=K(o,s,j(e,"w","themeTint"),j(e,"w","themeShade")));let i=l(e,"w","sz");i!==void 0&&(t.size=i);let a=l(e,"w","space");a!==void 0&&(t.space=a);let c=j(e,"w","shadow");c&&(t.shadow=c==="1"||c==="true");let d=j(e,"w","frame");return d&&(t.frame=d==="1"||d==="true"),t}function Me(e){if(!e)return;let n=f(e,"w","tab");if(n.length===0)return;let t=[];for(let o of n){let s=l(o,"w","pos"),i=j(o,"w","val");if(s!==void 0&&i){let a={position:s,alignment:i},c=j(o,"w","leader");c&&(a.leader=c),t.push(a);}}return t.length>0?t:void 0}function ee(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","jc");if(o){let y=j(o,"w","val");y&&(t.alignment=y);}let s=e(e$1,"w","bidi");s&&(t.bidi=m(s));let i=e(e$1,"w","spacing");if(i){let y=l(i,"w","before");y!==void 0&&(t.spaceBefore=y);let S=l(i,"w","after");S!==void 0&&(t.spaceAfter=S);let F=l(i,"w","line");F!==void 0&&(t.lineSpacing=F);let M=j(i,"w","lineRule");M&&(t.lineSpacingRule=M);let L=j(i,"w","beforeAutospacing");L&&(t.beforeAutospacing=L==="1"||L==="true");let I=j(i,"w","afterAutospacing");I&&(t.afterAutospacing=I==="1"||I==="true");}let a=e(e$1,"w","ind");if(a){let y=l(a,"w","left");y!==void 0&&(t.indentLeft=y);let S=l(a,"w","right");S!==void 0&&(t.indentRight=S);let F=l(a,"w","firstLine");F!==void 0&&(t.indentFirstLine=F);let M=l(a,"w","hanging");M!==void 0&&(t.indentFirstLine=-M,t.hangingIndent=true);}let c=e(e$1,"w","pBdr");if(c){let y={},S=R(e(c,"w","top"));S&&(y.top=S);let F=R(e(c,"w","bottom"));F&&(y.bottom=F);let M=R(e(c,"w","left"));M&&(y.left=M);let L=R(e(c,"w","right"));L&&(y.right=L);let I=R(e(c,"w","between"));I&&(y.between=I);let A=R(e(c,"w","bar"));A&&(y.bar=A),Object.keys(y).length>0&&(t.borders=y);}let d=e(e$1,"w","shd");d&&(t.shading=W(d));let u=e(e$1,"w","tabs");u&&(t.tabs=Me(u));let m$1=e(e$1,"w","keepNext");m$1&&(t.keepNext=m(m$1));let h=e(e$1,"w","keepLines");h&&(t.keepLines=m(h));let p=e(e$1,"w","widowControl");p&&(t.widowControl=m(p));let x=e(e$1,"w","pageBreakBefore");x&&(t.pageBreakBefore=m(x));let f=e(e$1,"w","contextualSpacing");f&&(t.contextualSpacing=m(f));let b=e(e$1,"w","numPr");if(b){let y=e(b,"w","numId"),S=e(b,"w","ilvl");if(y||S){if(t.numPr={},y){let F=l(y,"w","val");F!==void 0&&(t.numPr.numId=F);}if(S){let F=l(S,"w","val");F!==void 0&&(t.numPr.ilvl=F);}}}let C=e(e$1,"w","outlineLvl");if(C){let y=l(C,"w","val");y!==void 0&&(t.outlineLevel=y);}let X=e(e$1,"w","pStyle");if(X){let y=j(X,"w","val");y&&(t.styleId=y);}let D=e(e$1,"w","suppressLineNumbers");D&&(t.suppressLineNumbers=m(D));let N=e(e$1,"w","suppressAutoHyphens");N&&(t.suppressAutoHyphens=m(N));let T=e(e$1,"w","rPr");return T&&(t.runProperties=z(T,n)),Object.keys(t).length>0?t:void 0}function H(e){if(!e)return;let n=l(e,"w","w"),t=j(e,"w","type");if(n!==void 0&&t)return {value:n,type:t}}function ye(e$1){if(!e$1)return;let n={},t=R(e(e$1,"w","top"));t&&(n.top=t);let o=R(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=R(e(e$1,"w","left"));s&&(n.left=s);let i=R(e(e$1,"w","right"));i&&(n.right=i);let a=R(e(e$1,"w","insideH"));a&&(n.insideH=a);let c=R(e(e$1,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function ve(e$1){if(!e$1)return;let n={},t=H(e(e$1,"w","top"));t&&(n.top=t);let o=H(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=H(e(e$1,"w","left"));s&&(n.left=s);let i=H(e(e$1,"w","right"));return i&&(n.right=i),Object.keys(n).length>0?n:void 0}function De(e){if(!e)return;let n={},t=j(e,"w","val");if(t){let u=parseInt(t,16);isNaN(u)||(n.firstRow=(u&32)!==0,n.lastRow=(u&64)!==0,n.firstColumn=(u&128)!==0,n.lastColumn=(u&256)!==0,n.noHBand=(u&512)!==0,n.noVBand=(u&1024)!==0);}let o=j(e,"w","firstColumn");o&&(n.firstColumn=o==="1");let s=j(e,"w","firstRow");s&&(n.firstRow=s==="1");let i=j(e,"w","lastColumn");i&&(n.lastColumn=i==="1");let a=j(e,"w","lastRow");a&&(n.lastRow=a==="1");let c=j(e,"w","noHBand");c&&(n.noHBand=c==="1");let d=j(e,"w","noVBand");return d&&(n.noVBand=d==="1"),Object.keys(n).length>0?n:void 0}function re(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tblW");o&&(t.width=H(o));let s=e(e$1,"w","jc");if(s){let f=j(s,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}let i=e(e$1,"w","tblCellSpacing");i&&(t.cellSpacing=H(i));let a=e(e$1,"w","tblInd");a&&(t.indent=H(a));let c=e(e$1,"w","tblBorders");c&&(t.borders=ye(c));let d=e(e$1,"w","tblCellMar");d&&(t.cellMargins=ve(d));let u=e(e$1,"w","tblLayout");if(u){let f=j(u,"w","type");(f==="fixed"||f==="autofit")&&(t.layout=f);}let m$1=e(e$1,"w","tblStyle");if(m$1){let f=j(m$1,"w","val");f&&(t.styleId=f);}let h=e(e$1,"w","tblLook");h&&(t.look=De(h));let p=e(e$1,"w","shd");p&&(t.shading=W(p));let x=e(e$1,"w","bidiVisual");return x&&(t.bidi=m(x)),Object.keys(t).length>0?t:void 0}function se(e$1){if(!e$1)return;let n={},t=e(e$1,"w","trHeight");if(t){n.height=H(t);let c=j(t,"w","hRule");c&&(n.heightRule=c);}let o=e(e$1,"w","tblHeader");o&&(n.header=m(o));let s=e(e$1,"w","cantSplit");s&&(n.cantSplit=m(s));let i=e(e$1,"w","jc");if(i){let c=j(i,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(e$1,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function ae(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tcW");o&&(t.width=H(o));let s=e(e$1,"w","tcBorders");s&&(t.borders=ye(s));let i=e(e$1,"w","tcMar");i&&(t.margins=ve(i));let a=e(e$1,"w","shd");a&&(t.shading=W(a));let c=e(e$1,"w","vAlign");if(c){let f=j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(t.verticalAlign=f);}let d=e(e$1,"w","textDirection");if(d){let f=j(d,"w","val");f&&(t.textDirection=f);}let u=e(e$1,"w","gridSpan");if(u){let f=l(u,"w","val");f!==void 0&&(t.gridSpan=f);}let m$1=e(e$1,"w","vMerge");if(m$1){let f=j(m$1,"w","val");t.vMerge=f==="restart"?"restart":"continue";}let h=e(e$1,"w","tcFitText");h&&(t.fitText=m(h));let p=e(e$1,"w","noWrap");p&&(t.noWrap=m(p));let x=e(e$1,"w","hideMark");return x&&(t.hideMark=m(x)),Object.keys(t).length>0?t:void 0}function Le(e$1,n){let t={styleId:j(e$1,"w","styleId")??"",type:j(e$1,"w","type")??"paragraph"},o=j(e$1,"w","default");o&&(t.default=o==="1"||o==="true");let s=e(e$1,"w","name");s&&(t.name=j(s,"w","val")??void 0);let i=e(e$1,"w","basedOn");i&&(t.basedOn=j(i,"w","val")??void 0);let a=e(e$1,"w","next");a&&(t.next=j(a,"w","val")??void 0);let c=e(e$1,"w","link");c&&(t.link=j(c,"w","val")??void 0);let d=e(e$1,"w","uiPriority");if(d){let T=l(d,"w","val");T!==void 0&&(t.uiPriority=T);}let u=e(e$1,"w","hidden");u&&(t.hidden=m(u));let m$1=e(e$1,"w","semiHidden");m$1&&(t.semiHidden=m(m$1));let h=e(e$1,"w","unhideWhenUsed");h&&(t.unhideWhenUsed=m(h));let p=e(e$1,"w","qFormat");p&&(t.qFormat=m(p));let x=e(e$1,"w","personal");x&&(t.personal=m(x));let f$1=e(e$1,"w","pPr");f$1&&(t.pPr=ee(f$1,n));let b=e(e$1,"w","rPr");b&&(t.rPr=z(b,n));let C=e(e$1,"w","tblPr");C&&(t.tblPr=re(C));let X=e(e$1,"w","trPr");X&&(t.trPr=se(X));let D=e(e$1,"w","tcPr");D&&(t.tcPr=ae(D));let N=f(e$1,"w","tblStylePr");if(N.length>0){t.tblStylePr=[];for(let T of N){let y=j(T,"w","type");if(y){let S={type:y},F=e(T,"w","pPr");F&&(S.pPr=ee(F,n));let M=e(T,"w","rPr");M&&(S.rPr=z(M,n));let L=e(T,"w","tblPr");L&&(S.tblPr=re(L));let I=e(T,"w","trPr");I&&(S.trPr=se(I));let A=e(T,"w","tcPr");A&&(S.tcPr=ae(A)),t.tblStylePr.push(S);}}}return t}function Ae(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","rPrDefault");if(o){let i=e(o,"w","rPr");i&&(t.rPr=z(i,n));}let s=e(e$1,"w","pPrDefault");if(s){let i=e(s,"w","pPr");i&&(t.pPr=ee(i,n));}return t.rPr||t.pPr?t:void 0}function ke(e,n){if(!n)return e;if(!e)return n?{...n}:void 0;let t={...e};for(let o of Object.keys(n)){let s=n[o];if(s!==void 0)if(o==="runProperties")t.runProperties=a$2(t.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let i=t[o],a=s;t[o]={...i||{},...a||{}};}else o==="tabs"&&Array.isArray(s)?t.tabs=[...s]:t[o]=s;}return t}function xe(e,n,t,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let s=n.get(e.basedOn);if(!s)return e;let i=xe(s,n,t,o),a={...e,pPr:ke(i.pPr,e.pPr),rPr:a$2(i.rPr,e.rPr)};return e.type==="table"&&((i.tblPr||e.tblPr)&&(a.tblPr={...i.tblPr||{},...e.tblPr||{}}),(i.trPr||e.trPr)&&(a.trPr={...i.trPr||{},...e.trPr||{}}),(i.tcPr||e.tcPr)&&(a.tcPr={...i.tcPr||{},...e.tcPr||{}})),a}function le(e,n){let t=new Map;try{let o=c(e);if(!o)return t;let s=f(o,"w","style");for(let i of s){let a=Le(i,n);a.styleId&&t.set(a.styleId,a);}for(let[i,a]of t){let c=xe(a,t,n);t.set(i,c);}}catch(o){console.warn("Failed to parse styles:",o);}return t}function Se(e$1,n){let t={styles:[]};try{let o=c(e$1);if(!o)return t;let s=e(o,"w","docDefaults");t.docDefaults=Ae(s,n);let i=e(o,"w","latentStyles");i&&(t.latentStyles={defLockedState:j(i,"w","defLockedState")==="1",defUIPriority:l(i,"w","defUIPriority"),defSemiHidden:j(i,"w","defSemiHidden")==="1",defUnhideWhenUsed:j(i,"w","defUnhideWhenUsed")==="1",defQFormat:j(i,"w","defQFormat")==="1",count:l(i,"w","count")});let a=le(e$1,n);t.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return t}function Fe(e){let n={abstractNums:[],nums:[]};if(!e)return ce(n);let t=c(e);if(!t)return ce(n);let o=f(t,"w","abstractNum");for(let i of o){let a=Ee(i);a&&n.abstractNums.push(a);}let s=f(t,"w","num");for(let i of s){let a=Re(i);a&&n.nums.push(a);}return ce(n)}function Ee(e$1){let n=j(e$1,"w","abstractNumId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o={abstractNumId:t,levels:[]},s=e(e$1,"w","multiLevelType");if(s){let u=j(s,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let i=e(e$1,"w","name");i&&(o.name=j(i,"w","val")??void 0);let a=e(e$1,"w","numStyleLink");a&&(o.numStyleLink=j(a,"w","val")??void 0);let c=e(e$1,"w","styleLink");c&&(o.styleLink=j(c,"w","val")??void 0);let d=f(e$1,"w","lvl");for(let u of d){let m=Pe(u);m&&o.levels.push(m);}return o.levels.sort((u,m)=>u.ilvl-m.ilvl),o}function Re(e$1){let n=j(e$1,"w","numId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o=e(e$1,"w","abstractNumId");if(!o)return null;let s=j(o,"w","val");if(s===null)return null;let i=parseInt(s,10);if(isNaN(i))return null;let a={numId:t,abstractNumId:i},c=f(e$1,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let d of c){let u=j(d,"w","ilvl");if(u===null)continue;let m=parseInt(u,10);if(isNaN(m))continue;let h={ilvl:m},p=e(d,"w","startOverride");if(p){let f=j(p,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(h.startOverride=b);}}let x=e(d,"w","lvl");x&&(h.lvl=Pe(x)??void 0),a.levelOverrides.push(h);}}return a}function Pe(e$1){let n=j(e$1,"w","ilvl");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t)||t<0||t>8)return null;let o={ilvl:t,numFmt:"decimal",lvlText:""},s=e(e$1,"w","start");if(s){let f=j(s,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.start=b);}}let i=e(e$1,"w","numFmt");if(i){let f=j(i,"w","val");f&&(o.numFmt=Be(f));}let a=e(e$1,"w","lvlText");a&&(o.lvlText=j(a,"w","val")??"");let c=e(e$1,"w","lvlJc");if(c){let f=j(c,"w","val");(f==="left"||f==="center"||f==="right")&&(o.lvlJc=f);}let d=e(e$1,"w","suff");if(d){let f=j(d,"w","val");(f==="tab"||f==="space"||f==="nothing")&&(o.suffix=f);}let u=e(e$1,"w","isLgl");u&&(o.isLgl=m(u));let m$1=e(e$1,"w","lvlRestart");if(m$1){let f=j(m$1,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.lvlRestart=b);}}let h=e(e$1,"w","legacy");h&&(o.legacy={legacy:m(h),legacySpace:l(h,"w","legacySpace"),legacyIndent:l(h,"w","legacyIndent")});let p=e(e$1,"w","pPr");p&&(o.pPr=Oe(p));let x=e(e$1,"w","rPr");return x&&(o.rPr=Ve(x)),o}function Be(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function Oe(e$1){let n={},t=e(e$1,"w","ind");if(t){let s=l(t,"w","left"),i=l(t,"w","right"),a=l(t,"w","start"),c=l(t,"w","end"),d=l(t,"w","firstLine"),u=l(t,"w","hanging"),m=s??a,h=i??c;m!==void 0&&(n.indentLeft=m),h!==void 0&&(n.indentRight=h),u!==void 0?(n.indentFirstLine=-u,n.hangingIndent=true):d!==void 0&&(n.indentFirstLine=d);}let o=e(e$1,"w","tabs");if(o){n.tabs=[];let s=f(o,"w","tab");for(let i of s){let a=l(i,"w","pos"),c=j(i,"w","val"),d=j(i,"w","leader");a!==void 0&&c&&n.tabs.push({position:a,alignment:je(c),leader:He(d)});}}return n}function je(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function He(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Ve(e$1){let n={},t=e(e$1,"w","rFonts");t&&(n.fontFamily={ascii:j(t,"w","ascii")??void 0,hAnsi:j(t,"w","hAnsi")??void 0,eastAsia:j(t,"w","eastAsia")??void 0,cs:j(t,"w","cs")??void 0});let o=e(e$1,"w","sz");if(o){let d=l(o,"w","val");d!==void 0&&(n.fontSize=d);}let s=e(e$1,"w","color");if(s){let d=j(s,"w","val"),u=j(s,"w","themeColor");d==="auto"?n.color={auto:true}:u?n.color={themeColor:u,themeTint:j(s,"w","themeTint")??void 0,themeShade:j(s,"w","themeShade")??void 0}:d&&(n.color={rgb:d});}let i=e(e$1,"w","b");i&&(n.bold=m(i));let a=e(e$1,"w","i");a&&(n.italic=m(a));let c=e(e$1,"w","vanish");return c&&(n.hidden=m(c)),n}function ce(e){let n=new Map;for(let o of e.abstractNums)n.set(o.abstractNumId,o);let t=new Map;for(let o of e.nums)t.set(o.numId,o);return {definitions:e,getLevel(o,s){let i=t.get(o);if(!i)return null;if(i.levelOverrides){let c=i.levelOverrides.find(d=>d.ilvl===s);if(c){if(c.lvl)return c.lvl;let d=n.get(i.abstractNumId);if(d){let u=d.levels.find(m=>m.ilvl===s);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=n.get(i.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let c of n.values())if(c.styleLink===a.numStyleLink&&c.levels.length>0){a=c;break}}return a.levels.find(c=>c.ilvl===s)??null},getAbstract(o){return n.get(o)??null},getInstance(o){return t.get(o)??null},hasNumbering(o){return t.has(o)}}}function Ue(e,n){switch(n){case "decimal":case "decimalZero":return e.toString();case "upperRoman":return Ce(e).toUpperCase();case "lowerRoman":return Ce(e).toLowerCase();case "upperLetter":return Te(e).toUpperCase();case "lowerLetter":return Te(e).toLowerCase();case "ordinal":return We(e);case "bullet":return "\u2022";case "none":return "";case "decimalEnclosedParen":return `(${e})`;case "numberInDash":return `-${e}-`;default:return e.toString()}}function Ce(e){if(e<=0||e>3999)return e.toString();let n=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],t="",o=e;for(let[s,i]of n)for(;o>=s;)t+=i,o-=s;return t}function Te(e){if(e<=0)return "";let n="",t=e;for(;t>0;)t--,n=String.fromCharCode(97+t%26)+n,t=Math.floor(t/26);return n}function We(e){let n=["th","st","nd","rd"],t=e%100;return e+(n[(t-20)%10]||n[t]||n[0])}function gt(e,n,t){let o=e;for(let s=1;s<=9;s++){let i=`%${s}`;if(o.includes(i)){let a=s-1,c=n[a]??1,d=t[a]??"decimal",u=Ue(c,d);o=o.replace(i,u);}}return o}function wt(e){if(e.lvlText)return e.lvlText;let n=e.rPr?.fontFamily?.ascii||e.rPr?.fontFamily?.hAnsi;if(n){let t=n.toLowerCase();if(t==="symbol")return "\u2022";if(t.includes("wingding"))return "\u2751"}return "\u2022"}function ht(e){return e.numFmt==="bullet"||e.numFmt==="none"}function ze(e$1){let n=new Map,t=a$1(e$1);if(!t)return n;let o=e(t,"w16cex","commentsExtensible")??t;for(let s of i(o)){if((s.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j(s,"w16cex","paraId")??j(s,"w15","paraId")??s.attributes?.["w16cex:paraId"]??s.attributes?.["w15:paraId"],c=j(s,"w16cex","dateUtc")??j(s,"w15","dateUtc")??s.attributes?.["w16cex:dateUtc"]??s.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function $e(e$1){let n=new Map,t=new Map,o=a$1(e$1);if(!o)return {parentByParaId:n,doneByParaId:t};let s=e(o,"w15","commentsEx")??o;for(let i$1 of i(s)){if((i$1.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j(i$1,"w15","paraId")??i$1.attributes?.["w15:paraId"],d=j(i$1,"w15","paraIdParent")??i$1.attributes?.["w15:paraIdParent"],u=j(i$1,"w15","done")??i$1.attributes?.["w15:done"];if(c){let m=String(c).toUpperCase();d&&n.set(m,String(d).toUpperCase()),u==="1"&&t.set(m,true);}}return {parentByParaId:n,doneByParaId:t}}function Ne(e$1,n,t,o,s,i$1,a){if(!e$1)return [];let c=a$1(e$1);if(!c)return [];let d=i$1?ze(i$1):new Map,u=a?$e(a):null,m=e(c,"w","comments")??c,h=i(m),p=[],x=[];for(let f of h){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(j(f,"w","id")??"0",10),X=j(f,"w","author")??"Unknown",D=j(f,"w","initials"),N=D!=null?String(D):void 0,T=j(f,"w","date"),y=T!=null?String(T):void 0,S=j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j(f,"w","paraId"),M=(S?d.get(String(S).toUpperCase()):void 0)??y,L=j(f,"w","done")??f.attributes?.["w:done"],I$1=L==="1"||L==="true"?true:void 0,A=j(f,"w16cid","parentId")??j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=A!=null?parseInt(String(A),10):void 0,U=[],j$1="";for(let P of i(f))if((P.name?.replace(/^.*:/,"")??"")==="p"){let g=I(P,n,t,null,o,s);U.push(g);let E=j(P,"w14","paraId")??P.attributes?.["w14:paraId"];E&&(j$1=String(E).toUpperCase());}I$1==null&&u&&j$1&&u.doneByParaId.get(j$1)&&(I$1=true),x.push(j$1),p.push({id:C,author:X,initials:N,date:M,content:U,...I$1!=null?{done:I$1}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(u&&u.parentByParaId.size>0){let f=new Map;for(let b=0;b<p.length;b++){let C=x[b];C&&f.set(C,p[b].id);}for(let b=0;b<p.length;b++){if(p[b].parentId!=null)continue;let C=x[b];if(!C)continue;let X=u.parentByParaId.get(C);if(!X)continue;let D=f.get(X);D!=null&&(p[b]={...p[b],parentId:D});}}return p}async function Ie(e,n={}){let t=e instanceof ArrayBuffer?e:await p(e),{onProgress:o=()=>{},preloadFonts:s=true,parseHeadersFooters:i=true,parseNotes:a$1=true,detectVariables:c=true}=n,d=[];try{let p=function(P,B){let g=performance.now(),E=B(),k=performance.now()-g;return h.push({stage:P,ms:k}),k>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(k)}ms`),E};var u=p;let m=performance.now(),h=[];async function x(P,B){let g=performance.now(),E=await B(),k=performance.now()-g;return h.push({stage:P,ms:k}),k>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(k)}ms`),E}o("Extracting DOCX...",0);let f=await x("unzip",()=>G(t));o("Extracted DOCX",10),o("Parsing relationships...",10);let b=p("relationships",()=>f.documentRels?p$1(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=p("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let X=null,D;p("styles",()=>{f.stylesXml&&(X=le(f.stylesXml,C),D=Se(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let N=p("numbering",()=>Fe(f.numberingXml));o("Parsed numbering",35),o("Processing media files...",35);let T=p("media",()=>Ze(f,b));o("Processed media",40),o("Parsing document body...",40);let y={content:[]};p("documentBody",()=>{f.documentXml?y=L(f.documentXml,X,C,N,b,T):d.push("No document.xml found in DOCX");}),o("Parsed document body",55);let S,F;if(i){o("Parsing headers/footers...",55);let P=p("headersFooters",()=>_e(f,X,C,N,b,T));S=P.headers,F=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let M,L$1;if(a$1){o("Parsing footnotes/endnotes...",65);let P=p("footnotesEndnotes",()=>Je(f,X,C,N,b,T));M=P.footnotes,L$1=P.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let I=p("comments",()=>Ne(f.commentsXml,X,C,b,T,f.commentsExtensibleXml,f.commentsExtendedXml));I.length>0&&(y.comments=I);let A;c?(o("Detecting template variables...",75),A=p("variables",()=>K$1(y.content)),o("Detected variables",80)):o("Skipping variable detection",80),s?(o("Loading fonts...",80),await x("fonts",()=>qe(C,D,y)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let U={package:{document:y,styles:D,theme:C,numbering:N.definitions,headers:S,footers:F,footnotes:M,endnotes:L$1,relationships:b,media:T},originalBuffer:t,templateVariables:A,warnings:d.length>0?d:void 0},j=performance.now()-m;if(j>2e3){let P=h.filter(B=>B.ms>100).map(B=>`${B.stage}: ${Math.round(B.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(j)}ms`+(P?` (${P})`:""));}return o("Complete",100),U}catch(m){let h=m instanceof Error?m.message:String(m);throw console.error("[parseDocx] Failed to parse DOCX:",h,m),new Error(`Failed to parse DOCX: ${h}`)}}function Ze(e,n){let t=new Map;for(let[o,s]of e.media.entries()){let i=o.split("/").pop()||o,a=be(o),c=new Uint8Array(s),d="";for(let x=0;x<c.length;x++)d+=String.fromCharCode(c[x]);let u=btoa(d),m=`data:${a};base64,${u}`,h={path:o,filename:i,mimeType:a,data:s,dataUrl:m};t.set(o,h);let p=o.replace(/^word\//,"");p!==o&&t.set(p,h);}return t}function te(e,n){let t=n.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===t)return s}function _e(e,n,t,o$1,s,i){let a=new Map,c=new Map;for(let[d,u]of s.entries())if(u.type===o.header&&u.target){let m=u.target.split("/").pop()||u.target,h=te(e.headers,m);if(h){let p=`word/_rels/${m}.rels`,x=te(e.allXml,p),f=x?p$1(x):s,b=p$2(h,"default",n,t,o$1,f,i);a.set(d,b);}}else if(u.type===o.footer&&u.target){let m=u.target.split("/").pop()||u.target,h=te(e.footers,m);if(h){let p=`word/_rels/${m}.rels`,x=te(e.allXml,p),f=x?p$1(x):s,b=q(h,"default",n,t,o$1,f,i);c.set(d,b);}}return {headers:a,footers:c}}function Je(e,n,t,o,s$1,i){let a=r(e.footnotesXml,n,t,o,s$1,i),c=s(e.endnotesXml,n,t,o,s$1,i);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function qe(e,n,t){let o=new Set;if(e?.fontScheme){let{majorFont:s,minorFont:i}=e.fontScheme;s?.latin&&o.add(s.latin),i?.latin&&o.add(i.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let s of n.styles)s.rPr?.fontFamily?.ascii&&o.add(s.rPr.fontFamily.ascii),s.rPr?.fontFamily?.hAnsi&&o.add(s.rPr.fontFamily.hAnsi);if(t.content){for(let s of t.content)if(s.type==="paragraph")for(let i of s.content)i.type==="run"&&i.formatting?.fontFamily&&(i.formatting.fontFamily.ascii&&o.add(i.formatting.fontFamily.ascii),i.formatting.fontFamily.hAnsi&&o.add(i.formatting.fontFamily.hAnsi));}if(o.size>0)try{await l$1(Array.from(o));}catch(s){console.warn("Failed to load some fonts:",s);}}async function At(e){return Ie(e,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function kt(e,n){return Ie(e,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Et(e){let n=await G(e);if(!n.documentXml)return [];let t=L(n.documentXml);return K$1(t.content)}async function Rt(e){let n=await G(e),t=n.documentXml?K$1(L(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:t.length}}
1
+ import {a,L,K as K$1,p as p$2,q,r,s,I,b}from'./chunk-3GNIP6IX.mjs';import {p,l as l$1}from'./chunk-Y5HZAMND.mjs';import {a as a$2}from'./chunk-ILJUDEZ5.mjs';import {c,f,j,e,m,l,p as p$1,o,a as a$1,i}from'./chunk-6LOYA7G5.mjs';import Xe from'jszip';async function G(e){let n=await Xe.loadAsync(e),t={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:e};for(let[o,s]of Object.entries(n.files)){if(s.dir)continue;let i=o.toLowerCase();if(i.endsWith(".xml")||i.endsWith(".rels")){let a=await s.async("text");if(t.allXml.set(o,a),i==="word/document.xml")t.documentXml=a;else if(i==="word/styles.xml")t.stylesXml=a;else if(i==="word/theme/theme1.xml")t.themeXml=a;else if(i==="word/numbering.xml")t.numberingXml=a;else if(i==="word/fonttable.xml")t.fontTableXml=a;else if(i==="word/settings.xml")t.settingsXml=a;else if(i==="word/websettings.xml")t.webSettingsXml=a;else if(i==="word/footnotes.xml")t.footnotesXml=a;else if(i==="word/endnotes.xml")t.endnotesXml=a;else if(i==="word/comments.xml")t.commentsXml=a;else if(i==="word/commentsextensible.xml")t.commentsExtensibleXml=a;else if(i==="word/commentsextended.xml")t.commentsExtendedXml=a;else if(i==="word/_rels/document.xml.rels")t.documentRels=a;else if(i==="_rels/.rels")t.packageRels=a;else if(i==="[content_types].xml")t.contentTypesXml=a;else if(i==="docprops/core.xml")t.corePropsXml=a;else if(i==="docprops/app.xml")t.appPropsXml=a;else if(i==="docprops/custom.xml")t.customPropsXml=a;else if(i.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;t.headers.set(c,a);}else if(i.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;t.footers.set(c,a);}}else if(i.startsWith("word/media/")){let a=await s.async("arraybuffer");t.media.set(o,a);}else if(i.startsWith("word/fonts/")){let a=await s.async("arraybuffer");t.fonts.set(o,a);}}return t}function be(e){switch(e.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 K(e,n,t,o){let s={};return e&&e!=="auto"?s.rgb=e:e==="auto"&&(s.auto=true),n&&(s.themeColor=n),t&&(s.themeTint=t),o&&(s.themeShade=o),s}function W(e){if(!e)return;let n={},t=j(e,"w","color");t&&t!=="auto"&&(n.color={rgb:t});let o=j(e,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let s=j(e,"w","themeFill");s&&(n.fill=n.fill||{},n.fill.themeColor=s);let i=j(e,"w","themeFillTint");i&&n.fill&&(n.fill.themeTint=i);let a=j(e,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j(e,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function z(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","b");o&&(t.bold=m(o));let s=e(e$1,"w","bCs");s&&(t.boldCs=m(s));let i=e(e$1,"w","i");i&&(t.italic=m(i));let a=e(e$1,"w","iCs");a&&(t.italicCs=m(a));let c=e(e$1,"w","u");if(c){let g=j(c,"w","val");if(g){t.underline={style:g};let E=j(c,"w","color"),k=j(c,"w","themeColor");(E||k)&&(t.underline.color=K(E,k,j(c,"w","themeTint"),j(c,"w","themeShade")));}}let d=e(e$1,"w","strike");d&&(t.strike=m(d));let u=e(e$1,"w","dstrike");u&&(t.doubleStrike=m(u));let m$1=e(e$1,"w","vertAlign");if(m$1){let g=j(m$1,"w","val");(g==="superscript"||g==="subscript"||g==="baseline")&&(t.vertAlign=g);}let h=e(e$1,"w","smallCaps");h&&(t.smallCaps=m(h));let p=e(e$1,"w","caps");p&&(t.allCaps=m(p));let x=e(e$1,"w","vanish");x&&(t.hidden=m(x));let f=e(e$1,"w","color");f&&(t.color=K(j(f,"w","val"),j(f,"w","themeColor"),j(f,"w","themeTint"),j(f,"w","themeShade")));let b$1=e(e$1,"w","highlight");if(b$1){let g=j(b$1,"w","val");g&&(t.highlight=g);}let C=e(e$1,"w","shd");C&&(t.shading=W(C));let X=e(e$1,"w","sz");if(X){let g=l(X,"w","val");g!==void 0&&(t.fontSize=g);}let D=e(e$1,"w","szCs");if(D){let g=l(D,"w","val");g!==void 0&&(t.fontSizeCs=g);}let N=e(e$1,"w","rFonts");if(N){t.fontFamily={ascii:j(N,"w","ascii")??void 0,hAnsi:j(N,"w","hAnsi")??void 0,eastAsia:j(N,"w","eastAsia")??void 0,cs:j(N,"w","cs")??void 0};let g=j(N,"w","asciiTheme");g&&(t.fontFamily.asciiTheme=g,n&&!t.fontFamily.ascii&&(t.fontFamily.ascii=b(n,g)));let E=j(N,"w","hAnsiTheme");E&&(t.fontFamily.hAnsiTheme=E,n&&!t.fontFamily.hAnsi&&(t.fontFamily.hAnsi=b(n,E)));let k=j(N,"w","eastAsiaTheme");k&&(t.fontFamily.eastAsiaTheme=k,n&&!t.fontFamily.eastAsia&&(t.fontFamily.eastAsia=b(n,k)));let ne=j(N,"w","cstheme");ne&&(t.fontFamily.csTheme=ne,n&&!t.fontFamily.cs&&(t.fontFamily.cs=b(n,ne)));}let T=e(e$1,"w","spacing");if(T){let g=l(T,"w","val");g!==void 0&&(t.spacing=g);}let y=e(e$1,"w","position");if(y){let g=l(y,"w","val");g!==void 0&&(t.position=g);}let S=e(e$1,"w","w");if(S){let g=l(S,"w","val");g!==void 0&&(t.scale=g);}let F=e(e$1,"w","kern");if(F){let g=l(F,"w","val");g!==void 0&&(t.kerning=g);}let M=e(e$1,"w","effect");if(M){let g=j(M,"w","val");g&&(t.effect=g);}let L=e(e$1,"w","em");if(L){let g=j(L,"w","val");g&&(t.emphasisMark=g);}let I=e(e$1,"w","emboss");I&&(t.emboss=m(I));let A=e(e$1,"w","imprint");A&&(t.imprint=m(A));let V=e(e$1,"w","outline");V&&(t.outline=m(V));let U=e(e$1,"w","shadow");U&&(t.shadow=m(U));let j$1=e(e$1,"w","rtl");j$1&&(t.rtl=m(j$1));let P=e(e$1,"w","cs");P&&(t.cs=m(P));let B=e(e$1,"w","rStyle");if(B){let g=j(B,"w","val");g&&(t.styleId=g);}return Object.keys(t).length>0?t:void 0}function R(e){if(!e)return;let n=j(e,"w","val");if(!n)return;let t={style:n},o=j(e,"w","color"),s=j(e,"w","themeColor");(o||s)&&(t.color=K(o,s,j(e,"w","themeTint"),j(e,"w","themeShade")));let i=l(e,"w","sz");i!==void 0&&(t.size=i);let a=l(e,"w","space");a!==void 0&&(t.space=a);let c=j(e,"w","shadow");c&&(t.shadow=c==="1"||c==="true");let d=j(e,"w","frame");return d&&(t.frame=d==="1"||d==="true"),t}function Me(e){if(!e)return;let n=f(e,"w","tab");if(n.length===0)return;let t=[];for(let o of n){let s=l(o,"w","pos"),i=j(o,"w","val");if(s!==void 0&&i){let a={position:s,alignment:i},c=j(o,"w","leader");c&&(a.leader=c),t.push(a);}}return t.length>0?t:void 0}function ee(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","jc");if(o){let y=j(o,"w","val");y&&(t.alignment=y);}let s=e(e$1,"w","bidi");s&&(t.bidi=m(s));let i=e(e$1,"w","spacing");if(i){let y=l(i,"w","before");y!==void 0&&(t.spaceBefore=y);let S=l(i,"w","after");S!==void 0&&(t.spaceAfter=S);let F=l(i,"w","line");F!==void 0&&(t.lineSpacing=F);let M=j(i,"w","lineRule");M&&(t.lineSpacingRule=M);let L=j(i,"w","beforeAutospacing");L&&(t.beforeAutospacing=L==="1"||L==="true");let I=j(i,"w","afterAutospacing");I&&(t.afterAutospacing=I==="1"||I==="true");}let a=e(e$1,"w","ind");if(a){let y=l(a,"w","left");y!==void 0&&(t.indentLeft=y);let S=l(a,"w","right");S!==void 0&&(t.indentRight=S);let F=l(a,"w","firstLine");F!==void 0&&(t.indentFirstLine=F);let M=l(a,"w","hanging");M!==void 0&&(t.indentFirstLine=-M,t.hangingIndent=true);}let c=e(e$1,"w","pBdr");if(c){let y={},S=R(e(c,"w","top"));S&&(y.top=S);let F=R(e(c,"w","bottom"));F&&(y.bottom=F);let M=R(e(c,"w","left"));M&&(y.left=M);let L=R(e(c,"w","right"));L&&(y.right=L);let I=R(e(c,"w","between"));I&&(y.between=I);let A=R(e(c,"w","bar"));A&&(y.bar=A),Object.keys(y).length>0&&(t.borders=y);}let d=e(e$1,"w","shd");d&&(t.shading=W(d));let u=e(e$1,"w","tabs");u&&(t.tabs=Me(u));let m$1=e(e$1,"w","keepNext");m$1&&(t.keepNext=m(m$1));let h=e(e$1,"w","keepLines");h&&(t.keepLines=m(h));let p=e(e$1,"w","widowControl");p&&(t.widowControl=m(p));let x=e(e$1,"w","pageBreakBefore");x&&(t.pageBreakBefore=m(x));let f=e(e$1,"w","contextualSpacing");f&&(t.contextualSpacing=m(f));let b=e(e$1,"w","numPr");if(b){let y=e(b,"w","numId"),S=e(b,"w","ilvl");if(y||S){if(t.numPr={},y){let F=l(y,"w","val");F!==void 0&&(t.numPr.numId=F);}if(S){let F=l(S,"w","val");F!==void 0&&(t.numPr.ilvl=F);}}}let C=e(e$1,"w","outlineLvl");if(C){let y=l(C,"w","val");y!==void 0&&(t.outlineLevel=y);}let X=e(e$1,"w","pStyle");if(X){let y=j(X,"w","val");y&&(t.styleId=y);}let D=e(e$1,"w","suppressLineNumbers");D&&(t.suppressLineNumbers=m(D));let N=e(e$1,"w","suppressAutoHyphens");N&&(t.suppressAutoHyphens=m(N));let T=e(e$1,"w","rPr");return T&&(t.runProperties=z(T,n)),Object.keys(t).length>0?t:void 0}function H(e){if(!e)return;let n=l(e,"w","w"),t=j(e,"w","type");if(n!==void 0&&t)return {value:n,type:t}}function ye(e$1){if(!e$1)return;let n={},t=R(e(e$1,"w","top"));t&&(n.top=t);let o=R(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=R(e(e$1,"w","left"));s&&(n.left=s);let i=R(e(e$1,"w","right"));i&&(n.right=i);let a=R(e(e$1,"w","insideH"));a&&(n.insideH=a);let c=R(e(e$1,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function ve(e$1){if(!e$1)return;let n={},t=H(e(e$1,"w","top"));t&&(n.top=t);let o=H(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=H(e(e$1,"w","left"));s&&(n.left=s);let i=H(e(e$1,"w","right"));return i&&(n.right=i),Object.keys(n).length>0?n:void 0}function De(e){if(!e)return;let n={},t=j(e,"w","val");if(t){let u=parseInt(t,16);isNaN(u)||(n.firstRow=(u&32)!==0,n.lastRow=(u&64)!==0,n.firstColumn=(u&128)!==0,n.lastColumn=(u&256)!==0,n.noHBand=(u&512)!==0,n.noVBand=(u&1024)!==0);}let o=j(e,"w","firstColumn");o&&(n.firstColumn=o==="1");let s=j(e,"w","firstRow");s&&(n.firstRow=s==="1");let i=j(e,"w","lastColumn");i&&(n.lastColumn=i==="1");let a=j(e,"w","lastRow");a&&(n.lastRow=a==="1");let c=j(e,"w","noHBand");c&&(n.noHBand=c==="1");let d=j(e,"w","noVBand");return d&&(n.noVBand=d==="1"),Object.keys(n).length>0?n:void 0}function re(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tblW");o&&(t.width=H(o));let s=e(e$1,"w","jc");if(s){let f=j(s,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}let i=e(e$1,"w","tblCellSpacing");i&&(t.cellSpacing=H(i));let a=e(e$1,"w","tblInd");a&&(t.indent=H(a));let c=e(e$1,"w","tblBorders");c&&(t.borders=ye(c));let d=e(e$1,"w","tblCellMar");d&&(t.cellMargins=ve(d));let u=e(e$1,"w","tblLayout");if(u){let f=j(u,"w","type");(f==="fixed"||f==="autofit")&&(t.layout=f);}let m$1=e(e$1,"w","tblStyle");if(m$1){let f=j(m$1,"w","val");f&&(t.styleId=f);}let h=e(e$1,"w","tblLook");h&&(t.look=De(h));let p=e(e$1,"w","shd");p&&(t.shading=W(p));let x=e(e$1,"w","bidiVisual");return x&&(t.bidi=m(x)),Object.keys(t).length>0?t:void 0}function se(e$1){if(!e$1)return;let n={},t=e(e$1,"w","trHeight");if(t){n.height=H(t);let c=j(t,"w","hRule");c&&(n.heightRule=c);}let o=e(e$1,"w","tblHeader");o&&(n.header=m(o));let s=e(e$1,"w","cantSplit");s&&(n.cantSplit=m(s));let i=e(e$1,"w","jc");if(i){let c=j(i,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(e$1,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function ae(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tcW");o&&(t.width=H(o));let s=e(e$1,"w","tcBorders");s&&(t.borders=ye(s));let i=e(e$1,"w","tcMar");i&&(t.margins=ve(i));let a=e(e$1,"w","shd");a&&(t.shading=W(a));let c=e(e$1,"w","vAlign");if(c){let f=j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(t.verticalAlign=f);}let d=e(e$1,"w","textDirection");if(d){let f=j(d,"w","val");f&&(t.textDirection=f);}let u=e(e$1,"w","gridSpan");if(u){let f=l(u,"w","val");f!==void 0&&(t.gridSpan=f);}let m$1=e(e$1,"w","vMerge");if(m$1){let f=j(m$1,"w","val");t.vMerge=f==="restart"?"restart":"continue";}let h=e(e$1,"w","tcFitText");h&&(t.fitText=m(h));let p=e(e$1,"w","noWrap");p&&(t.noWrap=m(p));let x=e(e$1,"w","hideMark");return x&&(t.hideMark=m(x)),Object.keys(t).length>0?t:void 0}function Le(e$1,n){let t={styleId:j(e$1,"w","styleId")??"",type:j(e$1,"w","type")??"paragraph"},o=j(e$1,"w","default");o&&(t.default=o==="1"||o==="true");let s=e(e$1,"w","name");s&&(t.name=j(s,"w","val")??void 0);let i=e(e$1,"w","basedOn");i&&(t.basedOn=j(i,"w","val")??void 0);let a=e(e$1,"w","next");a&&(t.next=j(a,"w","val")??void 0);let c=e(e$1,"w","link");c&&(t.link=j(c,"w","val")??void 0);let d=e(e$1,"w","uiPriority");if(d){let T=l(d,"w","val");T!==void 0&&(t.uiPriority=T);}let u=e(e$1,"w","hidden");u&&(t.hidden=m(u));let m$1=e(e$1,"w","semiHidden");m$1&&(t.semiHidden=m(m$1));let h=e(e$1,"w","unhideWhenUsed");h&&(t.unhideWhenUsed=m(h));let p=e(e$1,"w","qFormat");p&&(t.qFormat=m(p));let x=e(e$1,"w","personal");x&&(t.personal=m(x));let f$1=e(e$1,"w","pPr");f$1&&(t.pPr=ee(f$1,n));let b=e(e$1,"w","rPr");b&&(t.rPr=z(b,n));let C=e(e$1,"w","tblPr");C&&(t.tblPr=re(C));let X=e(e$1,"w","trPr");X&&(t.trPr=se(X));let D=e(e$1,"w","tcPr");D&&(t.tcPr=ae(D));let N=f(e$1,"w","tblStylePr");if(N.length>0){t.tblStylePr=[];for(let T of N){let y=j(T,"w","type");if(y){let S={type:y},F=e(T,"w","pPr");F&&(S.pPr=ee(F,n));let M=e(T,"w","rPr");M&&(S.rPr=z(M,n));let L=e(T,"w","tblPr");L&&(S.tblPr=re(L));let I=e(T,"w","trPr");I&&(S.trPr=se(I));let A=e(T,"w","tcPr");A&&(S.tcPr=ae(A)),t.tblStylePr.push(S);}}}return t}function Ae(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","rPrDefault");if(o){let i=e(o,"w","rPr");i&&(t.rPr=z(i,n));}let s=e(e$1,"w","pPrDefault");if(s){let i=e(s,"w","pPr");i&&(t.pPr=ee(i,n));}return t.rPr||t.pPr?t:void 0}function ke(e,n){if(!n)return e;if(!e)return n?{...n}:void 0;let t={...e};for(let o of Object.keys(n)){let s=n[o];if(s!==void 0)if(o==="runProperties")t.runProperties=a$2(t.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let i=t[o],a=s;t[o]={...i||{},...a||{}};}else o==="tabs"&&Array.isArray(s)?t.tabs=[...s]:t[o]=s;}return t}function xe(e,n,t,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let s=n.get(e.basedOn);if(!s)return e;let i=xe(s,n,t,o),a={...e,pPr:ke(i.pPr,e.pPr),rPr:a$2(i.rPr,e.rPr)};return e.type==="table"&&((i.tblPr||e.tblPr)&&(a.tblPr={...i.tblPr||{},...e.tblPr||{}}),(i.trPr||e.trPr)&&(a.trPr={...i.trPr||{},...e.trPr||{}}),(i.tcPr||e.tcPr)&&(a.tcPr={...i.tcPr||{},...e.tcPr||{}})),a}function le(e,n){let t=new Map;try{let o=c(e);if(!o)return t;let s=f(o,"w","style");for(let i of s){let a=Le(i,n);a.styleId&&t.set(a.styleId,a);}for(let[i,a]of t){let c=xe(a,t,n);t.set(i,c);}}catch(o){console.warn("Failed to parse styles:",o);}return t}function Se(e$1,n){let t={styles:[]};try{let o=c(e$1);if(!o)return t;let s=e(o,"w","docDefaults");t.docDefaults=Ae(s,n);let i=e(o,"w","latentStyles");i&&(t.latentStyles={defLockedState:j(i,"w","defLockedState")==="1",defUIPriority:l(i,"w","defUIPriority"),defSemiHidden:j(i,"w","defSemiHidden")==="1",defUnhideWhenUsed:j(i,"w","defUnhideWhenUsed")==="1",defQFormat:j(i,"w","defQFormat")==="1",count:l(i,"w","count")});let a=le(e$1,n);t.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return t}function Fe(e){let n={abstractNums:[],nums:[]};if(!e)return ce(n);let t=c(e);if(!t)return ce(n);let o=f(t,"w","abstractNum");for(let i of o){let a=Ee(i);a&&n.abstractNums.push(a);}let s=f(t,"w","num");for(let i of s){let a=Re(i);a&&n.nums.push(a);}return ce(n)}function Ee(e$1){let n=j(e$1,"w","abstractNumId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o={abstractNumId:t,levels:[]},s=e(e$1,"w","multiLevelType");if(s){let u=j(s,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let i=e(e$1,"w","name");i&&(o.name=j(i,"w","val")??void 0);let a=e(e$1,"w","numStyleLink");a&&(o.numStyleLink=j(a,"w","val")??void 0);let c=e(e$1,"w","styleLink");c&&(o.styleLink=j(c,"w","val")??void 0);let d=f(e$1,"w","lvl");for(let u of d){let m=Pe(u);m&&o.levels.push(m);}return o.levels.sort((u,m)=>u.ilvl-m.ilvl),o}function Re(e$1){let n=j(e$1,"w","numId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o=e(e$1,"w","abstractNumId");if(!o)return null;let s=j(o,"w","val");if(s===null)return null;let i=parseInt(s,10);if(isNaN(i))return null;let a={numId:t,abstractNumId:i},c=f(e$1,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let d of c){let u=j(d,"w","ilvl");if(u===null)continue;let m=parseInt(u,10);if(isNaN(m))continue;let h={ilvl:m},p=e(d,"w","startOverride");if(p){let f=j(p,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(h.startOverride=b);}}let x=e(d,"w","lvl");x&&(h.lvl=Pe(x)??void 0),a.levelOverrides.push(h);}}return a}function Pe(e$1){let n=j(e$1,"w","ilvl");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t)||t<0||t>8)return null;let o={ilvl:t,numFmt:"decimal",lvlText:""},s=e(e$1,"w","start");if(s){let f=j(s,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.start=b);}}let i=e(e$1,"w","numFmt");if(i){let f=j(i,"w","val");f&&(o.numFmt=Be(f));}let a=e(e$1,"w","lvlText");a&&(o.lvlText=j(a,"w","val")??"");let c=e(e$1,"w","lvlJc");if(c){let f=j(c,"w","val");(f==="left"||f==="center"||f==="right")&&(o.lvlJc=f);}let d=e(e$1,"w","suff");if(d){let f=j(d,"w","val");(f==="tab"||f==="space"||f==="nothing")&&(o.suffix=f);}let u=e(e$1,"w","isLgl");u&&(o.isLgl=m(u));let m$1=e(e$1,"w","lvlRestart");if(m$1){let f=j(m$1,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.lvlRestart=b);}}let h=e(e$1,"w","legacy");h&&(o.legacy={legacy:m(h),legacySpace:l(h,"w","legacySpace"),legacyIndent:l(h,"w","legacyIndent")});let p=e(e$1,"w","pPr");p&&(o.pPr=Oe(p));let x=e(e$1,"w","rPr");return x&&(o.rPr=Ve(x)),o}function Be(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function Oe(e$1){let n={},t=e(e$1,"w","ind");if(t){let s=l(t,"w","left"),i=l(t,"w","right"),a=l(t,"w","start"),c=l(t,"w","end"),d=l(t,"w","firstLine"),u=l(t,"w","hanging"),m=s??a,h=i??c;m!==void 0&&(n.indentLeft=m),h!==void 0&&(n.indentRight=h),u!==void 0?(n.indentFirstLine=-u,n.hangingIndent=true):d!==void 0&&(n.indentFirstLine=d);}let o=e(e$1,"w","tabs");if(o){n.tabs=[];let s=f(o,"w","tab");for(let i of s){let a=l(i,"w","pos"),c=j(i,"w","val"),d=j(i,"w","leader");a!==void 0&&c&&n.tabs.push({position:a,alignment:je(c),leader:He(d)});}}return n}function je(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function He(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Ve(e$1){let n={},t=e(e$1,"w","rFonts");t&&(n.fontFamily={ascii:j(t,"w","ascii")??void 0,hAnsi:j(t,"w","hAnsi")??void 0,eastAsia:j(t,"w","eastAsia")??void 0,cs:j(t,"w","cs")??void 0});let o=e(e$1,"w","sz");if(o){let d=l(o,"w","val");d!==void 0&&(n.fontSize=d);}let s=e(e$1,"w","color");if(s){let d=j(s,"w","val"),u=j(s,"w","themeColor");d==="auto"?n.color={auto:true}:u?n.color={themeColor:u,themeTint:j(s,"w","themeTint")??void 0,themeShade:j(s,"w","themeShade")??void 0}:d&&(n.color={rgb:d});}let i=e(e$1,"w","b");i&&(n.bold=m(i));let a=e(e$1,"w","i");a&&(n.italic=m(a));let c=e(e$1,"w","vanish");return c&&(n.hidden=m(c)),n}function ce(e){let n=new Map;for(let o of e.abstractNums)n.set(o.abstractNumId,o);let t=new Map;for(let o of e.nums)t.set(o.numId,o);return {definitions:e,getLevel(o,s){let i=t.get(o);if(!i)return null;if(i.levelOverrides){let c=i.levelOverrides.find(d=>d.ilvl===s);if(c){if(c.lvl)return c.lvl;let d=n.get(i.abstractNumId);if(d){let u=d.levels.find(m=>m.ilvl===s);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=n.get(i.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let c of n.values())if(c.styleLink===a.numStyleLink&&c.levels.length>0){a=c;break}}return a.levels.find(c=>c.ilvl===s)??null},getAbstract(o){return n.get(o)??null},getInstance(o){return t.get(o)??null},hasNumbering(o){return t.has(o)}}}function Ue(e,n){switch(n){case "decimal":case "decimalZero":return e.toString();case "upperRoman":return Ce(e).toUpperCase();case "lowerRoman":return Ce(e).toLowerCase();case "upperLetter":return Te(e).toUpperCase();case "lowerLetter":return Te(e).toLowerCase();case "ordinal":return We(e);case "bullet":return "\u2022";case "none":return "";case "decimalEnclosedParen":return `(${e})`;case "numberInDash":return `-${e}-`;default:return e.toString()}}function Ce(e){if(e<=0||e>3999)return e.toString();let n=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],t="",o=e;for(let[s,i]of n)for(;o>=s;)t+=i,o-=s;return t}function Te(e){if(e<=0)return "";let n="",t=e;for(;t>0;)t--,n=String.fromCharCode(97+t%26)+n,t=Math.floor(t/26);return n}function We(e){let n=["th","st","nd","rd"],t=e%100;return e+(n[(t-20)%10]||n[t]||n[0])}function gt(e,n,t){let o=e;for(let s=1;s<=9;s++){let i=`%${s}`;if(o.includes(i)){let a=s-1,c=n[a]??1,d=t[a]??"decimal",u=Ue(c,d);o=o.replace(i,u);}}return o}function wt(e){if(e.lvlText)return e.lvlText;let n=e.rPr?.fontFamily?.ascii||e.rPr?.fontFamily?.hAnsi;if(n){let t=n.toLowerCase();if(t==="symbol")return "\u2022";if(t.includes("wingding"))return "\u2751"}return "\u2022"}function ht(e){return e.numFmt==="bullet"||e.numFmt==="none"}function ze(e$1){let n=new Map,t=a$1(e$1);if(!t)return n;let o=e(t,"w16cex","commentsExtensible")??t;for(let s of i(o)){if((s.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j(s,"w16cex","paraId")??j(s,"w15","paraId")??s.attributes?.["w16cex:paraId"]??s.attributes?.["w15:paraId"],c=j(s,"w16cex","dateUtc")??j(s,"w15","dateUtc")??s.attributes?.["w16cex:dateUtc"]??s.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function $e(e$1){let n=new Map,t=new Map,o=a$1(e$1);if(!o)return {parentByParaId:n,doneByParaId:t};let s=e(o,"w15","commentsEx")??o;for(let i$1 of i(s)){if((i$1.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j(i$1,"w15","paraId")??i$1.attributes?.["w15:paraId"],d=j(i$1,"w15","paraIdParent")??i$1.attributes?.["w15:paraIdParent"],u=j(i$1,"w15","done")??i$1.attributes?.["w15:done"];if(c){let m=String(c).toUpperCase();d&&n.set(m,String(d).toUpperCase()),u==="1"&&t.set(m,true);}}return {parentByParaId:n,doneByParaId:t}}function Ne(e$1,n,t,o,s,i$1,a){if(!e$1)return [];let c=a$1(e$1);if(!c)return [];let d=i$1?ze(i$1):new Map,u=a?$e(a):null,m=e(c,"w","comments")??c,h=i(m),p=[],x=[];for(let f of h){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(j(f,"w","id")??"0",10),X=j(f,"w","author")??"Unknown",D=j(f,"w","initials"),N=D!=null?String(D):void 0,T=j(f,"w","date"),y=T!=null?String(T):void 0,S=j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j(f,"w","paraId"),M=(S?d.get(String(S).toUpperCase()):void 0)??y,L=j(f,"w","done")??f.attributes?.["w:done"],I$1=L==="1"||L==="true"?true:void 0,A=j(f,"w16cid","parentId")??j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=A!=null?parseInt(String(A),10):void 0,U=[],j$1="";for(let P of i(f))if((P.name?.replace(/^.*:/,"")??"")==="p"){let g=I(P,n,t,null,o,s);U.push(g);let E=j(P,"w14","paraId")??P.attributes?.["w14:paraId"];E&&(j$1=String(E).toUpperCase());}I$1==null&&u&&j$1&&u.doneByParaId.get(j$1)&&(I$1=true),x.push(j$1),p.push({id:C,author:X,initials:N,date:M,content:U,...I$1!=null?{done:I$1}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(u&&u.parentByParaId.size>0){let f=new Map;for(let b=0;b<p.length;b++){let C=x[b];C&&f.set(C,p[b].id);}for(let b=0;b<p.length;b++){if(p[b].parentId!=null)continue;let C=x[b];if(!C)continue;let X=u.parentByParaId.get(C);if(!X)continue;let D=f.get(X);D!=null&&(p[b]={...p[b],parentId:D});}}return p}async function Ie(e,n={}){let t=e instanceof ArrayBuffer?e:await p(e),{onProgress:o=()=>{},preloadFonts:s=true,parseHeadersFooters:i=true,parseNotes:a$1=true,detectVariables:c=true}=n,d=[];try{let p=function(P,B){let g=performance.now(),E=B(),k=performance.now()-g;return h.push({stage:P,ms:k}),k>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(k)}ms`),E};var u=p;let m=performance.now(),h=[];async function x(P,B){let g=performance.now(),E=await B(),k=performance.now()-g;return h.push({stage:P,ms:k}),k>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(k)}ms`),E}o("Extracting DOCX...",0);let f=await x("unzip",()=>G(t));o("Extracted DOCX",10),o("Parsing relationships...",10);let b=p("relationships",()=>f.documentRels?p$1(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=p("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let X=null,D;p("styles",()=>{f.stylesXml&&(X=le(f.stylesXml,C),D=Se(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let N=p("numbering",()=>Fe(f.numberingXml));o("Parsed numbering",35),o("Processing media files...",35);let T=p("media",()=>Ze(f,b));o("Processed media",40),o("Parsing document body...",40);let y={content:[]};p("documentBody",()=>{f.documentXml?y=L(f.documentXml,X,C,N,b,T):d.push("No document.xml found in DOCX");}),o("Parsed document body",55);let S,F;if(i){o("Parsing headers/footers...",55);let P=p("headersFooters",()=>_e(f,X,C,N,b,T));S=P.headers,F=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let M,L$1;if(a$1){o("Parsing footnotes/endnotes...",65);let P=p("footnotesEndnotes",()=>Je(f,X,C,N,b,T));M=P.footnotes,L$1=P.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let I=p("comments",()=>Ne(f.commentsXml,X,C,b,T,f.commentsExtensibleXml,f.commentsExtendedXml));I.length>0&&(y.comments=I);let A;c?(o("Detecting template variables...",75),A=p("variables",()=>K$1(y.content)),o("Detected variables",80)):o("Skipping variable detection",80),s?(o("Loading fonts...",80),await x("fonts",()=>qe(C,D,y)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let U={package:{document:y,styles:D,theme:C,numbering:N.definitions,headers:S,footers:F,footnotes:M,endnotes:L$1,relationships:b,media:T},originalBuffer:t,templateVariables:A,warnings:d.length>0?d:void 0},j=performance.now()-m;if(j>2e3){let P=h.filter(B=>B.ms>100).map(B=>`${B.stage}: ${Math.round(B.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(j)}ms`+(P?` (${P})`:""));}return o("Complete",100),U}catch(m){let h=m instanceof Error?m.message:String(m);throw console.error("[parseDocx] Failed to parse DOCX:",h,m),new Error(`Failed to parse DOCX: ${h}`)}}function Ze(e,n){let t=new Map;for(let[o,s]of e.media.entries()){let i=o.split("/").pop()||o,a=be(o),c=new Uint8Array(s),d="";for(let x=0;x<c.length;x++)d+=String.fromCharCode(c[x]);let u=btoa(d),m=`data:${a};base64,${u}`,h={path:o,filename:i,mimeType:a,data:s,dataUrl:m};t.set(o,h);let p=o.replace(/^word\//,"");p!==o&&t.set(p,h);}return t}function te(e,n){let t=n.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===t)return s}function _e(e,n,t,o$1,s,i){let a=new Map,c=new Map;for(let[d,u]of s.entries())if(u.type===o.header&&u.target){let m=u.target.split("/").pop()||u.target,h=te(e.headers,m);if(h){let p=`word/_rels/${m}.rels`,x=te(e.allXml,p),f=x?p$1(x):s,b=p$2(h,"default",n,t,o$1,f,i);a.set(d,b);}}else if(u.type===o.footer&&u.target){let m=u.target.split("/").pop()||u.target,h=te(e.footers,m);if(h){let p=`word/_rels/${m}.rels`,x=te(e.allXml,p),f=x?p$1(x):s,b=q(h,"default",n,t,o$1,f,i);c.set(d,b);}}return {headers:a,footers:c}}function Je(e,n,t,o,s$1,i){let a=r(e.footnotesXml,n,t,o,s$1,i),c=s(e.endnotesXml,n,t,o,s$1,i);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function qe(e,n,t){let o=new Set;if(e?.fontScheme){let{majorFont:s,minorFont:i}=e.fontScheme;s?.latin&&o.add(s.latin),i?.latin&&o.add(i.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let s of n.styles)s.rPr?.fontFamily?.ascii&&o.add(s.rPr.fontFamily.ascii),s.rPr?.fontFamily?.hAnsi&&o.add(s.rPr.fontFamily.hAnsi);if(t.content){for(let s of t.content)if(s.type==="paragraph")for(let i of s.content)i.type==="run"&&i.formatting?.fontFamily&&(i.formatting.fontFamily.ascii&&o.add(i.formatting.fontFamily.ascii),i.formatting.fontFamily.hAnsi&&o.add(i.formatting.fontFamily.hAnsi));}if(o.size>0)try{await l$1(Array.from(o));}catch(s){console.warn("Failed to load some fonts:",s);}}async function At(e){return Ie(e,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function kt(e,n){return Ie(e,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Et(e){let n=await G(e);if(!n.documentXml)return [];let t=L(n.documentXml);return K$1(t.content)}async function Rt(e){let n=await G(e),t=n.documentXml?K$1(L(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:t.length}}
2
2
  export{Fe as a,Ue as b,gt as c,wt as d,ht as e,Ie as f,At as g,kt as h,Et as i,Rt as j};
@@ -1 +1 @@
1
- import {d}from'./chunk-7GHQ4YCJ.mjs';import {r}from'./chunk-5N5DBQJV.mjs';import {g,h}from'./chunk-G6Y4UZMJ.mjs';import {b}from'./chunk-UIROUI5I.mjs';import {c,e}from'./chunk-VW22RZ6C.mjs';function N(e,t,a){if(!(!e||e<=0)){if(t==="pct")return a*e/5e3;if(!t||t==="dxa"||t==="auto")return c(e)}}function q(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((a,o)=>a+Math.max(1,o.colSpan??1),0)))}function J(e,t,a){if(t<=0)return [];let o=a>0?a/t:0;if(e.length===0)return Array(t).fill(o);let n=e.slice(0,t),r=t-n.length;if(r>0){let u=n.filter(g=>g>0),c=u.length>0?u.reduce((g,h)=>g+h,0)/u.length:o;n=n.concat(Array(r).fill(c));}let s=n.reduce((u,c)=>u+(c>0?c:0),0),i=n.filter(u=>u<=0).length;if(s<=0)return Array(t).fill(o);if(i===0)return n;let l=Math.max(0,a-s),f=l>0?l/i:s/Math.max(1,t-i);return n.map(u=>u>0?u:f)}function K(e,t){if(e.pages.length===0)return null;let a=e.pageGap??0,o=0,n=null,r=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=o,u=f+l;if(t.y>=f&&t.y<u)return {pageIndex:s,page:i,pageY:t.y-f};let c=f+l/2,g=Math.abs(t.y-c);g<r&&(r=g,n=s),o=u+a;}if(n!==null){let s=e.pages[n],i=D(e,n);return {pageIndex:n,page:s,pageY:Math.max(0,Math.min(t.y-i,s.size?.h??e.pageSize.h))}}return null}function D(e,t){let a=e.pageGap??0,o=0;for(let n=0;n<t&&n<e.pages.length;n++){let s=e.pages[n].size?.h??e.pageSize.h;o+=s+a;}return o}function Ie(e,t){return K(e,{y:t})?.pageIndex??null}function Q(e,t){return e.findIndex(a=>a.id===t)}function Be(e,t){let a=0;for(let o=e.fromLine;o<e.toLine&&o<t.lines.length;o++)a+=t.lines[o].lineHeight;return a}function ce(e,t,a,o){let n=[...e.page.fragments].sort((r,s)=>{let i=r.y-s.y;return Math.abs(i)>.5?i:r.x-s.x});for(let r of n){let s=Q(t,r.blockId);if(s===-1)continue;let i=t[s],l=a[s];if(!i||!l)continue;let f;if(r.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Be(r,l);}else if(r.kind==="table")f=r.height;else if(r.kind==="image")f=r.height;else continue;let u=o.x>=r.x&&o.x<=r.x+r.width,c=o.y>=r.y&&o.y<=r.y+f;if(u&&c)return {fragment:r,block:i,measure:l,pageIndex:e.pageIndex,localX:o.x-r.x,localY:o.y-r.y}}return null}function Re(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="image")continue;let r=Q(t,n.blockId);if(r===-1)continue;let s=t[r],i=a[r];if(!s||!i)continue;let l=o.x>=n.x&&o.x<=n.x+n.width,f=o.y>=n.y&&o.y<=n.y+n.height;if(l&&f)return {fragment:n,block:s,measure:i,pageIndex:e.pageIndex,localX:o.x-n.x,localY:o.y-n.y}}return null}function ue(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="table")continue;let r$1=n,s=o.x>=r$1.x&&o.x<=r$1.x+r$1.width,i=o.y>=r$1.y&&o.y<=r$1.y+r$1.height;if(!s||!i)continue;let l=Q(t,r$1.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,g=u,h=o.x-r$1.x,x=o.y-r$1.y,d=r$1.headerRowCount??0,p=d>0&&r$1.continuesFromPrev?r(g,d):0,m=0,b=-1;if(g.rows.length===0||c.rows.length===0)continue;if(p>0&&x<p){let T=0;for(let w=0;w<d&&w<g.rows.length;w++){let E=g.rows[w];if(x>=T&&x<T+E.height){b=w;break}T+=E.height;}b===-1&&(b=0);}else {let T=x-p;for(let w=r$1.fromRow;w<r$1.toRow&&w<g.rows.length;w++){let E=g.rows[w];if(T>=m&&T<m+E.height){b=w;break}m+=E.height;}}if(b===-1&&(b=Math.min(r$1.toRow-1,g.rows.length-1),b<r$1.fromRow))continue;let k=g.rows[b],F=c.rows[b];if(!k||!F)continue;let P=0,M=-1;if(k.cells.length===0||F.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let w=k.cells[T];if(h>=P&&h<P+w.width){M=T;break}P+=w.width;}if(M===-1&&(M=k.cells.length-1,M<0))continue;let H=k.cells[M],R=F.cells[M];if(!H||!R)continue;let y=0;if(p>0&&b<d)for(let T=0;T<b;T++)y+=g.rows[T]?.height??0;else {y=p;for(let T=r$1.fromRow;T<b;T++)y+=g.rows[T]?.height??0;}let I=0;for(let T=0;T<M;T++)I+=k.cells[T]?.width??0;let C,S;if(R.blocks&&R.blocks.length>0){let T=R.blocks[0],w=H.blocks[0];T.kind==="paragraph"&&w?.kind==="paragraph"&&(C=T,S=w);}let _=h-I,L=x-y;return {fragment:r$1,block:c,measure:g,pageIndex:e.pageIndex,rowIndex:b,colIndex:M,cellBlock:C,cellMeasure:S,cellLocalX:Math.max(0,_),cellLocalY:Math.max(0,L)}}return null}function Se(e,t,a,o){let n={pageHit:null,fragmentHit:null,tableCellHit:null};if(n.pageHit=K(e,o),!n.pageHit)return n;let r=D(e,n.pageHit.pageIndex),s={x:o.x,y:o.y-r};return n.fragmentHit=ce(n.pageHit,t,a,s),n.fragmentHit?.fragment.kind==="table"&&(n.tableCellHit=ue(n.pageHit,t,a,s)),n}function Le(e){if(e.pages.length===0)return 0;let t=e.pageGap??0,a=0;for(let o=0;o<e.pages.length;o++){let n=e.pages[o];a+=n.size?.h??e.pageSize.h,o<e.pages.length-1&&(a+=t);}return a}function Ee(e,t){return D(e,t)}function Ce(e,t){if(t<0||t>=e.pages.length)return null;let a=D(e,t),n=e.pages[t].size?.h??e.pageSize.h;return {top:a,bottom:a+n}}function Z(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function fe(e,t){let a=[];for(let o=t.fromRun;o<=t.toRun&&o<e.runs.length;o++){let n=e.runs[o];if(n){if(n.kind==="tab"||n.kind==="image"||n.kind==="lineBreak"){a.push(n);continue}if(n.kind==="text"){let r=n.text??"",s=o===t.fromRun,i=o===t.toRun;if(s||i){let l=s?t.fromChar:0,f=i?t.toChar:r.length,u=r.slice(l,f);u.length>0&&a.push({...n,text:u});}else a.push(n);}}}return a}function ge(e,t){let a,o,n=e.pmStart??0,r=0;for(let s=0;s<e.runs.length&&s<=t.toRun;s++){let i=e.runs[s];i&&(s<t.fromRun?i.kind==="text"?r+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(r+=1):s===t.fromRun&&(r+=t.fromChar,a=n+r,i.kind==="text"&&(r=t.fromChar)));}if(a!==void 0){let s=0;for(let i=t.fromRun;i<=t.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===t.fromRun?t.fromChar:0,c=i===t.toRun?t.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}o=a+s;}return {pmStart:a,pmEnd:o}}function _e(e,t,a,o){let n=0;for(let r=a;r<o&&r<e.lines.length;r++){let i=e.lines[r].lineHeight;if(t>=n&&t<n+i)return r;n+=i;}return o>a?Math.min(o-1,e.lines.length-1):null}function Ae(e,t,a,o){let{pmStart:n,pmEnd:r}=ge(e,t);if(n===void 0||r===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(o-t.width)/2):s==="right"&&(i=Math.max(0,o-t.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:n};let f=fe(e,t);if(f.length===0)return {charOffset:0,pmPosition:n};let u=0,c=0;for(let h$1 of f){if(h$1.kind==="tab"){let x=h$1.width??48,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h$1.kind==="image"){let x=h$1.width,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h$1.kind==="lineBreak"){if(l>=u)return {charOffset:c,pmPosition:n+c};c+=1;continue}if(h$1.kind==="text"){let x=h$1.text??"";if(x.length===0)continue;let d=Z(h$1),p=g(x,d),m=u+p.width;if(l<=m){let b=l-u,k=h(b,p.charWidths),F=c+k;return {charOffset:F,pmPosition:n+F}}u=m,c+=x.length;}}return {charOffset:r-n,pmPosition:r}}function $(e){let{fragment:t,block:a,measure:o,localX:n,localY:r}=e;if(t.kind!=="paragraph"||a.kind!=="paragraph"||o.kind!=="paragraph")return null;let s=t,i=a,l=o,f=_e(l,r,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let k=s.fromLine;k<f;k++)c+=l.lines[k]?.lineHeight??0;let g=i.attrs?.indent,h=g?.left??0,x=g?.right??0,d=Math.max(0,t.width-h-x),p=n-h,{charOffset:m,pmPosition:b}=Ae(i,u,p,d);return {pmPosition:b,charOffset:m,lineIndex:f}}function he(e){let{cellBlock:t,cellMeasure:a,cellLocalX:o,cellLocalY:n}=e;if(!t||!a)return null;let r={fragment:{kind:"paragraph",blockId:t.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:t,measure:a,pageIndex:e.pageIndex,localX:o,localY:n};return $(r)?.pmPosition??null}function De(e,t){if(t)return he(t);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?$(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function de(e,t,a,o){let n=e.pmStart??0,r=e.pmEnd??n;if(a<n||a>r)return null;let s=a-n;for(let i=0;i<t.lines.length;i++){let l=t.lines[i],{pmStart:f,pmEnd:u}=ge(e,l);if(f===void 0||u===void 0)continue;let c=f-n,g$1=u-n;if(s>=c&&s<=g$1){let h=s-c,x=fe(e,l),d=0,p=0;for(let m of x)if(m.kind==="tab"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+(m.width??48),lineIndex:i};d+=m.width??48,p+=1;}else if(m.kind==="image"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+m.width,lineIndex:i};d+=m.width,p+=1;}else if(m.kind==="lineBreak"){if(h<=p)return {x:d,lineIndex:i};p+=1;}else if(m.kind==="text"){let b=m.text??"";if(h<=p+b.length){let P=h-p,M=Z(m),H=g(b.slice(0,P),M);return {x:d+H.width,lineIndex:i}}let k=Z(m),F=g(b,k);d+=F.width,p+=b.length;}return {x:d,lineIndex:i}}}return null}function Oe(e,t,a,o,n,r,s){let i=de(e,t,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,g=Math.max(0,r-u-c),h=t.lines[i.lineIndex];if(!h)return null;let x=0;l==="center"?x=Math.max(0,(g-h.width)/2):l==="right"&&(x=Math.max(0,g-h.width));let d=0;for(let p=s;p<i.lineIndex;p++)d+=t.lines[p]?.lineHeight??0;return {x:o+u+x+i.x,y:n+d,height:h.lineHeight}}function me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ee(e,t){return e.findIndex(a=>a.id===t)}function G(e,t){let o=(e.pmStart??0)+1,n=0,r;for(let l=0;l<e.runs.length&&l<=t.toRun;l++){let f=e.runs[l];if(f){if(l<t.fromRun)f.kind==="text"?n+=(f.text??"").length:n+=1;else if(l===t.fromRun){n+=t.fromChar,r=o+n;break}}}r===void 0&&(r=o);let s=0;for(let l=t.fromRun;l<=t.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===t.fromRun?t.fromChar:0,g=l===t.toRun?t.toChar:u.length;s+=g-c;}else s+=1;}let i=r+s;return {pmStart:r,pmEnd:i}}function pe(e,t,a,o){let n=[];for(let r=0;r<t.lines.length;r++){let s=t.lines[r],i=G(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<o&&n.push({line:s,index:r});}return n}function v(e,t,a){let o=G(e,t);return o.pmStart===void 0?0:Math.max(0,a-o.pmStart)}function z(e,t,a,o){let n=0,r=0;for(let s=t.fromRun;s<=t.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="image"){let l=i.width;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="lineBreak"){if(a<=r)return n;r+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===t.fromRun,u=s===t.toRun,c=f?t.fromChar:0,g$1=u?t.toChar:l.length,h=l.slice(c,g$1);if(r+h.length>=a){let p=a-r,m=me(i),b=g(h.slice(0,p),m);return n+b.width}let x=me(i),d=g(h,x);n+=d.width,r+=h.length;}}}return n}function W(e,t){let a=0;for(let o=0;o<t&&o<e.lines.length;o++)a+=e.lines[o].lineHeight;return a}function Xe(e,t,a,o,n){if(o===n)return [];let r$1=Math.min(o,n),s=Math.max(o,n),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=D(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=h,p=x,m=c,b=pe(d,p,r$1,s);for(let{line:k,index:F}of b){if(F<m.fromLine||F>=m.toLine)continue;let P=G(d,k);if(P.pmStart===void 0||P.pmEnd===void 0)continue;let M=Math.max(P.pmStart,r$1),H=Math.min(P.pmEnd,s);if(M>=H)continue;let R=v(d,k,M),y=v(d,k,H),B=d.attrs?.indent,I=B?.left??0,C=B?.right??0,S=Math.max(0,c.width-I-C),_=z(d,k,R),L=z(d,k,y),T=d.attrs?.alignment??"left",w=0;T==="center"?w=Math.max(0,(S-k.width)/2):T==="right"&&(w=Math.max(0,S-k.width));let E=W(p,F)-W(p,m.fromLine),A=c.x+I+w+Math.min(_,L),V=Math.max(1,Math.abs(L-_)),Y=c.y+E;i.push({x:A,y:Y+u,width:V,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="table"||!x||x.kind!=="table")continue;let d=h,p=x,m=c,b=m.headerRowCount??0,F=b>0&&m.continuesFromPrev?r(p,b):0;for(let P=m.fromRow;P<m.toRow&&P<d.rows.length;P++){let M=d.rows[P],H=p.rows[P];if(!M||!H)continue;let R=0;for(let y=0;y<M.cells.length;y++){let B=M.cells[y],I=H.cells[y];if(!(!B||!I)){for(let C=0;C<B.blocks.length;C++){let S=B.blocks[C],_=I.blocks[C];if(!S||S.kind!=="paragraph"||!_||_.kind!=="paragraph")continue;let L=S,T=_,w=pe(L,T,r$1,s),E=0;for(let{line:A,index:V}of w){let Y=G(L,A);if(Y.pmStart===void 0||Y.pmEnd===void 0)continue;let te=Math.max(Y.pmStart,r$1),ne=Math.min(Y.pmEnd,s);if(te>=ne)continue;let Me=v(L,A,te),ye=v(L,A,ne),re=z(L,A,Me,I.width),oe=z(L,A,ye,I.width),He=W(T,V);i.push({x:m.x+R+Math.min(re,oe),y:m.y+F+E+He+u,width:Math.max(1,Math.abs(oe-re)),height:A.lineHeight,pageIndex:l});}E+=T.totalHeight;}R+=I.width;}}F+=H.height;}}if(c.kind==="image"){let g=c.pmStart??0;(c.pmEnd??g+1)>r$1&&g<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ye(e,t,a,o){for(let n=0;n<e.pages.length;n++){let r=e.pages[n],s=D(e,n);for(let i of r.fragments){if(i.kind==="paragraph"){let l=ee(t,i.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,g=u,h=i,x=c.pmStart??0,d=c.pmEnd??x;if(o<x||o>d)continue;for(let p=h.fromLine;p<h.toLine;p++){let m=g.lines[p];if(!m)continue;let b=G(c,m);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&o>=b.pmStart&&o<=b.pmEnd){let k=v(c,m,o),F=c.attrs?.indent,P=F?.left??0,M=F?.right??0,H=Math.max(0,i.width-P-M),R=z(c,m,k),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(H-m.width)/2):y==="right"&&(B=Math.max(0,H-m.width));let I=W(g,p)-W(g,h.fromLine);return {x:i.x+P+B+R,y:i.y+I+s,height:m.lineHeight,pageIndex:n}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(o>=l&&o<=f){let u=o===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:n}}}}}return null}function ve(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function ze(e){let t=new Map;for(let a of e){let o=t.get(a.pageIndex)??[];o.push(a),t.set(a.pageIndex,o);}return t}function We(e){if(e.kind!=="paragraph")return false;let t=e.attrs;return t?!!(t.borders?.top||t.borders?.bottom||t.spacingExplicit?.before||t.spacingExplicit?.after):false}function xe(e){return be(e)}function be(e){let t=new Set;for(let a=1;a<e.length;a++){let o=e[a-1],n=e[a];o.kind==="table"&&n.kind==="paragraph"&&(n.runs.length>0||We(n)||t.add(a));}return e.map((a,o)=>{if(a.kind==="table")return Ge(a);if(a.kind!=="paragraph")return a;let n=t.has(o),r=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!r?.before,f=i&&!r?.after,u=l||f;if(!u&&!n)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),n&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function Ge(e){let t=false,a=e.rows.map(o=>{let n=false,r=o.cells.map(s=>{let i=be(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(n=true,{...s,blocks:i}):s});return n?(t=true,{...o,cells:r}):o});return t?{...e,rows:a}:e}function Ue(e){return e?.align??e?.alignment}function ke(e$1,t,a,o){let n=o.section==="header"?o.margins.header??48:o.pageSize.h-(o.margins.footer??48)-a,r=e$1.position?.vertical;if(!r)return t;let s=Ue(r),i=r.posOffset!==void 0?e(r.posOffset):void 0;if(r.relativeTo==="page"){if(i!==void 0)return i-n;if(s==="top")return -n;if(s==="bottom")return o.pageSize.h-e$1.height-n;if(s==="center")return (o.pageSize.h-e$1.height)/2-n}if(r.relativeTo==="margin"){let l=o.margins.top,f=o.pageSize.h-o.margins.top-o.margins.bottom;if(i!==void 0)return l+i-n;if(s==="top")return l-n;if(s==="bottom")return l+f-e$1.height-n;if(s==="center")return l+(f-e$1.height)/2-n}return i!==void 0?t+i:t}function Te(e,t,a,o){let n=0,r=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=t[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;n=Math.min(n,u),r=Math.max(r,c);for(let g of l.runs){if(g.kind!=="image"||!g.position)continue;let h=ke(g,u,a,o);n=Math.min(n,h),r=Math.max(r,h+g.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}}}return {visualTop:n,visualBottom:r}}function Ne(e,t,a,o){if(!e||!e.content||e.content.length===0)return;let n=b(e.content,{styles:o.styles??void 0,theme:o.theme??null}),r=d(n,{theme:o.theme??void 0});if(r.length===0)return;let s=xe(r),i=o.measureBlocks(s,t),l=i.reduce((c,g)=>g.kind==="paragraph"||g.kind==="table"?c+g.totalHeight:g.kind==="image"||g.kind==="textBox"?c+g.height:c,0),{visualTop:f,visualBottom:u}=Te(r,i,l,a);return {blocks:s,measures:i,height:l,visualTop:f,visualBottom:u}}var Pe=7,Fe=0;function we(e,t){if(e.kind!=="paragraph"||t.kind!=="paragraph")return "totalHeight"in t?t.totalHeight:"height"in t?t.height:0;let a=e.runs.filter(i=>i.kind!=="text"||i.text.length>0);if(!(t.lines.length===1&&a.length>0&&a.every(i=>i.kind==="image")))return t.totalHeight;let n=a.reduce((i,l)=>l.kind==="image"?Math.max(i,l.height):i,0),r=e.attrs?.spacing?.before??0,s=e.attrs?.spacing?.after??0;return r+n+s}function Ve(e){let t=e?.borders?.top?.width??0,a=e?.borders?.bottom?.width??0;return t+a}function je(e,t,a){let o=e.columnWidths??[],n=N(e.width,e.widthType,t),r=q(e),s=n??t;if(e.rows.length>0&&(o=J(o,r,s)),o.length>0&&n){let c=o.reduce((g,h)=>g+h,0);if(c>0&&Math.abs(c-n)>1){let g=n/c;o=o.map(h=>h*g);}}let i=new Map;for(let c=0;c<e.rows.length;c++){let g=e.rows[c];if(!g)continue;let h=0,x=i.get(c)??new Set;for(;x.has(h);)h++;for(let d of g.cells){let p=d.colSpan??1,m=d.rowSpan??1;if(m>1)for(let b=c+1;b<c+m;b++){i.has(b)||i.set(b,new Set);let k=i.get(b);for(let F=0;F<p;F++)k.add(h+F);}for(h+=p;x.has(h);)h++;}}let l=e.rows.map((c,g)=>{let h=0,x=i.get(g)??new Set;for(;x.has(h);)h++;return {cells:c.cells.map(d=>{let p=d.colSpan??1,m=0;for(let P=0;P<p&&h+P<o.length;P++)m+=o[h+P]??0;for(m===0&&(m=(d.width&&d.width>0?d.width:N(d.widthValue,d.widthType,s))??100),h+=p;x.has(h);)h++;let b=d.padding?.left??Pe,k=d.padding?.right??Pe,F=Math.max(1,m-b-k);return {blocks:d.blocks.map(P=>a(P,F)),width:m,height:0,colSpan:d.colSpan,rowSpan:d.rowSpan}}),height:0}});for(let c=0;c<l.length;c++){let g=l[c],h=e.rows[c]?.cells,x=0,d=0;for(let k=0;k<g.cells.length;k++){let F=g.cells[k],P=h?.[k],M=0;for(let y=0;y<F.blocks.length;y++){let B=P?.blocks[y],I=F.blocks[y];!B||!I||(M+=we(B,I));}F.height=M;let H=P?.padding?.top??Fe,R=P?.padding?.bottom??Fe;F.height+=H+R,x=Math.max(x,F.height),d=Math.max(d,Ve(P));}let p=e.rows[c],m=p?.height,b=p?.heightRule;m&&b==="exact"?g.height=m:m?g.height=Math.max(x+d,m):g.height=x+d;}let f=l.reduce((c,g)=>c+g.height,0),u=o.reduce((c,g)=>c+g,0)||n||t;return {kind:"table",rows:l,columnWidths:o,totalWidth:u,totalHeight:f}}var qe=816,Je=1056,Ke=96,Qe=48;function O(e){return Math.round(e/1440*96)}function Ze(e){return {w:e?.pageWidth?O(e.pageWidth):816,h:e?.pageHeight?O(e.pageHeight):1056}}function $e(e){return {top:e?.marginTop?O(e.marginTop):96,right:e?.marginRight?O(e.marginRight):96,bottom:e?.marginBottom?O(e.marginBottom):96,left:e?.marginLeft?O(e.marginLeft):96,header:e?.headerDistance?O(e.headerDistance):48,footer:e?.footerDistance?O(e.footerDistance):48}}function et(e,t){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let o=e.package.headers,n=e.package.footers,r=null,s=null,i=null,l=null;if(o&&t?.headerReferences){let f=t.headerReferences.find(c=>c.type==="default");f?.rId&&(r=o.get(f.rId)??null);let u=t.headerReferences.find(c=>c.type==="first");u?.rId&&(i=o.get(u.rId)??null);}if(n&&t?.footerReferences){let f=t.footerReferences.find(c=>c.type==="default");f?.rId&&(s=n.get(f.rId)??null);let u=t.footerReferences.find(c=>c.type==="first");u?.rId&&(l=n.get(u.rId)??null);}return t?.titlePg||(!r&&i&&(r=i),!s&&l&&(s=l)),{header:r,footer:s,firstHeader:i,firstFooter:l}}export{we as A,je as B,qe as C,Je as D,Ke as E,Qe as F,Ze as G,$e as H,et as I,N as a,q as b,J as c,K as d,D as e,Ie as f,ce as g,Re as h,ue as i,Se as j,Le as k,Ee as l,Ce as m,$ as n,he as o,De as p,de as q,Oe as r,Xe as s,Ye as t,ve as u,ze as v,xe as w,ke as x,Te as y,Ne as z};
1
+ import {d}from'./chunk-DN36K5JU.mjs';import {r}from'./chunk-5N5DBQJV.mjs';import {g,h}from'./chunk-7UTXBQKF.mjs';import {b}from'./chunk-GNPLUGUG.mjs';import {c,e}from'./chunk-VW22RZ6C.mjs';function N(e,t,a){if(!(!e||e<=0)){if(t==="pct")return a*e/5e3;if(!t||t==="dxa"||t==="auto")return c(e)}}function q(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((a,o)=>a+Math.max(1,o.colSpan??1),0)))}function J(e,t,a){if(t<=0)return [];let o=a>0?a/t:0;if(e.length===0)return Array(t).fill(o);let n=e.slice(0,t),r=t-n.length;if(r>0){let u=n.filter(g=>g>0),c=u.length>0?u.reduce((g,h)=>g+h,0)/u.length:o;n=n.concat(Array(r).fill(c));}let s=n.reduce((u,c)=>u+(c>0?c:0),0),i=n.filter(u=>u<=0).length;if(s<=0)return Array(t).fill(o);if(i===0)return n;let l=Math.max(0,a-s),f=l>0?l/i:s/Math.max(1,t-i);return n.map(u=>u>0?u:f)}function K(e,t){if(e.pages.length===0)return null;let a=e.pageGap??0,o=0,n=null,r=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=o,u=f+l;if(t.y>=f&&t.y<u)return {pageIndex:s,page:i,pageY:t.y-f};let c=f+l/2,g=Math.abs(t.y-c);g<r&&(r=g,n=s),o=u+a;}if(n!==null){let s=e.pages[n],i=D(e,n);return {pageIndex:n,page:s,pageY:Math.max(0,Math.min(t.y-i,s.size?.h??e.pageSize.h))}}return null}function D(e,t){let a=e.pageGap??0,o=0;for(let n=0;n<t&&n<e.pages.length;n++){let s=e.pages[n].size?.h??e.pageSize.h;o+=s+a;}return o}function Ie(e,t){return K(e,{y:t})?.pageIndex??null}function Q(e,t){return e.findIndex(a=>a.id===t)}function Be(e,t){let a=0;for(let o=e.fromLine;o<e.toLine&&o<t.lines.length;o++)a+=t.lines[o].lineHeight;return a}function ce(e,t,a,o){let n=[...e.page.fragments].sort((r,s)=>{let i=r.y-s.y;return Math.abs(i)>.5?i:r.x-s.x});for(let r of n){let s=Q(t,r.blockId);if(s===-1)continue;let i=t[s],l=a[s];if(!i||!l)continue;let f;if(r.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Be(r,l);}else if(r.kind==="table")f=r.height;else if(r.kind==="image")f=r.height;else continue;let u=o.x>=r.x&&o.x<=r.x+r.width,c=o.y>=r.y&&o.y<=r.y+f;if(u&&c)return {fragment:r,block:i,measure:l,pageIndex:e.pageIndex,localX:o.x-r.x,localY:o.y-r.y}}return null}function Re(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="image")continue;let r=Q(t,n.blockId);if(r===-1)continue;let s=t[r],i=a[r];if(!s||!i)continue;let l=o.x>=n.x&&o.x<=n.x+n.width,f=o.y>=n.y&&o.y<=n.y+n.height;if(l&&f)return {fragment:n,block:s,measure:i,pageIndex:e.pageIndex,localX:o.x-n.x,localY:o.y-n.y}}return null}function ue(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="table")continue;let r$1=n,s=o.x>=r$1.x&&o.x<=r$1.x+r$1.width,i=o.y>=r$1.y&&o.y<=r$1.y+r$1.height;if(!s||!i)continue;let l=Q(t,r$1.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,g=u,h=o.x-r$1.x,x=o.y-r$1.y,d=r$1.headerRowCount??0,p=d>0&&r$1.continuesFromPrev?r(g,d):0,m=0,b=-1;if(g.rows.length===0||c.rows.length===0)continue;if(p>0&&x<p){let T=0;for(let w=0;w<d&&w<g.rows.length;w++){let E=g.rows[w];if(x>=T&&x<T+E.height){b=w;break}T+=E.height;}b===-1&&(b=0);}else {let T=x-p;for(let w=r$1.fromRow;w<r$1.toRow&&w<g.rows.length;w++){let E=g.rows[w];if(T>=m&&T<m+E.height){b=w;break}m+=E.height;}}if(b===-1&&(b=Math.min(r$1.toRow-1,g.rows.length-1),b<r$1.fromRow))continue;let k=g.rows[b],F=c.rows[b];if(!k||!F)continue;let P=0,M=-1;if(k.cells.length===0||F.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let w=k.cells[T];if(h>=P&&h<P+w.width){M=T;break}P+=w.width;}if(M===-1&&(M=k.cells.length-1,M<0))continue;let H=k.cells[M],R=F.cells[M];if(!H||!R)continue;let y=0;if(p>0&&b<d)for(let T=0;T<b;T++)y+=g.rows[T]?.height??0;else {y=p;for(let T=r$1.fromRow;T<b;T++)y+=g.rows[T]?.height??0;}let I=0;for(let T=0;T<M;T++)I+=k.cells[T]?.width??0;let C,S;if(R.blocks&&R.blocks.length>0){let T=R.blocks[0],w=H.blocks[0];T.kind==="paragraph"&&w?.kind==="paragraph"&&(C=T,S=w);}let _=h-I,L=x-y;return {fragment:r$1,block:c,measure:g,pageIndex:e.pageIndex,rowIndex:b,colIndex:M,cellBlock:C,cellMeasure:S,cellLocalX:Math.max(0,_),cellLocalY:Math.max(0,L)}}return null}function Se(e,t,a,o){let n={pageHit:null,fragmentHit:null,tableCellHit:null};if(n.pageHit=K(e,o),!n.pageHit)return n;let r=D(e,n.pageHit.pageIndex),s={x:o.x,y:o.y-r};return n.fragmentHit=ce(n.pageHit,t,a,s),n.fragmentHit?.fragment.kind==="table"&&(n.tableCellHit=ue(n.pageHit,t,a,s)),n}function Le(e){if(e.pages.length===0)return 0;let t=e.pageGap??0,a=0;for(let o=0;o<e.pages.length;o++){let n=e.pages[o];a+=n.size?.h??e.pageSize.h,o<e.pages.length-1&&(a+=t);}return a}function Ee(e,t){return D(e,t)}function Ce(e,t){if(t<0||t>=e.pages.length)return null;let a=D(e,t),n=e.pages[t].size?.h??e.pageSize.h;return {top:a,bottom:a+n}}function Z(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function fe(e,t){let a=[];for(let o=t.fromRun;o<=t.toRun&&o<e.runs.length;o++){let n=e.runs[o];if(n){if(n.kind==="tab"||n.kind==="image"||n.kind==="lineBreak"){a.push(n);continue}if(n.kind==="text"){let r=n.text??"",s=o===t.fromRun,i=o===t.toRun;if(s||i){let l=s?t.fromChar:0,f=i?t.toChar:r.length,u=r.slice(l,f);u.length>0&&a.push({...n,text:u});}else a.push(n);}}}return a}function ge(e,t){let a,o,n=e.pmStart??0,r=0;for(let s=0;s<e.runs.length&&s<=t.toRun;s++){let i=e.runs[s];i&&(s<t.fromRun?i.kind==="text"?r+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(r+=1):s===t.fromRun&&(r+=t.fromChar,a=n+r,i.kind==="text"&&(r=t.fromChar)));}if(a!==void 0){let s=0;for(let i=t.fromRun;i<=t.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===t.fromRun?t.fromChar:0,c=i===t.toRun?t.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}o=a+s;}return {pmStart:a,pmEnd:o}}function _e(e,t,a,o){let n=0;for(let r=a;r<o&&r<e.lines.length;r++){let i=e.lines[r].lineHeight;if(t>=n&&t<n+i)return r;n+=i;}return o>a?Math.min(o-1,e.lines.length-1):null}function Ae(e,t,a,o){let{pmStart:n,pmEnd:r}=ge(e,t);if(n===void 0||r===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(o-t.width)/2):s==="right"&&(i=Math.max(0,o-t.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:n};let f=fe(e,t);if(f.length===0)return {charOffset:0,pmPosition:n};let u=0,c=0;for(let h$1 of f){if(h$1.kind==="tab"){let x=h$1.width??48,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h$1.kind==="image"){let x=h$1.width,d=u+x;if(l<=d){let p=u+x/2;return l<p?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}u=d,c+=1;continue}if(h$1.kind==="lineBreak"){if(l>=u)return {charOffset:c,pmPosition:n+c};c+=1;continue}if(h$1.kind==="text"){let x=h$1.text??"";if(x.length===0)continue;let d=Z(h$1),p=g(x,d),m=u+p.width;if(l<=m){let b=l-u,k=h(b,p.charWidths),F=c+k;return {charOffset:F,pmPosition:n+F}}u=m,c+=x.length;}}return {charOffset:r-n,pmPosition:r}}function $(e){let{fragment:t,block:a,measure:o,localX:n,localY:r}=e;if(t.kind!=="paragraph"||a.kind!=="paragraph"||o.kind!=="paragraph")return null;let s=t,i=a,l=o,f=_e(l,r,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let k=s.fromLine;k<f;k++)c+=l.lines[k]?.lineHeight??0;let g=i.attrs?.indent,h=g?.left??0,x=g?.right??0,d=Math.max(0,t.width-h-x),p=n-h,{charOffset:m,pmPosition:b}=Ae(i,u,p,d);return {pmPosition:b,charOffset:m,lineIndex:f}}function he(e){let{cellBlock:t,cellMeasure:a,cellLocalX:o,cellLocalY:n}=e;if(!t||!a)return null;let r={fragment:{kind:"paragraph",blockId:t.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:t,measure:a,pageIndex:e.pageIndex,localX:o,localY:n};return $(r)?.pmPosition??null}function De(e,t){if(t)return he(t);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?$(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function de(e,t,a,o){let n=e.pmStart??0,r=e.pmEnd??n;if(a<n||a>r)return null;let s=a-n;for(let i=0;i<t.lines.length;i++){let l=t.lines[i],{pmStart:f,pmEnd:u}=ge(e,l);if(f===void 0||u===void 0)continue;let c=f-n,g$1=u-n;if(s>=c&&s<=g$1){let h=s-c,x=fe(e,l),d=0,p=0;for(let m of x)if(m.kind==="tab"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+(m.width??48),lineIndex:i};d+=m.width??48,p+=1;}else if(m.kind==="image"){if(h<=p+1)return h<=p?{x:d,lineIndex:i}:{x:d+m.width,lineIndex:i};d+=m.width,p+=1;}else if(m.kind==="lineBreak"){if(h<=p)return {x:d,lineIndex:i};p+=1;}else if(m.kind==="text"){let b=m.text??"";if(h<=p+b.length){let P=h-p,M=Z(m),H=g(b.slice(0,P),M);return {x:d+H.width,lineIndex:i}}let k=Z(m),F=g(b,k);d+=F.width,p+=b.length;}return {x:d,lineIndex:i}}}return null}function Oe(e,t,a,o,n,r,s){let i=de(e,t,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,g=Math.max(0,r-u-c),h=t.lines[i.lineIndex];if(!h)return null;let x=0;l==="center"?x=Math.max(0,(g-h.width)/2):l==="right"&&(x=Math.max(0,g-h.width));let d=0;for(let p=s;p<i.lineIndex;p++)d+=t.lines[p]?.lineHeight??0;return {x:o+u+x+i.x,y:n+d,height:h.lineHeight}}function me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ee(e,t){return e.findIndex(a=>a.id===t)}function G(e,t){let o=(e.pmStart??0)+1,n=0,r;for(let l=0;l<e.runs.length&&l<=t.toRun;l++){let f=e.runs[l];if(f){if(l<t.fromRun)f.kind==="text"?n+=(f.text??"").length:n+=1;else if(l===t.fromRun){n+=t.fromChar,r=o+n;break}}}r===void 0&&(r=o);let s=0;for(let l=t.fromRun;l<=t.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===t.fromRun?t.fromChar:0,g=l===t.toRun?t.toChar:u.length;s+=g-c;}else s+=1;}let i=r+s;return {pmStart:r,pmEnd:i}}function pe(e,t,a,o){let n=[];for(let r=0;r<t.lines.length;r++){let s=t.lines[r],i=G(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<o&&n.push({line:s,index:r});}return n}function v(e,t,a){let o=G(e,t);return o.pmStart===void 0?0:Math.max(0,a-o.pmStart)}function z(e,t,a,o){let n=0,r=0;for(let s=t.fromRun;s<=t.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="image"){let l=i.width;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="lineBreak"){if(a<=r)return n;r+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===t.fromRun,u=s===t.toRun,c=f?t.fromChar:0,g$1=u?t.toChar:l.length,h=l.slice(c,g$1);if(r+h.length>=a){let p=a-r,m=me(i),b=g(h.slice(0,p),m);return n+b.width}let x=me(i),d=g(h,x);n+=d.width,r+=h.length;}}}return n}function W(e,t){let a=0;for(let o=0;o<t&&o<e.lines.length;o++)a+=e.lines[o].lineHeight;return a}function Xe(e,t,a,o,n){if(o===n)return [];let r$1=Math.min(o,n),s=Math.max(o,n),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=D(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=h,p=x,m=c,b=pe(d,p,r$1,s);for(let{line:k,index:F}of b){if(F<m.fromLine||F>=m.toLine)continue;let P=G(d,k);if(P.pmStart===void 0||P.pmEnd===void 0)continue;let M=Math.max(P.pmStart,r$1),H=Math.min(P.pmEnd,s);if(M>=H)continue;let R=v(d,k,M),y=v(d,k,H),B=d.attrs?.indent,I=B?.left??0,C=B?.right??0,S=Math.max(0,c.width-I-C),_=z(d,k,R),L=z(d,k,y),T=d.attrs?.alignment??"left",w=0;T==="center"?w=Math.max(0,(S-k.width)/2):T==="right"&&(w=Math.max(0,S-k.width));let E=W(p,F)-W(p,m.fromLine),A=c.x+I+w+Math.min(_,L),V=Math.max(1,Math.abs(L-_)),Y=c.y+E;i.push({x:A,y:Y+u,width:V,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let g=ee(t,c.blockId);if(g===-1)continue;let h=t[g],x=a[g];if(!h||h.kind!=="table"||!x||x.kind!=="table")continue;let d=h,p=x,m=c,b=m.headerRowCount??0,F=b>0&&m.continuesFromPrev?r(p,b):0;for(let P=m.fromRow;P<m.toRow&&P<d.rows.length;P++){let M=d.rows[P],H=p.rows[P];if(!M||!H)continue;let R=0;for(let y=0;y<M.cells.length;y++){let B=M.cells[y],I=H.cells[y];if(!(!B||!I)){for(let C=0;C<B.blocks.length;C++){let S=B.blocks[C],_=I.blocks[C];if(!S||S.kind!=="paragraph"||!_||_.kind!=="paragraph")continue;let L=S,T=_,w=pe(L,T,r$1,s),E=0;for(let{line:A,index:V}of w){let Y=G(L,A);if(Y.pmStart===void 0||Y.pmEnd===void 0)continue;let te=Math.max(Y.pmStart,r$1),ne=Math.min(Y.pmEnd,s);if(te>=ne)continue;let Me=v(L,A,te),ye=v(L,A,ne),re=z(L,A,Me,I.width),oe=z(L,A,ye,I.width),He=W(T,V);i.push({x:m.x+R+Math.min(re,oe),y:m.y+F+E+He+u,width:Math.max(1,Math.abs(oe-re)),height:A.lineHeight,pageIndex:l});}E+=T.totalHeight;}R+=I.width;}}F+=H.height;}}if(c.kind==="image"){let g=c.pmStart??0;(c.pmEnd??g+1)>r$1&&g<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ye(e,t,a,o){for(let n=0;n<e.pages.length;n++){let r=e.pages[n],s=D(e,n);for(let i of r.fragments){if(i.kind==="paragraph"){let l=ee(t,i.blockId);if(l===-1)continue;let f=t[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,g=u,h=i,x=c.pmStart??0,d=c.pmEnd??x;if(o<x||o>d)continue;for(let p=h.fromLine;p<h.toLine;p++){let m=g.lines[p];if(!m)continue;let b=G(c,m);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&o>=b.pmStart&&o<=b.pmEnd){let k=v(c,m,o),F=c.attrs?.indent,P=F?.left??0,M=F?.right??0,H=Math.max(0,i.width-P-M),R=z(c,m,k),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(H-m.width)/2):y==="right"&&(B=Math.max(0,H-m.width));let I=W(g,p)-W(g,h.fromLine);return {x:i.x+P+B+R,y:i.y+I+s,height:m.lineHeight,pageIndex:n}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(o>=l&&o<=f){let u=o===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:n}}}}}return null}function ve(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function ze(e){let t=new Map;for(let a of e){let o=t.get(a.pageIndex)??[];o.push(a),t.set(a.pageIndex,o);}return t}function We(e){if(e.kind!=="paragraph")return false;let t=e.attrs;return t?!!(t.borders?.top||t.borders?.bottom||t.spacingExplicit?.before||t.spacingExplicit?.after):false}function xe(e){return be(e)}function be(e){let t=new Set;for(let a=1;a<e.length;a++){let o=e[a-1],n=e[a];o.kind==="table"&&n.kind==="paragraph"&&(n.runs.length>0||We(n)||t.add(a));}return e.map((a,o)=>{if(a.kind==="table")return Ge(a);if(a.kind!=="paragraph")return a;let n=t.has(o),r=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!r?.before,f=i&&!r?.after,u=l||f;if(!u&&!n)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),n&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function Ge(e){let t=false,a=e.rows.map(o=>{let n=false,r=o.cells.map(s=>{let i=be(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(n=true,{...s,blocks:i}):s});return n?(t=true,{...o,cells:r}):o});return t?{...e,rows:a}:e}function Ue(e){return e?.align??e?.alignment}function ke(e$1,t,a,o){let n=o.section==="header"?o.margins.header??48:o.pageSize.h-(o.margins.footer??48)-a,r=e$1.position?.vertical;if(!r)return t;let s=Ue(r),i=r.posOffset!==void 0?e(r.posOffset):void 0;if(r.relativeTo==="page"){if(i!==void 0)return i-n;if(s==="top")return -n;if(s==="bottom")return o.pageSize.h-e$1.height-n;if(s==="center")return (o.pageSize.h-e$1.height)/2-n}if(r.relativeTo==="margin"){let l=o.margins.top,f=o.pageSize.h-o.margins.top-o.margins.bottom;if(i!==void 0)return l+i-n;if(s==="top")return l-n;if(s==="bottom")return l+f-e$1.height-n;if(s==="center")return l+(f-e$1.height)/2-n}return i!==void 0?t+i:t}function Te(e,t,a,o){let n=0,r=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=t[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;n=Math.min(n,u),r=Math.max(r,c);for(let g of l.runs){if(g.kind!=="image"||!g.position)continue;let h=ke(g,u,a,o);n=Math.min(n,h),r=Math.max(r,h+g.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;n=Math.min(n,s),r=Math.max(r,u),s=u;}}}return {visualTop:n,visualBottom:r}}function Ne(e,t,a,o){if(!e||!e.content||e.content.length===0)return;let n=b(e.content,{styles:o.styles??void 0,theme:o.theme??null}),r=d(n,{theme:o.theme??void 0});if(r.length===0)return;let s=xe(r),i=o.measureBlocks(s,t),l=i.reduce((c,g)=>g.kind==="paragraph"||g.kind==="table"?c+g.totalHeight:g.kind==="image"||g.kind==="textBox"?c+g.height:c,0),{visualTop:f,visualBottom:u}=Te(r,i,l,a);return {blocks:s,measures:i,height:l,visualTop:f,visualBottom:u}}var Pe=7,Fe=0;function we(e,t){if(e.kind!=="paragraph"||t.kind!=="paragraph")return "totalHeight"in t?t.totalHeight:"height"in t?t.height:0;let a=e.runs.filter(i=>i.kind!=="text"||i.text.length>0);if(!(t.lines.length===1&&a.length>0&&a.every(i=>i.kind==="image")))return t.totalHeight;let n=a.reduce((i,l)=>l.kind==="image"?Math.max(i,l.height):i,0),r=e.attrs?.spacing?.before??0,s=e.attrs?.spacing?.after??0;return r+n+s}function Ve(e){let t=e?.borders?.top?.width??0,a=e?.borders?.bottom?.width??0;return t+a}function je(e,t,a){let o=e.columnWidths??[],n=N(e.width,e.widthType,t),r=q(e),s=n??t;if(e.rows.length>0&&(o=J(o,r,s)),o.length>0&&n){let c=o.reduce((g,h)=>g+h,0);if(c>0&&Math.abs(c-n)>1){let g=n/c;o=o.map(h=>h*g);}}let i=new Map;for(let c=0;c<e.rows.length;c++){let g=e.rows[c];if(!g)continue;let h=0,x=i.get(c)??new Set;for(;x.has(h);)h++;for(let d of g.cells){let p=d.colSpan??1,m=d.rowSpan??1;if(m>1)for(let b=c+1;b<c+m;b++){i.has(b)||i.set(b,new Set);let k=i.get(b);for(let F=0;F<p;F++)k.add(h+F);}for(h+=p;x.has(h);)h++;}}let l=e.rows.map((c,g)=>{let h=0,x=i.get(g)??new Set;for(;x.has(h);)h++;return {cells:c.cells.map(d=>{let p=d.colSpan??1,m=0;for(let P=0;P<p&&h+P<o.length;P++)m+=o[h+P]??0;for(m===0&&(m=(d.width&&d.width>0?d.width:N(d.widthValue,d.widthType,s))??100),h+=p;x.has(h);)h++;let b=d.padding?.left??Pe,k=d.padding?.right??Pe,F=Math.max(1,m-b-k);return {blocks:d.blocks.map(P=>a(P,F)),width:m,height:0,colSpan:d.colSpan,rowSpan:d.rowSpan}}),height:0}});for(let c=0;c<l.length;c++){let g=l[c],h=e.rows[c]?.cells,x=0,d=0;for(let k=0;k<g.cells.length;k++){let F=g.cells[k],P=h?.[k],M=0;for(let y=0;y<F.blocks.length;y++){let B=P?.blocks[y],I=F.blocks[y];!B||!I||(M+=we(B,I));}F.height=M;let H=P?.padding?.top??Fe,R=P?.padding?.bottom??Fe;F.height+=H+R,x=Math.max(x,F.height),d=Math.max(d,Ve(P));}let p=e.rows[c],m=p?.height,b=p?.heightRule;m&&b==="exact"?g.height=m:m?g.height=Math.max(x+d,m):g.height=x+d;}let f=l.reduce((c,g)=>c+g.height,0),u=o.reduce((c,g)=>c+g,0)||n||t;return {kind:"table",rows:l,columnWidths:o,totalWidth:u,totalHeight:f}}var qe=816,Je=1056,Ke=96,Qe=48;function O(e){return Math.round(e/1440*96)}function Ze(e){return {w:e?.pageWidth?O(e.pageWidth):816,h:e?.pageHeight?O(e.pageHeight):1056}}function $e(e){return {top:e?.marginTop?O(e.marginTop):96,right:e?.marginRight?O(e.marginRight):96,bottom:e?.marginBottom?O(e.marginBottom):96,left:e?.marginLeft?O(e.marginLeft):96,header:e?.headerDistance?O(e.headerDistance):48,footer:e?.footerDistance?O(e.footerDistance):48}}function et(e,t){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let o=e.package.headers,n=e.package.footers,r=null,s=null,i=null,l=null;if(o&&t?.headerReferences){let f=t.headerReferences.find(c=>c.type==="default");f?.rId&&(r=o.get(f.rId)??null);let u=t.headerReferences.find(c=>c.type==="first");u?.rId&&(i=o.get(u.rId)??null);}if(n&&t?.footerReferences){let f=t.footerReferences.find(c=>c.type==="default");f?.rId&&(s=n.get(f.rId)??null);let u=t.footerReferences.find(c=>c.type==="first");u?.rId&&(l=n.get(u.rId)??null);}return t?.titlePg||(!r&&i&&(r=i),!s&&l&&(s=l)),{header:r,footer:s,firstHeader:i,firstFooter:l}}export{we as A,je as B,qe as C,Je as D,Ke as E,Qe as F,Ze as G,$e as H,et as I,N as a,q as b,J as c,K as d,D as e,Ie as f,ce as g,Re as h,ue as i,Se as j,Le as k,Ee as l,Ce as m,$ as n,he as o,De as p,de as q,Oe as r,Xe as s,Ye as t,ve as u,ze as v,xe as w,ke as x,Te as y,Ne as z};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js');var Ut=1440,G=96,ct=Ut/G,ft=11,ht="Calibri",Yt=1,Xt=.8,jt=.2,I=null;function Z(){if(!I){let t=typeof document<"u"?document.createElement("canvas"):null;if(!t)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(I=t.getContext("2d"),!I)throw new Error("Failed to get 2D context from canvas")}return I}function Gt(){I=null;}var lt=new Map;function gt(t){let e=lt.get(t);if(e===void 0){let n=chunkN3Y5BUKV_js.a(t);e={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},lt.set(t,e);}return e}function Kt(t){return gt(t).cssFallback}function B(t){let e=[];t.italic&&e.push("italic"),t.bold&&e.push("bold");let n=t.fontSize??ft,i=L(n);e.push(`${i}px`);let r=t.fontFamily??ht;return e.push(Kt(r)),e.join(" ")}function H(t){let e=t.fontSize??ft,n=t.fontFamily??ht,i=L(e),r=i*Xt,o=i*jt,g=i*Yt;try{let m=Z();m.font=B(t);let d=m.measureText("Hg");typeof d.actualBoundingBoxAscent=="number"&&typeof d.actualBoundingBoxDescent=="number"&&(r=d.actualBoundingBoxAscent,o=d.actualBoundingBoxDescent);}catch{}g=Math.max(g,r+o);let h=gt(n).singleLineRatio;return {fontSize:e,ascent:r,descent:o,lineHeight:g,fontFamily:n,singleLineRatio:h}}function C(t,e){if(!t)return 0;let n=Z();n.font=B(e);let r=n.measureText(t).width;return e.letterSpacing&&t.length>1&&(r+=e.letterSpacing*(t.length-1)),r}function qt(t,e){let n=C(t,e),i=H(e);return {width:n,height:i.ascent+i.descent,ascent:i.ascent,descent:i.descent}}function K(t,e){let n=H(e);if(!t)return {width:0,charWidths:[],metrics:n};let i=Z();i.font=B(e);let r=e.letterSpacing??0,o=[],g=0;for(let h=0;h<t.length;h++){let m=t[h],y=i.measureText(m).width;r&&h<t.length-1&&(y+=r),o.push(y),g+=y;}return {width:g,charWidths:o,metrics:n}}function Jt(t,e){if(e.length===0||t<=0)return 0;let n=0;for(let i=0;i<e.length;i++){let r=e[i],o=n+r/2;if(t<=o)return i;n+=r;}return e.length}function Qt(t,e){if(t<=0||e.length===0)return 0;let n=Math.min(t,e.length),i=0;for(let r=0;r<n;r++)i+=e[r];return i}function q(t){return t/ct}function Vt(t){return Math.round(t*ct)}function L(t){return t*G/72}function mt(t){return t*72/G}function te(t){return L(t/2)}function ee(t){return mt(t)*2}function ne(t,e){return t.map(n=>{let i=n.x-n.distLeft,r=n.x+n.width+n.distRight,o=n.y-n.distTop,g=n.y+n.height+n.distBottom,h=0,m=0,d,y=n.wrapText??"bothSides";y==="right"?h=J(r):y==="left"?m=Q(i,e):y==="largest"?{leftMargin:h,rightMargin:m}=oe(i,r,e):re(i,r,e)?d=ae(i,r,e):n.side==="left"?h=J(r):m=Q(i,e);let _=tt(h,m,e);return {leftMargin:_.leftMargin,rightMargin:_.rightMargin,topY:o,bottomY:g,segments:d}})}function V(t,e){return t.segments?.reduce((i,r)=>i+r.availableWidth,0)??e-t.leftMargin-t.rightMargin}function $(t,e,n,i){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let r=0,o=0,g,h=i+t,m=h+e;for(let d of n)if(!(m<=d.topY||h>=d.bottomY)){if(d.segments?.length){g=g?ie(g,d.segments):d.segments;continue}r=Math.max(r,d.leftMargin),o=Math.max(o,d.rightMargin);}return {leftMargin:r,rightMargin:o,segments:g}}function ie(t,e){let n=[];for(let i of t)for(let r of e){let o=Math.max(i.leftOffset,r.leftOffset),g=Math.min(i.leftOffset+i.availableWidth,r.leftOffset+r.availableWidth);g>o&&n.push({leftOffset:o,availableWidth:g-o});}return n}function re(t,e,n){return t>0&&e<n}function ae(t,e,n){return [{leftOffset:0,availableWidth:Math.max(0,t)},{leftOffset:Math.max(0,e),availableWidth:Math.max(0,n-e)}].filter(i=>i.availableWidth>1)}function oe(t,e,n){let i=Math.max(0,t);return Math.max(0,n-e)>=i?{leftMargin:J(e),rightMargin:0}:{leftMargin:0,rightMargin:Q(t,n)}}function J(t){return Math.max(0,t)}function Q(t,e){return Math.max(0,e-t)}var R=11,O="Calibri",se=1.15,N=1,E=.5;function ue(t,e){if(e&&e.length>0)for(let i of e){let r=q(i.pos);if(r>t+.5)return Math.max(1,r-t)}let n=t%et;return Math.max(1,n<.5?et:et-n)}function dt(t,e,n,i=false){let r=1,o=t.length,g=0;for(;r<=o;){let h=r+o>>>1;C(t.slice(0,h),e)<=n?(g=h,r=h+1):o=h-1;}return i&&g===0?1:g}function z(t){return {fontFamily:t.fontFamily??O,fontSize:t.fontSize??R,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function bt(t,e,n){let i=L(t),r=n?.ascent??i*.8,o=n?.descent??i*.2,g=n?.singleLineRatio??1.15,h=i*g,m;if(e?.lineRule==="exact"&&e.line!==void 0)m=e.line;else if(e?.lineRule==="atLeast"&&e.line!==void 0){let d=h*N;m=Math.max(e.line,d);}else e?.line!==void 0&&e?.lineUnit==="multiplier"?m=h*e.line:e?.line!==void 0&&e?.lineUnit==="px"?m=e.line:m=h*N;return {ascent:r,descent:o,lineHeight:m}}function pt(t,e,n){let i=H({fontSize:t,fontFamily:n??O}),r=bt(t,e,i),o=e?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let g=L(t),h=Math.max(r.lineHeight,g*se);if(h!==r.lineHeight)return {...r,lineHeight:h}}return r}function D(t){return t.kind==="text"}function xt(t){return t.kind==="tab"}function Ft(t){return t.kind==="image"}function Mt(t){return t.kind==="lineBreak"}function Tt(t){return t.kind==="field"}function le(t){return !t.text||t.text.replace(/\u00a0/g," ").trim().length===0}function ce(t,e){let n=0;for(let i=e+1;i<t.length;i++){let r=t[i];if(xt(r)||Mt(r))break;if(D(r))n+=C(r.text||"",z(r));else if(Tt(r)){let o={fontFamily:r.fontFamily??O,fontSize:r.fontSize??R,bold:r.bold,italic:r.italic};n+=C(r.fallback||"1",o);}else Ft(r)&&(n+=r.width||0);}return n}function fe(t){let e=[];for(let n=0;n<t.length;n++){let i=t[n];(i===" "||i==="-"||i===" ")&&e.push(n+1);}return e}var et=48;function tt(t,e,n){let i=Math.max(1,n),r=Math.max(0,t),o=Math.max(0,e);return r>=i||o>=i||r+o>=i?{leftMargin:0,rightMargin:0}:{leftMargin:r,rightMargin:o}}function Ct(t,e,n){let i=t.runs,r=t.attrs,o=r?.spacing,g=n?.floatingZones,h=n?.paragraphYOffset??0,m=r?.indent,d=m?.left??0,y=m?.right??0,_=(m?.firstLine??0)-(m?.hanging??0),it=Math.max(1,e-d-y),_t=Math.max(1,it-_),rt=0,At=L(R)*N,A=$(0,At,g,h),Zt=Math.max(1,V(A,_t)),T=[];if(i.length===0){if(r?.suppressEmptyParagraphHeight)return T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:T,totalHeight:0};let s=r?.defaultFontSize??R,u=r?.defaultFontFamily??O,c=pt(s,o,u);T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...c});let l=c.lineHeight;return o?.before&&(l+=o.before),o?.after&&(l+=o.after),{kind:"paragraph",lines:T,totalHeight:l}}if(i.length===1&&D(i[0])&&le(i[0])){let s=i[0],u=s.fontSize??r?.defaultFontSize??R,c=s.fontFamily??r?.defaultFontFamily??O,l=pt(u,o,c);T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...l});let f=l.lineHeight;return o?.before&&(f+=o.before),o?.after&&(f+=o.after),{kind:"paragraph",lines:T,totalHeight:f}}let a={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:R,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:Zt,leftOffset:A.leftMargin,rightOffset:A.rightMargin,segmentZones:A.segments},at=()=>{let s=bt(a.maxFontSize,o,a.maxFontMetrics),u={...s};if(a.maxImageHeightPx>u.lineHeight){let l=a.maxImageHeightPx,f=u.descent;u.lineHeight=l+f*2,u.ascent=l+f;}let c={fromRun:a.fromRun,fromChar:a.fromChar,toRun:a.toRun,toChar:a.toChar,width:a.width,...u};a.leftOffset>0&&(c.leftOffset=a.leftOffset),a.rightOffset>0&&(c.rightOffset=a.rightOffset),a.segmentZones?.length&&(c.segments=Bt(c,a.segmentZones)),T.push(c),rt+=s.lineHeight;},Bt=(s,u)=>{let c=u[0],l=u[1];if(!c)return;if(!l||s.width<=c.availableWidth+E)return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:s.toChar,width:s.width,leftOffset:c.leftOffset,availableWidth:c.availableWidth}];if(s.fromRun!==s.toRun)return;let f=i[s.fromRun];if(!f||!D(f))return;let M=f,p=M.text.slice(s.fromChar,s.toChar),b=z(M),x=dt(p,b,c.availableWidth);if(x<=0||x>=p.length)return;let k=s.fromChar+x,F=p.slice(0,x),Y=p.slice(x);return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:k,width:C(F,b),leftOffset:c.leftOffset,availableWidth:c.availableWidth},{fromRun:s.fromRun,fromChar:k,toRun:s.toRun,toChar:s.toChar,width:C(Y,b),leftOffset:l.leftOffset,availableWidth:l.availableWidth}]},S=(s,u)=>{at();let c=L(R)*N,l=$(rt,c,g,h),f=Math.max(1,V(l,it));a={fromRun:s,fromChar:u,toRun:s,toChar:u,width:0,maxFontSize:R,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:f,leftOffset:l.leftMargin,rightOffset:l.rightMargin,segmentZones:l.segments};},W=s=>{let u=s.fontSize??R;(!a.maxFontMetrics||u>a.maxFontSize)&&(a.maxFontSize=u,a.maxFontMetrics=H(s));};for(let s=0;s<i.length;s++){let u=i[s];if(Mt(u)){a.toRun=s,a.toChar=0,S(s+1,0);continue}if(xt(u)){let c=z(u);W(c);let l=r?.tabs,f=a.width+(a.leftOffset??0),M=ue(f,l);if(f+M>a.availableWidth+E){let p=ce(i,s),b=a.availableWidth-f-p;b>1&&(M=b);}a.width+M>a.availableWidth+E&&(S(s,0),W(c)),a.width+=M,a.toRun=s,a.toChar=1;continue}if(Ft(u)){let c=u.wrapType,l=u.displayMode==="float"||chunkJFZIXFRC_js.c(c);if(u.position&&l){a.toRun=s,a.toChar=1;continue}if(c==="topAndBottom"||u.displayMode==="block"){a.width>0&&S(s,0);let p=u.height,b=u.distTop??6,x=u.distBottom??6;a.toRun=s,a.toChar=1,a.maxImageHeightPx=p+b+x,S(s+1,0);continue}let f=u.width,M=u.height;M>a.maxImageHeightPx&&(a.maxImageHeightPx=M),a.width+f>a.availableWidth+E&&S(s,0),a.width+=f,a.toRun=s,a.toChar=1;continue}if(Tt(u)){let c=u.fallback||"1",l={fontFamily:u.fontFamily??O,fontSize:u.fontSize??R,bold:u.bold,italic:u.italic};W(l);let f=C(c,l);a.width>0&&a.width+f>a.availableWidth+E&&(S(s,0),W(l)),a.width+=f,a.toRun=s,a.toChar=1;continue}if(D(u)){let c=u,l=c.text,f=z(c);if(W(f),!l||l.length===0){a.toRun=s,a.toChar=0;continue}let M=fe(l),p=0;for(;p<l.length;){let b=l.length;for(let F of M)if(F>p){b=F;break}let x=l.slice(p,b),k=C(x,f);if(k>a.availableWidth+E){let F=0;for(;F<x.length;){let Y=a.availableWidth-a.width+E,$t=x.slice(F),X=dt($t,f,Y);if(X===0){if(a.width>0){S(s,p+F),W(f);continue}X=1;}let j=F+X,Dt=x.slice(F,j),Nt=C(Dt,f);a.width+=Nt,a.toRun=s,a.toChar=p+j,F=j,F<x.length&&(S(s,p+F),W(f));}p=b;continue}a.width>0&&a.width+k>a.availableWidth+E&&(S(s,p),W(f)),a.width+=k,a.toRun=s,a.toChar=b,p=b;}}}at();let ot=T.reduce((s,u)=>s+u.lineHeight,0);r?.listMarker&&!r?.listMarkerHidden&&(m?.hanging??0)===0&&T.length>0&&(ot+=T[0].lineHeight);let U=ot;return o?.before&&(U+=o.before),o?.after&&(U+=o.after),{kind:"paragraph",lines:T,totalHeight:U}}function he(t,e){return t.map(n=>Ct(n,e))}function ge(t){let e=z(t);return K(t.text,e).charWidths}var Rt=2e4,P=new Map;function yt(t,e,n){return `${t}|${e}|${n||0}`}function St(){for(;P.size>Rt;){let t=P.keys().next().value;if(t===void 0)break;P.delete(t);}}function me(t,e,n=0){let i=yt(t,e,n),r=P.get(i);if(r!==void 0)return P.delete(i),P.set(i,r),r.width}function de(t,e,n,i){let r=yt(t,e,n);P.set(r,{width:i}),St();}function Lt(){P.clear();}function pe(t){!Number.isFinite(t)||t<=0||(Rt=t,St());}function Pt(){return P.size}var be=1e3,wt=be,w=new Map;function vt(t,e,n=false,i=false){return `${t}|${e}|${n}|${i}`}function Wt(){for(;w.size>wt;){let t=w.keys().next().value;if(t===void 0)break;w.delete(t);}}function xe(t,e,n=false,i=false){let r=vt(t,e,n,i),o=w.get(r);if(o!==void 0)return w.delete(r),w.set(r,o),o}function Fe(t,e,n,i,r){let o=vt(t,e,n,i);w.set(o,r),Wt();}function Et(){w.clear();}function Me(t){!Number.isFinite(t)||t<=0||(wt=t,Wt());}function kt(){return w.size}var Te=5e3,Ht=Te,v=new Map;function nt(t){let e=[];for(let i of t.runs)i.kind==="text"?e.push(`t:${i.text}|${i.fontFamily}|${i.fontSize}|${i.bold}|${i.italic}`):i.kind==="tab"?e.push(`tab:${i.width}`):i.kind==="image"?e.push(`img:${i.width}x${i.height}`):i.kind==="lineBreak"&&e.push("br");let n=t.attrs;if(n){n.alignment&&e.push(`align:${n.alignment}`),n.indent&&e.push(`indent:${n.indent.left}|${n.indent.right}|${n.indent.firstLine}|${n.indent.hanging}`),n.spacing&&e.push(`spacing:${n.spacing.before}|${n.spacing.after}|${n.spacing.line}|${n.spacing.lineRule}`),n.defaultFontSize!=null&&e.push(`dfs:${n.defaultFontSize}`),n.defaultFontFamily!=null&&e.push(`dff:${n.defaultFontFamily}`);let i=n.borders;if(i){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";e.push(`bdr:${r(i.top)}|${r(i.bottom)}|${r(i.left)}|${r(i.right)}`);}n.suppressEmptyParagraphHeight&&e.push("sup");}return e.join("||")}function Ot(){for(;v.size>Ht;){let t=v.keys().next().value;if(t===void 0)break;v.delete(t);}}function Ce(t,e){let n=nt(t),i=v.get(n);if(i!==void 0&&i.maxWidth===e)return v.delete(n),v.set(n,i),i.measure}function Re(t,e,n){let i=nt(t);v.set(i,{measure:n,maxWidth:e}),Ot();}function It(){v.clear();}function ye(t){!Number.isFinite(t)||t<=0||(Ht=t,Ot());}function zt(){return v.size}function Se(){Lt(),Et(),It();}function Le(){return Pt()+kt()+zt()}exports.A=xe;exports.B=Fe;exports.C=Et;exports.D=Me;exports.E=kt;exports.F=nt;exports.G=Ce;exports.H=Re;exports.I=It;exports.J=ye;exports.K=zt;exports.L=Se;exports.M=Le;exports.a=Z;exports.b=Gt;exports.c=B;exports.d=H;exports.e=C;exports.f=qt;exports.g=K;exports.h=Jt;exports.i=Qt;exports.j=q;exports.k=Vt;exports.l=L;exports.m=mt;exports.n=te;exports.o=ee;exports.p=ne;exports.q=$;exports.r=tt;exports.s=Ct;exports.t=he;exports.u=ge;exports.v=me;exports.w=de;exports.x=Lt;exports.y=pe;exports.z=Pt;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkD4RPOJC7_js=require('./chunk-D4RPOJC7.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function k(t){let e=new Map,n=new Map;return t.descendants(i=>{let o=i.marks.find(r=>r.type.name==="insertion"),a=i.marks.find(r=>r.type.name==="deletion");if(o){let r=Number(o.attrs.revisionId);Number.isFinite(r)&&e.set(r,(e.get(r)??0)+1);}if(a){let r=Number(a.attrs.revisionId);Number.isFinite(r)&&n.set(r,(n.get(r)??0)+1);}}),{insertionById:e,deletionById:n}}function N(t){return t.attrs.href||""}function E(t){let e=t.filter(n=>n.type.name!=="hyperlink");return e.length===0?"":e.map(n=>`${n.type.name}:${JSON.stringify(n.attrs)}`).sort().join("|")}function T(t){let e={};for(let n of t)switch(n.type.name){case "bold":e.bold=true,e.boldCs=true;break;case "italic":e.italic=true,e.italicCs=true;break;case "underline":{let i=n.attrs;e.underline={style:i.style||"single",color:i.color};break}case "strike":n.attrs.double?e.doubleStrike=true:e.strike=true;break;case "textColor":{let i=n.attrs;e.color={rgb:i.rgb,themeColor:i.themeColor,themeTint:i.themeTint,themeShade:i.themeShade};break}case "highlight":e.highlight=n.attrs.color;break;case "fontSize":e.fontSize=n.attrs.size,e.fontSizeCs=n.attrs.size;break;case "fontFamily":{let i=n.attrs;e.fontFamily={ascii:i.ascii,hAnsi:i.hAnsi,eastAsia:i.eastAsia||void 0,cs:i.cs||i.ascii||void 0,asciiTheme:i.asciiTheme,hAnsiTheme:i.hAnsiTheme||void 0,eastAsiaTheme:i.eastAsiaTheme||void 0,csTheme:i.csTheme||void 0};break}case "superscript":e.vertAlign="superscript";break;case "subscript":e.vertAlign="subscript";break;case "allCaps":e.allCaps=true;break;case "smallCaps":e.smallCaps=true;break;case "characterSpacing":{n.attrs.spacing!=null&&(e.spacing=n.attrs.spacing),n.attrs.position!=null&&(e.position=n.attrs.position),n.attrs.scale!=null&&(e.scale=n.attrs.scale),n.attrs.kerning!=null&&(e.kerning=n.attrs.kerning);break}case "emboss":e.emboss=true;break;case "imprint":e.imprint=true;break;case "textShadow":e.shadow=true;break;case "emphasisMark":e.emphasisMark=n.attrs.type||"dot";break;case "textOutline":e.outline=true;break;case "hidden":e.hidden=true;break;case "rtl":e.rtl=true;break;case "textEffect":e.effect=n.attrs.effect||"blinkBackground";break}return e}function L(t){let e=t.attrs.href;return e?.startsWith("#")?{type:"hyperlink",anchor:e.substring(1),tooltip:t.attrs.tooltip||void 0,children:[]}:{type:"hyperlink",href:e,tooltip:t.attrs.tooltip||void 0,rId:t.attrs.rId||void 0,children:[]}}function x(t,e){let n=e.marks.filter(i=>i.type.name!=="hyperlink");e.isText&&e.text?t.children.push(C(e.text,n)):e.type.name==="tab"?t.children.push(w()):e.type.name==="hardBreak"&&t.children.push(P());}function C(t,e){let n=T(e),i={type:"text",text:t};return {type:"run",formatting:Object.keys(n).length>0?n:void 0,content:[i]}}function H(t,e){let n=t.content[t.content.length-1];n&&n.type==="text"?n.text+=e:t.content.push({type:"text",text:e});}function P(){return {type:"run",content:[{type:"break",breakType:"textWrapping"}]}}function w(){return {type:"run",content:[{type:"tab"}]}}function O(t,e){let n=t.attrs,i=e&&e.length>0?T(e):void 0,o=n.displayText||"";if(!o)switch(n.fieldType){case "PAGE":o="1";break;case "NUMPAGES":o="1";break;default:o=" ";break}let a={type:"run",content:[{type:"text",text:o}],...i&&Object.keys(i).length>0?{formatting:i}:{}};return n.fieldKind==="complex"?{type:"complexField",instruction:n.instruction,fieldType:n.fieldType,fieldCode:[],fieldResult:[a],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}:{type:"simpleField",instruction:n.instruction,fieldType:n.fieldType,content:[a],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}}function W(t){let e=t.attrs;return {type:"mathEquation",display:e.display||"inline",ommlXml:e.ommlXml,plainText:e.plainText||void 0}}function D(t){let e=t.attrs,i={type:e.wrapType||"inline"};e.distTop!==void 0&&(i.distT=chunk4Q2IP5FW_js.f(e.distTop)),e.distBottom!==void 0&&(i.distB=chunk4Q2IP5FW_js.f(e.distBottom)),e.distLeft!==void 0&&(i.distL=chunk4Q2IP5FW_js.f(e.distLeft)),e.distRight!==void 0&&(i.distR=chunk4Q2IP5FW_js.f(e.distRight)),e.wrapText&&(i.wrapText=e.wrapText);let o={type:"image",rId:e.rId||"",src:e.src,alt:e.alt||void 0,title:e.title||void 0,size:{width:chunk4Q2IP5FW_js.f(e.width||0),height:chunk4Q2IP5FW_js.f(e.height||0)},wrap:i};if(e.transform){let r=e.transform,l={},s=r.match(/rotate\(([-\d.]+)deg\)/);s&&(l.rotation=parseFloat(s[1])),r.includes("scaleX(-1)")&&(l.flipH=true),r.includes("scaleY(-1)")&&(l.flipV=true),(l.rotation||l.flipH||l.flipV)&&(o.transform=l);}if(e.position?.horizontal&&e.position?.vertical){let r=e.position;o.position={horizontal:{relativeTo:r.horizontal.relativeTo||"column",alignment:r.horizontal.align,posOffset:r.horizontal.posOffset},vertical:{relativeTo:r.vertical.relativeTo||"paragraph",alignment:r.vertical.align,posOffset:r.vertical.posOffset}};}if(e.borderWidth&&e.borderWidth>0){let r={solid:"solid",dotted:"dot",dashed:"dash",double:"solid",groove:"solid",ridge:"solid",inset:"solid",outset:"solid"};o.outline={width:chunk4Q2IP5FW_js.f(e.borderWidth),color:e.borderColor?{rgb:e.borderColor.replace("#","")}:void 0,style:e.borderStyle&&r[e.borderStyle]||"solid"};}if(e.hlinkHref&&(o.hlinkHref=e.hlinkHref),e.cropTop!==void 0||e.cropRight!==void 0||e.cropBottom!==void 0||e.cropLeft!==void 0){let r={};e.cropTop!==void 0&&e.cropTop!==null&&(r.top=e.cropTop),e.cropRight!==void 0&&e.cropRight!==null&&(r.right=e.cropRight),e.cropBottom!==void 0&&e.cropBottom!==null&&(r.bottom=e.cropBottom),e.cropLeft!==void 0&&e.cropLeft!==null&&(r.left=e.cropLeft),Object.keys(r).length>0&&(o.crop=r);}if(e.opacity!==void 0&&e.opacity!==null&&e.opacity<1&&(o.opacity=e.opacity),e.layoutInCell!==void 0&&e.layoutInCell!==null&&(o.layoutInCell=e.layoutInCell),e.allowOverlap!==void 0&&e.allowOverlap!==null&&(o.allowOverlap=e.allowOverlap),e.effectExtentTop||e.effectExtentBottom||e.effectExtentLeft||e.effectExtentRight){let r={};e.effectExtentTop&&(r.top=chunk4Q2IP5FW_js.f(e.effectExtentTop)),e.effectExtentBottom&&(r.bottom=chunk4Q2IP5FW_js.f(e.effectExtentBottom)),e.effectExtentLeft&&(r.left=chunk4Q2IP5FW_js.f(e.effectExtentLeft)),e.effectExtentRight&&(r.right=chunk4Q2IP5FW_js.f(e.effectExtentRight)),Object.keys(r).length>0&&(o.padding=r);}return {type:"run",content:[{type:"drawing",image:o}]}}function j(t){let e=t.attrs,n={type:"shape",shapeType:e.shapeType||"rect",id:e.shapeId||void 0,size:{width:e.width?chunk4Q2IP5FW_js.f(e.width):0,height:e.height?chunk4Q2IP5FW_js.f(e.height):0}};if(e.fillType==="gradient"&&e.gradientStops)try{let o=JSON.parse(e.gradientStops);n.fill={type:"gradient",gradient:{type:e.gradientType||"linear",angle:e.gradientAngle||void 0,stops:o.map(a=>({position:a.position,color:{rgb:a.color.replace("#","")}}))}};}catch{n.fill={type:"solid",color:{rgb:(e.fillColor||"000000").replace("#","")}};}else e.fillColor?n.fill={type:e.fillType||"solid",color:{rgb:e.fillColor.replace("#","")}}:e.fillType==="none"&&(n.fill={type:"none"});if(e.outlineWidth&&e.outlineWidth>0){let o={solid:"solid",dotted:"dot",dashed:"dash"};n.outline={width:chunk4Q2IP5FW_js.f(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&o[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:n}]}}function b(t,e){let n=t.attrs,i=J(z(t,e),t),o=n.bookmarks;if(o&&o.length>0){let r=o.map(s=>({type:"bookmarkStart",id:s.id,name:s.name})),l=o.map(s=>({type:"bookmarkEnd",id:s.id}));i=[...r,...i,...l];}let a={type:"paragraph",paraId:n.paraId||void 0,textId:n.textId||void 0,formatting:q(n),content:i};return n.renderedPageBreakBefore&&(a.renderedPageBreakBefore=true),n._sectionProperties?a.sectionProperties=n._sectionProperties:n.sectionBreakType&&(a.sectionProperties={sectionStart:n.sectionBreakType}),a}function J(t,e){let n=new Set;if(e.forEach(r=>{for(let l of r.marks)l.type.name==="comment"&&n.add(l.attrs.commentId);}),n.size===0)return t;let i=[],o=new Set,a=0;e.forEach(r=>{let l=new Set;for(let s of r.marks)s.type.name==="comment"&&l.add(s.attrs.commentId);for(let s of [...o])l.has(s)||(i.push({type:"commentRangeEnd",id:s}),o.delete(s));for(let s of l)o.has(s)||(i.push({type:"commentRangeStart",id:s}),o.add(s));a<t.length&&i.push(t[a]),a++;});for(let r of o)i.push({type:"commentRangeEnd",id:r});return i}function q(t){if(t._originalFormatting){let n=t._originalFormatting,i={...n};return t.alignment!==(n.alignment||void 0)&&(i.alignment=t.alignment||void 0),t.numPr!==n.numPr&&JSON.stringify(t.numPr)!==JSON.stringify(n.numPr)&&(i.numPr=t.numPr||void 0),t.styleId!==(n.styleId||void 0)&&(i.styleId=t.styleId||void 0),t.pageBreakBefore!==(n.pageBreakBefore||void 0)&&(i.pageBreakBefore=t.pageBreakBefore||void 0),t.bidi!==(n.bidi||void 0)&&(i.bidi=t.bidi||void 0),i}if(t.alignment||t.spaceBefore||t.spaceAfter||t.lineSpacing||t.indentLeft||t.indentRight||t.indentFirstLine||t.numPr||t.styleId||t.borders||t.shading||t.tabs||t.outlineLevel!=null||t.contextualSpacing||t.bidi)return {alignment:t.alignment||void 0,spaceBefore:t.spaceBefore||void 0,spaceAfter:t.spaceAfter||void 0,lineSpacing:t.lineSpacing||void 0,lineSpacingRule:t.lineSpacingRule||void 0,indentLeft:t.indentLeft||void 0,indentRight:t.indentRight||void 0,indentFirstLine:t.indentFirstLine||void 0,hangingIndent:t.hangingIndent||void 0,numPr:t.numPr||void 0,styleId:t.styleId||void 0,borders:t.borders||void 0,shading:t.shading||void 0,tabs:t.tabs||void 0,outlineLevel:t.outlineLevel??void 0,contextualSpacing:t.contextualSpacing||void 0,bidi:t.bidi||void 0}}function z(t,e){let n=[],i=e??k(t),o=null,a=null,r=null;return t.forEach(l=>{let s=l.marks.find(p=>p.type.name==="footnoteRef");if(s){o&&(n.push(o),o=null,a=null),r&&(n.push(r),r=null);let u={type:s.attrs.noteType==="endnote"?"endnoteRef":"footnoteRef",id:parseInt(s.attrs.id,10)||0};n.push({type:"run",content:[u]});return}let d=l.marks.find(p=>p.type.name==="insertion"),m=l.marks.find(p=>p.type.name==="deletion");if(d||m){o&&(n.push(o),o=null,a=null),r&&(n.push(r),r=null);let p=d||m,u=l.marks.filter(I=>I.type.name!=="insertion"&&I.type.name!=="deletion"),h=T(u),y={type:"run",content:l.isText&&l.text?[{type:"text",text:l.text}]:[],...Object.keys(h).length>0?{formatting:h}:{}},g={id:p.attrs.revisionId,author:p.attrs.author||"Unknown",date:p.attrs.date||void 0},R=g.id,K=(i.insertionById.get(R)??0)>0,V=(i.deletionById.get(R)??0)>0,F=K&&V;d?F?n.push({type:"moveTo",info:g,content:[y]}):n.push({type:"insertion",info:g,content:[y]}):F?n.push({type:"moveFrom",info:g,content:[y]}):n.push({type:"deletion",info:g,content:[y]});return}let f=l.marks.find(p=>p.type.name==="hyperlink");if(f){let p=N(f),u=r?.href||(r?.anchor?`#${r.anchor}`:"");r&&u===p?x(r,l):(o&&(n.push(o),o=null,a=null),r&&n.push(r),r=L(f),x(r,l));return}if(r&&(n.push(r),r=null),l.isText){let p=E(l.marks);o&&a===p?H(o,l.text||""):(o&&n.push(o),o=C(l.text||"",l.marks),a=p);}else l.type.name==="hardBreak"?(o&&(n.push(o),o=null,a=null),n.push(P())):l.type.name==="image"?(o&&(n.push(o),o=null,a=null),n.push(D(l))):l.type.name==="shape"?(o&&(n.push(o),o=null,a=null),n.push(j(l))):l.type.name==="tab"?(o&&(n.push(o),o=null,a=null),n.push(w())):l.type.name==="field"?(o&&(n.push(o),o=null,a=null),n.push(O(l,l.marks))):l.type.name==="sdt"?(o&&(n.push(o),o=null,a=null),n.push(U(l))):l.type.name==="math"&&(o&&(n.push(o),o=null,a=null),n.push(W(l)));}),o&&n.push(o),r&&n.push(r),n}function U(t){let e=t.attrs,n={sdtType:e.sdtType??"richText",alias:e.alias??void 0,tag:e.tag??void 0,lock:e.lock??void 0,placeholder:e.placeholder??void 0,showingPlaceholder:e.showingPlaceholder??void 0,dateFormat:e.dateFormat??void 0,listItems:e.listItems?JSON.parse(e.listItems):void 0,checked:e.checked!=null?e.checked:void 0},o=z(t).filter(a=>a.type==="run"||a.type==="hyperlink"||a.type==="simpleField"||a.type==="complexField"||a.type==="inlineSdt"||a.type==="mathEquation");return {type:"inlineSdt",properties:n,content:o}}function X(t){for(let e of t)for(let n of e.cells){let i=n.formatting?.borders;if(i){let o=i.top||i.left||i.right||i.bottom||i.insideH||i.insideV;return o?{top:i.top??o,bottom:i.bottom??o,left:i.left??o,right:i.right??o,insideH:i.insideH??i.bottom??o,insideV:i.insideV??i.right??o}:void 0}}}function G(t,e){let n=[],i=[],o=0;for(let a=0;a<t.childCount;a++){let r=t.child(a),l=0;r.forEach(s=>{if(s.type.name!=="tableCell"&&s.type.name!=="tableHeader")return;for(;n[a]?.[l];)l++;let d=s.attrs.rowspan||1,m=s.attrs.colspan||1;i.push({row:a,col:l,rowspan:d,colspan:m,cell:Z(s,e)});for(let f=a;f<a+d;f++){let p=n[f]??[];n[f]=p;for(let u=l;u<l+m;u++)p[u]=true;}l+=m,o=Math.max(o,l);});}return {anchors:i,totalCols:o}}function M(t,e){let n=t.attrs,{anchors:i,totalCols:o}=G(t,e),a=new Map,r=new Map;for(let d of i){a.set(`${d.row}-${d.col}`,d);for(let m=d.row;m<d.row+d.rowspan;m++)for(let f=d.col;f<d.col+d.colspan;f++)r.set(`${m}-${f}`,d);}let l=[];for(let d=0;d<t.childCount;d++){let m=t.child(d),f=[];for(let p=0;p<o;){let u=a.get(`${d}-${p}`);if(u){let g={...u.cell.formatting??{}};u.colspan>1?g.gridSpan=u.colspan:delete g.gridSpan,u.rowspan>1?g.vMerge="restart":delete g.vMerge,f.push({...u.cell,formatting:Object.keys(g).length?g:void 0}),p+=u.colspan;continue}let h=r.get(`${d}-${p}`);if(!h){p++;continue}let y={...h.cell.formatting??{}};h.colspan>1?y.gridSpan=h.colspan:delete y.gridSpan,y.vMerge="continue",f.push({...h.cell,content:[],formatting:y}),p+=h.colspan;}l.push({type:"tableRow",formatting:Q(m.attrs),cells:f});}let s=Y(n)||void 0;if(!s?.borders){let d=X(l);if(d)if(s)s.borders=d;else return {type:"table",columnWidths:n.columnWidths||void 0,formatting:{borders:d},rows:l}}return {type:"table",columnWidths:n.columnWidths||void 0,formatting:s,rows:l}}function Y(t){if(t._originalFormatting){let o=t._originalFormatting,a={...o};t.styleId!==(o.styleId||void 0)&&(a.styleId=t.styleId||void 0),t.justification!==(o.justification||void 0)&&(a.justification=t.justification||void 0),t.floating!==(o.floating||void 0)&&(a.floating=t.floating||void 0),t.look!==(o.look||void 0)&&(a.look=t.look||void 0);let r=o.width?.value,l=o.width?.type;return (t.width!==r||t.widthType!==l)&&(t.width!=null||t.widthType?a.width={value:t.width??0,type:t.widthType||"dxa"}:a.width=void 0),t.cellMargins&&(a.cellMargins={top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}),a}if(!(t.styleId||t.width!=null||t.widthType||t.justification||t.floating||t.cellMargins||t.look))return;let n=t.cellMargins?{top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}:void 0,i;return (t.width!=null||t.widthType)&&(i={value:t.width??0,type:t.widthType||"dxa"}),{styleId:t.styleId||void 0,width:i,justification:t.justification||void 0,floating:t.floating||void 0,cellMargins:n,look:t.look||void 0}}function Q(t){if(t._originalFormatting){let n=t._originalFormatting,i={...n};return t.height!==(n.height?.value||void 0)&&(i.height=t.height?{value:t.height,type:"dxa"}:void 0),t.heightRule!==(n.heightRule||void 0)&&(i.heightRule=t.heightRule||void 0),t.isHeader!==(n.header||void 0)&&(i.header=t.isHeader||void 0),i}if(t.height||t.isHeader)return {height:t.height?{value:t.height,type:"dxa"}:void 0,heightRule:t.heightRule||void 0,header:t.isHeader||void 0}}function Z(t,e){let n=t.attrs,i=[];return t.forEach(o=>{o.type.name==="paragraph"?i.push(b(o,e)):o.type.name==="table"&&i.push(M(o,e));}),{type:"tableCell",formatting:ee(n),content:i}}function ee(t){if(t._originalFormatting){let i=t._originalFormatting,o={...i};if(t.colspan>1&&(o.gridSpan=t.colspan),t.width!=null&&(o.width={value:t.width,type:t.widthType||"dxa"}),t.verticalAlign!==(i.verticalAlign||void 0)&&(o.verticalAlign=t.verticalAlign||void 0),t.backgroundColor?t._originalResolvedFill===t.backgroundColor&&i.shading?o.shading=i.shading:o.shading={fill:{rgb:t.backgroundColor}}:i.shading&&(o.shading=void 0),t.borders&&(o.borders=t.borders),t.margins){let a=t.margins,r={};a.top!=null&&(r.top={value:a.top,type:"dxa"}),a.bottom!=null&&(r.bottom={value:a.bottom,type:"dxa"}),a.left!=null&&(r.left={value:a.left,type:"dxa"}),a.right!=null&&(r.right={value:a.right,type:"dxa"}),o.margins=r;}return t.textDirection!==(i.textDirection||void 0)&&(o.textDirection=t.textDirection||void 0),o}if(!(t.colspan>1||t.rowspan>1||t.width!=null||t.verticalAlign||t.backgroundColor||t.borders||t.margins||t.textDirection))return;let n;if(t.margins){let i=t.margins;n={},i.top!=null&&(n.top={value:i.top,type:"dxa"}),i.bottom!=null&&(n.bottom={value:i.bottom,type:"dxa"}),i.left!=null&&(n.left={value:i.left,type:"dxa"}),i.right!=null&&(n.right={value:i.right,type:"dxa"});}return {gridSpan:t.colspan>1?t.colspan:void 0,width:t.width!=null?{value:t.width,type:t.widthType||"dxa"}:void 0,verticalAlign:t.verticalAlign||void 0,textDirection:t.textDirection||void 0,shading:t.backgroundColor?{fill:{rgb:t.backgroundColor}}:void 0,borders:t.borders,margins:n}}function v(t){let e=t.attrs,n=[];t.forEach(l=>{l.type.name==="paragraph"&&n.push(b(l));});let i={type:"shape",shapeType:"rect",id:e.textBoxId||void 0,size:{width:e.width?chunk4Q2IP5FW_js.f(e.width):0,height:e.height?chunk4Q2IP5FW_js.f(e.height):0},textBody:{content:n.length>0?n:[{type:"paragraph",content:[]}],margins:{top:e.marginTop!=null?chunk4Q2IP5FW_js.f(e.marginTop):void 0,bottom:e.marginBottom!=null?chunk4Q2IP5FW_js.f(e.marginBottom):void 0,left:e.marginLeft!=null?chunk4Q2IP5FW_js.f(e.marginLeft):void 0,right:e.marginRight!=null?chunk4Q2IP5FW_js.f(e.marginRight):void 0}}},o=chunkD4RPOJC7_js.d(e);o&&(i.position=o);let a=chunkD4RPOJC7_js.e(e);if(a&&(i.wrap=a),e.fillColor&&(i.fill={type:"solid",color:{rgb:e.fillColor.replace("#","")}}),e.outlineWidth&&e.outlineWidth>0){let l={solid:"solid",dotted:"dot",dashed:"dash"};i.outline={width:chunk4Q2IP5FW_js.f(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&l[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:i}]}}function _(t){return {type:"paragraph",content:[v(t)]}}function te(t,e){let i={content:$(t),finalSectionProperties:e?.package.document.finalSectionProperties,sections:e?.package.document.sections,comments:e?.package.document.comments};return e?{...e,package:{...e.package,document:i}}:{package:{document:i}}}function $(t){let e=[],n=k(t),i=[],o=()=>{for(let a of i)e.push({type:"paragraph",content:[a]});i=[];};return t.forEach(a=>{if(a.type.name==="paragraph"){let r=b(a,n);i.length>0&&(r.content=[...i,...r.content],i=[]),e.push(r);}else if(a.type.name==="table")o(),e.push(M(a,n));else if(a.type.name==="textBox"){let r=a.attrs;chunkD4RPOJC7_js.c(r)?i.push(v(a)):(o(),e.push(_(a)));}else a.type.name==="pageBreak"&&(o(),e.push(ne()));}),o(),e}function ne(){return {type:"paragraph",content:[{type:"run",content:[{type:"break",breakType:"page"}]}]}}function xe(t,e){return te(e,t)}function Ce(t){return $(t)}exports.a=te;exports.b=xe;exports.c=Ce;
@@ -1 +1 @@
1
- 'use strict';var chunkCKXAHSJQ_js=require('./chunk-CKXAHSJQ.js');require('./chunk-U4UCHBZ7.js'),require('./chunk-ESI4BSBF.js');var chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js');require('./chunk-6ILFFGGS.js'),require('./chunk-CWAP26GB.js'),require('./chunk-KBU6QQFU.js'),require('./chunk-MZOVDLYL.js'),require('./chunk-YGHHSCPR.js'),require('./chunk-7VCMJCBY.js'),require('./chunk-Q4CKLXWA.js'),require('./chunk-4Q2IP5FW.js'),require('./chunk-DC7S76ZX.js');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkCKXAHSJQ_js.b}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkCKXAHSJQ_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}});
1
+ 'use strict';var chunkAFMMYLPX_js=require('./chunk-AFMMYLPX.js');require('./chunk-U4UCHBZ7.js'),require('./chunk-ESI4BSBF.js');var chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js');require('./chunk-C6GSFUV2.js'),require('./chunk-DV6IEOP5.js'),require('./chunk-KBU6QQFU.js'),require('./chunk-MZOVDLYL.js'),require('./chunk-YGHHSCPR.js'),require('./chunk-7VCMJCBY.js'),require('./chunk-Q4CKLXWA.js'),require('./chunk-4Q2IP5FW.js'),require('./chunk-DC7S76ZX.js');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkAFMMYLPX_js.b}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkAFMMYLPX_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}});
@@ -1 +1 @@
1
- export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-J7ULKGU2.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-VKTCTMIO.mjs';import'./chunk-BWHUD2XC.mjs';import'./chunk-Y5HZAMND.mjs';import'./chunk-ILJUDEZ5.mjs';import'./chunk-IBNUQL57.mjs';import'./chunk-6LOYA7G5.mjs';import'./chunk-VQWZHPWI.mjs';import'./chunk-VW22RZ6C.mjs';import'./chunk-QYUPLKLP.mjs';
1
+ export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-AGNZEOVL.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-R7RR6M4A.mjs';import'./chunk-3GNIP6IX.mjs';import'./chunk-Y5HZAMND.mjs';import'./chunk-ILJUDEZ5.mjs';import'./chunk-IBNUQL57.mjs';import'./chunk-6LOYA7G5.mjs';import'./chunk-VQWZHPWI.mjs';import'./chunk-VW22RZ6C.mjs';import'./chunk-QYUPLKLP.mjs';
package/dist/core.d.mts CHANGED
@@ -42,7 +42,7 @@ export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinat
42
42
  export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.mjs';
43
43
  export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.mjs';
44
44
  import { Run } from './types/content.mjs';
45
- export { BlockContent, BookmarkEnd, BookmarkStart, DocumentBody, Endnote, Field, FooterReference, Footnote, HeaderFooter, HeaderReference, Hyperlink, Image, Paragraph, RunContent, SectionProperties, Shape, Table, TableCell, TableRow, TextBox, TextContent } from './types/content.mjs';
45
+ export { BlockContent, BookmarkEnd, BookmarkStart, Comment, CommentRangeEnd, CommentRangeStart, Deletion, DocumentBody, Endnote, Field, FooterReference, Footnote, HeaderFooter, HeaderReference, Hyperlink, Image, Insertion, MoveFrom, MoveTo, Paragraph, ParagraphContent, RunContent, SectionProperties, Shape, Table, TableCell, TableRow, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange } from './types/content.mjs';
46
46
  import { EditorView } from 'prosemirror-view';
47
47
  export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.mjs';
48
48
  export { P as ParagraphFormatting, T as TextFormatting } from './formatting-D9I-lFS4.mjs';
package/dist/core.d.ts CHANGED
@@ -42,7 +42,7 @@ export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinat
42
42
  export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.js';
43
43
  export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.js';
44
44
  import { Run } from './types/content.js';
45
- export { BlockContent, BookmarkEnd, BookmarkStart, DocumentBody, Endnote, Field, FooterReference, Footnote, HeaderFooter, HeaderReference, Hyperlink, Image, Paragraph, RunContent, SectionProperties, Shape, Table, TableCell, TableRow, TextBox, TextContent } from './types/content.js';
45
+ export { BlockContent, BookmarkEnd, BookmarkStart, Comment, CommentRangeEnd, CommentRangeStart, Deletion, DocumentBody, Endnote, Field, FooterReference, Footnote, HeaderFooter, HeaderReference, Hyperlink, Image, Insertion, MoveFrom, MoveTo, Paragraph, ParagraphContent, RunContent, SectionProperties, Shape, Table, TableCell, TableRow, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange } from './types/content.js';
46
46
  import { EditorView } from 'prosemirror-view';
47
47
  export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.js';
48
48
  export { P as ParagraphFormatting, T as TextFormatting } from './formatting-BwpZWdGi.js';
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunkFC6QL3E6_js=require('./chunk-FC6QL3E6.js');require('./chunk-23CP3TOP.js');var chunk4AJYHCPB_js=require('./chunk-4AJYHCPB.js');require('./chunk-N27FJQTG.js'),require('./chunk-44RUAQA2.js'),require('./chunk-DROCYKAR.js'),require('./chunk-7RDCZLTU.js'),require('./chunk-DY2MJCSV.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkS7IKPRC3_js=require('./chunk-S7IKPRC3.js'),chunkWLQEPVDR_js=require('./chunk-WLQEPVDR.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkCKXAHSJQ_js=require('./chunk-CKXAHSJQ.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkTE2AF7FM_js=require('./chunk-TE2AF7FM.js'),chunkWNTT4MGC_js=require('./chunk-WNTT4MGC.js'),chunkCCWOLPZE_js=require('./chunk-CCWOLPZE.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunk6ILFFGGS_js=require('./chunk-6ILFFGGS.js');require('./chunk-CWAP26GB.js');var chunkKBU6QQFU_js=require('./chunk-KBU6QQFU.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-Y7JZPBBW.js'),require('./chunk-D4RPOJC7.js'),require('./chunk-IP2VXNWG.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-MZOVDLYL.js'),require('./chunk-YGHHSCPR.js'),require('./chunk-7VCMJCBY.js'),require('./chunk-SUXJX72X.js'),require('./chunk-DFZTUQ7O.js'),require('./chunk-BHBOAP6Z.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-NERY274X.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-T4CPTPRP.js'),require('./chunk-Q4CKLXWA.js');var chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let m=L(s);m&&(e.color={rgb:m});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let m=S(l);m&&(e.shading={fill:{rgb:m}});}return Object.keys(e).length>0?e:void 0}function Lt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=Lt(s,e);if(l){let m=h(s);o.push({type:"run",formatting:m,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var to="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunkFC6QL3E6_js.z}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunk4AJYHCPB_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunk4AJYHCPB_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunk4AJYHCPB_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunk4AJYHCPB_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunk4AJYHCPB_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunk4AJYHCPB_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunk4AJYHCPB_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunk4AJYHCPB_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunk4AJYHCPB_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkS7IKPRC3_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkWLQEPVDR_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkWLQEPVDR_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkWLQEPVDR_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkCKXAHSJQ_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkWNTT4MGC_js.s}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkWNTT4MGC_js.h}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkWNTT4MGC_js.l}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkCCWOLPZE_js.f}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkCCWOLPZE_js.g}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkCCWOLPZE_js.e}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunk6ILFFGGS_js.f}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkKBU6QQFU_js.g}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkKBU6QQFU_js.e}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkKBU6QQFU_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkKBU6QQFU_js.d}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkKBU6QQFU_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkKBU6QQFU_js.h}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkKBU6QQFU_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkKBU6QQFU_js.f}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkKBU6QQFU_js.m}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkKBU6QQFU_js.p}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.e}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.g}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.p}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.j}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.f}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.d}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.i}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.h}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.c}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=to;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;
1
+ 'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunkNFYCMDM5_js=require('./chunk-NFYCMDM5.js');require('./chunk-GH5N36F7.js');var chunkPK4PDRTA_js=require('./chunk-PK4PDRTA.js');require('./chunk-BD4CYYFB.js'),require('./chunk-44RUAQA2.js'),require('./chunk-DROCYKAR.js'),require('./chunk-7RDCZLTU.js'),require('./chunk-TZJUO3NW.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkKSYEBTYE_js=require('./chunk-KSYEBTYE.js'),chunkWLQEPVDR_js=require('./chunk-WLQEPVDR.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkAFMMYLPX_js=require('./chunk-AFMMYLPX.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkTE2AF7FM_js=require('./chunk-TE2AF7FM.js'),chunkWNTT4MGC_js=require('./chunk-WNTT4MGC.js'),chunkCCWOLPZE_js=require('./chunk-CCWOLPZE.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunkC6GSFUV2_js=require('./chunk-C6GSFUV2.js');require('./chunk-DV6IEOP5.js');var chunkKBU6QQFU_js=require('./chunk-KBU6QQFU.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-HVZMO3BU.js'),require('./chunk-D4RPOJC7.js'),require('./chunk-IP2VXNWG.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-MZOVDLYL.js'),require('./chunk-YGHHSCPR.js'),require('./chunk-7VCMJCBY.js'),require('./chunk-SUXJX72X.js'),require('./chunk-DFZTUQ7O.js'),require('./chunk-BHBOAP6Z.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-NERY274X.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-T4CPTPRP.js'),require('./chunk-Q4CKLXWA.js');var chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function Lt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=Lt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var to="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunkNFYCMDM5_js.z}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunkPK4PDRTA_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunkPK4PDRTA_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunkPK4PDRTA_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunkPK4PDRTA_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunkPK4PDRTA_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunkPK4PDRTA_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunkPK4PDRTA_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunkPK4PDRTA_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunkPK4PDRTA_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkKSYEBTYE_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkKSYEBTYE_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkKSYEBTYE_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkWLQEPVDR_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkWLQEPVDR_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkWLQEPVDR_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkAFMMYLPX_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkWNTT4MGC_js.s}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkWNTT4MGC_js.h}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkWNTT4MGC_js.l}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkCCWOLPZE_js.f}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkCCWOLPZE_js.g}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkCCWOLPZE_js.e}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkC6GSFUV2_js.f}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkKBU6QQFU_js.g}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkKBU6QQFU_js.e}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkKBU6QQFU_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkKBU6QQFU_js.d}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkKBU6QQFU_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkKBU6QQFU_js.h}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkKBU6QQFU_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkKBU6QQFU_js.f}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkKBU6QQFU_js.m}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkKBU6QQFU_js.p}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.e}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.g}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.p}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.j}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.f}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.d}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.i}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.h}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.c}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=to;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;