@eigenpal/docx-editor-core 1.0.2 → 1.1.0

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 (266) hide show
  1. package/LICENSE +13 -16
  2. package/README.md +1 -1
  3. package/dist/agent/index.d.mts +4 -5
  4. package/dist/agent/index.d.ts +4 -5
  5. package/dist/agent/index.js +1 -1
  6. package/dist/agent/index.mjs +1 -1
  7. package/dist/{chunk-NLTX7XVR.js → chunk-25KY5HLN.js} +1 -1
  8. package/dist/chunk-44FHVKSI.js +1 -0
  9. package/dist/{chunk-4S5VOHQK.mjs → chunk-5CDBSK2R.mjs} +1 -1
  10. package/dist/chunk-6Y6LON6Y.mjs +1 -0
  11. package/dist/chunk-6ZXL3EIP.mjs +2 -0
  12. package/dist/chunk-73AZQWIE.js +1 -0
  13. package/dist/chunk-7HANRHHL.js +1 -0
  14. package/dist/chunk-7LRR7RKE.mjs +15 -0
  15. package/dist/{chunk-AGNZEOVL.mjs → chunk-7Z2AGPNQ.mjs} +1 -1
  16. package/dist/chunk-BGE57OES.js +1 -0
  17. package/dist/chunk-BOOHU5EW.mjs +1 -0
  18. package/dist/chunk-CA2EYL6T.mjs +1 -0
  19. package/dist/chunk-CTHHUJAB.mjs +2 -0
  20. package/dist/chunk-DLCDDB66.mjs +3 -0
  21. package/dist/chunk-DV6GWBUJ.js +2 -0
  22. package/dist/chunk-E4JMCA5X.js +2 -0
  23. package/dist/chunk-F44ZLDZS.js +4 -0
  24. package/dist/chunk-FCJWLEKT.mjs +1 -0
  25. package/dist/chunk-FDEDN2RC.mjs +0 -0
  26. package/dist/chunk-FEWCI2E5.mjs +1 -0
  27. package/dist/chunk-GFDIPDJ6.mjs +1 -0
  28. package/dist/chunk-GM4USWKO.js +2 -0
  29. package/dist/chunk-GWBVJZVT.js +3 -0
  30. package/dist/chunk-GY5BWVM7.js +1 -0
  31. package/dist/{chunk-7SGC3CXJ.js → chunk-H42RXHT4.js} +1 -1
  32. package/dist/chunk-HMBVSDCH.mjs +1 -0
  33. package/dist/chunk-HQPWFUP5.js +2 -0
  34. package/dist/chunk-HV6HE6YR.js +59 -0
  35. package/dist/chunk-IF4C25FN.mjs +1 -0
  36. package/dist/chunk-IMKU4O3P.js +1 -0
  37. package/dist/chunk-IQG3KLWY.mjs +2 -0
  38. package/dist/{chunk-AFMMYLPX.js → chunk-J4J2Y6EU.js} +2 -2
  39. package/dist/chunk-KGDXHUYC.js +1 -0
  40. package/dist/chunk-KHF4JU7D.mjs +1 -0
  41. package/dist/chunk-LCICADWM.js +2 -0
  42. package/dist/{chunk-GFQM7PKY.js → chunk-LOCW6MR2.js} +1 -1
  43. package/dist/chunk-LTHT4A4S.js +1 -0
  44. package/dist/chunk-MJ6XZFVD.mjs +1 -0
  45. package/dist/chunk-MNOHUTKE.js +15 -0
  46. package/dist/chunk-MP4QSEO2.mjs +1 -0
  47. package/dist/chunk-MZ2XCZAN.mjs +1 -0
  48. package/dist/chunk-OAWTQ3IY.js +1 -0
  49. package/dist/chunk-OEXVWIHW.mjs +2 -0
  50. package/dist/chunk-ONRBRDIC.mjs +59 -0
  51. package/dist/{chunk-6PR4XHQ3.mjs → chunk-ONWOHAFW.mjs} +1 -1
  52. package/dist/{chunk-EXOP727C.mjs → chunk-OUEKNYX5.mjs} +1 -1
  53. package/dist/chunk-OX75Q5ZG.mjs +1 -0
  54. package/dist/chunk-QEACB5VG.js +1 -0
  55. package/dist/chunk-RFC2SXZ6.mjs +4 -0
  56. package/dist/chunk-RFVFX5WK.mjs +1 -0
  57. package/dist/chunk-SORYYVJ7.js +1 -0
  58. package/dist/chunk-TUIEV7Q7.js +1 -0
  59. package/dist/chunk-U74VPTIU.js +1 -0
  60. package/dist/chunk-UOQT6A7P.js +1 -0
  61. package/dist/chunk-V5VDCQDN.mjs +1 -0
  62. package/dist/chunk-VHUVPHPI.mjs +1 -0
  63. package/dist/{chunk-XCMA7AY7.js → chunk-W7GLQ6DV.js} +1 -1
  64. package/dist/chunk-WLHNIXWC.mjs +2 -0
  65. package/dist/chunk-X6HFDXKB.js +1 -0
  66. package/dist/chunk-XPV6VILW.mjs +1 -0
  67. package/dist/chunk-Y3ZQQI4D.js +1 -0
  68. package/dist/chunk-YTDWMXNS.js +1 -0
  69. package/dist/chunk-ZUGNF5KU.js +1 -0
  70. package/dist/chunk-ZX26QZJ5.mjs +1 -0
  71. package/dist/{colorResolver-CVsPLsw1.d.ts → colorResolver-BZ_yScf4.d.ts} +1 -1
  72. package/dist/{colorResolver-C3q7MLLD.d.mts → colorResolver-C6DtsoFI.d.mts} +1 -1
  73. package/dist/content-5Mrz6w_b.d.mts +1360 -0
  74. package/dist/content-CmqAwdFL.d.ts +1360 -0
  75. package/dist/core-plugins.d.mts +3 -4
  76. package/dist/core-plugins.d.ts +3 -4
  77. package/dist/core-plugins.js +1 -1
  78. package/dist/core-plugins.mjs +1 -1
  79. package/dist/core.d.mts +10 -11
  80. package/dist/core.d.ts +10 -11
  81. package/dist/core.js +1 -1
  82. package/dist/core.mjs +1 -1
  83. package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-BRaaXIHm.d.ts} +1 -1
  84. package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-DgO3A9av.d.mts} +1 -1
  85. package/dist/docx/index.d.mts +3 -4
  86. package/dist/docx/index.d.ts +3 -4
  87. package/dist/docx/index.js +1 -1
  88. package/dist/docx/index.mjs +1 -1
  89. package/dist/docx/parser.d.mts +3 -4
  90. package/dist/docx/parser.d.ts +3 -4
  91. package/dist/docx/parser.js +1 -1
  92. package/dist/docx/parser.mjs +1 -1
  93. package/dist/docx/rezip.d.mts +3 -4
  94. package/dist/docx/rezip.d.ts +3 -4
  95. package/dist/docx/rezip.js +1 -1
  96. package/dist/docx/rezip.mjs +1 -1
  97. package/dist/docx/serializer/index.d.mts +4 -5
  98. package/dist/docx/serializer/index.d.ts +4 -5
  99. package/dist/docx/serializer/index.js +1 -1
  100. package/dist/docx/serializer/index.mjs +1 -1
  101. package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-8b4X-AIh.d.mts} +63 -3
  102. package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-CK2QLq68.d.ts} +63 -3
  103. package/dist/{formatting-D9I-lFS4.d.mts → formatting-BH4hcZiq.d.mts} +1 -1
  104. package/dist/{formatting-BwpZWdGi.d.ts → formatting-_OXU8gLB.d.ts} +1 -1
  105. package/dist/{headerFooterLayout-DkclHZ0Z.d.mts → headerFooterLayout-72Vz7yp3.d.mts} +94 -3
  106. package/dist/{headerFooterLayout-B3QVg556.d.ts → headerFooterLayout-Ca4ESDHF.d.ts} +94 -3
  107. package/dist/headless.d.mts +9 -9
  108. package/dist/headless.d.ts +9 -9
  109. package/dist/headless.js +1 -1
  110. package/dist/headless.mjs +1 -1
  111. package/dist/layout-bridge/index.d.mts +7 -7
  112. package/dist/layout-bridge/index.d.ts +7 -7
  113. package/dist/layout-bridge/index.js +1 -1
  114. package/dist/layout-bridge/index.mjs +1 -1
  115. package/dist/layout-bridge/measuring/index.d.mts +43 -2
  116. package/dist/layout-bridge/measuring/index.d.ts +43 -2
  117. package/dist/layout-bridge/measuring/index.js +1 -1
  118. package/dist/layout-bridge/measuring/index.mjs +1 -1
  119. package/dist/layout-bridge/tableInsertHover.js +1 -1
  120. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  121. package/dist/layout-bridge/toFlowBlocks.d.mts +11 -3
  122. package/dist/layout-bridge/toFlowBlocks.d.ts +11 -3
  123. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  124. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  125. package/dist/layout-engine/index.d.mts +33 -3
  126. package/dist/layout-engine/index.d.ts +33 -3
  127. package/dist/layout-engine/index.js +1 -1
  128. package/dist/layout-engine/index.mjs +1 -1
  129. package/dist/layout-engine/types.d.mts +53 -0
  130. package/dist/layout-engine/types.d.ts +53 -0
  131. package/dist/layout-painter/index.d.mts +4 -5
  132. package/dist/layout-painter/index.d.ts +4 -5
  133. package/dist/layout-painter/index.js +1 -1
  134. package/dist/layout-painter/index.mjs +1 -1
  135. package/dist/layout-painter/renderPage.d.mts +4 -5
  136. package/dist/layout-painter/renderPage.d.ts +4 -5
  137. package/dist/layout-painter/renderPage.js +1 -1
  138. package/dist/layout-painter/renderPage.mjs +1 -1
  139. package/dist/managers/AutoSaveManager.d.mts +3 -4
  140. package/dist/managers/AutoSaveManager.d.ts +3 -4
  141. package/dist/managers/TableSelectionManager.d.mts +3 -4
  142. package/dist/managers/TableSelectionManager.d.ts +3 -4
  143. package/dist/managers/types.d.mts +3 -4
  144. package/dist/managers/types.d.ts +3 -4
  145. package/dist/{marks-CCPVlQzL.d.mts → marks-BY573yZn.d.mts} +1 -1
  146. package/dist/{marks-BujVxYP4.d.ts → marks-CjC9tF5k.d.ts} +1 -1
  147. package/dist/mcp-cli.mjs +24 -23
  148. package/dist/mcp.d.mts +3 -4
  149. package/dist/mcp.d.ts +3 -4
  150. package/dist/mcp.js +3 -3
  151. package/dist/mcp.mjs +1 -1
  152. package/dist/{nodes-BXi1Uu3e.d.mts → nodes-7753Bgi_.d.mts} +66 -3
  153. package/dist/{nodes-DfKj9kUA.d.ts → nodes-CC_nwkT_.d.ts} +66 -3
  154. package/dist/prosemirror/commands/formatting.d.mts +2 -2
  155. package/dist/prosemirror/commands/formatting.d.ts +2 -2
  156. package/dist/prosemirror/commands/formatting.js +1 -1
  157. package/dist/prosemirror/commands/formatting.mjs +1 -1
  158. package/dist/prosemirror/commands/index.d.mts +82 -8
  159. package/dist/prosemirror/commands/index.d.ts +82 -8
  160. package/dist/prosemirror/commands/index.js +1 -1
  161. package/dist/prosemirror/commands/index.mjs +1 -1
  162. package/dist/prosemirror/commands/paragraph.d.mts +1 -1
  163. package/dist/prosemirror/commands/paragraph.d.ts +1 -1
  164. package/dist/prosemirror/commands/paragraph.js +1 -1
  165. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  166. package/dist/prosemirror/conversion/fromProseDoc.d.mts +3 -4
  167. package/dist/prosemirror/conversion/fromProseDoc.d.ts +3 -4
  168. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  169. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  170. package/dist/prosemirror/conversion/index.d.mts +11 -4
  171. package/dist/prosemirror/conversion/index.d.ts +11 -4
  172. package/dist/prosemirror/conversion/index.js +1 -1
  173. package/dist/prosemirror/conversion/index.mjs +1 -1
  174. package/dist/prosemirror/editor.css +155 -95
  175. package/dist/prosemirror/extensions/index.d.mts +1 -1
  176. package/dist/prosemirror/extensions/index.d.ts +1 -1
  177. package/dist/prosemirror/extensions/index.js +1 -1
  178. package/dist/prosemirror/extensions/index.mjs +1 -1
  179. package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
  180. package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
  181. package/dist/prosemirror/index.d.mts +5 -6
  182. package/dist/prosemirror/index.d.ts +5 -6
  183. package/dist/prosemirror/index.js +1 -1
  184. package/dist/prosemirror/index.mjs +1 -1
  185. package/dist/prosemirror/plugins/index.d.mts +122 -18
  186. package/dist/prosemirror/plugins/index.d.ts +122 -18
  187. package/dist/prosemirror/plugins/index.js +1 -1
  188. package/dist/prosemirror/plugins/index.mjs +1 -1
  189. package/dist/prosemirror/plugins/selectionTracker.d.mts +1 -1
  190. package/dist/prosemirror/plugins/selectionTracker.d.ts +1 -1
  191. package/dist/prosemirror/schema/index.d.mts +4 -5
  192. package/dist/prosemirror/schema/index.d.ts +4 -5
  193. package/dist/prosemirror/schema/index.js +1 -1
  194. package/dist/prosemirror/schema/index.mjs +1 -1
  195. package/dist/prosemirror/styles/index.d.mts +2 -2
  196. package/dist/prosemirror/styles/index.d.ts +2 -2
  197. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +45 -23
  198. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +45 -23
  199. package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
  200. package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
  201. package/dist/{selectionContext-85CE0f7a.d.ts → selectionContext-BPAqgNgk.d.ts} +1 -1
  202. package/dist/{selectionContext-Xq3AY7pn.d.mts → selectionContext-CoZat7QZ.d.mts} +1 -1
  203. package/dist/{styles-jqO45PSq.d.ts → styles-BBv7doYK.d.ts} +1 -1
  204. package/dist/{styles-BBoqh07F.d.mts → styles-EI2lxeEN.d.mts} +1 -1
  205. package/dist/types/agentApi.d.mts +1 -1
  206. package/dist/types/agentApi.d.ts +1 -1
  207. package/dist/types/content.d.mts +4 -1167
  208. package/dist/types/content.d.ts +4 -1167
  209. package/dist/types/document.d.mts +25 -8
  210. package/dist/types/document.d.ts +25 -8
  211. package/dist/utils/comments.d.mts +79 -6
  212. package/dist/utils/comments.d.ts +79 -6
  213. package/dist/utils/comments.js +1 -1
  214. package/dist/utils/comments.mjs +1 -1
  215. package/dist/utils/highlightColors.js +1 -1
  216. package/dist/utils/highlightColors.mjs +1 -1
  217. package/dist/utils/index.d.mts +5 -6
  218. package/dist/utils/index.d.ts +5 -6
  219. package/dist/utils/index.js +3 -3
  220. package/dist/utils/index.mjs +3 -3
  221. package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-DF3-nxUC.d.mts} +1 -1
  222. package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-sBkgVh3f.d.ts} +1 -1
  223. package/package.json +3 -3
  224. package/dist/chunk-2D3UPAMA.mjs +0 -1
  225. package/dist/chunk-2RCMY2GE.mjs +0 -1
  226. package/dist/chunk-3GNIP6IX.mjs +0 -4
  227. package/dist/chunk-44RUAQA2.js +0 -1
  228. package/dist/chunk-5N5DBQJV.mjs +0 -1
  229. package/dist/chunk-5TNMVXDS.mjs +0 -1
  230. package/dist/chunk-6DK4UBGM.js +0 -1
  231. package/dist/chunk-6LOYA7G5.mjs +0 -2
  232. package/dist/chunk-7VCMJCBY.js +0 -2
  233. package/dist/chunk-APFTVA4F.mjs +0 -1
  234. package/dist/chunk-BKHQA6JJ.js +0 -1
  235. package/dist/chunk-BOYVCOLZ.mjs +0 -1
  236. package/dist/chunk-BS35CXMN.js +0 -1
  237. package/dist/chunk-BTOBVF4I.mjs +0 -1
  238. package/dist/chunk-C6GSFUV2.js +0 -2
  239. package/dist/chunk-CP5OSG5Z.mjs +0 -1
  240. package/dist/chunk-CP767TWV.js +0 -1
  241. package/dist/chunk-DV6IEOP5.js +0 -4
  242. package/dist/chunk-IBNUQL57.mjs +0 -2
  243. package/dist/chunk-KBU6QQFU.js +0 -9
  244. package/dist/chunk-LDKESXXK.mjs +0 -3
  245. package/dist/chunk-LTYW3NLX.js +0 -59
  246. package/dist/chunk-NERY274X.js +0 -1
  247. package/dist/chunk-NMSU4MWP.mjs +0 -1
  248. package/dist/chunk-NNQWQOC5.mjs +0 -1
  249. package/dist/chunk-OLKDLRJ4.js +0 -1
  250. package/dist/chunk-P3AXSRLG.mjs +0 -1
  251. package/dist/chunk-P6RNOYAG.mjs +0 -2
  252. package/dist/chunk-R7RR6M4A.mjs +0 -2
  253. package/dist/chunk-RCS6UNIJ.mjs +0 -1
  254. package/dist/chunk-T5RYEG2V.js +0 -1
  255. package/dist/chunk-TRJWRZZD.js +0 -1
  256. package/dist/chunk-TYYOBPNK.js +0 -1
  257. package/dist/chunk-UCZVMHB5.mjs +0 -59
  258. package/dist/chunk-V435QKZB.js +0 -3
  259. package/dist/chunk-VQ2QGHYS.js +0 -2
  260. package/dist/chunk-WZP6ZHBR.js +0 -1
  261. package/dist/chunk-XDH55WXX.mjs +0 -1
  262. package/dist/chunk-Y5HZAMND.mjs +0 -9
  263. package/dist/chunk-YE357WVA.js +0 -1
  264. package/dist/chunk-YGHHSCPR.js +0 -2
  265. package/dist/lists-CdiIk_c1.d.ts +0 -142
  266. package/dist/lists-JDB80qyP.d.mts +0 -142
