@eigenpal/docx-js-editor 0.0.28 → 0.0.29

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 (136) hide show
  1. package/dist/{ClipboardManager-BzgQ-SOi.d.cts → ClipboardManager-t936d0KD.d.mts} +1 -1
  2. package/dist/{DocumentAgent-B9FUoSVS.d.cts → DocumentAgent-BqA9EJ3F.d.mts} +1 -1
  3. package/dist/FindReplaceDialog-AQFR4OCT.js +1 -1
  4. package/dist/FindReplaceDialog-N4J5OB7O.mjs +1 -0
  5. package/dist/FootnotePropertiesDialog-UFUIHLDW.mjs +1 -0
  6. package/dist/FootnotePropertiesDialog-YYIZU5U6.js +1 -1
  7. package/dist/HyperlinkDialog-HGZ2S37Z.js +1 -1
  8. package/dist/HyperlinkDialog-YQSQFHOP.mjs +1 -0
  9. package/dist/ImagePositionDialog-DQ4JWS4F.js +1 -1
  10. package/dist/ImagePositionDialog-HT6J2SHV.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-3VK2S2AF.mjs +1 -0
  12. package/dist/ImagePropertiesDialog-GJMGLM6G.js +1 -1
  13. package/dist/PageSetupDialog-3QCVUNDL.mjs +1 -0
  14. package/dist/PageSetupDialog-ZZTFPZKJ.js +1 -1
  15. package/dist/TablePropertiesDialog-FI5E3RCB.mjs +1 -0
  16. package/dist/TablePropertiesDialog-STZOGHJB.js +1 -1
  17. package/dist/chunk-2KHL5RSD.js +3 -3
  18. package/dist/chunk-4VUZBV2S.js +1 -1
  19. package/dist/chunk-6WPRCJ5A.mjs +1 -0
  20. package/dist/chunk-7HZRJTOL.mjs +4 -0
  21. package/dist/chunk-AARNCPWR.js +1 -1
  22. package/dist/chunk-AZRYS2WF.mjs +2 -0
  23. package/dist/chunk-BUEMG4NW.js +1 -1
  24. package/dist/chunk-CQRI4YUS.mjs +26 -0
  25. package/dist/chunk-CTYOM6BE.js +2 -2
  26. package/dist/{chunk-PRBTINOW.js → chunk-DLVLK5FT.mjs} +2 -2
  27. package/dist/chunk-FVUGBRDD.js +1 -1
  28. package/dist/chunk-G72SXG7G.js +258 -0
  29. package/dist/chunk-H5NTJZO4.js +1 -1
  30. package/dist/chunk-I6LFWQFR.mjs +59 -0
  31. package/dist/chunk-IFPN3NT3.js +3 -3
  32. package/dist/chunk-IRO7KGGC.js +59 -0
  33. package/dist/chunk-KCUPCJFL.mjs +111 -0
  34. package/dist/chunk-LYBG4YI7.mjs +1 -0
  35. package/dist/chunk-M5F4SK3W.mjs +1 -0
  36. package/dist/chunk-MRWJ3GNH.js +9 -0
  37. package/dist/chunk-MVCTPHRR.mjs +258 -0
  38. package/dist/chunk-PB7VMDDP.js +24 -0
  39. package/dist/chunk-PJVI53AH.js +2 -2
  40. package/dist/chunk-QAZ4233N.mjs +1 -0
  41. package/dist/{chunk-OJ7NJK46.cjs → chunk-QQ63M65M.js} +1 -1
  42. package/dist/chunk-QTSXJRP6.mjs +1 -0
  43. package/dist/chunk-QVPR2W5S.js +1 -1
  44. package/dist/chunk-SE5EN2QL.js +1 -1
  45. package/dist/chunk-TAUMSKRE.mjs +1 -0
  46. package/dist/{chunk-JO2CKU4O.js → chunk-TDEHAPMZ.mjs} +1 -1
  47. package/dist/chunk-VHWEKJ35.js +10 -0
  48. package/dist/chunk-VR6PT4IZ.js +26 -0
  49. package/dist/chunk-W53SI3XW.mjs +1 -0
  50. package/dist/chunk-WOHFANC5.mjs +3 -0
  51. package/dist/chunk-XGL3EGKF.js +7 -7
  52. package/dist/chunk-XWBCP563.mjs +2 -0
  53. package/dist/{chunk-TOGKKPIW.js → chunk-YGTSQZRK.mjs} +1 -1
  54. package/dist/chunk-Z35FA4M4.mjs +10 -0
  55. package/dist/{clipboard-Cm7udEnb.d.cts → clipboard-BkM7Zvgs.d.mts} +1 -1
  56. package/dist/{colorResolver-Bu7uJqpw.d.cts → colorResolver-BwI_Uxp3.d.mts} +2 -2
  57. package/dist/{core-plugins-reexport.d.cts → core-plugins-reexport.d.mts} +4 -4
  58. package/dist/core-plugins-reexport.js +1 -1
  59. package/dist/core-plugins-reexport.mjs +1 -0
  60. package/dist/{core-reexport.d.cts → core-reexport.d.mts} +11 -11
  61. package/dist/core-reexport.js +1 -1
  62. package/dist/core-reexport.mjs +1 -0
  63. package/dist/executor-L2MVKMXO.js +1 -1
  64. package/dist/executor-XKBCCVNY.mjs +1 -0
  65. package/dist/{fontLoader-X8ocGzeD.d.cts → fontLoader-DicgJidU.d.mts} +1 -1
  66. package/dist/{headless-reexport.d.cts → headless-reexport.d.mts} +7 -7
  67. package/dist/headless-reexport.js +2 -2
  68. package/dist/headless-reexport.mjs +4 -0
  69. package/dist/{index.d.cts → index.d.mts} +14 -14
  70. package/dist/index.d.ts +2 -2
  71. package/dist/index.js +6 -6
  72. package/dist/index.mjs +155 -0
  73. package/dist/lib-BCT2DRYI.mjs +1 -0
  74. package/dist/lib-U35UU4OU.js +1 -1
  75. package/dist/{mcp-reexport.d.cts → mcp-reexport.d.mts} +2 -2
  76. package/dist/mcp-reexport.js +9 -9
  77. package/dist/mcp-reexport.mjs +16 -0
  78. package/dist/processTemplate-5ZST2Q5L.js +1 -0
  79. package/dist/{processTemplate-CGIQEJ26.js → processTemplate-LRHXOWMZ.mjs} +1 -1
  80. package/dist/{react-BgZObIoP.d.ts → react-By80Gfi-.d.ts} +4 -0
  81. package/dist/{react-D9JDP3cV.d.cts → react-C-pJU0Y4.d.mts} +8 -4
  82. package/dist/{react.d.cts → react.d.mts} +5 -5
  83. package/dist/react.d.ts +1 -1
  84. package/dist/react.js +1 -1
  85. package/dist/react.mjs +1 -0
  86. package/dist/{registry-Bxb5ZI1z.d.cts → registry-DyIMyB-0.d.mts} +1 -1
  87. package/dist/selectionRects-6TRAXB7D.js +1 -0
  88. package/dist/selectionRects-IS7ZAS3A.mjs +1 -0
  89. package/dist/{types-D03hsi5t.d.cts → types-B3LkfO0u.d.mts} +1 -1
  90. package/dist/{ui.d.cts → ui.d.mts} +3 -3
  91. package/dist/ui.js +1 -1
  92. package/dist/ui.mjs +1 -0
  93. package/dist/{variableDetector-iGl52A6q.d.cts → variableDetector-CIqTek7A.d.mts} +1 -1
  94. package/package.json +17 -18
  95. package/dist/FindReplaceDialog-J3DI3U5I.cjs +0 -1
  96. package/dist/FootnotePropertiesDialog-DO5DCAW6.cjs +0 -1
  97. package/dist/HyperlinkDialog-PEPS3C2G.cjs +0 -1
  98. package/dist/ImagePositionDialog-UYXYHSP4.cjs +0 -1
  99. package/dist/ImagePropertiesDialog-V6SVKINO.cjs +0 -1
  100. package/dist/PageSetupDialog-RLMYJ3BA.cjs +0 -1
  101. package/dist/TablePropertiesDialog-A36OXG3A.cjs +0 -1
  102. package/dist/chunk-2FYTKTQL.cjs +0 -111
  103. package/dist/chunk-2VHQ7YOQ.cjs +0 -1
  104. package/dist/chunk-3YHC2RAO.js +0 -258
  105. package/dist/chunk-63YB7DGI.js +0 -59
  106. package/dist/chunk-7OCUAFPO.cjs +0 -258
  107. package/dist/chunk-HE3SUXOQ.cjs +0 -4
  108. package/dist/chunk-HRUPO723.js +0 -10
  109. package/dist/chunk-IA4LPH2A.cjs +0 -1
  110. package/dist/chunk-JMR5HNJP.cjs +0 -10
  111. package/dist/chunk-KR32M3S4.cjs +0 -1
  112. package/dist/chunk-MSV5LTHM.cjs +0 -9
  113. package/dist/chunk-NLYEW36R.js +0 -26
  114. package/dist/chunk-NVAQQYBJ.cjs +0 -1
  115. package/dist/chunk-P7ZF45KZ.cjs +0 -1
  116. package/dist/chunk-PCJ5ACUV.cjs +0 -1
  117. package/dist/chunk-PVV7DV3L.cjs +0 -59
  118. package/dist/chunk-QDNL7NWN.cjs +0 -3
  119. package/dist/chunk-VPDOOMUJ.cjs +0 -26
  120. package/dist/chunk-VTAS7VZ6.cjs +0 -2
  121. package/dist/chunk-XKBIFFAS.cjs +0 -24
  122. package/dist/chunk-XS2AQFMF.cjs +0 -2
  123. package/dist/chunk-YS7FDEZ4.cjs +0 -1
  124. package/dist/core-plugins-reexport.cjs +0 -1
  125. package/dist/core-reexport.cjs +0 -1
  126. package/dist/executor-JGWZ7S6Z.cjs +0 -1
  127. package/dist/headless-reexport.cjs +0 -4
  128. package/dist/index.cjs +0 -155
  129. package/dist/lib-SPXD4LFI.cjs +0 -1
  130. package/dist/mcp-reexport.cjs +0 -16
  131. package/dist/processTemplate-FOYV6BC5.cjs +0 -1
  132. package/dist/react.cjs +0 -1
  133. package/dist/selectionRects-BMXJJCPJ.cjs +0 -1
  134. package/dist/selectionRects-TWK7CAC3.js +0 -1
  135. package/dist/ui.cjs +0 -1
  136. /package/dist/{agentApi-BVHzyk2l.d.cts → agentApi-BVHzyk2l.d.mts} +0 -0
@@ -0,0 +1,2 @@
1
+ import {useState,useCallback,useRef,useEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function _(){return {matchCase:false,matchWholeWord:false,useRegex:false}}function H(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X(e,n){if(!e)return null;try{let t;n.useRegex?t=e:t=H(e),n.matchWholeWord&&(t=`\\b${t}\\b`);let c=n.matchCase?"g":"gi";return new RegExp(t,c)}catch{return null}}function D(e,n,t){if(!e||!n)return [];let c=[],i=n;t.matchCase||(i=n.toLowerCase());let f=v=>v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d;t.matchWholeWord?d=`\\b${f(i)}\\b`:d=f(i);let s=t.matchCase?"g":"gi",p=new RegExp(d,s),h;for(;(h=p.exec(e))!==null;)c.push({start:h.index,end:h.index+h[0].length}),h[0].length===0&&p.lastIndex++;return c}function me(e,n,t,c){let i=X(n,c);return i?e.replace(i,t):e}function be(e,n,t,c,i=0){let f=D(e,n,c),d=f.find(p=>p.start>=i)||f[0];return d?{content:e.substring(0,d.start)+t+e.substring(d.end),replaced:true,matchStart:d.start,matchEnd:d.start+t.length}:{content:e,replaced:false,matchStart:-1,matchEnd:-1}}function Se(e){return e?e.totalCount===0?"No results":e.totalCount===1?"1 match":`${e.currentIndex+1} of ${e.totalCount} matches`:""}function ye(e){return !e||e.trim()===""}function Ce(){return {currentMatchColor:"#FFFF00",otherMatchColor:"#FFFFAA"}}function k(e){if(!e||!e.content)return "";let n="";for(let t of e.content)t.type==="text"?n+=t.text||"":t.type==="tab"?n+=" ":t.type==="break"&&t.breakType==="textWrapping"&&(n+=`
2
+ `);return n}function Fe(e){if(!e||!e.content)return "";let n="";for(let t of e.content)if(t.type==="run")n+=k(t);else if(t.type==="hyperlink")for(let c of t.children||[])c.type==="run"&&(n+=k(c));return n}function Re(e,n,t){if(!e||!n)return [];let c=[],i=e.package?.document||e.package?.document;if(!i||!i.content)return c;let f=0;for(let d of i.content)if(d.type==="paragraph"){let s=q(d,n,t,f);c.push(...s),f++;}else if(d.type==="table")for(let s of d.rows||[])for(let p of s.cells||[])for(let h of p.content||[])h.type;return c}function q(e,n,t,c){let i=[],f=Fe(e);if(!f)return i;let d=D(f,n,t);for(let s of d){let p=Te(e,s.start);i.push({paragraphIndex:c,contentIndex:p.contentIndex,startOffset:p.offsetInContent,endOffset:p.offsetInContent+(s.end-s.start),text:f.substring(s.start,s.end)});}return i}function Te(e,n){if(!e||!e.content)return {contentIndex:0,runIndex:0,offsetInContent:n};let t=0,c=0;for(let i of e.content){let f="";if(i.type==="run")f=k(i);else if(i.type==="hyperlink")for(let s of i.children||[])s.type==="run"&&(f+=k(s));let d=f.length;if(t+d>n)return {contentIndex:c,runIndex:c,offsetInContent:n-t};t+=d,c++;}return {contentIndex:Math.max(0,e.content.length-1),runIndex:Math.max(0,e.content.length-1),offsetInContent:0}}function Ie(e,n){if(!e||!n)return;let t=e.querySelector(`[data-paragraph-index="${n.paragraphIndex}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"center"});}function Ee(e){let[n,t]=useState({isOpen:false,searchText:"",replaceText:"",options:_(),matches:[],currentIndex:0,replaceMode:e?.initialReplaceMode??false}),c=useCallback(o=>{t(r=>({...r,isOpen:true,replaceMode:false,searchText:o||r.searchText,matches:[],currentIndex:0}));},[]),i=useCallback(o=>{t(r=>({...r,isOpen:true,replaceMode:true,searchText:o||r.searchText,matches:[],currentIndex:0}));},[]),f=useCallback(()=>{t(o=>({...o,isOpen:false}));},[]),d=useCallback(()=>{t(o=>({...o,isOpen:!o.isOpen}));},[]),s=useCallback(o=>{t(r=>({...r,searchText:o}));},[]),p=useCallback(o=>{t(r=>({...r,replaceText:o}));},[]),h=useCallback(o=>{t(r=>({...r,options:{...r.options,...o}}));},[]),v=useCallback((o,r=0)=>{let E=Math.max(0,Math.min(r,o.length-1));t(L=>({...L,matches:o,currentIndex:o.length>0?E:0})),e?.onMatchesChange?.(o),o.length>0?e?.onCurrentMatchChange?.(o[E],E):e?.onCurrentMatchChange?.(null,-1);},[e]),M=useCallback(()=>{let o=0;return t(r=>r.matches.length===0?r:(o=(r.currentIndex+1)%r.matches.length,{...r,currentIndex:o})),o},[]),N=useCallback(()=>{let o=0;return t(r=>r.matches.length===0?r:(o=r.currentIndex===0?r.matches.length-1:r.currentIndex-1,{...r,currentIndex:o})),o},[]),w=useCallback(o=>{t(r=>r.matches.length===0||o<0||o>=r.matches.length?r:{...r,currentIndex:o});},[]),x=useCallback(()=>n.matches.length===0?null:n.matches[n.currentIndex]||null,[n.matches,n.currentIndex]),O=useCallback(()=>n.matches.length>0,[n.matches.length]);return {state:n,openFind:c,openReplace:i,close:f,toggle:d,setSearchText:s,setReplaceText:p,setOptions:h,setMatches:v,goToNextMatch:M,goToPreviousMatch:N,goToMatch:w,getCurrentMatch:x,hasMatches:O}}var Me={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent",display:"flex",alignItems:"flex-start",justifyContent:"flex-end",zIndex:1e4,pointerEvents:"none"},Oe={backgroundColor:"white",borderRadius:"4px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.2)",minWidth:"360px",maxWidth:"440px",width:"100%",margin:"60px 20px 20px 20px",pointerEvents:"auto"},Le={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg-subtle)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},ke={margin:0,fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},Ne={background:"none",border:"none",fontSize:"18px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"2px 6px",lineHeight:1},we={padding:"16px"},Q={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},Z={width:"60px",fontSize:"13px",color:"var(--doc-text)",flexShrink:0},Y={flex:1,padding:"8px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",fontSize:"13px",boxSizing:"border-box",outline:"none"},ee={...Y,borderColor:"var(--doc-link)",boxShadow:"0 0 0 2px rgba(5, 99, 193, 0.1)"},Pe={display:"flex",flexDirection:"column",gap:"6px",marginLeft:"8px"},B={padding:"6px 12px",borderRadius:"3px",fontSize:"12px",fontWeight:500,cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)",minWidth:"80px",textAlign:"center"},te={...B,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text-placeholder)",cursor:"not-allowed"},U={padding:"6px 10px",borderRadius:"3px",fontSize:"14px",cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)"},ne={...U,color:"var(--doc-border-input)",cursor:"not-allowed"},_e={display:"flex",gap:"16px",marginTop:"4px",marginLeft:"68px"},W={display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--doc-text-muted)",cursor:"pointer"},oe={width:"14px",height:"14px",cursor:"pointer"},re={marginLeft:"68px",fontSize:"12px",color:"var(--doc-text-muted)",marginBottom:"8px"},De={...re,color:"var(--doc-error)"},Ae=({style:e})=>jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:e,children:jsx("polyline",{points:"18 15 12 9 6 15"})}),We=({style:e})=>jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:e,children:jsx("polyline",{points:"6 9 12 15 18 9"})});function Ye({isOpen:e,onClose:n,onFind:t,onFindNext:c,onFindPrevious:i,onReplace:f,onReplaceAll:d,onHighlightMatches:s,onClearHighlights:p,initialSearchText:h="",replaceMode:v=false,currentResult:M,className:N,style:w}){let[x,O]=useState(""),[o,r]=useState(""),[E,L]=useState(v),[C,ae]=useState(false),[F,ce]=useState(false),[l,R]=useState(null),[ie,K]=useState(false),[se,z]=useState(false),P=useRef(null),$=useRef(null);useEffect(()=>{M!==void 0&&R(M);},[M]),useEffect(()=>{if(e){if(O(h),r(""),L(v),R(null),setTimeout(()=>{P.current?.focus(),P.current?.select();},100),h){let a=t(h,{matchCase:C,matchWholeWord:F});R(a),a?.matches&&s&&s(a.matches);}}else p&&p();},[e,h,v]);let S=useCallback(()=>{if(!x.trim()){R(null),p&&p();return}let a=t(x,{matchCase:C,matchWholeWord:F});R(a),a?.matches&&s?s(a.matches):p&&p();},[x,C,F,t,s,p]);useEffect(()=>{e&&x.trim()&&S();},[C,F]);let le=useCallback(a=>{O(a.target.value);},[]),de=useCallback(a=>{a.key==="Enter"?(a.preventDefault(),a.shiftKey?V():l?G():S()):a.key==="Escape"&&n();},[l,S,n]),pe=useCallback(a=>{a.key==="Enter"?(a.preventDefault(),j()):a.key==="Escape"&&n();},[n]),G=useCallback(()=>{if(!x.trim()){S();return}if(!l){S();return}if(c()&&l){let y=(l.currentIndex+1)%l.totalCount;R({...l,currentIndex:y});}},[x,l,S,c]),V=useCallback(()=>{if(!x.trim()){S();return}if(!l){S();return}if(i()&&l){let y=l.currentIndex===0?l.totalCount-1:l.currentIndex-1;R({...l,currentIndex:y});}},[x,l,S,i]),j=useCallback(()=>{if(!l||l.totalCount===0)return;if(f(o)){let y=t(x,{matchCase:C,matchWholeWord:F});R(y),y?.matches&&s&&s(y.matches);}},[l,o,x,C,F,f,t,s]),ue=useCallback(()=>{if(!x.trim())return;d(x,o,{matchCase:C,matchWholeWord:F})>0&&(R({matches:[],totalCount:0,currentIndex:-1}),p&&p());},[x,o,C,F,d,p]),fe=useCallback(()=>{L(a=>{let y=!a;return y&&setTimeout(()=>$.current?.focus(),100),y});},[]),xe=useCallback(a=>{a.target,a.currentTarget;},[]),he=useCallback(a=>{a.key==="Escape"&&n();},[n]);if(!e)return null;let T=l&&l.totalCount>0,ge=l&&l.totalCount===0&&x.trim();return jsx("div",{className:`docx-find-replace-dialog-overlay ${N||""}`,style:{...Me,...w},onClick:xe,onKeyDown:he,children:jsxs("div",{className:"docx-find-replace-dialog","data-testid":"find-replace-dialog",style:Oe,role:"dialog","aria-modal":"false","aria-labelledby":"find-replace-dialog-title",children:[jsxs("div",{className:"docx-find-replace-dialog-header",style:Le,children:[jsx("h2",{id:"find-replace-dialog-title",style:ke,children:E?"Find and Replace":"Find"}),jsx("button",{type:"button",className:"docx-find-replace-dialog-close",style:Ne,onClick:n,"aria-label":"Close dialog",children:"\xD7"})]}),jsxs("div",{className:"docx-find-replace-dialog-body",style:we,children:[jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[jsx("label",{htmlFor:"find-text",style:Z,children:"Find:"}),jsx("input",{ref:P,id:"find-text",type:"text",className:"docx-find-replace-dialog-input",style:ie?ee:Y,value:x,onChange:le,onKeyDown:de,onFocus:()=>K(true),onBlur:()=>{K(false),x.trim()&&!l&&S();},placeholder:"Enter text to find...","aria-label":"Find text"}),jsxs("div",{style:{display:"flex",gap:"4px"},children:[jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:T?U:ne,onClick:V,disabled:!T,"aria-label":"Find previous",title:"Find Previous (Shift+Enter)",children:jsx(Ae,{})}),jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:T?U:ne,onClick:G,disabled:!T,"aria-label":"Find next",title:"Find Next (Enter)",children:jsx(We,{})})]})]}),T&&jsxs("div",{className:"docx-find-replace-dialog-status",style:re,children:[l.currentIndex+1," of ",l.totalCount," matches"]}),ge&&jsx("div",{className:"docx-find-replace-dialog-status",style:De,children:"No results found"}),E&&jsx(Fragment,{children:jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[jsx("label",{htmlFor:"replace-text",style:Z,children:"Replace:"}),jsx("input",{ref:$,id:"replace-text",type:"text",className:"docx-find-replace-dialog-input",style:se?ee:Y,value:o,onChange:a=>r(a.target.value),onKeyDown:pe,onFocus:()=>z(true),onBlur:()=>z(false),placeholder:"Enter replacement text...","aria-label":"Replace text"}),jsxs("div",{style:Pe,children:[jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:T?B:te,onClick:j,disabled:!T,title:"Replace current match",children:"Replace"}),jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:T?B:te,onClick:ue,disabled:!T,title:"Replace all matches",children:"Replace All"})]})]})}),jsxs("div",{className:"docx-find-replace-dialog-options",style:_e,children:[jsxs("label",{className:"docx-find-replace-dialog-option",style:W,children:[jsx("input",{type:"checkbox",style:oe,checked:C,onChange:a=>ae(a.target.checked)}),"Match case"]}),jsxs("label",{className:"docx-find-replace-dialog-option",style:W,children:[jsx("input",{type:"checkbox",style:oe,checked:F,onChange:a=>ce(a.target.checked)}),"Whole words"]}),!E&&jsx("button",{type:"button",style:{...W,background:"none",border:"none",cursor:"pointer",color:"var(--doc-link)",padding:0},onClick:fe,children:"+ Replace"})]})]})]})})}var je=Ye;export{_ as a,H as b,X as c,D as d,me as e,be as f,Se as g,ye as h,Ce as i,Re as j,q as k,Ie as l,Ee as m,Ye as n,je as o};
@@ -1,4 +1,4 @@
1
- import {a as a$1}from'./chunk-HRUPO723.js';import {j,c,d,g,e,k as k$1,i,f,l}from'./chunk-63YB7DGI.js';import {b,a as a$2}from'./chunk-AARNCPWR.js';import {a,n}from'./chunk-NLYEW36R.js';import {d as d$1}from'./chunk-H5NTJZO4.js';function G(r,t){let e=et(t),n=new RegExp(`<w:p[\\s][^>]*w14:paraId="${e}"`,"g"),a=[],o;for(;(o=n.exec(r))!==null;)a.push(o.index);if(a.length===0||a.length>1)return null;let s=a[0],i=s,c=0;for(;i<r.length;){let l=r.indexOf("<",i);if(l===-1)break;if(r.startsWith("<w:p",l)){let u=r[l+4];if(u===">"||u===" "||u==="/"){let g=r.indexOf(">",l);if(g===-1)break;if(r[g-1]==="/"){if(c===0)return {start:s,end:g+1};i=g+1;}else c++,i=g+1;}else i=l+1;}else if(r.startsWith("</w:p>",l)){if(c--,c===0)return {start:s,end:l+6};i=l+6;}else i=l+1;}return null}function Q(r,t){let e=G(r,t);return e?r.substring(e.start,e.end):null}function q(r){let t=0,e=/<w:p[\s>]/g,n;for(;(n=e.exec(r))!==null;){let a=n.index,o=r[a+4];(o===">"||o===" ")&&t++;}return t}function X(r){let t=new Map,e=/w14:paraId="([^"]+)"/g,n;for(;(n=e.exec(r))!==null;){let a=n[1];t.set(a,(t.get(a)||0)+1);}return t}function tt(r,t,e){if(e.size===0)return {safe:true};let n=X(r),a=X(t);for(let i of e){let c=n.get(i)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-original: ${i}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-original: ${i}`}}for(let i of e){let c=a.get(i)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${i}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${i}`}}let o=q(r),s=q(t);return o!==s?{safe:false,reason:`paragraph-count-mismatch: original=${o}, serialized=${s}`}:{safe:true}}function Z(r,t,e){if(e.size===0)return r;if(!tt(r,t,e).safe)return null;let a=[];for(let s of e){let i=G(r,s);if(!i)return null;let c=Q(t,s);if(!c)return null;a.push({start:i.start,end:i.end,newXml:c});}a.sort((s,i)=>i.start-s.start);let o=r;for(let{start:s,end:i,newXml:c}of a)o=o.substring(0,s)+c+o.substring(i);return o}function et(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(r){for(let t of r)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing"&&n.image?.src?.startsWith("data:")&&!n.image?.rId)return true}else if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true}else if(t.type==="table"){for(let e of t.rows)for(let n of e.cells)if(J(n.content))return true}return false}async function Y(r,t,e$1){let{changedParaIds:n,structuralChange:a$1,hasUntrackedChanges:o}=e$1;if(a$1||o||!t)return null;let s=r.package.document.content;if(J(s))return null;let i$1=r.package.document.comments,c$1=i$1&&i$1.length>0,l=j(r);try{let g$1=await(await import('./lib-U35UU4OU.js')).default.loadAsync(t),f=new Map;if(n.size>0){let p=g$1.file("word/document.xml");if(!p)return null;let m=await p.async("text"),b=c(r),d=Z(m,b,n);if(!d)return null;f.set("word/document.xml",d);}if(c$1){f.set("word/comments.xml",d(i$1));let p=g$1.file("[Content_Types].xml");if(p){let d=await p.async("text");d.includes("/word/comments.xml")||f.set("[Content_Types].xml",d.replace("</Types>",`<Override PartName="/word/comments.xml" ContentType="${g}"/></Types>`));}let m="word/_rels/document.xml.rels",b=g$1.file(m);if(b){let d=await b.async("text");if(!d.includes("comments.xml")){let x=e(d);f.set(m,d.replace("</Relationships>",`<Relationship Id="rId${x+1}" Type="${a.comments}" Target="comments.xml"/></Relationships>`));}}}for(let[p,m]of l)f.set(p,m);let y=g$1.file("docProps/core.xml");if(y){let p=await y.async("text");f.set("docProps/core.xml",k$1(p,{updateModifiedDate:!0}));}return await i(g$1,f)}catch{return null}}function nt(){return [{styleId:"Normal",type:"paragraph",name:"Normal",default:true,qFormat:true,uiPriority:0,rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},{styleId:"Title",type:"paragraph",name:"Title",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:10,rPr:{fontSize:52,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Subtitle",type:"paragraph",name:"Subtitle",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:11,rPr:{fontSize:30,color:{rgb:"666666"},fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Heading1",type:"paragraph",name:"Heading 1",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:40,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:400,spaceAfter:120,lineSpacing:240}},{styleId:"Heading2",type:"paragraph",name:"Heading 2",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:32,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:360,spaceAfter:80,lineSpacing:240}},{styleId:"Heading3",type:"paragraph",name:"Heading 3",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:28,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:320,spaceAfter:80,lineSpacing:240}},{styleId:"Heading4",type:"paragraph",name:"Heading 4",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:24,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:280,spaceAfter:80,lineSpacing:240}}]}function rt(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function at(r={}){let t=rt();r.pageWidth!==void 0&&(t.pageWidth=r.pageWidth),r.pageHeight!==void 0&&(t.pageHeight=r.pageHeight),r.orientation!==void 0&&(t.orientation=r.orientation),r.marginTop!==void 0&&(t.marginTop=r.marginTop),r.marginBottom!==void 0&&(t.marginBottom=r.marginBottom),r.marginLeft!==void 0&&(t.marginLeft=r.marginLeft),r.marginRight!==void 0&&(t.marginRight=r.marginRight);let e={type:"text",text:r.initialText||""};return {package:{document:{content:[{type:"paragraph",content:[{type:"run",content:r.initialText?[e]:[],formatting:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}}}],formatting:{lineSpacing:276}}],finalSectionProperties:t},styles:{docDefaults:{rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},styles:nt()}},templateVariables:[],warnings:[]}}function Wt(r,t={}){return at({...t,initialText:r})}var T=class r{constructor(t){d$1(this,"_document");d$1(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await n(t);return new r(e)}static fromDocument(t){return new r(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$1(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:n,name:o.name||n,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(s=>s.type==="paragraph"),a=n.map((s,i)=>{let c=this._getParagraphText(s),l=s.formatting?.styleId;return {index:i,preview:c.slice(0,t),style:l,isHeading:l?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(l),isListItem:!!s.listRendering,isEmpty:c.trim().length===0}}),o=(e.sections||[]).map((s,i)=>({index:i,paragraphCount:s.content?.length||0,pageSize:s.properties?.pageWidth&&s.properties?.pageHeight?{width:s.properties.pageWidth,height:s.properties.pageHeight}:void 0,isLandscape:s.properties?.orientation==="landscape",hasHeader:!!s.properties?.headerReferences?.length,hasFooter:!!s.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:a,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let a={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(a)}replaceRange(t,e,n={}){let a={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(a)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,a={}){let o={type:"insertTable",position:t,rows:e,columns:n,data:a.data,hasHeader:a.hasHeader};return this._executeCommand(o)}insertImage(t,e,n={}){let a={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(a)}insertHyperlink(t,e,n={}){let a={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(a)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n$1=this._document.originalBuffer;if(!n$1)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:a}=await import('./processTemplate-CGIQEJ26.js'),o=a(n$1,e),s=await n(o),i=new r(s);return i._pendingVariables={},i}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await Y(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await f(this._document);return this._document.originalBuffer=e,e}return l(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new r(b(this._document,t))}_executeCommand(t){let e=new r(a$2(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
1
+ import {a as a$1}from'./chunk-Z35FA4M4.mjs';import {j,c,d,g,e,k as k$1,i,f,l}from'./chunk-I6LFWQFR.mjs';import {b,a as a$2}from'./chunk-M5F4SK3W.mjs';import {a,n}from'./chunk-CQRI4YUS.mjs';import {d as d$1}from'./chunk-TAUMSKRE.mjs';function G(r,t){let e=et(t),n=new RegExp(`<w:p[\\s][^>]*w14:paraId="${e}"`,"g"),a=[],o;for(;(o=n.exec(r))!==null;)a.push(o.index);if(a.length===0||a.length>1)return null;let s=a[0],i=s,c=0;for(;i<r.length;){let l=r.indexOf("<",i);if(l===-1)break;if(r.startsWith("<w:p",l)){let u=r[l+4];if(u===">"||u===" "||u==="/"){let g=r.indexOf(">",l);if(g===-1)break;if(r[g-1]==="/"){if(c===0)return {start:s,end:g+1};i=g+1;}else c++,i=g+1;}else i=l+1;}else if(r.startsWith("</w:p>",l)){if(c--,c===0)return {start:s,end:l+6};i=l+6;}else i=l+1;}return null}function Q(r,t){let e=G(r,t);return e?r.substring(e.start,e.end):null}function q(r){let t=0,e=/<w:p[\s>]/g,n;for(;(n=e.exec(r))!==null;){let a=n.index,o=r[a+4];(o===">"||o===" ")&&t++;}return t}function X(r){let t=new Map,e=/w14:paraId="([^"]+)"/g,n;for(;(n=e.exec(r))!==null;){let a=n[1];t.set(a,(t.get(a)||0)+1);}return t}function tt(r,t,e){if(e.size===0)return {safe:true};let n=X(r),a=X(t);for(let i of e){let c=n.get(i)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-original: ${i}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-original: ${i}`}}for(let i of e){let c=a.get(i)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${i}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${i}`}}let o=q(r),s=q(t);return o!==s?{safe:false,reason:`paragraph-count-mismatch: original=${o}, serialized=${s}`}:{safe:true}}function Z(r,t,e){if(e.size===0)return r;if(!tt(r,t,e).safe)return null;let a=[];for(let s of e){let i=G(r,s);if(!i)return null;let c=Q(t,s);if(!c)return null;a.push({start:i.start,end:i.end,newXml:c});}a.sort((s,i)=>i.start-s.start);let o=r;for(let{start:s,end:i,newXml:c}of a)o=o.substring(0,s)+c+o.substring(i);return o}function et(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(r){for(let t of r)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing"&&n.image?.src?.startsWith("data:")&&!n.image?.rId)return true}else if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true}else if(t.type==="table"){for(let e of t.rows)for(let n of e.cells)if(J(n.content))return true}return false}async function Y(r,t,e$1){let{changedParaIds:n,structuralChange:a$1,hasUntrackedChanges:o}=e$1;if(a$1||o||!t)return null;let s=r.package.document.content;if(J(s))return null;let i$1=r.package.document.comments,c$1=i$1&&i$1.length>0,l=j(r);try{let g$1=await(await import('./lib-BCT2DRYI.mjs')).default.loadAsync(t),f=new Map;if(n.size>0){let p=g$1.file("word/document.xml");if(!p)return null;let m=await p.async("text"),b=c(r),d=Z(m,b,n);if(!d)return null;f.set("word/document.xml",d);}if(c$1){f.set("word/comments.xml",d(i$1));let p=g$1.file("[Content_Types].xml");if(p){let d=await p.async("text");d.includes("/word/comments.xml")||f.set("[Content_Types].xml",d.replace("</Types>",`<Override PartName="/word/comments.xml" ContentType="${g}"/></Types>`));}let m="word/_rels/document.xml.rels",b=g$1.file(m);if(b){let d=await b.async("text");if(!d.includes("comments.xml")){let x=e(d);f.set(m,d.replace("</Relationships>",`<Relationship Id="rId${x+1}" Type="${a.comments}" Target="comments.xml"/></Relationships>`));}}}for(let[p,m]of l)f.set(p,m);let y=g$1.file("docProps/core.xml");if(y){let p=await y.async("text");f.set("docProps/core.xml",k$1(p,{updateModifiedDate:!0}));}return await i(g$1,f)}catch{return null}}function nt(){return [{styleId:"Normal",type:"paragraph",name:"Normal",default:true,qFormat:true,uiPriority:0,rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},{styleId:"Title",type:"paragraph",name:"Title",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:10,rPr:{fontSize:52,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Subtitle",type:"paragraph",name:"Subtitle",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:11,rPr:{fontSize:30,color:{rgb:"666666"},fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Heading1",type:"paragraph",name:"Heading 1",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:40,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:400,spaceAfter:120,lineSpacing:240}},{styleId:"Heading2",type:"paragraph",name:"Heading 2",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:32,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:360,spaceAfter:80,lineSpacing:240}},{styleId:"Heading3",type:"paragraph",name:"Heading 3",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:28,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:320,spaceAfter:80,lineSpacing:240}},{styleId:"Heading4",type:"paragraph",name:"Heading 4",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:24,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:280,spaceAfter:80,lineSpacing:240}}]}function rt(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function at(r={}){let t=rt();r.pageWidth!==void 0&&(t.pageWidth=r.pageWidth),r.pageHeight!==void 0&&(t.pageHeight=r.pageHeight),r.orientation!==void 0&&(t.orientation=r.orientation),r.marginTop!==void 0&&(t.marginTop=r.marginTop),r.marginBottom!==void 0&&(t.marginBottom=r.marginBottom),r.marginLeft!==void 0&&(t.marginLeft=r.marginLeft),r.marginRight!==void 0&&(t.marginRight=r.marginRight);let e={type:"text",text:r.initialText||""};return {package:{document:{content:[{type:"paragraph",content:[{type:"run",content:r.initialText?[e]:[],formatting:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}}}],formatting:{lineSpacing:276}}],finalSectionProperties:t},styles:{docDefaults:{rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},styles:nt()}},templateVariables:[],warnings:[]}}function Wt(r,t={}){return at({...t,initialText:r})}var T=class r{constructor(t){d$1(this,"_document");d$1(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await n(t);return new r(e)}static fromDocument(t){return new r(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$1(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:n,name:o.name||n,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(s=>s.type==="paragraph"),a=n.map((s,i)=>{let c=this._getParagraphText(s),l=s.formatting?.styleId;return {index:i,preview:c.slice(0,t),style:l,isHeading:l?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(l),isListItem:!!s.listRendering,isEmpty:c.trim().length===0}}),o=(e.sections||[]).map((s,i)=>({index:i,paragraphCount:s.content?.length||0,pageSize:s.properties?.pageWidth&&s.properties?.pageHeight?{width:s.properties.pageWidth,height:s.properties.pageHeight}:void 0,isLandscape:s.properties?.orientation==="landscape",hasHeader:!!s.properties?.headerReferences?.length,hasFooter:!!s.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:a,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let a={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(a)}replaceRange(t,e,n={}){let a={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(a)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,a={}){let o={type:"insertTable",position:t,rows:e,columns:n,data:a.data,hasHeader:a.hasHeader};return this._executeCommand(o)}insertImage(t,e,n={}){let a={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(a)}insertHyperlink(t,e,n={}){let a={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(a)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n$1=this._document.originalBuffer;if(!n$1)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:a}=await import('./processTemplate-LRHXOWMZ.mjs'),o=a(n$1,e),s=await n(o),i=new r(s);return i._pendingVariables={},i}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await Y(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await f(this._document);return this._document.originalBuffer=e,e}return l(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new r(b(this._document,t))}_executeCommand(t){let e=new r(a$2(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
2
2
  `)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let a of n.cells)for(let o of a.content)o.type==="paragraph"&&e.push(this._getParagraphText(o));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let a=this._getRunText(n);a&&e.push({text:a,formatting:n.formatting});}else if(n.type==="hyperlink"){let a=n.href||"";for(let o of n.children)if(o.type==="run"){let s=this._getRunText(o);s&&e.push({text:s,formatting:o.formatting,isHyperlink:true,hyperlinkUrl:a});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let a of n.content)if(a.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Gt(r){return T.fromBuffer(r)}function Zt(r){return T.fromDocument(r)}function ot(r,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,a=r.package.document,o=a.content.filter(m=>m.type==="paragraph"),s=it(o,e,n),i=a$1(r),c=st(r),l=ct(a),u=lt(a),g=pt(a),f=a.content.some(m=>m.type==="table"),y=ft(a),p=mt(a);return {paragraphCount:o.length,wordCount:u,characterCount:g,variables:i,variableCount:i.length,availableStyles:c,outline:s,sections:l,hasTables:f,hasImages:y,hasHyperlinks:p}}function Qt(r,t,e={}){let{contextChars:n=200,includeSuggestions:a=true}=e,s=r.package.document.content.filter(x=>x.type==="paragraph"),i=s[t.start.paragraphIndex];if(!i)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=h(i),l="";if(t.start.paragraphIndex===t.end.paragraphIndex)l=c.slice(t.start.offset,t.end.offset);else {let x=[];for(let C=t.start.paragraphIndex;C<=t.end.paragraphIndex;C++){let H=s[C];if(!H)continue;let w=h(H);C===t.start.paragraphIndex?x.push(w.slice(t.start.offset)):C===t.end.paragraphIndex?x.push(w.slice(0,t.end.offset)):x.push(w);}l=x.join(`
3
3
  `);}let u=yt(s,t.start.paragraphIndex,t.start.offset,n),g=xt(s,t.end.paragraphIndex,t.end.offset,n),f=bt(i,t.start.offset),y=i.formatting||{},p={index:t.start.paragraphIndex,fullText:c,style:i.formatting?.styleId,wordCount:F(c)},m=false,b=Pt(i,t.start.offset),d=a?Ct(l):[];return {selectedText:l,range:t,formatting:f,paragraphFormatting:y,textBefore:u,textAfter:g,paragraph:p,inTable:m,inHyperlink:b,suggestedActions:d}}function K(r){let t=ot(r,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(a=>a.isHeading);if(n.length>0){e.push(`
4
4
  Headings:`);for(let a of n.slice(0,5)){let o=a.headingLevel||1;e.push(`${" ".repeat(o-1)}- ${a.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function it(r,t,e){let n=[];for(let a=0;a<Math.min(r.length,e);a++){let o=r[a],s=h(o),i=o.formatting?.styleId;n.push({index:a,preview:s.slice(0,t),style:i,isHeading:dt(i),headingLevel:ht(i),isListItem:!!o.listRendering,isEmpty:s.trim().length===0});}return n}function st(r){let t=r.package.styles;if(!t?.styles)return [];let e=[];for(let[n,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:n,name:o.name||n,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}function ct(r){return r.sections?r.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function lt(r){let t=0;for(let e of r.content)if(e.type==="paragraph"){let n=h(e);t+=F(n);}else e.type==="table"&&(t+=ut(e));return t}function F(r){return r.split(/\s+/).filter(e=>e.length>0).length}function pt(r){let t=0;for(let e of r.content)if(e.type==="paragraph"){let n=h(e);t+=n.length;}else e.type==="table"&&(t+=gt(e));return t}function ut(r){let t=0;for(let e of r.rows)for(let n of e.cells)for(let a of n.content)if(a.type==="paragraph"){let o=h(a);t+=F(o);}return t}function gt(r){let t=0;for(let e of r.rows)for(let n of e.cells)for(let a of n.content)if(a.type==="paragraph"){let o=h(a);t+=o.length;}return t}function h(r){let t=[];for(let e of r.content)e.type==="run"?t.push(k(e)):e.type==="hyperlink"&&t.push(v(e));return t.join("")}function k(r){return r.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function v(r){let t=[];for(let e of r.children)e.type==="run"&&t.push(k(e));return t.join("")}function ft(r){for(let t of r.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function mt(r){for(let t of r.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function dt(r){return r?r.toLowerCase().includes("heading"):false}function ht(r){if(!r)return;let t=r.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function yt(r,t,e,n){let a=[],o=0,s=r[t];if(s){let l=h(s).slice(0,e);a.unshift(l),o+=l.length;}for(let c=t-1;c>=0&&o<n;c--){let l=r[c];if(!l)continue;let u=h(l);a.unshift(u),o+=u.length;}let i=a.join(`
@@ -0,0 +1,10 @@
1
+ import {b as b$1,f as f$1}from'./chunk-DLVLK5FT.mjs';import {n}from'./chunk-CQRI4YUS.mjs';function H(e){return g(e).variables}function g(e){let t=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(e.package?.document){let r=$(e.package.document);r.forEach(o=>{t.push({name:o,location:"body"});}),n.body=Array.from(new Set(r)).sort();}if(e.package?.document?.sections&&e.package.document.sections.forEach((r,o)=>{r.properties.headerReferences&&r.properties.headerReferences.forEach(i=>{});}),e.package?.footnotes){let r=D(e.package.footnotes);r.forEach(o=>{t.push({name:o,location:"footnote"});}),n.footnotes=Array.from(new Set(r)).sort();}if(e.package?.endnotes){let r=D(e.package.endnotes);r.forEach(o=>{t.push({name:o,location:"endnote"});}),n.endnotes=Array.from(new Set(r)).sort();}e.templateVariables&&e.templateVariables.forEach(r=>{t.some(o=>o.name===r)||t.push({name:r,location:"body"});});let a=new Set;return t.forEach(r=>a.add(r.name)),{variables:Array.from(a).sort(),totalOccurrences:t.length,byLocation:n,occurrences:t}}function $(e){let t=[];if(e.content&&t.push(...R(e.content)),e.sections)for(let n of e.sections)n.content&&t.push(...R(n.content));return t}function R(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(...b(n)):n.type==="table"&&t.push(...P(n));return t}function b(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="run"?t.push(...d(n)):n.type==="hyperlink"?t.push(...J(n)):n.type==="simpleField"?t.push(...L(n)):n.type==="complexField"&&t.push(...F(n));return t}function d(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="text"&&n.text&&t.push(...E(n.text));return t}function J(e){let t=[];if(!e.children)return t;for(let n of e.children)n.type==="run"&&t.push(...d(n));return t}function L(e){let t=[];if(e.instruction&&t.push(...E(e.instruction)),e.content)for(let n of e.content)n.type==="run"&&t.push(...d(n));return t}function F(e){let t=[];if(e.fieldCode)for(let n of e.fieldCode)n.type==="run"&&t.push(...d(n));if(e.fieldResult)for(let n of e.fieldResult)n.type==="run"&&t.push(...d(n));return t}function P(e){let t=[];if(!e.rows)return t;for(let n of e.rows)if(n.cells)for(let a of n.cells)t.push(...B(a));return t}function B(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="paragraph"?t.push(...b(n)):n.type==="table"&&t.push(...P(n));return t}function D(e){let t=[];for(let n of e)if(n.content)for(let a of n.content)t.push(...b(a));return t}var k=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g,M=/\{(.+?)\}/g;function E(e){if(!e)return [];let t=[],n=new RegExp(k),a;for(;(a=n.exec(e))!==null;)t.push(a[1]);return t}function q(e){return k.test(e)}function U(e){return !(!e||typeof e!="string"||e.length===0||e.length>100||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/.test(e))}function X(e){if(!e)return "";let t=e.replace(/\s+/g,"_");return t=t.replace(/[^a-zA-Z0-9_\-\.]/g,""),t&&!/^[a-zA-Z_]/.test(t)&&(t="_"+t),t.substring(0,100)}function G(e){return `{${e}}`}function K(e){let t=e.match(/^\{(.+?)\}$/);return t?t[1]:null}function Q(e,t){return e&&e.replace(M,(n,a)=>{let r=a.trim();return r in t?t[r]:n})}function Y(e,t=""){return e&&e.replace(M,t)}function ee(e){return H(e).length>0}function Z(e){return typeof e=="object"&&e!==null&&("_def"in e||"parse"in e||"safeParse"in e)}function h(e,t){let n=t,{position:a,variableName:r}=n,o=JSON.parse(JSON.stringify(e)),s=o.package.document.content.filter(u=>u.type==="paragraph");if(a.paragraphIndex>=s.length)throw new Error(`Paragraph index ${a.paragraphIndex} out of bounds`);let c=s[a.paragraphIndex],l=`{${r}}`;return S(c,a.offset,l),o.templateVariables||(o.templateVariables=[]),o.templateVariables.includes(r)||o.templateVariables.push(r),o}function y(e,t){let n=t,{range:a,variableName:r}=n,o=JSON.parse(JSON.stringify(e)),s=o.package.document.content.filter(u=>u.type==="paragraph");if(a.start.paragraphIndex!==a.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(a.start.paragraphIndex>=s.length)throw new Error(`Paragraph index ${a.start.paragraphIndex} out of bounds`);let c=s[a.start.paragraphIndex];z(c,a.start.offset,a.end.offset);let l=`{${r}}`;return S(c,a.start.offset,l),o.templateVariables||(o.templateVariables=[]),o.templateVariables.includes(r)||o.templateVariables.push(r),o}function S(e,t,n){let a=0,r=false;for(let o=0;o<e.content.length;o++){let i=e.content[o];if(i.type==="run"){let s=x(i),c=a,l=a+s.length;if(!r&&t>=c&&t<=l){let u=t-c,v=s.slice(0,u),V=s.slice(u),m=[];for(let p=0;p<o;p++)m.push(e.content[p]);v&&m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:v}]}),m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:n}]}),V&&m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:V}]});for(let p=o+1;p<e.content.length;p++)m.push(e.content[p]);e.content=m,r=true;break}a=l;}else if(i.type==="hyperlink")for(let s of i.children)s.type==="run"&&(a+=x(s).length);}r||e.content.push({type:"run",content:[{type:"text",text:n}]});}function z(e,t,n){let a=[],r=0;for(let o of e.content)if(o.type==="run"){let i=x(o),s=r,c=r+i.length;if(c<=t||s>=n)a.push(o);else {let l="";s<t&&(l+=i.slice(0,t-s)),c>n&&(l+=i.slice(n-s)),l.length>0&&a.push({type:"run",formatting:o.formatting,content:[{type:"text",text:l}]});}r=c;}else a.push(o);e.content=a;}function x(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}var f={type:"string",description:"Document ID from a previous docx_load call"},j={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},_={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
2
+ Returns variable names without braces, along with their locations (body, headers, footers, etc.).
3
+ Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};try{let r=g(a.document);return {content:[{type:"text",text:JSON.stringify({variables:r.variables,count:r.variables.length,totalOccurrences:r.totalOccurrences,byLocation:r.byLocation},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},A={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
4
+ The variable can later be substituted with actual values using docx_apply_template.
5
+ Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:f,position:j,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(e,t)=>{let{documentId:n,position:a,variableName:r}=e,o=t.session.documents.get(n);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(r))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${r}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:i}=await import('./executor-XKBCCVNY.mjs'),s=i(o.document,{type:"insertText",position:a,text:`{${r}}`});return o.document=s,o.lastModified=Date.now(),s.templateVariables||(s.templateVariables=[]),s.templateVariables.includes(r)||s.templateVariables.push(r),{content:[{type:"text",text:JSON.stringify({success:!0,variable:r,insertedAs:`{${r}}`,position:a})}]}}catch(i){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${i.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},O={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
6
+ Replaces all {variable} placeholders with the corresponding values provided.
7
+ Preserves all formatting (fonts, styles, colors, tables).
8
+ Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:f,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(e,t)=>{let{documentId:n$1,variables:a,keepUnmatchedVariables:r=true}=e,o=t.session.documents.get(n$1);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n$1}`}]};if(!o.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let i=b$1(o.buffer,a,{nullGetter:r?"keep":"empty"}),s=await n(i.buffer);return o.document=s,o.buffer=i.buffer,o.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:i.replacedVariables,unreplacedVariables:i.unreplacedVariables,warnings:i.warnings})}]}}catch(i){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${i.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},N={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
9
+ Checks for syntax errors like unclosed braces, invalid tag names, etc.
10
+ Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!a.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let r=f$1(a.buffer);return {content:[{type:"text",text:JSON.stringify({valid:r.valid,tags:r.tags,errors:r.errors.map(o=>({message:o.message,variable:o.variable,type:o.type}))},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},T=[_,A,O,N];var W={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:h,replaceWithTemplateVariable:y},mcpTools:T};export{H as a,g as b,$ as c,b as d,E as e,q as f,U as g,X as h,G as i,K as j,Q as k,Y as l,ee as m,Z as n,W as o};
@@ -1,5 +1,5 @@
1
1
  import React__default, { CSSProperties, ReactNode } from 'react';
2
- import { e as Table, a0 as TableCell, b as Run, a as Paragraph } from './agentApi-BVHzyk2l.cjs';
2
+ import { e as Table, a0 as TableCell, b as Run, a as Paragraph } from './agentApi-BVHzyk2l.mjs';
3
3
 
4
4
  /**
5
5
  * Print Utilities
@@ -1,5 +1,5 @@
1
- import { D as Document, d as DocumentBody, V as SectionProperties, A as AgentCommand, h as AgentContext, R as Range, W as SelectionContext, T as TextFormatting, ao as ColorValue, a3 as Theme, ap as ThemeColorSlot, al as ThemeColorScheme } from './agentApi-BVHzyk2l.cjs';
2
- import { g as DocxInput } from './DocumentAgent-B9FUoSVS.cjs';
1
+ import { D as Document, d as DocumentBody, V as SectionProperties, A as AgentCommand, h as AgentContext, R as Range, W as SelectionContext, T as TextFormatting, ao as ColorValue, a3 as Theme, ap as ThemeColorSlot, al as ThemeColorScheme } from './agentApi-BVHzyk2l.mjs';
2
+ import { g as DocxInput } from './DocumentAgent-BqA9EJ3F.mjs';
3
3
 
4
4
  /**
5
5
  * Main Parser Orchestrator - Unified parseDocx function
@@ -1,7 +1,7 @@
1
- import { C as CorePlugin } from './types-D03hsi5t.cjs';
2
- export { b as CommandHandler, d as CommandResult, E as ExtractCommand, J as JsonSchema, L as LoadedDocument, e as McpSession, f as McpToolAnnotations, g as McpToolContent, h as McpToolContext, M as McpToolDefinition, n as McpToolExample, i as McpToolHandler, j as McpToolResult, k as PluginCommand, b as PluginCommandHandler, l as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, i as ToolHandler, j as ToolResult, T as TypedCommandHandler, Z as ZodSchemaLike, m as isZodSchema } from './types-D03hsi5t.cjs';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-Bxb5ZI1z.cjs';
4
- import './agentApi-BVHzyk2l.cjs';
1
+ import { C as CorePlugin } from './types-B3LkfO0u.mjs';
2
+ export { b as CommandHandler, d as CommandResult, E as ExtractCommand, J as JsonSchema, L as LoadedDocument, e as McpSession, f as McpToolAnnotations, g as McpToolContent, h as McpToolContext, M as McpToolDefinition, n as McpToolExample, i as McpToolHandler, j as McpToolResult, k as PluginCommand, b as PluginCommandHandler, l as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, i as ToolHandler, j as ToolResult, T as TypedCommandHandler, Z as ZodSchemaLike, m as isZodSchema } from './types-B3LkfO0u.mjs';
3
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-DyIMyB-0.mjs';
4
+ import './agentApi-BVHzyk2l.mjs';
5
5
 
6
6
  /**
7
7
  * Docxtemplater Plugin
@@ -1 +1 @@
1
- export{o as docxtemplaterPlugin,n as isZodSchema}from'./chunk-HRUPO723.js';import'./chunk-PRBTINOW.js';import'./chunk-NLYEW36R.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-BUEMG4NW.js';import'./chunk-SE5EN2QL.js';import'./chunk-IFPN3NT3.js';import'./chunk-H5NTJZO4.js';
1
+ 'use strict';var chunkVHWEKJ35_js=require('./chunk-VHWEKJ35.js');require('./chunk-PB7VMDDP.js'),require('./chunk-VR6PT4IZ.js');var chunkBUEMG4NW_js=require('./chunk-BUEMG4NW.js');require('./chunk-SE5EN2QL.js'),require('./chunk-IFPN3NT3.js'),require('./chunk-H5NTJZO4.js');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkVHWEKJ35_js.o}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkVHWEKJ35_js.n}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkBUEMG4NW_js.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkBUEMG4NW_js.c}});
@@ -0,0 +1 @@
1
+ export{o as docxtemplaterPlugin,n as isZodSchema}from'./chunk-Z35FA4M4.mjs';import'./chunk-DLVLK5FT.mjs';import'./chunk-CQRI4YUS.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-W53SI3XW.mjs';import'./chunk-LYBG4YI7.mjs';import'./chunk-WOHFANC5.mjs';import'./chunk-TAUMSKRE.mjs';
@@ -1,15 +1,15 @@
1
- import { D as Document } from './agentApi-BVHzyk2l.cjs';
2
- export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, l as BlockContent, ad as BookmarkEnd, ae as BookmarkStart, p as DeleteTextCommand, d as DocumentBody, r as DocxPackage, E as Endnote, af as Field, ag as FooterReference, F as Footnote, t as FormatTextCommand, ah as HeaderFooter, ai as HeaderReference, H as Hyperlink, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, L as ListLevel, N as NumberingDefinitions, a as Paragraph, J as ParagraphContext, K as ParagraphFormatting, P as Position, R as Range, Q as Relationship, S as ReplaceTextCommand, b as Run, c as RunContent, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, aj as Shape, Y as Style, Z as StyleDefinitions, $ as SuggestedAction, e as Table, a0 as TableCell, a1 as TableRow, ak as TextBox, a2 as TextContent, T as TextFormatting, a3 as Theme, al as ThemeColorScheme, am as ThemeFont, an as ThemeFontScheme } from './agentApi-BVHzyk2l.cjs';
3
- export { A as AgentContextOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, a0 as ThemeMatrixCell, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, a1 as ensureHexPrefix, p as executeCommand, q as executeCommands, r as formatPx, a2 as generateThemeTintShadeMatrix, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, x as getTemplateTags, a3 as getThemeTintShadeHex, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, M as processTemplate, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, a4 as resolveHighlightToCss, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-Bu7uJqpw.cjs';
4
- import { S as Subscribable, E as ErrorManagerSnapshot, P as PluginLifecycleSnapshot, a as PluginLifecycleConfig } from './ClipboardManager-BzgQ-SOi.cjs';
5
- export { A as AutoSaveManager, b as AutoSaveManagerOptions, c as AutoSaveSnapshot, d as AutoSaveStatus, C as CellCoordinates, e as ClipboardSelection, f as EditorHandle, g as EditorPluginCore, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, l as PositionCoordinates, R as RenderedDomContext, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, n as TableSelectionManager, o as TableSelectionSnapshot, p as createSelectionFromDOM, q as deleteTableFromDocument, r as extractFormattingFromElement, s as findTableFromClick, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, y as getTableFromDocument, z as isAutoSaveSupported, B as rgbToHex, D as updateTableInDocument } from './ClipboardManager-BzgQ-SOi.cjs';
6
- export { C as CorePlugin, e as McpSession, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult } from './types-D03hsi5t.cjs';
7
- export { D as DocumentAgent, g as DocxInput, d as attemptSelectiveSave, t as toArrayBuffer } from './DocumentAgent-B9FUoSVS.cjs';
8
- export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-X8ocGzeD.cjs';
1
+ import { D as Document } from './agentApi-BVHzyk2l.mjs';
2
+ export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, l as BlockContent, ad as BookmarkEnd, ae as BookmarkStart, p as DeleteTextCommand, d as DocumentBody, r as DocxPackage, E as Endnote, af as Field, ag as FooterReference, F as Footnote, t as FormatTextCommand, ah as HeaderFooter, ai as HeaderReference, H as Hyperlink, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, L as ListLevel, N as NumberingDefinitions, a as Paragraph, J as ParagraphContext, K as ParagraphFormatting, P as Position, R as Range, Q as Relationship, S as ReplaceTextCommand, b as Run, c as RunContent, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, aj as Shape, Y as Style, Z as StyleDefinitions, $ as SuggestedAction, e as Table, a0 as TableCell, a1 as TableRow, ak as TextBox, a2 as TextContent, T as TextFormatting, a3 as Theme, al as ThemeColorScheme, am as ThemeFont, an as ThemeFontScheme } from './agentApi-BVHzyk2l.mjs';
3
+ export { A as AgentContextOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, a0 as ThemeMatrixCell, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, a1 as ensureHexPrefix, p as executeCommand, q as executeCommands, r as formatPx, a2 as generateThemeTintShadeMatrix, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, x as getTemplateTags, a3 as getThemeTintShadeHex, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, M as processTemplate, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, a4 as resolveHighlightToCss, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-BwI_Uxp3.mjs';
4
+ import { S as Subscribable, E as ErrorManagerSnapshot, P as PluginLifecycleSnapshot, a as PluginLifecycleConfig } from './ClipboardManager-t936d0KD.mjs';
5
+ export { A as AutoSaveManager, b as AutoSaveManagerOptions, c as AutoSaveSnapshot, d as AutoSaveStatus, C as CellCoordinates, e as ClipboardSelection, f as EditorHandle, g as EditorPluginCore, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, k as PluginPanelProps, l as PositionCoordinates, R as RenderedDomContext, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, n as TableSelectionManager, o as TableSelectionSnapshot, p as createSelectionFromDOM, q as deleteTableFromDocument, r as extractFormattingFromElement, s as findTableFromClick, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, y as getTableFromDocument, z as isAutoSaveSupported, B as rgbToHex, D as updateTableInDocument } from './ClipboardManager-t936d0KD.mjs';
6
+ export { C as CorePlugin, e as McpSession, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult } from './types-B3LkfO0u.mjs';
7
+ export { D as DocumentAgent, g as DocxInput, d as attemptSelectiveSave, t as toArrayBuffer } from './DocumentAgent-BqA9EJ3F.mjs';
8
+ export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-DicgJidU.mjs';
9
9
  import { EditorView } from 'prosemirror-view';
10
- export { P as PluginRegistry, p as pluginRegistry, r as registerPlugins } from './registry-Bxb5ZI1z.cjs';
11
- export { V as VariableDetectionResult, a as VariableOccurrence, b as buildPatchedDocumentXml, c as createDocx, d as detectVariables, e as detectVariablesDetailed, f as detectVariablesInBody, g as detectVariablesInParagraph, h as documentHasVariables, i as extractVariablesFromText, j as formatVariable, k as hasTemplateVariables, l as isValidVariableName, p as parseVariable, r as removeVariables, m as repackDocx, n as replaceVariables, s as sanitizeVariableName, u as updateMultipleFiles, v as validatePatchSafety } from './variableDetector-iGl52A6q.cjs';
12
- export { docxtemplaterPlugin } from './core-plugins-reexport.cjs';
10
+ export { P as PluginRegistry, p as pluginRegistry, r as registerPlugins } from './registry-DyIMyB-0.mjs';
11
+ export { V as VariableDetectionResult, a as VariableOccurrence, b as buildPatchedDocumentXml, c as createDocx, d as detectVariables, e as detectVariablesDetailed, f as detectVariablesInBody, g as detectVariablesInParagraph, h as documentHasVariables, i as extractVariablesFromText, j as formatVariable, k as hasTemplateVariables, l as isValidVariableName, p as parseVariable, r as removeVariables, m as repackDocx, n as replaceVariables, s as sanitizeVariableName, u as updateMultipleFiles, v as validatePatchSafety } from './variableDetector-CIqTek7A.mjs';
12
+ export { docxtemplaterPlugin } from './core-plugins-reexport.mjs';
13
13
  import 'prosemirror-state';
14
14
  import 'prosemirror-model';
15
15
 
@@ -1 +1 @@
1
- export{r as AutoSaveManager,L as EditorCoordinator,H as ErrorManager,K as LayoutCoordinator,J as PluginLifecycleManager,q as Subscribable,x as TABLE_DATA_ATTRIBUTES,C as TableSelectionManager,M as VERSION,n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,F as createSelectionFromDOM,B as deleteTableFromDocument,D as extractFormattingFromElement,o as findPageBreaks,y as findTableFromClick,s as formatLastSaveTime,v as formatStorageSize,t as getAutoSaveStatusLabel,u as getAutoSaveStorageSize,E as getSelectionRuns,z as getTableFromDocument,m as hasPageBreakBefore,I as injectStyles,h as insertHorizontalRule,f as insertPageBreak,w as isAutoSaveSupported,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak,G as rgbToHex,A as updateTableInDocument}from'./chunk-FVUGBRDD.js';export{f as DocumentAgent,c as attemptSelectiveSave,m as buildExtendedSelectionContext,b as buildPatchedDocumentXml,l as buildSelectionContext,e as createDocumentWithText,d as createEmptyDocument,i as getAgentContext,k as getDocumentSummary,a as validatePatchSafety}from'./chunk-TOGKKPIW.js';export{l as blendColors,q as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,m as ensureHexPrefix,p as generateThemeTintShadeMatrix,f as getContrastingColor,o as getThemeTintShadeHex,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,a as resolveColor,b as resolveHighlightColor,n as resolveHighlightToCss,c as resolveShadingColor}from'./chunk-4VUZBV2S.js';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,o as docxtemplaterPlugin,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-HRUPO723.js';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-PRBTINOW.js';export{l as createDocx,f as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties,h as updateMultipleFiles}from'./chunk-63YB7DGI.js';export{a as executeCommand,b as executeCommands}from'./chunk-AARNCPWR.js';export{i as canRenderFont,g as getLoadedFonts,e as isFontLoaded,f as isFontsLoading,c as loadFont,j as loadFontFromBuffer,d as loadFonts,h as onFontsLoaded,n as parseDocx,k as preloadCommonFonts,m as toArrayBuffer}from'./chunk-NLYEW36R.js';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-BUEMG4NW.js';export{c as emuToPixels,e as emuToTwips,k as formatPx,h as halfPointsToPixels,d as pixelsToEmu,b as pixelsToTwips,g as pointsToPixels,f as twipsToEmu,a as twipsToPixels}from'./chunk-SE5EN2QL.js';import'./chunk-IFPN3NT3.js';import'./chunk-H5NTJZO4.js';
1
+ 'use strict';var chunkFVUGBRDD_js=require('./chunk-FVUGBRDD.js'),chunkMRWJ3GNH_js=require('./chunk-MRWJ3GNH.js'),chunk4VUZBV2S_js=require('./chunk-4VUZBV2S.js'),chunkVHWEKJ35_js=require('./chunk-VHWEKJ35.js'),chunkPB7VMDDP_js=require('./chunk-PB7VMDDP.js'),chunkIRO7KGGC_js=require('./chunk-IRO7KGGC.js'),chunkAARNCPWR_js=require('./chunk-AARNCPWR.js'),chunkVR6PT4IZ_js=require('./chunk-VR6PT4IZ.js'),chunkBUEMG4NW_js=require('./chunk-BUEMG4NW.js'),chunkSE5EN2QL_js=require('./chunk-SE5EN2QL.js');require('./chunk-IFPN3NT3.js'),require('./chunk-H5NTJZO4.js');Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkFVUGBRDD_js.r}});Object.defineProperty(exports,"EditorCoordinator",{enumerable:true,get:function(){return chunkFVUGBRDD_js.L}});Object.defineProperty(exports,"ErrorManager",{enumerable:true,get:function(){return chunkFVUGBRDD_js.H}});Object.defineProperty(exports,"LayoutCoordinator",{enumerable:true,get:function(){return chunkFVUGBRDD_js.K}});Object.defineProperty(exports,"PluginLifecycleManager",{enumerable:true,get:function(){return chunkFVUGBRDD_js.J}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkFVUGBRDD_js.q}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunkFVUGBRDD_js.x}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunkFVUGBRDD_js.C}});Object.defineProperty(exports,"VERSION",{enumerable:true,get:function(){return chunkFVUGBRDD_js.M}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkFVUGBRDD_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkFVUGBRDD_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkFVUGBRDD_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkFVUGBRDD_js.d}});Object.defineProperty(exports,"createSelectionFromDOM",{enumerable:true,get:function(){return chunkFVUGBRDD_js.F}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunkFVUGBRDD_js.B}});Object.defineProperty(exports,"extractFormattingFromElement",{enumerable:true,get:function(){return chunkFVUGBRDD_js.D}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkFVUGBRDD_js.o}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunkFVUGBRDD_js.y}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkFVUGBRDD_js.s}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkFVUGBRDD_js.v}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkFVUGBRDD_js.t}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkFVUGBRDD_js.u}});Object.defineProperty(exports,"getSelectionRuns",{enumerable:true,get:function(){return chunkFVUGBRDD_js.E}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunkFVUGBRDD_js.z}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkFVUGBRDD_js.m}});Object.defineProperty(exports,"injectStyles",{enumerable:true,get:function(){return chunkFVUGBRDD_js.I}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkFVUGBRDD_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.f}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkFVUGBRDD_js.w}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkFVUGBRDD_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkFVUGBRDD_js.p}});Object.defineProperty(exports,"rgbToHex",{enumerable:true,get:function(){return chunkFVUGBRDD_js.G}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunkFVUGBRDD_js.A}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.c}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.m}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.b}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.l}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.e}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.d}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.i}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.k}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunk4VUZBV2S_js.l}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunk4VUZBV2S_js.q}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.j}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunk4VUZBV2S_js.m}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunk4VUZBV2S_js.p}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.f}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunk4VUZBV2S_js.o}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunk4VUZBV2S_js.d}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunk4VUZBV2S_js.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunk4VUZBV2S_js.g}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.b}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunk4VUZBV2S_js.n}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.c}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkVHWEKJ35_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkVHWEKJ35_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkVHWEKJ35_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.m}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkVHWEKJ35_js.o}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkVHWEKJ35_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkVHWEKJ35_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkVHWEKJ35_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkVHWEKJ35_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkVHWEKJ35_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkPB7VMDDP_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkPB7VMDDP_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkPB7VMDDP_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkPB7VMDDP_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkPB7VMDDP_js.f}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkIRO7KGGC_js.l}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkIRO7KGGC_js.f}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkIRO7KGGC_js.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkIRO7KGGC_js.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkIRO7KGGC_js.a}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkIRO7KGGC_js.h}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkAARNCPWR_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkAARNCPWR_js.b}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.i}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.g}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.e}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.f}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.c}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.j}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.d}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.h}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.n}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.k}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.m}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkBUEMG4NW_js.c}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.c}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkSE5EN2QL_js.e}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkSE5EN2QL_js.k}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.h}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkSE5EN2QL_js.d}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkSE5EN2QL_js.b}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.g}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkSE5EN2QL_js.f}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.a}});
@@ -0,0 +1 @@
1
+ export{r as AutoSaveManager,L as EditorCoordinator,H as ErrorManager,K as LayoutCoordinator,J as PluginLifecycleManager,q as Subscribable,x as TABLE_DATA_ATTRIBUTES,C as TableSelectionManager,M as VERSION,n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,F as createSelectionFromDOM,B as deleteTableFromDocument,D as extractFormattingFromElement,o as findPageBreaks,y as findTableFromClick,s as formatLastSaveTime,v as formatStorageSize,t as getAutoSaveStatusLabel,u as getAutoSaveStorageSize,E as getSelectionRuns,z as getTableFromDocument,m as hasPageBreakBefore,I as injectStyles,h as insertHorizontalRule,f as insertPageBreak,w as isAutoSaveSupported,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak,G as rgbToHex,A as updateTableInDocument}from'./chunk-QTSXJRP6.mjs';export{f as DocumentAgent,c as attemptSelectiveSave,m as buildExtendedSelectionContext,b as buildPatchedDocumentXml,l as buildSelectionContext,e as createDocumentWithText,d as createEmptyDocument,i as getAgentContext,k as getDocumentSummary,a as validatePatchSafety}from'./chunk-YGTSQZRK.mjs';export{l as blendColors,q as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,m as ensureHexPrefix,p as generateThemeTintShadeMatrix,f as getContrastingColor,o as getThemeTintShadeHex,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,a as resolveColor,b as resolveHighlightColor,n as resolveHighlightToCss,c as resolveShadingColor}from'./chunk-QAZ4233N.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,o as docxtemplaterPlugin,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-Z35FA4M4.mjs';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-DLVLK5FT.mjs';export{l as createDocx,f as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties,h as updateMultipleFiles}from'./chunk-I6LFWQFR.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-M5F4SK3W.mjs';export{i as canRenderFont,g as getLoadedFonts,e as isFontLoaded,f as isFontsLoading,c as loadFont,j as loadFontFromBuffer,d as loadFonts,h as onFontsLoaded,n as parseDocx,k as preloadCommonFonts,m as toArrayBuffer}from'./chunk-CQRI4YUS.mjs';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-W53SI3XW.mjs';export{c as emuToPixels,e as emuToTwips,k as formatPx,h as halfPointsToPixels,d as pixelsToEmu,b as pixelsToTwips,g as pointsToPixels,f as twipsToEmu,a as twipsToPixels}from'./chunk-LYBG4YI7.mjs';import'./chunk-WOHFANC5.mjs';import'./chunk-TAUMSKRE.mjs';
@@ -1 +1 @@
1
- export{a as executeCommand,b as executeCommands}from'./chunk-AARNCPWR.js';import'./chunk-BUEMG4NW.js';import'./chunk-H5NTJZO4.js';
1
+ 'use strict';var chunkAARNCPWR_js=require('./chunk-AARNCPWR.js');require('./chunk-BUEMG4NW.js'),require('./chunk-H5NTJZO4.js');Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkAARNCPWR_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkAARNCPWR_js.b}});
@@ -0,0 +1 @@
1
+ export{a as executeCommand,b as executeCommands}from'./chunk-M5F4SK3W.mjs';import'./chunk-W53SI3XW.mjs';import'./chunk-TAUMSKRE.mjs';
@@ -1,4 +1,4 @@
1
- import { D as Document, B as BreakContent, a as Paragraph, b as Run, c as RunContent } from './agentApi-BVHzyk2l.cjs';
1
+ import { D as Document, B as BreakContent, a as Paragraph, b as Run, c as RunContent } from './agentApi-BVHzyk2l.mjs';
2
2
 
3
3
  /**
4
4
  * Insert Operations Utility
@@ -1,10 +1,10 @@
1
- import { d as DocumentBody, a as Paragraph, T as TextFormatting, H as Hyperlink, b as Run, e as Table, P as Position } from './agentApi-BVHzyk2l.cjs';
2
- export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, k as ApplyVariablesCommand, l as BlockContent, C as Comment, m as CommentRangeEnd, n as CommentRangeStart, o as DEFAULT_AI_ACTIONS, p as DeleteTextCommand, q as Deletion, D as Document, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, y as Insertion, L as ListLevel, M as MoveFrom, z as MoveTo, N as NumberingDefinitions, G as ParagraphContent, J as ParagraphContext, K as ParagraphFormatting, O as ParagraphOutline, R as Range, Q as Relationship, S as ReplaceTextCommand, c as RunContent, U as SectionInfo, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, Y as Style, Z as StyleDefinitions, _ as StyleInfo, $ as SuggestedAction, a0 as TableCell, a1 as TableRow, a2 as TextContent, a3 as Theme, a4 as TrackedChangeInfo, a5 as TrackedRunChange, a6 as comparePositions, a7 as createCollapsedRange, a8 as createCommand, a9 as createRange, aa as getActionDescription, ab as getActionLabel, ac as isPositionInRange } from './agentApi-BVHzyk2l.cjs';
3
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, F as FormattingSummary, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, T as TemplateError, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, f as buildSelectionContextFromContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, k as createTemplateProcessor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, v as getMissingVariables, w as getSelectionFormattingSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, L as previewTemplate, M as processTemplate, N as processTemplateAdvanced, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-Bu7uJqpw.cjs';
4
- export { b as CommandHandler, d as CommandResult, C as CorePlugin, J as JsonSchema, L as LoadedDocument, e as McpSession, f as McpToolAnnotations, g as McpToolContent, h as McpToolContext, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult, C as Plugin, k as PluginCommand, b as PluginCommandHandler, l as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, i as ToolHandler, j as ToolResult, Z as ZodSchemaLike, m as isZodSchema } from './types-D03hsi5t.cjs';
5
- export { D as DocumentAgent, F as FormattedTextSegment, I as InsertHyperlinkOptions, a as InsertImageOptions, b as InsertTableOptions, c as InsertTextOptions, d as attemptSelectiveSave, e as createAgent, f as createAgentFromDocument } from './DocumentAgent-B9FUoSVS.cjs';
6
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-Bxb5ZI1z.cjs';
7
- export { V as VariableDetectionResult, a as VariableOccurrence, b as buildPatchedDocumentXml, c as createDocx, d as detectVariables, e as detectVariablesDetailed, f as detectVariablesInBody, g as detectVariablesInParagraph, h as documentHasVariables, i as extractVariablesFromText, j as formatVariable, k as hasTemplateVariables, l as isValidVariableName, p as parseVariable, r as removeVariables, m as repackDocx, n as replaceVariables, s as sanitizeVariableName, u as updateMultipleFiles, v as validatePatchSafety } from './variableDetector-iGl52A6q.cjs';
1
+ import { d as DocumentBody, a as Paragraph, T as TextFormatting, H as Hyperlink, b as Run, e as Table, P as Position } from './agentApi-BVHzyk2l.mjs';
2
+ export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, k as ApplyVariablesCommand, l as BlockContent, C as Comment, m as CommentRangeEnd, n as CommentRangeStart, o as DEFAULT_AI_ACTIONS, p as DeleteTextCommand, q as Deletion, D as Document, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, y as Insertion, L as ListLevel, M as MoveFrom, z as MoveTo, N as NumberingDefinitions, G as ParagraphContent, J as ParagraphContext, K as ParagraphFormatting, O as ParagraphOutline, R as Range, Q as Relationship, S as ReplaceTextCommand, c as RunContent, U as SectionInfo, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, Y as Style, Z as StyleDefinitions, _ as StyleInfo, $ as SuggestedAction, a0 as TableCell, a1 as TableRow, a2 as TextContent, a3 as Theme, a4 as TrackedChangeInfo, a5 as TrackedRunChange, a6 as comparePositions, a7 as createCollapsedRange, a8 as createCommand, a9 as createRange, aa as getActionDescription, ab as getActionLabel, ac as isPositionInRange } from './agentApi-BVHzyk2l.mjs';
3
+ export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, F as FormattingSummary, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, T as TemplateError, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, f as buildSelectionContextFromContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, k as createTemplateProcessor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, v as getMissingVariables, w as getSelectionFormattingSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, L as previewTemplate, M as processTemplate, N as processTemplateAdvanced, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-BwI_Uxp3.mjs';
4
+ export { b as CommandHandler, d as CommandResult, C as CorePlugin, J as JsonSchema, L as LoadedDocument, e as McpSession, f as McpToolAnnotations, g as McpToolContent, h as McpToolContext, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult, C as Plugin, k as PluginCommand, b as PluginCommandHandler, l as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, i as ToolHandler, j as ToolResult, Z as ZodSchemaLike, m as isZodSchema } from './types-B3LkfO0u.mjs';
5
+ export { D as DocumentAgent, F as FormattedTextSegment, I as InsertHyperlinkOptions, a as InsertImageOptions, b as InsertTableOptions, c as InsertTextOptions, d as attemptSelectiveSave, e as createAgent, f as createAgentFromDocument } from './DocumentAgent-BqA9EJ3F.mjs';
6
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-DyIMyB-0.mjs';
7
+ export { V as VariableDetectionResult, a as VariableOccurrence, b as buildPatchedDocumentXml, c as createDocx, d as detectVariables, e as detectVariablesDetailed, f as detectVariablesInBody, g as detectVariablesInParagraph, h as documentHasVariables, i as extractVariablesFromText, j as formatVariable, k as hasTemplateVariables, l as isValidVariableName, p as parseVariable, r as removeVariables, m as repackDocx, n as replaceVariables, s as sanitizeVariableName, u as updateMultipleFiles, v as validatePatchSafety } from './variableDetector-CIqTek7A.mjs';
8
8
 
9
9
  /**
10
10
  * Shared Text Utilities for Agent Module
@@ -1,4 +1,4 @@
1
- export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'./chunk-QVPR2W5S.js';export{f as DocumentAgent,c as attemptSelectiveSave,m as buildExtendedSelectionContext,b as buildPatchedDocumentXml,l as buildSelectionContext,j as buildSelectionContextFromContext,g as createAgent,h as createAgentFromDocument,e as createDocumentWithText,d as createEmptyDocument,i as getAgentContext,k as getDocumentSummary,n as getSelectionFormattingSummary,a as validatePatchSafety}from'./chunk-TOGKKPIW.js';export{l as blendColors,q as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,f as getContrastingColor,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor}from'./chunk-4VUZBV2S.js';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,n as isZodSchema,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-HRUPO723.js';export{j as createTemplateProcessor,g as getMissingVariables,e as getTemplateTags,h as previewTemplate,a as processTemplate,i as processTemplateAdvanced,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-PRBTINOW.js';export{l as createDocx,f as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties,h as updateMultipleFiles}from'./chunk-63YB7DGI.js';export{a as executeCommand,b as executeCommands}from'./chunk-AARNCPWR.js';export{n as parseDocx}from'./chunk-NLYEW36R.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-BUEMG4NW.js';export{c as emuToPixels,e as emuToTwips,k as formatPx,h as halfPointsToPixels,d as pixelsToEmu,b as pixelsToTwips,g as pointsToPixels,f as twipsToEmu,a as twipsToPixels}from'./chunk-SE5EN2QL.js';import'./chunk-IFPN3NT3.js';import'./chunk-H5NTJZO4.js';function l(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function f(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(l(r));return e.join(" ")}function Ne(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(l(t)):t.type==="table"&&e.push(f(t));return e.join(`
1
+ 'use strict';var chunkQVPR2W5S_js=require('./chunk-QVPR2W5S.js'),chunkMRWJ3GNH_js=require('./chunk-MRWJ3GNH.js'),chunk4VUZBV2S_js=require('./chunk-4VUZBV2S.js'),chunkVHWEKJ35_js=require('./chunk-VHWEKJ35.js'),chunkPB7VMDDP_js=require('./chunk-PB7VMDDP.js'),chunkIRO7KGGC_js=require('./chunk-IRO7KGGC.js'),chunkAARNCPWR_js=require('./chunk-AARNCPWR.js'),chunkVR6PT4IZ_js=require('./chunk-VR6PT4IZ.js'),chunkBUEMG4NW_js=require('./chunk-BUEMG4NW.js'),chunkSE5EN2QL_js=require('./chunk-SE5EN2QL.js');require('./chunk-IFPN3NT3.js'),require('./chunk-H5NTJZO4.js');function l(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function f(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(l(r));return e.join(" ")}function Ne(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(l(t)):t.type==="table"&&e.push(f(t));return e.join(`
2
2
  `)}function m(n){return n.split(/\s+/).filter(t=>t.length>0).length}function qe(n,e=true){return e?n.length:n.replace(/\s/g,"").length}function Ze(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=m(l(t)):t.type==="table"&&(e+=_e(t));return e}function _e(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=m(l(r)));return e}function Je(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=l(t).length:t.type==="table"&&(e+=Ue(t));return e}function Ue(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=l(r).length);return e}function Xe(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=l(i).slice(0,e.offset);o.unshift(s),r+=s.length;}for(let p=e.paragraphIndex-1;p>=0&&r<t;p--){let s=n[p];if(!s)continue;let u=l(s);o.unshift(u),r+=u.length;}let a=o.join(`
3
3
  `);return a.length>t?"..."+a.slice(-t):a}function Ge(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=l(i).slice(e.offset);o.push(s),r+=s.length;}for(let p=e.paragraphIndex+1;p<n.length&&r<t;p++){let s=n[p];if(!s)continue;let u=l(s);o.push(u),r+=u.length;}let a=o.join(`
4
- `);return a.length>t?a.slice(0,t)+"...":a}function Ke(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Qe(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ye(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function $e(n){return n?n.toLowerCase().includes("heading"):false}function et(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function tt(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function nt(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function ot(n){return n.content.some(e=>e.type==="table")}function x(n){return n.content.filter(e=>e.type==="paragraph")}function rt(n,e){return x(n)[e]}function at(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var st="0.0.2";export{st as VERSION,qe as countCharacters,m as countWords,at as getBlockIndexForParagraph,Je as getBodyCharacterCount,Ne as getBodyText,Ze as getBodyWordCount,Ke as getFormattingAtPosition,Ye as getHyperlinkAtPosition,g as getHyperlinkText,rt as getParagraphAtIndex,l as getParagraphText,x as getParagraphs,c as getRunText,f as getTableText,Ge as getTextAfter,Xe as getTextBefore,nt as hasHyperlinks,tt as hasImages,ot as hasTables,$e as isHeadingStyle,Qe as isPositionInHyperlink,et as parseHeadingLevel};
4
+ `);return a.length>t?a.slice(0,t)+"...":a}function Ke(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Qe(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ye(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function $e(n){return n?n.toLowerCase().includes("heading"):false}function et(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function tt(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function nt(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function ot(n){return n.content.some(e=>e.type==="table")}function x(n){return n.content.filter(e=>e.type==="paragraph")}function rt(n,e){return x(n)[e]}function at(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var st="0.0.2";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkQVPR2W5S_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkQVPR2W5S_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkQVPR2W5S_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkQVPR2W5S_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkQVPR2W5S_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkQVPR2W5S_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkQVPR2W5S_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkQVPR2W5S_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.c}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.m}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.b}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.l}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.j}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.g}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.h}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.e}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.d}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.i}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.k}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.n}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkMRWJ3GNH_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunk4VUZBV2S_js.l}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunk4VUZBV2S_js.q}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.j}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.f}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunk4VUZBV2S_js.d}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunk4VUZBV2S_js.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunk4VUZBV2S_js.g}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunk4VUZBV2S_js.c}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkVHWEKJ35_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkVHWEKJ35_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkVHWEKJ35_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkVHWEKJ35_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkVHWEKJ35_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkVHWEKJ35_js.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkVHWEKJ35_js.n}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkVHWEKJ35_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkVHWEKJ35_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkVHWEKJ35_js.h}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkPB7VMDDP_js.j}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkPB7VMDDP_js.g}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkPB7VMDDP_js.e}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkPB7VMDDP_js.h}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkPB7VMDDP_js.a}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkPB7VMDDP_js.i}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkPB7VMDDP_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkPB7VMDDP_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkPB7VMDDP_js.f}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkIRO7KGGC_js.l}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkIRO7KGGC_js.f}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkIRO7KGGC_js.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkIRO7KGGC_js.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkIRO7KGGC_js.a}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkIRO7KGGC_js.h}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkAARNCPWR_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkAARNCPWR_js.b}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkVR6PT4IZ_js.n}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkBUEMG4NW_js.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkBUEMG4NW_js.c}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.c}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkSE5EN2QL_js.e}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkSE5EN2QL_js.k}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.h}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkSE5EN2QL_js.d}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkSE5EN2QL_js.b}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.g}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkSE5EN2QL_js.f}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkSE5EN2QL_js.a}});exports.VERSION=st;exports.countCharacters=qe;exports.countWords=m;exports.getBlockIndexForParagraph=at;exports.getBodyCharacterCount=Je;exports.getBodyText=Ne;exports.getBodyWordCount=Ze;exports.getFormattingAtPosition=Ke;exports.getHyperlinkAtPosition=Ye;exports.getHyperlinkText=g;exports.getParagraphAtIndex=rt;exports.getParagraphText=l;exports.getParagraphs=x;exports.getRunText=c;exports.getTableText=f;exports.getTextAfter=Ge;exports.getTextBefore=Xe;exports.hasHyperlinks=nt;exports.hasImages=tt;exports.hasTables=ot;exports.isHeadingStyle=$e;exports.isPositionInHyperlink=Qe;exports.parseHeadingLevel=et;
@@ -0,0 +1,4 @@
1
+ export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'./chunk-6WPRCJ5A.mjs';export{f as DocumentAgent,c as attemptSelectiveSave,m as buildExtendedSelectionContext,b as buildPatchedDocumentXml,l as buildSelectionContext,j as buildSelectionContextFromContext,g as createAgent,h as createAgentFromDocument,e as createDocumentWithText,d as createEmptyDocument,i as getAgentContext,k as getDocumentSummary,n as getSelectionFormattingSummary,a as validatePatchSafety}from'./chunk-YGTSQZRK.mjs';export{l as blendColors,q as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,f as getContrastingColor,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor}from'./chunk-QAZ4233N.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,n as isZodSchema,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-Z35FA4M4.mjs';export{j as createTemplateProcessor,g as getMissingVariables,e as getTemplateTags,h as previewTemplate,a as processTemplate,i as processTemplateAdvanced,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-DLVLK5FT.mjs';export{l as createDocx,f as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties,h as updateMultipleFiles}from'./chunk-I6LFWQFR.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-M5F4SK3W.mjs';export{n as parseDocx}from'./chunk-CQRI4YUS.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-W53SI3XW.mjs';export{c as emuToPixels,e as emuToTwips,k as formatPx,h as halfPointsToPixels,d as pixelsToEmu,b as pixelsToTwips,g as pointsToPixels,f as twipsToEmu,a as twipsToPixels}from'./chunk-LYBG4YI7.mjs';import'./chunk-WOHFANC5.mjs';import'./chunk-TAUMSKRE.mjs';function l(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function f(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(l(r));return e.join(" ")}function Ne(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(l(t)):t.type==="table"&&e.push(f(t));return e.join(`
2
+ `)}function m(n){return n.split(/\s+/).filter(t=>t.length>0).length}function qe(n,e=true){return e?n.length:n.replace(/\s/g,"").length}function Ze(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=m(l(t)):t.type==="table"&&(e+=_e(t));return e}function _e(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=m(l(r)));return e}function Je(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=l(t).length:t.type==="table"&&(e+=Ue(t));return e}function Ue(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=l(r).length);return e}function Xe(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=l(i).slice(0,e.offset);o.unshift(s),r+=s.length;}for(let p=e.paragraphIndex-1;p>=0&&r<t;p--){let s=n[p];if(!s)continue;let u=l(s);o.unshift(u),r+=u.length;}let a=o.join(`
3
+ `);return a.length>t?"..."+a.slice(-t):a}function Ge(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=l(i).slice(e.offset);o.push(s),r+=s.length;}for(let p=e.paragraphIndex+1;p<n.length&&r<t;p++){let s=n[p];if(!s)continue;let u=l(s);o.push(u),r+=u.length;}let a=o.join(`
4
+ `);return a.length>t?a.slice(0,t)+"...":a}function Ke(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Qe(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ye(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function $e(n){return n?n.toLowerCase().includes("heading"):false}function et(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function tt(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function nt(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function ot(n){return n.content.some(e=>e.type==="table")}function x(n){return n.content.filter(e=>e.type==="paragraph")}function rt(n,e){return x(n)[e]}function at(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var st="0.0.2";export{st as VERSION,qe as countCharacters,m as countWords,at as getBlockIndexForParagraph,Je as getBodyCharacterCount,Ne as getBodyText,Ze as getBodyWordCount,Ke as getFormattingAtPosition,Ye as getHyperlinkAtPosition,g as getHyperlinkText,rt as getParagraphAtIndex,l as getParagraphText,x as getParagraphs,c as getRunText,f as getTableText,Ge as getTextAfter,Xe as getTextBefore,nt as hasHyperlinks,tt as hasImages,ot as hasTables,$e as isHeadingStyle,Qe as isPositionInHyperlink,et as parseHeadingLevel};
@@ -1,22 +1,22 @@
1
- import { R as ReactEditorPlugin } from './react-D9JDP3cV.cjs';
2
- export { D as DEFAULT_SELECTION_STYLE, a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorMode, e as EditorPlugin, f as ErrorBoundary, g as ErrorBoundaryProps, h as ErrorContextValue, i as ErrorProvider, H as HIGH_CONTRAST_SELECTION_STYLE, j as HighlightRect, P as PLUGIN_HOST_STYLES, k as ParseErrorDisplay, l as ParseErrorDisplayProps, m as PluginContext, n as PluginHost, o as PluginHostProps, p as PluginHostRef, q as RenderAsyncOptions, S as SELECTION_CSS_VARS, r as SelectionHighlightConfig, s as SelectionOverlayProps, t as SelectionRange, T as TableSelectionState, U as UnsupportedFeatureWarning, u as UnsupportedFeatureWarningProps, v as UseAutoSaveOptions, w as UseAutoSaveReturn, x as UseClipboardOptions, y as UseClipboardReturn, z as UseSelectionHighlightOptions, A as UseSelectionHighlightReturn, B as UseTableSelectionOptions, C as UseTableSelectionReturn, F as UseWheelZoomOptions, G as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as areSelectionStylesInjected, J as clampZoom, K as clearSelection, L as createSelectionChangeHandler, M as findNearestZoomPreset, N as formatZoom, O as generateOverlayElements, Q as generateSelectionCSS, V as getHighlightRectStyle, W as getMergedSelectionRects, X as getNextZoomPreset, Y as getPreviousZoomPreset, _ as getSelectedText, $ as getSelectionBoundingRect, a0 as getSelectionRects, a1 as getUserFriendlyMessage, a2 as getZoomPresets, a3 as hasActiveSelection, a4 as highlightTextRange, a5 as injectSelectionStyles, a6 as isParseError, a7 as isSelectionBackwards, a8 as isSelectionWithin, a9 as isZoomPreset, aa as mergeAdjacentRects, ab as normalizeSelectionDirection, ac as parseZoom, ad as removeSelectionStyles, ae as renderAsync, af as selectRange, ag as useAutoSave, ah as useClipboard, ai as useErrorNotifications, aj as useSelectionHighlight, ak as useTableSelection, al as useWheelZoom } from './react-D9JDP3cV.cjs';
3
- export { D as DocumentAgent, g as DocxInput, t as toArrayBuffer } from './DocumentAgent-B9FUoSVS.cjs';
4
- export { A as AgentContextOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, M as processTemplate, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-Bu7uJqpw.cjs';
5
- export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-X8ocGzeD.cjs';
6
- import { ToolbarProps } from './ui.cjs';
7
- export { AdvancedColorPicker, AlignmentButtons, AlignmentButtonsProps, ColorOption, ColorPicker, ColorPickerProps, ContextMenu, ContextMenuProps, DialogKeyboardShortcut, FindMatch, FindOptions, FindReplaceDialog, FindReplaceDialogProps, FindReplaceOptions, FindReplaceState, FindResult, FontOption, FontPicker, FontPickerProps, FontSizePicker, FontSizePickerProps, HighlightOptions, HorizontalRuler, HorizontalRulerProps, HyperlinkData, HyperlinkDialog, HyperlinkDialogProps, ImageData, IndicatorPosition, IndicatorVariant, InsertImageDialog, InsertImageDialogProps, InsertSymbolDialog, InsertSymbolDialogProps, InsertTableDialog, InsertTableDialogProps, KeyboardShortcutsDialog, KeyboardShortcutsDialogProps, LineSpacingOption, LineSpacingPicker, LineSpacingPickerProps, ListButtons, ListButtonsProps, ListState, LoadingIndicator, LoadingIndicatorProps, LoadingOperation, LoadingSize, LoadingVariant, PasteOption, PasteSpecialDialog, PasteSpecialDialogProps, ResponsePreview, ResponsePreviewProps, ResponsePreviewState, ResponsiveToolbar, ResponsiveToolbarGroup, ResponsiveToolbarGroupProps, ResponsiveToolbarProps, SYMBOL_CATEGORIES, ShortcutCategory, StyleOption, StylePicker, StylePickerProps, SymbolCategory, TableBorderColorPicker, TableBorderColorPickerProps, TableBorderPicker, TableBorderPickerProps, TableBorderWidthPicker, TableBorderWidthPickerProps, TableCellFillPicker, TableCellFillPickerProps, TableConfig, TableInsertButtons, TableInsertButtonsProps, TableMergeButton, TableMergeButtonProps, TableMoreDropdown, TableMoreDropdownProps, TextContextAction, TextContextMenu, TextContextMenuItem, TextContextMenuProps, Toolbar, ToolbarButton, ToolbarGroup, ToolbarItem, ToolbarItemPriority, ToolbarSeparator, UnsavedIndicator, UnsavedIndicatorProps, UseFindReplaceReturn, UseKeyboardShortcutsDialogOptions, UseKeyboardShortcutsDialogReturn, UseLoadingOptions, UseLoadingReturn, UsePasteSpecialOptions, UsePasteSpecialReturn, UseResponsiveToolbarOptions, UseResponsiveToolbarReturn, UseTextContextMenuOptions, UseTextContextMenuReturn, UseUnsavedChangesOptions, UseUnsavedChangesReturn, ZoomControl, ZoomControlProps, calculateFitDimensions, clampTableConfig, createChangeTracker, createDefaultFindOptions, createDefaultListState, createDefaultTableConfig, createErrorResponse, createMockResponse, createSearchPattern, createToolbarItem, createToolbarItems, dataUrlToBlob, delay, escapeRegexString, findAllMatches, findInDocument, findInParagraph, formatFileSize, formatShortcutKeys, formatTableDimensions, getActionShortcut, getAllActions, getAllCategories, getAllIndicatorPositions, getAllIndicatorVariants, getAllLoadingSizes, getAllLoadingVariants, getAllPasteOptions, getCategoryLabel, getCommonShortcuts, getDefaultActions, getDefaultHighlightOptions, getDefaultPasteOption, getDefaultShortcuts, getDefaultTextContextMenuItems, getImageAcceptString, getImageDimensions, getLoadingVariantLabel, getMarginInUnits, getMatchCountText, getPasteOption, getRecommendedPriority, getRulerDimensions, getShortcutsByCategory, getSupportedImageExtensions, getSymbolCategories, getSymbolUnicodeInfo, getSymbolsByCategory, getTablePresets, getTextActionLabel, getTextActionShortcut, getVariantLabel, isActionAvailable, isEmptySearch, isPasteSpecialShortcut, isTextActionAvailable, isValidImageFile, isValidTableConfig, parseMarginFromUnits, positionToMargin, replaceAllInContent, replaceFirstInContent, scrollToMatch, searchSymbols, symbolFromCodePoint, useContextMenu, useFindReplace, useHyperlinkDialog, useInsertImageDialog, useInsertSymbolDialog, useInsertTableDialog, useKeyboardShortcutsDialog, useLoading, useLoadingOperations, usePasteSpecial, useResponsePreview, useResponsiveToolbar, useTextContextMenu, useUnsavedChanges } from './ui.cjs';
1
+ import { R as ReactEditorPlugin } from './react-C-pJU0Y4.mjs';
2
+ export { D as DEFAULT_SELECTION_STYLE, a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorMode, e as EditorPlugin, f as ErrorBoundary, g as ErrorBoundaryProps, h as ErrorContextValue, i as ErrorProvider, H as HIGH_CONTRAST_SELECTION_STYLE, j as HighlightRect, P as PLUGIN_HOST_STYLES, k as ParseErrorDisplay, l as ParseErrorDisplayProps, m as PluginContext, n as PluginHost, o as PluginHostProps, p as PluginHostRef, q as RenderAsyncOptions, S as SELECTION_CSS_VARS, r as SelectionHighlightConfig, s as SelectionOverlayProps, t as SelectionRange, T as TableSelectionState, U as UnsupportedFeatureWarning, u as UnsupportedFeatureWarningProps, v as UseAutoSaveOptions, w as UseAutoSaveReturn, x as UseClipboardOptions, y as UseClipboardReturn, z as UseSelectionHighlightOptions, A as UseSelectionHighlightReturn, B as UseTableSelectionOptions, C as UseTableSelectionReturn, F as UseWheelZoomOptions, G as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as areSelectionStylesInjected, J as clampZoom, K as clearSelection, L as createSelectionChangeHandler, M as findNearestZoomPreset, N as formatZoom, O as generateOverlayElements, Q as generateSelectionCSS, V as getHighlightRectStyle, W as getMergedSelectionRects, X as getNextZoomPreset, Y as getPreviousZoomPreset, _ as getSelectedText, $ as getSelectionBoundingRect, a0 as getSelectionRects, a1 as getUserFriendlyMessage, a2 as getZoomPresets, a3 as hasActiveSelection, a4 as highlightTextRange, a5 as injectSelectionStyles, a6 as isParseError, a7 as isSelectionBackwards, a8 as isSelectionWithin, a9 as isZoomPreset, aa as mergeAdjacentRects, ab as normalizeSelectionDirection, ac as parseZoom, ad as removeSelectionStyles, ae as renderAsync, af as selectRange, ag as useAutoSave, ah as useClipboard, ai as useErrorNotifications, aj as useSelectionHighlight, ak as useTableSelection, al as useWheelZoom } from './react-C-pJU0Y4.mjs';
3
+ export { D as DocumentAgent, g as DocxInput, t as toArrayBuffer } from './DocumentAgent-BqA9EJ3F.mjs';
4
+ export { A as AgentContextOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, M as processTemplate, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-BwI_Uxp3.mjs';
5
+ export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-DicgJidU.mjs';
6
+ import { ToolbarProps } from './ui.mjs';
7
+ export { AdvancedColorPicker, AlignmentButtons, AlignmentButtonsProps, ColorOption, ColorPicker, ColorPickerProps, ContextMenu, ContextMenuProps, DialogKeyboardShortcut, FindMatch, FindOptions, FindReplaceDialog, FindReplaceDialogProps, FindReplaceOptions, FindReplaceState, FindResult, FontOption, FontPicker, FontPickerProps, FontSizePicker, FontSizePickerProps, HighlightOptions, HorizontalRuler, HorizontalRulerProps, HyperlinkData, HyperlinkDialog, HyperlinkDialogProps, ImageData, IndicatorPosition, IndicatorVariant, InsertImageDialog, InsertImageDialogProps, InsertSymbolDialog, InsertSymbolDialogProps, InsertTableDialog, InsertTableDialogProps, KeyboardShortcutsDialog, KeyboardShortcutsDialogProps, LineSpacingOption, LineSpacingPicker, LineSpacingPickerProps, ListButtons, ListButtonsProps, ListState, LoadingIndicator, LoadingIndicatorProps, LoadingOperation, LoadingSize, LoadingVariant, PasteOption, PasteSpecialDialog, PasteSpecialDialogProps, ResponsePreview, ResponsePreviewProps, ResponsePreviewState, ResponsiveToolbar, ResponsiveToolbarGroup, ResponsiveToolbarGroupProps, ResponsiveToolbarProps, SYMBOL_CATEGORIES, ShortcutCategory, StyleOption, StylePicker, StylePickerProps, SymbolCategory, TableBorderColorPicker, TableBorderColorPickerProps, TableBorderPicker, TableBorderPickerProps, TableBorderWidthPicker, TableBorderWidthPickerProps, TableCellFillPicker, TableCellFillPickerProps, TableConfig, TableInsertButtons, TableInsertButtonsProps, TableMergeButton, TableMergeButtonProps, TableMoreDropdown, TableMoreDropdownProps, TextContextAction, TextContextMenu, TextContextMenuItem, TextContextMenuProps, Toolbar, ToolbarButton, ToolbarGroup, ToolbarItem, ToolbarItemPriority, ToolbarSeparator, UnsavedIndicator, UnsavedIndicatorProps, UseFindReplaceReturn, UseKeyboardShortcutsDialogOptions, UseKeyboardShortcutsDialogReturn, UseLoadingOptions, UseLoadingReturn, UsePasteSpecialOptions, UsePasteSpecialReturn, UseResponsiveToolbarOptions, UseResponsiveToolbarReturn, UseTextContextMenuOptions, UseTextContextMenuReturn, UseUnsavedChangesOptions, UseUnsavedChangesReturn, ZoomControl, ZoomControlProps, calculateFitDimensions, clampTableConfig, createChangeTracker, createDefaultFindOptions, createDefaultListState, createDefaultTableConfig, createErrorResponse, createMockResponse, createSearchPattern, createToolbarItem, createToolbarItems, dataUrlToBlob, delay, escapeRegexString, findAllMatches, findInDocument, findInParagraph, formatFileSize, formatShortcutKeys, formatTableDimensions, getActionShortcut, getAllActions, getAllCategories, getAllIndicatorPositions, getAllIndicatorVariants, getAllLoadingSizes, getAllLoadingVariants, getAllPasteOptions, getCategoryLabel, getCommonShortcuts, getDefaultActions, getDefaultHighlightOptions, getDefaultPasteOption, getDefaultShortcuts, getDefaultTextContextMenuItems, getImageAcceptString, getImageDimensions, getLoadingVariantLabel, getMarginInUnits, getMatchCountText, getPasteOption, getRecommendedPriority, getRulerDimensions, getShortcutsByCategory, getSupportedImageExtensions, getSymbolCategories, getSymbolUnicodeInfo, getSymbolsByCategory, getTablePresets, getTextActionLabel, getTextActionShortcut, getVariantLabel, isActionAvailable, isEmptySearch, isPasteSpecialShortcut, isTextActionAvailable, isValidImageFile, isValidTableConfig, parseMarginFromUnits, positionToMargin, replaceAllInContent, replaceFirstInContent, scrollToMatch, searchSymbols, symbolFromCodePoint, useContextMenu, useFindReplace, useHyperlinkDialog, useInsertImageDialog, useInsertSymbolDialog, useInsertTableDialog, useKeyboardShortcutsDialog, useLoading, useLoadingOperations, usePasteSpecial, useResponsePreview, useResponsiveToolbar, useTextContextMenu, useUnsavedChanges } from './ui.mjs';
8
8
  import { ReactNode } from 'react';
9
9
  import * as react_jsx_runtime from 'react/jsx-runtime';
10
- export { C as CLIPBOARD_TYPES, a as ClipboardContent, b as ClipboardOptions, I as INTERNAL_CLIPBOARD_TYPE, P as ParsedClipboardContent, c as PrintButton, d as PrintButtonProps, e as PrintOptions, f as PrintStyles, T as TableAction, g as TableContext, h as TableSelection, i as TableToolbar, j as TableToolbarProps, k as addColumn, l as addRow, m as cleanWordHtml, n as copyParagraphs, o as copyRuns, p as createClipboardHandlers, q as createTableContext, r as deleteColumn, s as deleteRow, t as formatPrintPageRange, u as getCellAt, v as getColumnCount, w as getDefaultPrintOptions, x as handlePasteEvent, y as htmlToRuns, z as isEditorHtml, A as isPrintSupported, B as isWordHtml, D as mergeCells, E as openPrintWindow, F as paragraphsToClipboardContent, G as parseClipboardHtml, H as parsePageRange, J as readFromClipboard, K as runsToClipboardContent, L as splitCell, M as triggerPrint, N as writeToClipboard } from './clipboard-Cm7udEnb.cjs';
11
- export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, l as BlockContent, ad as BookmarkEnd, ae as BookmarkStart, p as DeleteTextCommand, D as Document, d as DocumentBody, r as DocxPackage, E as Endnote, af as Field, ag as FooterReference, F as Footnote, t as FormatTextCommand, ah as HeaderFooter, ai as HeaderReference, H as Hyperlink, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, L as ListLevel, N as NumberingDefinitions, a as Paragraph, J as ParagraphContext, K as ParagraphFormatting, P as Position, R as Range, Q as Relationship, S as ReplaceTextCommand, b as Run, c as RunContent, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, aj as Shape, Y as Style, Z as StyleDefinitions, $ as SuggestedAction, e as Table, a0 as TableCell, a1 as TableRow, ak as TextBox, a2 as TextContent, T as TextFormatting, a3 as Theme, al as ThemeColorScheme, am as ThemeFont, an as ThemeFontScheme } from './agentApi-BVHzyk2l.cjs';
10
+ export { C as CLIPBOARD_TYPES, a as ClipboardContent, b as ClipboardOptions, I as INTERNAL_CLIPBOARD_TYPE, P as ParsedClipboardContent, c as PrintButton, d as PrintButtonProps, e as PrintOptions, f as PrintStyles, T as TableAction, g as TableContext, h as TableSelection, i as TableToolbar, j as TableToolbarProps, k as addColumn, l as addRow, m as cleanWordHtml, n as copyParagraphs, o as copyRuns, p as createClipboardHandlers, q as createTableContext, r as deleteColumn, s as deleteRow, t as formatPrintPageRange, u as getCellAt, v as getColumnCount, w as getDefaultPrintOptions, x as handlePasteEvent, y as htmlToRuns, z as isEditorHtml, A as isPrintSupported, B as isWordHtml, D as mergeCells, E as openPrintWindow, F as paragraphsToClipboardContent, G as parseClipboardHtml, H as parsePageRange, J as readFromClipboard, K as runsToClipboardContent, L as splitCell, M as triggerPrint, N as writeToClipboard } from './clipboard-BkM7Zvgs.mjs';
11
+ export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, l as BlockContent, ad as BookmarkEnd, ae as BookmarkStart, p as DeleteTextCommand, D as Document, d as DocumentBody, r as DocxPackage, E as Endnote, af as Field, ag as FooterReference, F as Footnote, t as FormatTextCommand, ah as HeaderFooter, ai as HeaderReference, H as Hyperlink, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, L as ListLevel, N as NumberingDefinitions, a as Paragraph, J as ParagraphContext, K as ParagraphFormatting, P as Position, R as Range, Q as Relationship, S as ReplaceTextCommand, b as Run, c as RunContent, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, aj as Shape, Y as Style, Z as StyleDefinitions, $ as SuggestedAction, e as Table, a0 as TableCell, a1 as TableRow, ak as TextBox, a2 as TextContent, T as TextFormatting, a3 as Theme, al as ThemeColorScheme, am as ThemeFont, an as ThemeFontScheme } from './agentApi-BVHzyk2l.mjs';
12
12
  import * as prosemirror_state from 'prosemirror-state';
13
13
  import { Plugin, PluginKey } from 'prosemirror-state';
14
14
  import { DecorationSet, EditorView } from 'prosemirror-view';
15
- export { C as CorePlugin, e as McpSession, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult } from './types-D03hsi5t.cjs';
16
- export { P as PluginRegistry, p as pluginRegistry, r as registerPlugins } from './registry-Bxb5ZI1z.cjs';
17
- export { docxtemplaterPlugin } from './core-plugins-reexport.cjs';
18
- import { k as PluginPanelProps } from './ClipboardManager-BzgQ-SOi.cjs';
19
- export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, l as PositionCoordinates, R as RenderedDomContext, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, p as createSelectionFromDOM, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, z as isAutoSaveSupported } from './ClipboardManager-BzgQ-SOi.cjs';
15
+ export { C as CorePlugin, e as McpSession, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult } from './types-B3LkfO0u.mjs';
16
+ export { P as PluginRegistry, p as pluginRegistry, r as registerPlugins } from './registry-DyIMyB-0.mjs';
17
+ export { docxtemplaterPlugin } from './core-plugins-reexport.mjs';
18
+ import { k as PluginPanelProps } from './ClipboardManager-t936d0KD.mjs';
19
+ export { d as AutoSaveStatus, e as ClipboardSelection, h as ErrorNotification, i as ErrorSeverity, j as PanelConfig, l as PositionCoordinates, R as RenderedDomContext, m as SavedDocumentData, T as TABLE_DATA_ATTRIBUTES, p as createSelectionFromDOM, t as formatLastSaveTime, u as formatStorageSize, v as getAutoSaveStatusLabel, w as getAutoSaveStorageSize, x as getSelectionRuns, z as isAutoSaveSupported } from './ClipboardManager-t936d0KD.mjs';
20
20
  import 'prosemirror-model';
21
21
 
22
22
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReactEditorPlugin } from './react-BgZObIoP.js';
2
- export { D as DEFAULT_SELECTION_STYLE, a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorMode, e as EditorPlugin, f as ErrorBoundary, g as ErrorBoundaryProps, h as ErrorContextValue, i as ErrorProvider, H as HIGH_CONTRAST_SELECTION_STYLE, j as HighlightRect, P as PLUGIN_HOST_STYLES, k as ParseErrorDisplay, l as ParseErrorDisplayProps, m as PluginContext, n as PluginHost, o as PluginHostProps, p as PluginHostRef, q as RenderAsyncOptions, S as SELECTION_CSS_VARS, r as SelectionHighlightConfig, s as SelectionOverlayProps, t as SelectionRange, T as TableSelectionState, U as UnsupportedFeatureWarning, u as UnsupportedFeatureWarningProps, v as UseAutoSaveOptions, w as UseAutoSaveReturn, x as UseClipboardOptions, y as UseClipboardReturn, z as UseSelectionHighlightOptions, A as UseSelectionHighlightReturn, B as UseTableSelectionOptions, C as UseTableSelectionReturn, F as UseWheelZoomOptions, G as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as areSelectionStylesInjected, J as clampZoom, K as clearSelection, L as createSelectionChangeHandler, M as findNearestZoomPreset, N as formatZoom, O as generateOverlayElements, Q as generateSelectionCSS, V as getHighlightRectStyle, W as getMergedSelectionRects, X as getNextZoomPreset, Y as getPreviousZoomPreset, _ as getSelectedText, $ as getSelectionBoundingRect, a0 as getSelectionRects, a1 as getUserFriendlyMessage, a2 as getZoomPresets, a3 as hasActiveSelection, a4 as highlightTextRange, a5 as injectSelectionStyles, a6 as isParseError, a7 as isSelectionBackwards, a8 as isSelectionWithin, a9 as isZoomPreset, aa as mergeAdjacentRects, ab as normalizeSelectionDirection, ac as parseZoom, ad as removeSelectionStyles, ae as renderAsync, af as selectRange, ag as useAutoSave, ah as useClipboard, ai as useErrorNotifications, aj as useSelectionHighlight, ak as useTableSelection, al as useWheelZoom } from './react-BgZObIoP.js';
1
+ import { R as ReactEditorPlugin } from './react-By80Gfi-.js';
2
+ export { D as DEFAULT_SELECTION_STYLE, a as DocxEditor, b as DocxEditorHandle, c as DocxEditorProps, d as DocxEditorRef, E as EditorMode, e as EditorPlugin, f as ErrorBoundary, g as ErrorBoundaryProps, h as ErrorContextValue, i as ErrorProvider, H as HIGH_CONTRAST_SELECTION_STYLE, j as HighlightRect, P as PLUGIN_HOST_STYLES, k as ParseErrorDisplay, l as ParseErrorDisplayProps, m as PluginContext, n as PluginHost, o as PluginHostProps, p as PluginHostRef, q as RenderAsyncOptions, S as SELECTION_CSS_VARS, r as SelectionHighlightConfig, s as SelectionOverlayProps, t as SelectionRange, T as TableSelectionState, U as UnsupportedFeatureWarning, u as UnsupportedFeatureWarningProps, v as UseAutoSaveOptions, w as UseAutoSaveReturn, x as UseClipboardOptions, y as UseClipboardReturn, z as UseSelectionHighlightOptions, A as UseSelectionHighlightReturn, B as UseTableSelectionOptions, C as UseTableSelectionReturn, F as UseWheelZoomOptions, G as UseWheelZoomReturn, Z as ZOOM_PRESETS, I as areSelectionStylesInjected, J as clampZoom, K as clearSelection, L as createSelectionChangeHandler, M as findNearestZoomPreset, N as formatZoom, O as generateOverlayElements, Q as generateSelectionCSS, V as getHighlightRectStyle, W as getMergedSelectionRects, X as getNextZoomPreset, Y as getPreviousZoomPreset, _ as getSelectedText, $ as getSelectionBoundingRect, a0 as getSelectionRects, a1 as getUserFriendlyMessage, a2 as getZoomPresets, a3 as hasActiveSelection, a4 as highlightTextRange, a5 as injectSelectionStyles, a6 as isParseError, a7 as isSelectionBackwards, a8 as isSelectionWithin, a9 as isZoomPreset, aa as mergeAdjacentRects, ab as normalizeSelectionDirection, ac as parseZoom, ad as removeSelectionStyles, ae as renderAsync, af as selectRange, ag as useAutoSave, ah as useClipboard, ai as useErrorNotifications, aj as useSelectionHighlight, ak as useTableSelection, al as useWheelZoom } from './react-By80Gfi-.js';
3
3
  export { D as DocumentAgent, g as DocxInput, t as toArrayBuffer } from './DocumentAgent-CRCXiBT7.js';
4
4
  export { A as AgentContextOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, M as processTemplate, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './colorResolver-Dlmk3itT.js';
5
5
  export { I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-BI9ZoACv.js';