@@ -0,0 +1 @@
1
+ import {c,b,i}from'./chunk-MJ6XZFVD.mjs';import {a}from'./chunk-67LVRQIR.mjs';import {chainCommands}from'prosemirror-commands';import {splitCell,mergeCells,columnResizing,tableEditing,CellSelection}from'prosemirror-tables';import {PluginKey,Plugin,TextSelection,Selection}from'prosemirror-state';import {DecorationSet,Decoration}from'prosemirror-view';function He(n){switch(n.toLowerCase()){case "solid":return "single";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "groove":return "threeDEngrave";case "ridge":return "threeDEmboss";case "inset":return "inset";case "outset":return "outset";default:return "single"}}function Le(n){if(!n)return 8;let o=n.trim().toLowerCase();if(o==="thin")return 4;if(o==="medium")return 8;if(o==="thick")return 16;let e=parseFloat(o);return isNaN(e)?8:o.endsWith("pt")?Math.round(e*8):(o.endsWith("px"),Math.round(e*6))}function X(n){if(!n||n==="transparent"||n==="inherit")return null;let o=n.match(/#([0-9a-fA-F]{6})/);if(o)return {rgb:o[1].toUpperCase()};let e=n.match(/#([0-9a-fA-F]{3})$/);if(e){let[r,l,s]=e[1];return {rgb:(r+r+l+l+s+s).toUpperCase()}}let t=n.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);return t?{rgb:[t[1],t[2],t[3]].map(l=>parseInt(l).toString(16).padStart(2,"0")).join("").toUpperCase()}:null}function Fe(n){let o=(s,a,c)=>{if(!(!s||s==="none"||s==="hidden"))return {style:He(s),color:X(a)||void 0,size:Le(c)}},e=o(n.borderTopStyle,n.borderTopColor,n.borderTopWidth),t=o(n.borderBottomStyle,n.borderBottomColor,n.borderBottomWidth),r=o(n.borderLeftStyle,n.borderLeftColor,n.borderLeftWidth),l=o(n.borderRightStyle,n.borderRightColor,n.borderRightWidth);return !e&&!t&&!r&&!l?null:{top:e,bottom:t,left:r,right:l}}function Oe(n){let o=s=>{if(!s||s==="0px")return;let a=parseFloat(s);if(!(isNaN(a)||a===0))return s.endsWith("pt")?Math.round(a*20):Math.round(a*15)},e=o(n.paddingTop),t=o(n.paddingRight),r=o(n.paddingBottom),l=o(n.paddingLeft);return e===void 0&&t===void 0&&r===void 0&&l===void 0?null:{top:e,right:t,bottom:r,left:l}}function Ge(n){if(n)switch(n.toLowerCase()){case "top":return "top";case "middle":return "center";case "bottom":return "bottom";default:return}}function _e(n){return X(n)?.rgb}function O(n){let o=n.style,e=Fe(o),t=Oe(o);return {colspan:n.colSpan||1,rowspan:n.rowSpan||1,verticalAlign:n.dataset.valign||Ge(o.verticalAlign)||void 0,backgroundColor:n.dataset.bgcolor||_e(o.backgroundColor)||void 0,borders:e||void 0,margins:t||void 0}}var Z={content:"tableRow+",group:"block",tableRole:"table",isolating:true,attrs:{styleId:{default:null},width:{default:null},widthType:{default:null},justification:{default:null},columnWidths:{default:null},floating:{default:null},cellMargins:{default:null},look:{default:null},_originalFormatting:{default:null},tblPrChange:{default:null}},parseDOM:[{tag:"table",getAttrs(n){let o=n;return {styleId:o.dataset.styleId||void 0,justification:o.dataset.justification}}}],toDOM(n){let o=n.attrs,e={class:"docx-table"};o.styleId&&(e["data-style-id"]=o.styleId);let t=["border-collapse: collapse"];if(o.width&&o.widthType==="pct")t.push(`width: ${o.width/50}%`),t.push("table-layout: fixed");else if(o.width&&o.widthType==="dxa"){let r=Math.round(o.width/20*1.333);t.push(`width: ${r}px`),t.push("table-layout: fixed");}else t.push("width: 100%"),t.push("table-layout: fixed");if(o.justification==="center"?t.push("margin-left: auto","margin-right: auto"):o.justification==="right"&&t.push("margin-left: auto"),e.style=t.join("; "),Array.isArray(o.tblPrChange)&&o.tblPrChange.length>0){let r=o.tblPrChange[0];e.class+=" ep-revision-prop-change",e["data-revision-id"]=String(r.info.id),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date);}return ["table",e,["tbody",0]]}},ee={content:"(tableCell | tableHeader)+",tableRole:"row",attrs:{height:{default:null},heightRule:{default:null},isHeader:{default:false},_originalFormatting:{default:null},trIns:{default:null},trDel:{default:null},trPrChange:{default:null}},parseDOM:[{tag:"tr"}],toDOM(n){let o=n.attrs,e={};if(o.height){let t=Math.round(o.height/20*1.333);e.style=`height: ${t}px`;}if(o.trIns||o.trDel){let t=o.trIns??o.trDel,r=o.trIns?"ep-revision-ins":"ep-revision-del";e.class="ep-revision-row "+r,e["data-revision-id"]=String(t.revisionId),e["data-revision-author"]=t.author,t.date&&(e["data-revision-date"]=t.date);}else if(Array.isArray(o.trPrChange)&&o.trPrChange.length>0){let t=o.trPrChange[0];e.class="ep-revision-prop-change",e["data-revision-id"]=String(t.info.id),e["data-revision-author"]=t.info.author,t.info.date&&(e["data-revision-date"]=t.info.date);}return ["tr",e,0]}},Ue={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",thinThickSmallGap:"double",thickThinSmallGap:"double",thinThickThinSmallGap:"double",thinThickMediumGap:"double",thickThinMediumGap:"double",thinThickThinMediumGap:"double",thinThickLargeGap:"double",thickThinLargeGap:"double",thinThickThinLargeGap:"double",wave:"solid",doubleWave:"double",dashDotStroked:"dashed",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function te(n){let o=[],e=n.borders;if(!e)return o;let t=r=>{if(!r||!r.style||r.style==="none"||r.style==="nil")return "none";let l=r.size?Math.max(1,Math.round(r.size/8*1.333)):1,s=Ue[r.style]||"solid",a$1=a(r.color,void 0);return `${l}px ${s} ${a$1}`};return o.push(`border-top: ${t(e.top)}`),o.push(`border-bottom: ${t(e.bottom)}`),o.push(`border-left: ${t(e.left)}`),o.push(`border-right: ${t(e.right)}`),o}function oe(n){let o=n.margins;if(!o){let a=Math.round(7.1982);return [`padding: ${a}px ${a}px`]}let e=a=>a?Math.round(a/20*1.333):0,t=e(o.top),r=e(o.right),l=e(o.bottom),s=e(o.left);return [`padding: ${t}px ${r}px ${l}px ${s}px`]}function ne(n){if(!n)return [];let o=[];switch(n){case "tbRl":case "tbRlV":o.push("writing-mode: vertical-rl");break;case "btLr":o.push("writing-mode: vertical-lr","transform: rotate(180deg)");break;case "rl":case "rlV":o.push("direction: rtl");break;case "tb":case "tbV":o.push("writing-mode: vertical-lr");break}return o}function re(n){let o=[];if(n.colwidth&&n.colwidth.length>0){let e=n.colwidth.reduce((t,r)=>t+r,0);o.push(`width: ${e}px`);}else if(n.width&&n.widthType==="pct")o.push(`width: ${n.width}%`);else if(n.width){let e=Math.round(n.width/20*1.333);o.push(`width: ${e}px`);}return o}var le={content:"(paragraph | table)+",tableRole:"cell",isolating:true,attrs:{colspan:{default:1},rowspan:{default:1},colwidth:{default:null},width:{default:null},widthType:{default:null},verticalAlign:{default:null},backgroundColor:{default:null},borders:{default:null},margins:{default:null},textDirection:{default:null},noWrap:{default:false},_originalFormatting:{default:null},_originalResolvedFill:{default:null},cellMarker:{default:null},tcPrChange:{default:null}},parseDOM:[{tag:"td",getAttrs:n=>O(n)}],toDOM(n){let o=n.attrs,e={class:"docx-table-cell"};if(o.cellMarker){let r=o.cellMarker,l=r.kind==="ins"?"ep-revision-ins":r.kind==="del"?"ep-revision-del":"ep-revision-merge";e.class=`${e.class} ep-revision-cell ${l}`,e["data-revision-id"]=String(r.info.revisionId),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date),r.kind==="merge"&&(e["data-vmerge"]=r.vMerge);}else if(Array.isArray(o.tcPrChange)&&o.tcPrChange.length>0){let r=o.tcPrChange[0];e.class=`${e.class} ep-revision-prop-change`,e["data-revision-id"]=String(r.info.id),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date);}o.colspan>1&&(e.colspan=String(o.colspan)),o.rowspan>1&&(e.rowspan=String(o.rowspan));let t=[];return t.push(...oe(o)),o.noWrap?t.push("white-space: nowrap"):t.push("word-wrap: break-word","overflow-wrap: break-word","overflow: hidden"),t.push(...re(o)),t.push(...te(o)),t.push(...ne(o.textDirection)),o.verticalAlign&&(e["data-valign"]=o.verticalAlign,t.push(`vertical-align: ${o.verticalAlign}`)),o.backgroundColor&&(e["data-bgcolor"]=o.backgroundColor,t.push(`background-color: #${o.backgroundColor}`)),e.style=t.join("; "),["td",e,0]}},se={content:"(paragraph | table)+",tableRole:"header_cell",isolating:true,attrs:{colspan:{default:1},rowspan:{default:1},colwidth:{default:null},width:{default:null},widthType:{default:null},verticalAlign:{default:null},backgroundColor:{default:null},borders:{default:null},margins:{default:null},textDirection:{default:null},noWrap:{default:false},_originalFormatting:{default:null},_originalResolvedFill:{default:null},cellMarker:{default:null},tcPrChange:{default:null}},parseDOM:[{tag:"th",getAttrs:n=>O(n)}],toDOM(n){let o=n.attrs,e={class:"docx-table-header"};if(o.colspan>1&&(e.colspan=String(o.colspan)),o.rowspan>1&&(e.rowspan=String(o.rowspan)),o.cellMarker){let r=o.cellMarker,l=r.kind==="ins"?"ep-revision-ins":r.kind==="del"?"ep-revision-del":"ep-revision-merge";e.class=`${e.class} ep-revision-cell ${l}`,e["data-revision-id"]=String(r.info.revisionId),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date),r.kind==="merge"&&(e["data-vmerge"]=r.vMerge);}else if(Array.isArray(o.tcPrChange)&&o.tcPrChange.length>0){let r=o.tcPrChange[0];e.class=`${e.class} ep-revision-prop-change`,e["data-revision-id"]=String(r.info.id),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date);}let t=["font-weight: bold"];return t.push(...oe(o)),o.noWrap?t.push("white-space: nowrap"):t.push("word-wrap: break-word","overflow-wrap: break-word","overflow: hidden"),t.push(...re(o)),t.push(...te(o)),t.push(...ne(o.textDirection)),o.verticalAlign&&(e["data-valign"]=o.verticalAlign,t.push(`vertical-align: ${o.verticalAlign}`)),o.backgroundColor&&(e["data-bgcolor"]=o.backgroundColor,t.push(`background-color: #${o.backgroundColor}`)),e.style=t.join("; "),["th",e,0]}};function y(n){let{selection:o}=n,{$from:e}=o,r=o instanceof CellSelection&&o.$anchorCell.pos!==o.$headCell.pos,l,s,a,c,i;for(let p=e.depth;p>0;p--){let h=e.node(p);if(h.type.name==="tableCell"||h.type.name==="tableHeader"){i=h;let g=e.node(p-1);if(g&&g.type.name==="tableRow"){let w=0,x=false;g.forEach((T,C,P)=>{x||(P===e.index(p-1)?(c=w,x=true):w+=T.attrs.colspan||1);});}}else if(h.type.name==="tableRow"){let g=e.node(p-1);g&&g.type.name==="table"&&(a=e.index(p-1));}else if(h.type.name==="table"){l=h,s=e.before(p);break}}if(!l)return {isInTable:false};let d=0,u=0;l.forEach(p=>{if(p.type.name==="tableRow"){d++;let h=0;p.forEach(g=>{h+=g.attrs.colspan||1;}),u=Math.max(u,h);}});let b=!!i&&!r,f,m;if(i){let p=i.attrs;p.backgroundColor&&typeof p.backgroundColor=="string"&&(m=p.backgroundColor);let h=p.borders;if(h)for(let g of ["top","right","bottom","left"]){let w=h[g];if(w?.color&&w.style&&w.style!=="none"&&w.style!=="nil"){f=w.color;break}}}return {isInTable:true,table:l,tablePos:s,rowIndex:a,columnIndex:c,rowCount:d,columnCount:u,hasMultiCellSelection:r,canSplitCell:!!b,cellBorderColor:f,cellBackgroundColor:m}}function G(n){let{$from:o}=n.selection;for(let e=o.depth;e>0;e--){let t=o.node(e);if(t.type.name==="tableCell"||t.type.name==="tableHeader")return true}return false}function ae(n){let{$from:o}=n.selection,e=-1,t=-1,r=-1;for(let l=o.depth;l>0;l--){let s=o.node(l);if(s.type.name==="tableCell"||s.type.name==="tableHeader")e=l;else if(s.type.name==="tableRow")t=l;else if(s.type.name==="table"){r=l;break}}return e===-1||t===-1||r===-1?null:{cellDepth:e,cellPos:o.before(e),rowDepth:t,tableDepth:r}}function qe(){return (n,o)=>{if(!G(n))return false;let e=ae(n);if(!e)return false;let{$from:t}=n.selection,r=t.node(e.tableDepth),l=t.node(e.rowDepth),s=t.index(e.rowDepth),a=t.index(e.tableDepth);if(s<l.childCount-1){let c=e.cellPos+t.node(e.cellDepth).nodeSize;if(o){let i=c+1+1,d=n.tr.setSelection(Selection.near(n.doc.resolve(i)));o(d.scrollIntoView());}return true}if(a<r.childCount-1){let i=t.before(e.rowDepth)+l.nodeSize;if(o){let d=i+1+1+1,u=n.tr.setSelection(Selection.near(n.doc.resolve(d)));o(u.scrollIntoView());}return true}return false}}function Je(){return (n,o)=>{if(!G(n))return false;let e=ae(n);if(!e)return false;let{$from:t}=n.selection,r=t.node(e.tableDepth),l=t.index(e.rowDepth),s=t.index(e.tableDepth);if(l>0){let c=t.node(e.rowDepth).child(l-1),i=e.cellPos-c.nodeSize;if(o){let d=i+c.nodeSize-2,u=n.tr.setSelection(Selection.near(n.doc.resolve(d),-1));o(u.scrollIntoView());}return true}if(s>0){let a=r.child(s-1),i=t.before(e.rowDepth)-a.nodeSize;if(o){let u=i+a.nodeSize-1-1,b=n.tr.setSelection(Selection.near(n.doc.resolve(u),-1));o(b.scrollIntoView());}return true}return false}}function E(n,o={}){let e=n?.attrs??{};return {colspan:e.colspan||1,rowspan:1,colwidth:e.colwidth,width:e.width,widthType:e.widthType,verticalAlign:e.verticalAlign,backgroundColor:e.backgroundColor,borders:e.borders,margins:e.margins,textDirection:e.textDirection,noWrap:e.noWrap,...o}}function z(n,o){let{$from:e}=n.selection;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.name===o)return {pos:e.before(t),node:r}}return null}function B(n){let o=n.selection;if(o instanceof CellSelection){let t=[];return o.forEachCell((r,l)=>{t.push({pos:l,node:r});}),t}let e=z(n,"tableCell")??z(n,"tableHeader");return e?[e]:[]}function V(n,o){let e=new Map,t=new Map,r=n.childCount,l=0;return n.forEach((s,a,c)=>{if(s.type.name!=="tableRow")return;let i=0;s.forEach((d,u)=>{let b=o+a+u+2,f=d.attrs.colspan||1;e.set(b,{rowIdx:c,colIdx:i,colspan:f,pos:b,node:d}),t.set(`${c},${i}`,b),i+=f;}),l=Math.max(l,i);}),{cellByPos:e,cellByRC:t,totalRows:r,totalCols:l}}function ie(n,o,e){let t=[];return o.forEach(r=>{let l=n.nodes.paragraph.create(),a={...E(r),cellMarker:{kind:"ins",info:e}};t.push(n.nodes.tableCell.create(a,l));}),n.nodes.tableRow.create({height:o.attrs.height??360,heightRule:o.attrs.heightRule??"atLeast",isHeader:o.attrs.isHeader??false,trIns:e},t)}function Xe(n){return function(e,t,r="000000",l=9360,s){let a=[],c=Math.floor(l/t),i=360,d="atLeast",u={style:"single",size:4,color:{rgb:r}},b={top:u,bottom:u,left:u,right:u};for(let m=0;m<e;m++){let p=[];for(let g=0;g<t;g++){let w=n.nodes.paragraph.create(),x={colspan:1,rowspan:1,borders:b,width:c,widthType:"dxa"};s&&(x.cellMarker={kind:"ins",info:s}),p.push(n.nodes.tableCell.create(x,w));}let h={height:i,heightRule:d};s&&(h.trIns=s),a.push(n.nodes.tableRow.create(h,p));}let f=Array(t).fill(c);return n.nodes.table.create({columnWidths:f,width:l,widthType:"dxa"},a)}}function de(n){let o=Xe(n);return function(t,r){return (l,s)=>{let{$from:a}=l.selection,c="000000",i$1=l.storedMarks||a.marks();for(let u of i$1)if(u.type.name==="textColor"&&u.attrs.rgb){c=u.attrs.rgb;break}let d=a.pos;for(let u=a.depth;u>0;u--){let b=a.node(u);if(b.type.name==="paragraph"||b.type.name==="table"){d=a.after(u);break}}if(s){let u=9360;for(let P=a.depth;P>0;P--){let R=a.node(P);if(R.type.name==="tableCell"||R.type.name==="tableHeader"){let S=R.attrs.width;S&&S>0&&(u=Math.max(S-216,360));break}}let b=i(l),f=o(t,r,c,u,b),m=n.nodes.paragraph.create(),h=l.doc.resolve(d).nodeBefore?.type.name==="table",g=h?[m,f,m]:[f,m],w=l.tr.insert(d,g),x=d+1;h&&(x+=m.nodeSize);let C=x+1+1;w.setSelection(TextSelection.create(w.doc,C)),s(w.scrollIntoView());}return true}}}function ce(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.rowIndex===void 0||!t.table||t.tablePos===void 0)return false;if(e){let r=o.tr,l=t.table.child(t.rowIndex),s=i(o),a;if(s)a=ie(n,l,s);else {let i=[];l.forEach(d=>{let u=n.nodes.paragraph.create(),b=E(d);i.push(n.nodes.tableCell.create(b,u));}),a=n.nodes.tableRow.create({height:l.attrs.height??360,heightRule:l.attrs.heightRule??"atLeast"},i);}let c=t.tablePos+1;for(let i=0;i<t.rowIndex;i++)c+=t.table.child(i).nodeSize;r.insert(c,a),e(r.scrollIntoView());}return true}}function ue(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.rowIndex===void 0||!t.table||t.tablePos===void 0)return false;if(e){let r=o.tr,l=t.table.child(t.rowIndex),s=i(o),a;if(s)a=ie(n,l,s);else {let i=[];l.forEach(d=>{let u=n.nodes.paragraph.create(),b=E(d);i.push(n.nodes.tableCell.create(b,u));}),a=n.nodes.tableRow.create({height:l.attrs.height??360,heightRule:l.attrs.heightRule??"atLeast"},i);}let c=t.tablePos+1;for(let i=0;i<=t.rowIndex;i++)c+=t.table.child(i).nodeSize;r.insert(c,a),e(r.scrollIntoView());}return true}}function fe(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.columnIndex===void 0||!t.table||t.tablePos===void 0)return false;if(e){let r=o.tr,l=(t.columnCount||1)+1,s=Math.floor(5e3/l),a=[],c=t.tablePos+1;t.table.forEach(d=>{a.push(c),c+=d.nodeSize;}),t.table.forEach((d,u,b)=>{if(d.type.name==="tableRow"){let m=r.mapping.map(a[b])+1,p=0,h=false;if(d.forEach(g=>{if(!h&&p===t.columnIndex){let w=n.nodes.paragraph.create(),x=E(g,{colspan:1,rowspan:1});x.width=s,x.widthType="pct";let T=n.nodes.tableCell.create(x,w);r=r.insert(m,T),h=true;}m+=g.nodeSize,p+=g.attrs.colspan||1;}),!h&&p<=t.columnIndex){let g=n.nodes.paragraph.create(),w=E(d.child(d.childCount-1)??null,{colspan:1,rowspan:1});w.width=s,w.widthType="pct";let x=n.nodes.tableCell.create(w,g);r=r.insert(m,x);}}});let i=r.doc.nodeAt(t.tablePos);if(i&&i.type.name==="table"){let d=i.child(0);if(d&&d.type.name==="tableRow"){let m=t.tablePos+2;d.forEach(p=>{(p.type.name==="tableCell"||p.type.name==="tableHeader")&&(r=r.setNodeMarkup(m,void 0,{...p.attrs,width:s,widthType:"pct"})),m+=p.nodeSize;});}let u=d?.childCount??l,b=i.attrs.width||9360,f=Math.floor(b/Math.max(1,u));r=r.setNodeMarkup(t.tablePos,void 0,{...i.attrs,columnWidths:Array(u).fill(f)});}e(r.scrollIntoView());}return true}}function pe(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.columnIndex===void 0||!t.table||t.tablePos===void 0)return false;if(e){let r=o.tr,l=(t.columnCount||1)+1,s=Math.floor(5e3/l),a=[],c=t.tablePos+1;t.table.forEach(d=>{a.push(c),c+=d.nodeSize;}),t.table.forEach((d,u,b)=>{if(d.type.name==="tableRow"){let m=r.mapping.map(a[b])+1,p=0,h=false;if(d.forEach(g=>{if(m+=g.nodeSize,p+=g.attrs.colspan||1,!h&&p>t.columnIndex){let w=n.nodes.paragraph.create(),x=E(g,{colspan:1,rowspan:1});x.width=s,x.widthType="pct";let T=n.nodes.tableCell.create(x,w);r=r.insert(m,T),h=true;}}),!h){let g=n.nodes.paragraph.create(),w=E(d.child(d.childCount-1)??null,{colspan:1,rowspan:1});w.width=s,w.widthType="pct";let x=n.nodes.tableCell.create(w,g);r=r.insert(m,x);}}});let i=r.doc.nodeAt(t.tablePos);if(i&&i.type.name==="table"){let d=i.child(0);if(d&&d.type.name==="tableRow"){let m=t.tablePos+2;d.forEach(p=>{(p.type.name==="tableCell"||p.type.name==="tableHeader")&&(r=r.setNodeMarkup(m,void 0,{...p.attrs,width:s,widthType:"pct"})),m+=p.nodeSize;});}let u=d?.childCount??l,b=i.attrs.width||9360,f=Math.floor(b/Math.max(1,u));r=r.setNodeMarkup(t.tablePos,void 0,{...i.attrs,columnWidths:Array(u).fill(f)});}e(r.scrollIntoView());}return true}}var be=(n,o)=>{let e=y(n);if(!e.isInTable||e.rowIndex===void 0||!e.table||e.tablePos===void 0||(e.rowCount||0)<=1)return false;if(o){let t=n.tr,r=e.tablePos+1;for(let a=0;a<e.rowIndex;a++)r+=e.table.child(a).nodeSize;let l=e.table.child(e.rowIndex),s=i(n);if(s){t.setNodeMarkup(r,void 0,{...l.attrs,trDel:s});let a=r+1;l.forEach(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&t.setNodeMarkup(a,void 0,{...c.attrs,cellMarker:{kind:"del",info:s}}),a+=c.nodeSize;});}else {let a=r+l.nodeSize;t.delete(r,a);}o(t.scrollIntoView());}return true},me=(n,o)=>{let e=y(n);if(!e.isInTable||e.columnIndex===void 0||!e.table||e.tablePos===void 0||(e.columnCount||0)<=1)return false;if(o){let t=n.tr,r=(e.columnCount||2)-1,l=Math.floor(5e3/r),s=[],a=e.tablePos+1;e.table.forEach(i=>{if(i.type.name==="tableRow"){let d=a+1,u=0;i.forEach(b=>{let f=d,m=d+b.nodeSize,p=b.attrs.colspan||1;u<=e.columnIndex&&e.columnIndex<u+p&&s.push({start:f,end:m}),d=m,u+=p;});}a+=i.nodeSize;}),s.reverse().forEach(({start:i,end:d})=>{t=t.delete(i,d);});let c=t.doc.nodeAt(e.tablePos);if(c&&c.type.name==="table"){let i=c.child(0);if(i&&i.type.name==="tableRow"){let f=e.tablePos+2;i.forEach(m=>{(m.type.name==="tableCell"||m.type.name==="tableHeader")&&(t=t.setNodeMarkup(f,void 0,{...m.attrs,width:l,widthType:"pct"})),f+=m.nodeSize;});}let d=i?.childCount??r,u=c.attrs.width||9360,b=Math.floor(u/Math.max(1,d));t=t.setNodeMarkup(e.tablePos,void 0,{...c.attrs,columnWidths:Array(d).fill(b)});}o(t.scrollIntoView());}return true},he=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(o){let t=n.tr;t.delete(e.tablePos,e.tablePos+e.table.nodeSize),o(t.scrollIntoView());}return true},_=(n,o)=>{let e=n.selection;if(!("$anchorCell"in e&&typeof e.forEachCell=="function"))return false;let r=y(n);if(!r.isInTable||r.tablePos===void 0||!r.table)return false;let l=0;r.table.descendants(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&(l+=1);});let s=0;if(e.forEachCell(()=>{s+=1;}),!(l>0&&s>=l))return false;if(o){let c=n.tr.delete(r.tablePos,r.tablePos+r.table.nodeSize);o(c.scrollIntoView());}return true},U=n=>{let{$from:o,empty:e}=n.selection;if(!e)return false;let t=o.parent;if(t.type.name!=="paragraph"||t.textContent.length>0)return false;let r=o.depth;if(r<1)return false;let l=o.node(r-1),s=o.index(r-1),a=s>0?l.child(s-1):null,c=s+1<l.childCount?l.child(s+1):null,i=a?.type.name==="table",d=c?.type.name==="table";return !!(i||d)};var ge=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(o){let t=e.tablePos+1,r=n.doc.resolve(t),l=n.doc.resolve(e.tablePos+e.table.nodeSize-2),s=CellSelection.create(n.doc,r.pos,l.pos);o(n.tr.setSelection(s));}return true},we=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table||e.rowIndex===void 0)return false;if(o){let r=e.tablePos+1;for(let i=0;i<e.rowIndex;i++){let d=e.table.child(i);r+=d.nodeSize;}let l=e.table.child(e.rowIndex),s=r+1,a=r+l.nodeSize-2,c=CellSelection.create(n.doc,s,a);o(n.tr.setSelection(c));}return true},Ce=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table||e.columnIndex===void 0)return false;if(o){let t=e.tablePos+1,r=e.table.child(0),l=e.table.child(e.table.childCount-1),s=t+1;for(let d=0;d<e.columnIndex&&d<r.childCount;d++)s+=r.child(d).nodeSize;let a=t;for(let d=0;d<e.table.childCount-1;d++)a+=e.table.child(d).nodeSize;let c=a+1;for(let d=0;d<e.columnIndex&&d<l.childCount;d++)c+=l.child(d).nodeSize;let i=CellSelection.create(n.doc,s,c);o(n.tr.setSelection(i));}return true};var F={top:{adjSide:"bottom",dRow:-1,dCol:0},bottom:{adjSide:"top",dRow:1,dCol:0},left:{adjSide:"right",dRow:0,dCol:-1},right:{adjSide:"left",dRow:0,dCol:1}};function W(n,o){return (e,t)=>{let r=y(e);if(!r.isInTable||r.tablePos===void 0||!r.table)return false;if(t){let l=e.tr,s=r.table,a=r.tablePos,c=o??{style:"single",size:4,color:{rgb:"000000"}},i={style:"none"},{cellByPos:d,cellByRC:u}=V(s,a),b=B(e),f=1/0,m=-1,p=1/0,h=-1;for(let{pos:T}of b){let C=d.get(T);C&&(f=Math.min(f,C.rowIdx),m=Math.max(m,C.rowIdx),p=Math.min(p,C.colIdx),h=Math.max(h,C.colIdx+C.colspan-1));}let g=new Map,w=(T,C)=>g.get(T)??{...C.attrs},x=(T,C)=>{g.set(T,C);};for(let{pos:T}of b){let C=d.get(T);if(!C)continue;let P=C.rowIdx===f,R=C.rowIdx===m,S=C.colIdx===p,M=C.colIdx+C.colspan-1===h,k;switch(n){case "all":k={top:c,bottom:c,left:c,right:c};break;case "outside":k={top:P?c:i,bottom:R?c:i,left:S?c:i,right:M?c:i};break;case "inside":k={top:P?i:c,bottom:R?i:c,left:S?i:c,right:M?i:c};break;case "none":k={top:i,bottom:i,left:i,right:i};break}let N=w(T,C.node),v=N.borders||{};x(T,{...N,borders:{...v,...k}});for(let A of ["top","bottom","left","right"]){let $=k[A];if(!$)continue;let I=F[A],We=A==="right"?C.colIdx+C.colspan:C.colIdx+I.dCol,H=u.get(`${C.rowIdx+I.dRow},${We}`);if(H===void 0)continue;let je=d.get(H),J=w(H,je.node),Ve=J.borders||{};x(H,{...J,borders:{...Ve,[I.adjSide]:$}});}}for(let[T,C]of g)l.setNodeMarkup(l.mapping.map(T),void 0,C);t(l.scrollIntoView());}return true}}function xe(n,o,e){return (t,r)=>{let l=y(t);if(!l.isInTable||l.tablePos===void 0||!l.table)return false;if(r){let s=t.tr,a=B(t),c=o||{style:"none"},i={style:"none"},d=["top","bottom","left","right"],{cellByPos:u,cellByRC:b}=V(l.table,l.tablePos),f=new Map,m=(h,g)=>f.get(h)??{...g.attrs},p=(h,g)=>f.set(h,g);for(let{pos:h,node:g}of a){let w=u.get(h),x=m(h,g),T=x.borders||{},C=n==="all"?d:[n],P=e?{top:i,bottom:i,left:i,right:i}:{...T};for(let R of C)P[R]=c;if(w){let R=e?d:C;for(let S of R){let M=P[S],k=F[S],N=S==="right"?w.colIdx+w.colspan:w.colIdx+k.dCol,v=b.get(`${w.rowIdx+k.dRow},${N}`);if(v!==void 0){let A=u.get(v),$=m(v,A.node),I=$.borders||{};p(v,{...$,borders:{...I,[k.adjSide]:M}});}}}p(h,{...x,borders:P});}for(let[h,g]of f)s.setNodeMarkup(s.mapping.map(h),void 0,g);r(s.scrollIntoView());}return true}}function ye(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=B(o),s=n.replace(/^#/,""),a={style:"single",size:4},{cellByPos:c,cellByRC:i}=V(t.table,t.tablePos),d=new Map,u=(f,m)=>d.get(f)??{...m.attrs},b=(f,m)=>d.set(f,m);for(let{pos:f,node:m}of l){let p=c.get(f),h=u(f,m),g=h.borders||{},w={};for(let x of ["top","bottom","left","right"]){let T={...a,...g[x],color:{rgb:s}};if(w[x]=T,p){let C=F[x],P=x==="right"?p.colIdx+p.colspan:p.colIdx+C.dCol,R=i.get(`${p.rowIdx+C.dRow},${P}`);if(R!==void 0){let S=c.get(R),M=u(R,S.node),k=M.borders||{};b(R,{...M,borders:{...k,[C.adjSide]:T}});}}}b(f,{...h,borders:{...g,...w}});}for(let[f,m]of d)r.setNodeMarkup(r.mapping.map(f),void 0,m);e(r.scrollIntoView());}return true}}function Te(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=B(o),s={style:"single",color:{rgb:"000000"}},{cellByPos:a,cellByRC:c}=V(t.table,t.tablePos),i=new Map,d=(b,f)=>i.get(b)??{...f.attrs},u=(b,f)=>i.set(b,f);for(let{pos:b,node:f}of l){let m=a.get(b),p=d(b,f),h=p.borders||{},g={};for(let w of ["top","bottom","left","right"]){let x={...s,...h[w],size:n};if(g[w]=x,m){let T=F[w],C=w==="right"?m.colIdx+m.colspan:m.colIdx+T.dCol,P=c.get(`${m.rowIdx+T.dRow},${C}`);if(P!==void 0){let R=a.get(P),S=d(P,R.node),M=S.borders||{};u(P,{...S,borders:{...M,[T.adjSide]:x}});}}}u(b,{...p,borders:{...h,...g}});}for(let[b,f]of i)r.setNodeMarkup(r.mapping.map(b),void 0,f);e(r.scrollIntoView());}return true}}function Se(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=B(o),s=n?n.replace(/^#/,""):null;for(let{pos:a,node:c}of l)r.setNodeMarkup(r.mapping.map(a),void 0,{...c.attrs,backgroundColor:s});e(r.scrollIntoView());}return true}}function Pe(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=B(o);for(let{pos:s,node:a}of l)r.setNodeMarkup(r.mapping.map(s),void 0,{...a.attrs,verticalAlign:n});e(r.scrollIntoView());}return true}}function Re(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=B(o);for(let{pos:s,node:a}of l){let i={...a.attrs.margins||{},...n};r.setNodeMarkup(r.mapping.map(s),void 0,{...a.attrs,margins:i});}e(r.scrollIntoView());}return true}}function Ie(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=B(o);for(let{pos:s,node:a}of l)r.setNodeMarkup(r.mapping.map(s),void 0,{...a.attrs,textDirection:n});e(r.scrollIntoView());}return true}}var ke=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(o){let t=n.tr,r=B(n);for(let{pos:l,node:s}of r)t.setNodeMarkup(t.mapping.map(l),void 0,{...s.attrs,noWrap:!s.attrs.noWrap});o(t.scrollIntoView());}return true};function Me(n,o){return (e,t)=>{let r=y(e);if(!r.isInTable||r.tablePos===void 0||!r.table)return false;if(t){let l=z(e,"tableRow");if(!l)return true;let s=e.tr.setNodeMarkup(l.pos,void 0,{...l.node.attrs,height:n,heightRule:n?o||"atLeast":null});t(s.scrollIntoView());}return true}}var ve=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table||!e.columnCount)return false;if(o){let t=n.tr,r=e.table,l=e.columnCount,s=r.attrs.columnWidths,a=s?s.reduce((u,b)=>u+b,0):9360,c=Math.floor(a/l),i=e.tablePos+1;r.forEach(u=>{if(u.type.name==="tableRow"){let b=i+1;u.forEach(f=>{(f.type.name==="tableCell"||f.type.name==="tableHeader")&&(t=t.setNodeMarkup(b,void 0,{...f.attrs,width:c,widthType:"dxa",colwidth:null})),b+=f.nodeSize;});}i+=u.nodeSize;});let d=Array(l).fill(c);t=t.setNodeMarkup(e.tablePos,void 0,{...r.attrs,columnWidths:d}),o(t.scrollIntoView());}return true},Ae=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(o){let t=n.tr,r=e.table,l=e.tablePos+1;r.forEach(s=>{if(s.type.name==="tableRow"){let a=l+1;s.forEach(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&(t=t.setNodeMarkup(a,void 0,{...c.attrs,width:null,widthType:null,colwidth:null})),a+=c.nodeSize;});}l+=s.nodeSize;}),t=t.setNodeMarkup(e.tablePos,void 0,{...r.attrs,columnWidths:null,width:null,widthType:"auto"}),o(t.scrollIntoView());}return true};function Be(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l=t.table,s=t.tablePos,a=l.childCount,c=n.look??{firstRow:true,lastRow:false,noHBand:false},i=n.conditionals??{},d=n.tableBorders;r=r.setNodeMarkup(s,void 0,{...l.attrs,styleId:n.styleId});let u=0,b=s+1;for(let f=0;f<a;f++){let m=l.child(f),p=f===0&&!!c.firstRow,h=f===a-1&&!!c.lastRow,g=c.noHBand!==true,w=m.childCount,x;p?x="firstRow":h?x="lastRow":(g&&(x=u%2===0?"band1Horz":"band2Horz"),u++);let T=b+1;for(let C=0;C<w;C++){let P=m.child(C),R=r.mapping.map(T),S=x,M=C===0&&!!c.firstCol,k=C===w-1&&!!c.lastCol;p&&M&&i.nwCell?S="nwCell":p&&k&&i.neCell?S="neCell":h&&M&&i.swCell?S="swCell":h&&k&&i.seCell?S="seCell":M?S="firstCol":k&&(S="lastCol");let N=S?i[S]:void 0,v={...P.attrs};N?.backgroundColor?v.backgroundColor=N.backgroundColor:v.backgroundColor=null;let A={},$=["top","bottom","left","right"];for(let I of $)N?.borders&&N.borders[I]!==void 0?A[I]=N.borders[I]:d&&(I==="top"&&f>0||I==="bottom"&&f<a-1?A[I]=d.insideH??d[I]:I==="left"&&C>0||I==="right"&&C<w-1?A[I]=d.insideV??d[I]:A[I]=d[I]);Object.keys(A).length>0?v.borders=A:v.borders=null,r=r.setNodeMarkup(R,void 0,v),T+=P.nodeSize;}b+=m.nodeSize;}e(r.scrollIntoView());}return true}}function Ne(n){return (o,e)=>{let t=y(o);if(!t.isInTable||t.tablePos===void 0||!t.table)return false;if(e){let r=o.tr,l={...t.table.attrs};"width"in n&&(l.width=n.width),"widthType"in n&&(l.widthType=n.widthType),"justification"in n&&(l.justification=n.justification),r.setNodeMarkup(t.tablePos,void 0,l),e(r.scrollIntoView());}return true}}var Ee=(n,o)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(o){let t=z(n,"tableRow");if(!t)return true;let r=n.tr.setNodeMarkup(t.pos,void 0,{...t.node.attrs,isHeader:!t.node.attrs.isHeader});o(r.scrollIntoView());}return true};function $e(){let n=new PluginKey("activeCell");return new Plugin({key:n,props:{decorations(o){let{selection:e}=o;if(e instanceof CellSelection)return DecorationSet.empty;let{$from:t}=e;for(let r=t.depth;r>0;r--){let l=t.node(r);if(l.type.name==="tableCell"||l.type.name==="tableHeader"){let s=t.before(r);return DecorationSet.create(o.doc,[Decoration.node(s,s+l.nodeSize,{class:"activeCell"})])}}return DecorationSet.empty}}})}function ze(n){let{schema:o}=n,e=de(o),t=ce(o),r=ue(o),l=fe(o),s=pe(o);return {plugins:[columnResizing({handleWidth:5,cellMinWidth:25,lastColumnResizable:true}),tableEditing(),$e()],keyboardShortcuts:{Backspace:chainCommands(_,U),Delete:chainCommands(_,U)},commands:{insertTable:e,addRowAbove:()=>t,addRowBelow:()=>r,deleteRow:()=>be,addColumnLeft:()=>l,addColumnRight:()=>s,deleteColumn:()=>me,deleteTable:()=>he,selectTable:()=>ge,selectRow:()=>we,selectColumn:()=>Ce,mergeCells:()=>mergeCells,splitCell:()=>splitCell,setCellBorder:xe,setTableBorders:W,setCellVerticalAlign:Pe,setCellMargins:Re,setCellTextDirection:Ie,toggleNoWrap:()=>ke,setRowHeight:Me,toggleHeaderRow:()=>Ee,distributeColumns:()=>ve,autoFitContents:()=>Ae,setTableProperties:Ne,applyTableStyle:Be,setCellFillColor:Se,setTableBorderColor:ye,setTableBorderWidth:Te,removeTableBorders:()=>W("none"),setAllTableBorders:a=>W("all",a),setOutsideTableBorders:a=>W("outside",a),setInsideTableBorders:a=>W("inside",a)}}}var at=c({name:"table",schemaNodeName:"table",nodeSpec:Z}),it=c({name:"tableRow",schemaNodeName:"tableRow",nodeSpec:ee}),dt=c({name:"tableCell",schemaNodeName:"tableCell",nodeSpec:le}),ct=c({name:"tableHeader",schemaNodeName:"tableHeader",nodeSpec:se}),ut=b({name:"tablePlugin",onSchemaReady:ze});function io(){return [at(),it(),dt(),ct(),ut()]}export{y as a,G as b,qe as c,Je as d,at as e,it as f,dt as g,ct as h,ut as i,io as j};
@@ -1,6 +1,6 @@
1
1
  import { Document } from './types/document.js';
2
2
  import { T as ThemeColorSlot, C as ColorValue } from './colors-C3vA7HUU.js';
3
- import { T as Theme, f as ThemeColorScheme } from './styles-jqO45PSq.js';
3
+ import { T as Theme, f as ThemeColorScheme } from './styles-BBv7doYK.js';
4
4
 
5
5
  /**
6
6
  * Template Processing Utility
@@ -1,6 +1,6 @@
1
1
  import { Document } from './types/document.mjs';
2
2
  import { T as ThemeColorSlot, C as ColorValue } from './colors-C3vA7HUU.mjs';
3
- import { T as Theme, f as ThemeColorScheme } from './styles-BBoqh07F.mjs';
3
+ import { T as Theme, f as ThemeColorScheme } from './styles-EI2lxeEN.mjs';
4
4
 
5
5
  /**
6
6
  * Template Processing Utility