kordoc 4.24.1 → 4.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +2 -2
  2. package/dist/{-TSN4SWFV.js → -SRNEV7LS.js} +11 -11
  3. package/dist/{chunk-B77K6J3U.js → chunk-3HN65YAL.js} +2 -2
  4. package/dist/{chunk-SWCO5NP6.js → chunk-4745MFQU.js} +3 -3
  5. package/dist/{chunk-2SMANR76.js → chunk-4XC4O7FJ.js} +4 -4
  6. package/dist/{chunk-RS2Q64N5.js → chunk-7NTMM6PO.js} +2 -2
  7. package/dist/{chunk-4BCQ3FQS.js → chunk-C6ZVB547.js} +11 -11
  8. package/dist/{chunk-LBPUPT6S.js → chunk-DHMBPMKC.js} +74 -30
  9. package/dist/chunk-DHMBPMKC.js.map +1 -0
  10. package/dist/{chunk-LEL5UBGR.js → chunk-E6VBLBOO.js} +2 -2
  11. package/dist/{chunk-LEUS275C.js → chunk-E7B5CXYI.js} +2 -2
  12. package/dist/chunk-GS7T56RP.cjs.map +1 -1
  13. package/dist/{chunk-RIQVVWVF.cjs → chunk-HLTPMSYW.cjs} +3 -3
  14. package/dist/chunk-HLTPMSYW.cjs.map +1 -0
  15. package/dist/{chunk-KGOVG47P.cjs → chunk-IGG63DFK.cjs} +3 -3
  16. package/dist/chunk-IGG63DFK.cjs.map +1 -0
  17. package/dist/chunk-J55UQC5H.cjs.map +1 -1
  18. package/dist/{chunk-5QBTJ4LA.cjs → chunk-JFUUFJZW.cjs} +6 -6
  19. package/dist/chunk-JFUUFJZW.cjs.map +1 -0
  20. package/dist/{chunk-HP24FYLJ.js → chunk-JMOAMKAR.js} +4 -4
  21. package/dist/{chunk-W4P3QPSB.js → chunk-KUC5I5MB.js} +2 -2
  22. package/dist/{chunk-YE4T2P6F.js → chunk-LMEF7FN5.js} +2 -2
  23. package/dist/{chunk-NAPPGU3W.js → chunk-M46PB75E.js} +2 -2
  24. package/dist/{chunk-AJ3DJSO6.js → chunk-MHNJOJQV.js} +4 -4
  25. package/dist/{chunk-5EP6VFP5.js → chunk-NJ5RUDCW.js} +3 -3
  26. package/dist/{chunk-MI25BZSU.js → chunk-NMFFIUI6.js} +2 -2
  27. package/dist/{chunk-TYXXTWPH.cjs → chunk-PNSALBXH.cjs} +2 -2
  28. package/dist/chunk-PNSALBXH.cjs.map +1 -0
  29. package/dist/{chunk-JSI5T77E.cjs → chunk-PNX5FYHC.cjs} +24 -24
  30. package/dist/chunk-PNX5FYHC.cjs.map +1 -0
  31. package/dist/{chunk-V2GW3M2F.js → chunk-R2GIGE5H.js} +2 -2
  32. package/dist/{chunk-L2OJUIII.js → chunk-RIRPLFPN.js} +2 -2
  33. package/dist/{chunk-WYYUWBTS.js → chunk-TDMBTG7U.js} +2 -2
  34. package/dist/chunk-TK3FDAEE.cjs.map +1 -1
  35. package/dist/{chunk-G7SKCXQG.js → chunk-TW3V6FSH.js} +2 -2
  36. package/dist/{chunk-4VNIEHWM.cjs → chunk-UNICY546.cjs} +23 -23
  37. package/dist/chunk-UNICY546.cjs.map +1 -0
  38. package/dist/{chunk-ZR3BPESP.js → chunk-VPSF5LEM.js} +3 -3
  39. package/dist/{chunk-6H7D4QTM.js → chunk-W24TJJNN.js} +2 -2
  40. package/dist/{chunk-BIVO2GMU.js → chunk-WDSTW3BD.js} +2 -2
  41. package/dist/{chunk-RVKOFZAT.js → chunk-WJAFE3Z6.js} +2 -2
  42. package/dist/chunks-AL4P5TO5.js +10 -0
  43. package/dist/cli.js +30 -30
  44. package/dist/{formula-6J26PNHL.js → formula-DSB574H7.js} +4 -4
  45. package/dist/{formula-5DGAZK6N.cjs → formula-HK2MNZ3Q.cjs} +9 -9
  46. package/dist/formula-HK2MNZ3Q.cjs.map +1 -0
  47. package/dist/{formula-PNZX2ZAZ.js → formula-U2LZ67KI.js} +3 -3
  48. package/dist/{image-ocr-UNTKJLQL.js → image-ocr-3QB2HLSI.js} +9 -9
  49. package/dist/{image-ocr-RPHNFU7I.js → image-ocr-J54Q3YWP.js} +6 -6
  50. package/dist/{image-ocr-I4PGBAJ7.cjs → image-ocr-QNIMVE5A.cjs} +17 -17
  51. package/dist/image-ocr-QNIMVE5A.cjs.map +1 -0
  52. package/dist/index.cjs +472 -428
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.js +74 -30
  55. package/dist/index.js.map +1 -1
  56. package/dist/mcp.js +23 -23
  57. package/dist/{model-bundle-ZSDEJFA7.js → model-bundle-CGWU4ALC.js} +5 -5
  58. package/dist/{models-JS66XYKO.js → models-A3TF3BDV.js} +5 -5
  59. package/dist/page-range-QHHFTL7X.cjs.map +1 -1
  60. package/dist/{parse-worker-v2-JHPEY3MI.js → parse-worker-v2-MNUD4WAR.js} +12 -12
  61. package/dist/{parser-YKATDDQV.js → parser-C3ARF26I.js} +12 -12
  62. package/dist/{parser-N64TUIWU.js → parser-OBGWEWSU.js} +9 -9
  63. package/dist/{parser-NMV5GTKC.cjs → parser-RPAHN3OR.cjs} +157 -157
  64. package/dist/parser-RPAHN3OR.cjs.map +1 -0
  65. package/dist/{pdf-ocr-KTKR2JQH.js → pdf-ocr-ENLVEEYL.js} +9 -9
  66. package/dist/pdf-ocr-GA5QJFNK.cjs +31 -0
  67. package/dist/pdf-ocr-GA5QJFNK.cjs.map +1 -0
  68. package/dist/{pdf-ocr-W3LDJYCA.js → pdf-ocr-K53REDNY.js} +6 -6
  69. package/dist/{profile-io-JRODOL7A.js → profile-io-ZGFEO7CB.js} +3 -3
  70. package/dist/{rasterize-2DMR7RGP.js → rasterize-QMC2SAUT.js} +3 -3
  71. package/dist/{redact-doc-TC6QSTPM.js → redact-doc-JH6RZZBE.js} +11 -11
  72. package/dist/{render-WEUU5EDS.js → render-ZGKQLKPJ.js} +7 -7
  73. package/dist/seal-KMGYTJAV.js +10 -0
  74. package/dist/{setup-LKJKGMKJ.js → setup-LAQGCYQ2.js} +3 -3
  75. package/dist/visual-4OYJFGXL.js +21 -0
  76. package/dist/{watch-HHFVXB3G.js → watch-7YPB4TKC.js} +12 -12
  77. package/package.json +1 -1
  78. package/dist/chunk-4VNIEHWM.cjs.map +0 -1
  79. package/dist/chunk-5QBTJ4LA.cjs.map +0 -1
  80. package/dist/chunk-JSI5T77E.cjs.map +0 -1
  81. package/dist/chunk-KGOVG47P.cjs.map +0 -1
  82. package/dist/chunk-LBPUPT6S.js.map +0 -1
  83. package/dist/chunk-RIQVVWVF.cjs.map +0 -1
  84. package/dist/chunk-TYXXTWPH.cjs.map +0 -1
  85. package/dist/chunks-HPPVNSBT.js +0 -10
  86. package/dist/formula-5DGAZK6N.cjs.map +0 -1
  87. package/dist/image-ocr-I4PGBAJ7.cjs.map +0 -1
  88. package/dist/parser-NMV5GTKC.cjs.map +0 -1
  89. package/dist/pdf-ocr-JXK752RC.cjs +0 -31
  90. package/dist/pdf-ocr-JXK752RC.cjs.map +0 -1
  91. package/dist/seal-LSALFURW.js +0 -10
  92. package/dist/visual-PHZHJRY5.js +0 -21
  93. /package/dist/{-TSN4SWFV.js.map → -SRNEV7LS.js.map} +0 -0
  94. /package/dist/{chunk-B77K6J3U.js.map → chunk-3HN65YAL.js.map} +0 -0
  95. /package/dist/{chunk-SWCO5NP6.js.map → chunk-4745MFQU.js.map} +0 -0
  96. /package/dist/{chunk-2SMANR76.js.map → chunk-4XC4O7FJ.js.map} +0 -0
  97. /package/dist/{chunk-RS2Q64N5.js.map → chunk-7NTMM6PO.js.map} +0 -0
  98. /package/dist/{chunk-4BCQ3FQS.js.map → chunk-C6ZVB547.js.map} +0 -0
  99. /package/dist/{chunk-LEL5UBGR.js.map → chunk-E6VBLBOO.js.map} +0 -0
  100. /package/dist/{chunk-LEUS275C.js.map → chunk-E7B5CXYI.js.map} +0 -0
  101. /package/dist/{chunk-HP24FYLJ.js.map → chunk-JMOAMKAR.js.map} +0 -0
  102. /package/dist/{chunk-W4P3QPSB.js.map → chunk-KUC5I5MB.js.map} +0 -0
  103. /package/dist/{chunk-YE4T2P6F.js.map → chunk-LMEF7FN5.js.map} +0 -0
  104. /package/dist/{chunk-NAPPGU3W.js.map → chunk-M46PB75E.js.map} +0 -0
  105. /package/dist/{chunk-AJ3DJSO6.js.map → chunk-MHNJOJQV.js.map} +0 -0
  106. /package/dist/{chunk-5EP6VFP5.js.map → chunk-NJ5RUDCW.js.map} +0 -0
  107. /package/dist/{chunk-MI25BZSU.js.map → chunk-NMFFIUI6.js.map} +0 -0
  108. /package/dist/{chunk-V2GW3M2F.js.map → chunk-R2GIGE5H.js.map} +0 -0
  109. /package/dist/{chunk-L2OJUIII.js.map → chunk-RIRPLFPN.js.map} +0 -0
  110. /package/dist/{chunk-WYYUWBTS.js.map → chunk-TDMBTG7U.js.map} +0 -0
  111. /package/dist/{chunk-G7SKCXQG.js.map → chunk-TW3V6FSH.js.map} +0 -0
  112. /package/dist/{chunk-ZR3BPESP.js.map → chunk-VPSF5LEM.js.map} +0 -0
  113. /package/dist/{chunk-6H7D4QTM.js.map → chunk-W24TJJNN.js.map} +0 -0
  114. /package/dist/{chunk-BIVO2GMU.js.map → chunk-WDSTW3BD.js.map} +0 -0
  115. /package/dist/{chunk-RVKOFZAT.js.map → chunk-WJAFE3Z6.js.map} +0 -0
  116. /package/dist/{chunks-HPPVNSBT.js.map → chunks-AL4P5TO5.js.map} +0 -0
  117. /package/dist/{formula-6J26PNHL.js.map → formula-DSB574H7.js.map} +0 -0
  118. /package/dist/{formula-PNZX2ZAZ.js.map → formula-U2LZ67KI.js.map} +0 -0
  119. /package/dist/{image-ocr-UNTKJLQL.js.map → image-ocr-3QB2HLSI.js.map} +0 -0
  120. /package/dist/{image-ocr-RPHNFU7I.js.map → image-ocr-J54Q3YWP.js.map} +0 -0
  121. /package/dist/{model-bundle-ZSDEJFA7.js.map → model-bundle-CGWU4ALC.js.map} +0 -0
  122. /package/dist/{models-JS66XYKO.js.map → models-A3TF3BDV.js.map} +0 -0
  123. /package/dist/{parse-worker-v2-JHPEY3MI.js.map → parse-worker-v2-MNUD4WAR.js.map} +0 -0
  124. /package/dist/{parser-YKATDDQV.js.map → parser-C3ARF26I.js.map} +0 -0
  125. /package/dist/{parser-N64TUIWU.js.map → parser-OBGWEWSU.js.map} +0 -0
  126. /package/dist/{pdf-ocr-KTKR2JQH.js.map → pdf-ocr-ENLVEEYL.js.map} +0 -0
  127. /package/dist/{pdf-ocr-W3LDJYCA.js.map → pdf-ocr-K53REDNY.js.map} +0 -0
  128. /package/dist/{profile-io-JRODOL7A.js.map → profile-io-ZGFEO7CB.js.map} +0 -0
  129. /package/dist/{rasterize-2DMR7RGP.js.map → rasterize-QMC2SAUT.js.map} +0 -0
  130. /package/dist/{redact-doc-TC6QSTPM.js.map → redact-doc-JH6RZZBE.js.map} +0 -0
  131. /package/dist/{render-WEUU5EDS.js.map → render-ZGKQLKPJ.js.map} +0 -0
  132. /package/dist/{seal-LSALFURW.js.map → seal-KMGYTJAV.js.map} +0 -0
  133. /package/dist/{setup-LKJKGMKJ.js.map → setup-LAQGCYQ2.js.map} +0 -0
  134. /package/dist/{visual-PHZHJRY5.js.map → visual-4OYJFGXL.js.map} +0 -0
  135. /package/dist/{watch-HHFVXB3G.js.map → watch-7YPB4TKC.js.map} +0 -0
package/README.md CHANGED
@@ -119,15 +119,15 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
119
119
 
120
120
  ## 최근 업데이트
121
121
 
122
- 최신 배포: **[4.24.1](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.1)** · 2026-10-21
122
+ 최신 배포: **[4.24.2](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.2)** · 2026-10-24
123
123
 
124
124
  | 버전 | 주요 변경 |
125
125
  | --- | --- |
126
+ | 4.24.2 | 렌더를 한컴 PDF 와 더 가깝게: 쪽을 넘어온 떠 있는 표·칸 안 여러 개체 쌓기·세로 오프셋 이중 계산·마지막 행 높이·줄바꿈 앞 공백·쪽 번호(렌더 글 위치 86,508 → 86,954 / 90,550) |
126
127
  | 4.24.1 | 검수 수정: 블록 검수 희소 표 메모리 폭주·천원 규칙 이차 시간·예산 검산(목록 줄·소계(A)·비율 행), `generate --template` 견본 덮어쓰기 차단 |
127
128
  | 4.24.0 | 블록 단위 검수 `lintBlocks`: 열린 문서의 문단·표 칸을 블록으로 넘기면 지적을 블록 id·블록 안 위치로 돌려줌(CLI `lint-blocks`, MCP `lint_document`, 워커, Python SDK) |
128
129
  | 4.23.1 | 견본 생성 제목표 결재선 칸을 직위별로, 산출근거 줄·표 칸 천원 단위 오탐 제거 |
129
130
  | 4.23.0 | 부서 서식 견본으로 새 문서 생성(`generate --template`), 예산 문서 검수(`lint --budget`), MCP `lint_document` |
130
- | 4.22.18 | kordoc 생성 보고서의 제목 틀·장 띠·요약 상자 패치, 변경 추적 HWP 패치 결과가 한글에 보이지 않던 문제 |
131
131
 
132
132
  이전 버전과 상세 내용은 [변경 이력](CHANGELOG.md)에 있습니다.
133
133
 
@@ -58,10 +58,10 @@ import {
58
58
  usesGaejosikMunche,
59
59
  usesLogicStructure,
60
60
  validateHwpx
61
- } from "./chunk-4BCQ3FQS.js";
61
+ } from "./chunk-C6ZVB547.js";
62
62
  import {
63
63
  blocksToChunks
64
- } from "./chunk-MI25BZSU.js";
64
+ } from "./chunk-NMFFIUI6.js";
65
65
  import {
66
66
  SPACE_EM_FIXED,
67
67
  SPACE_EM_FONT,
@@ -86,20 +86,20 @@ import {
86
86
  renderSceneToHtml,
87
87
  simulateWrap,
88
88
  simulateWrapKeepWord
89
- } from "./chunk-LBPUPT6S.js";
90
- import "./chunk-LEL5UBGR.js";
89
+ } from "./chunk-DHMBPMKC.js";
90
+ import "./chunk-E6VBLBOO.js";
91
91
  import {
92
92
  blocksToPages
93
- } from "./chunk-RS2Q64N5.js";
93
+ } from "./chunk-7NTMM6PO.js";
94
94
  import "./chunk-VKVDMH7X.js";
95
95
  import "./chunk-VQFA55IC.js";
96
96
  import "./chunk-BYMPPVT3.js";
97
- import "./chunk-W4P3QPSB.js";
97
+ import "./chunk-KUC5I5MB.js";
98
98
  import {
99
99
  blocksToMarkdown,
100
100
  flattenLayoutTables,
101
101
  hasStructuredCellContent
102
- } from "./chunk-BIVO2GMU.js";
102
+ } from "./chunk-WDSTW3BD.js";
103
103
  import {
104
104
  ValueCursor,
105
105
  applySplices,
@@ -113,11 +113,11 @@ import {
113
113
  isLabelCell,
114
114
  placeSealHwpx,
115
115
  scanSectionXml
116
- } from "./chunk-5EP6VFP5.js";
117
- import "./chunk-L2OJUIII.js";
116
+ } from "./chunk-NJ5RUDCW.js";
117
+ import "./chunk-RIRPLFPN.js";
118
118
  import {
119
119
  VERSION
120
- } from "./chunk-YE4T2P6F.js";
120
+ } from "./chunk-LMEF7FN5.js";
121
121
  import {
122
122
  DEFAULT_REDACT_RULES,
123
123
  redactMarkdown,
@@ -227,4 +227,4 @@ export {
227
227
  usesLogicStructure,
228
228
  validateHwpx
229
229
  };
230
- //# sourceMappingURL=-TSN4SWFV.js.map
230
+ //# sourceMappingURL=-SRNEV7LS.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  blocksToMarkdown
3
- } from "./chunk-G7SKCXQG.js";
3
+ } from "./chunk-TW3V6FSH.js";
4
4
 
5
5
  // src/image/transcode.ts
6
6
  import { deflateSync } from "zlib";
@@ -168,4 +168,4 @@ export {
168
168
  inlineImagesIntoMarkdown,
169
169
  blocksToPages
170
170
  };
171
- //# sourceMappingURL=chunk-B77K6J3U.js.map
171
+ //# sourceMappingURL=chunk-3HN65YAL.js.map
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  parse
4
- } from "./chunk-4BCQ3FQS.js";
4
+ } from "./chunk-C6ZVB547.js";
5
5
  import {
6
6
  classifyError,
7
7
  sanitizeError,
8
8
  toArrayBuffer
9
- } from "./chunk-YE4T2P6F.js";
9
+ } from "./chunk-LMEF7FN5.js";
10
10
 
11
11
  // src/cli/worker-parse.ts
12
12
  import { readFileSync, statSync } from "fs";
@@ -26,4 +26,4 @@ async function parseWorkerFile(absPath, options) {
26
26
  export {
27
27
  parseWorkerFile
28
28
  };
29
- //# sourceMappingURL=chunk-SWCO5NP6.js.map
29
+ //# sourceMappingURL=chunk-4745MFQU.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  UNRULED_REGION_TABLES,
7
7
  extractPageBlocksWithLines
8
- } from "./chunk-ZR3BPESP.js";
8
+ } from "./chunk-VPSF5LEM.js";
9
9
  import {
10
10
  validateOcrOptions
11
11
  } from "./chunk-BYMPPVT3.js";
@@ -16,11 +16,11 @@ import {
16
16
  ocrSourcePath,
17
17
  parseCharacterDict,
18
18
  resolveOcrModels
19
- } from "./chunk-V2GW3M2F.js";
19
+ } from "./chunk-R2GIGE5H.js";
20
20
  import {
21
21
  KordocError,
22
22
  OPTIONAL_DEP_INSTALL_HINT
23
- } from "./chunk-YE4T2P6F.js";
23
+ } from "./chunk-LMEF7FN5.js";
24
24
 
25
25
  // src/ocr/ruling-lines.ts
26
26
  var INK_LUMA_MAX = 205;
@@ -2215,4 +2215,4 @@ export {
2215
2215
  groupOcrLines,
2216
2216
  ocrItemsToBlocks
2217
2217
  };
2218
- //# sourceMappingURL=chunk-2SMANR76.js.map
2218
+ //# sourceMappingURL=chunk-4XC4O7FJ.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  blocksToMarkdown
4
- } from "./chunk-BIVO2GMU.js";
4
+ } from "./chunk-WDSTW3BD.js";
5
5
 
6
6
  // src/page-markdown.ts
7
7
  function blocksToPages(blocks, render = blocksToMarkdown) {
@@ -29,4 +29,4 @@ function blocksToPages(blocks, render = blocksToMarkdown) {
29
29
  export {
30
30
  blocksToPages
31
31
  };
32
- //# sourceMappingURL=chunk-RS2Q64N5.js.map
32
+ //# sourceMappingURL=chunk-7NTMM6PO.js.map
@@ -51,10 +51,10 @@ import {
51
51
  resolveParaHeading,
52
52
  simulateWrap,
53
53
  takeTocLeaders
54
- } from "./chunk-LBPUPT6S.js";
54
+ } from "./chunk-DHMBPMKC.js";
55
55
  import {
56
56
  blocksToPages
57
- } from "./chunk-RS2Q64N5.js";
57
+ } from "./chunk-7NTMM6PO.js";
58
58
  import {
59
59
  bmpToPng,
60
60
  inlineImagesIntoMarkdown
@@ -76,7 +76,7 @@ import {
76
76
  tidyScriptTags,
77
77
  unframeLayoutTables,
78
78
  wrapScript
79
- } from "./chunk-W4P3QPSB.js";
79
+ } from "./chunk-KUC5I5MB.js";
80
80
  import {
81
81
  MAX_COLS,
82
82
  MAX_ROWS,
@@ -99,7 +99,7 @@ import {
99
99
  noteTableHtml,
100
100
  sanitizeText,
101
101
  visibleText
102
- } from "./chunk-BIVO2GMU.js";
102
+ } from "./chunk-WDSTW3BD.js";
103
103
  import {
104
104
  ANNOTATION_BLANK_RE,
105
105
  ValueCursor,
@@ -132,7 +132,7 @@ import {
132
132
  resolveUnmatched,
133
133
  scanInlineSegments,
134
134
  scanSectionXml
135
- } from "./chunk-5EP6VFP5.js";
135
+ } from "./chunk-NJ5RUDCW.js";
136
136
  import {
137
137
  MAX_DECOMPRESS_SIZE,
138
138
  MAX_XML_DEPTH,
@@ -149,7 +149,7 @@ import {
149
149
  localName,
150
150
  rawTextContent,
151
151
  readZipEntry
152
- } from "./chunk-L2OJUIII.js";
152
+ } from "./chunk-RIRPLFPN.js";
153
153
  import {
154
154
  KordocError,
155
155
  classifyError,
@@ -165,7 +165,7 @@ import {
165
165
  toArrayBuffer,
166
166
  unescapeHtml,
167
167
  unzipLimitBytes
168
- } from "./chunk-YE4T2P6F.js";
168
+ } from "./chunk-LMEF7FN5.js";
169
169
 
170
170
  // src/table/visual.ts
171
171
  import { readFile as readFile2 } from "fs/promises";
@@ -19329,7 +19329,7 @@ var MIN_SIDE = 24;
19329
19329
  async function ocrEmbeddedImages(blocks, options, warnings) {
19330
19330
  const ocr = options?.ocr;
19331
19331
  if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
19332
- const { parseImageDocument } = await import("./image-ocr-UNTKJLQL.js");
19332
+ const { parseImageDocument } = await import("./image-ocr-3QB2HLSI.js");
19333
19333
  let inserted = false, unreadable = 0;
19334
19334
  let failed = null;
19335
19335
  const walk = async (list, depth) => {
@@ -33059,7 +33059,7 @@ function scriptsOff(r, off) {
33059
33059
  }
33060
33060
  async function parseImage(buffer, options) {
33061
33061
  try {
33062
- const { parseImageDocument } = await import("./image-ocr-UNTKJLQL.js");
33062
+ const { parseImageDocument } = await import("./image-ocr-3QB2HLSI.js");
33063
33063
  const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
33064
33064
  stripScriptTags({ blocks });
33065
33065
  return {
@@ -33123,7 +33123,7 @@ async function parseHwp(buffer, options) {
33123
33123
  async function parsePdf(buffer, options) {
33124
33124
  let parsePdfDocument;
33125
33125
  try {
33126
- const mod = await import("./parser-YKATDDQV.js");
33126
+ const mod = await import("./parser-C3ARF26I.js");
33127
33127
  parsePdfDocument = mod.parsePdfDocument;
33128
33128
  } catch {
33129
33129
  return {
@@ -33356,4 +33356,4 @@ export {
33356
33356
  parseHwpml,
33357
33357
  fillForm
33358
33358
  };
33359
- //# sourceMappingURL=chunk-4BCQ3FQS.js.map
33359
+ //# sourceMappingURL=chunk-C6ZVB547.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  loadSharp,
4
4
  rasterizePageSvg
5
- } from "./chunk-LEL5UBGR.js";
5
+ } from "./chunk-E6VBLBOO.js";
6
6
  import {
7
7
  inlineImagesIntoMarkdown
8
8
  } from "./chunk-VKVDMH7X.js";
@@ -16,7 +16,7 @@ import {
16
16
  HEADING_RATIO_H3,
17
17
  tidyScriptTags,
18
18
  unframeLayoutTables
19
- } from "./chunk-W4P3QPSB.js";
19
+ } from "./chunk-KUC5I5MB.js";
20
20
  import {
21
21
  MAX_COLS,
22
22
  MAX_ROWS,
@@ -32,7 +32,7 @@ import {
32
32
  mapPuaText,
33
33
  markNonLayoutTable,
34
34
  romanNumeral
35
- } from "./chunk-BIVO2GMU.js";
35
+ } from "./chunk-WDSTW3BD.js";
36
36
  import {
37
37
  DEFAULT_CHAR,
38
38
  DEFAULT_PARA_GEOM,
@@ -46,7 +46,7 @@ import {
46
46
  hwpxAppMajor,
47
47
  parseRenderStyles,
48
48
  readZipEntry
49
- } from "./chunk-L2OJUIII.js";
49
+ } from "./chunk-RIRPLFPN.js";
50
50
  import {
51
51
  KordocError,
52
52
  compareSectionPaths,
@@ -54,7 +54,7 @@ import {
54
54
  precheckZipSize,
55
55
  sanitizeHref,
56
56
  toArrayBuffer
57
- } from "./chunk-YE4T2P6F.js";
57
+ } from "./chunk-LMEF7FN5.js";
58
58
 
59
59
  // src/render/svg-render.ts
60
60
  import JSZip from "jszip";
@@ -130,7 +130,7 @@ function tableColumnBoundaries(constraints, count, total, noExactRow = false) {
130
130
  const lp = longestPathBoundaries(constraints, count);
131
131
  return lp && Math.abs(lp.x[count] - total) <= 2 && (noExactRow || lp.x.every((v, k) => Math.abs(v - prop[k]) <= 2 || lp.tight[k])) ? lp.x : prop;
132
132
  }
133
- function solveRowHeights(cells, rowCount, maxTotal = Number.POSITIVE_INFINITY) {
133
+ function solveRowHeights(cells, rowCount, maxTotal = Number.POSITIVE_INFINITY, shrinkLast = false) {
134
134
  const h = new Array(rowCount).fill(0);
135
135
  for (const c of cells) {
136
136
  if (c.rowSpan === 1 && c.rowAddr >= 0 && c.rowAddr < rowCount) {
@@ -177,6 +177,9 @@ function solveRowHeights(cells, rowCount, maxTotal = Number.POSITIVE_INFINITY) {
177
177
  total += add;
178
178
  }
179
179
  }
180
+ const last = rowCount - 1, over = total - maxTotal;
181
+ const lastCells = cells.filter((c) => c.rowAddr + c.rowSpan - 1 === last);
182
+ if (shrinkLast && over > 0 && last >= 0 && lastCells.length && lastCells.every((c) => c.rowSpan === 1 && c.contentH != null && c.contentH <= h[last] - over)) h[last] -= over;
180
183
  return h;
181
184
  }
182
185
 
@@ -11443,9 +11446,9 @@ function cellContentExtent(cell, memo) {
11443
11446
  const pos = findChildByLocalName(o.el, "pos");
11444
11447
  if ((pos?.getAttribute("vertRelTo") ?? "PARA") !== "PARA") continue;
11445
11448
  const om = findChildByLocalName(o.el, "outMargin");
11446
- const pushed = baseV - (num(om, "top") + o.height + num(om, "bottom"));
11447
- const anchor = pushed >= (paraStart > 0 ? paraStart - 100 : -100) ? pushed : baseV - (memo?.paraGeom?.get(p.getAttribute("paraPrIDRef") ?? "")?.spaceBefore ?? 0);
11448
11449
  const vo = num(pos, "vertOffset");
11450
+ const pushed = baseV - (Math.max(0, vo) + num(om, "top") + o.height + num(om, "bottom"));
11451
+ const anchor = pushed >= (paraStart > 0 ? paraStart - 100 : -100) ? pushed : baseV - (memo?.paraGeom?.get(p.getAttribute("paraPrIDRef") ?? "")?.spaceBefore ?? 0);
11449
11452
  const oh = o.tag === "tbl" ? Math.max(o.height, measureTableHeight(o.el, memo)) : o.height;
11450
11453
  ext = Math.max(ext, anchor + num(om, "top") + Math.max(0, vo) + oh);
11451
11454
  }
@@ -11491,6 +11494,21 @@ function collectCells(tbl) {
11491
11494
  }
11492
11495
  return cells;
11493
11496
  }
11497
+ function inCell(el) {
11498
+ for (let n = el.parentNode; n; n = n.parentNode) if (ln(n) === "tc") return true;
11499
+ return false;
11500
+ }
11501
+ function splitSaved(c) {
11502
+ let prev = Number.NEGATIVE_INFINITY;
11503
+ for (const p of c.sub ? elements(c.sub) : []) {
11504
+ if (ln(p) !== "p") continue;
11505
+ for (const s of buildPara(p).segs) {
11506
+ if (s.vertpos < prev) return true;
11507
+ prev = s.vertpos;
11508
+ }
11509
+ }
11510
+ return false;
11511
+ }
11494
11512
  function measureTableRowHeights(tbl, memo) {
11495
11513
  const cells = collectCells(tbl);
11496
11514
  if (cells.length === 0 || cells.length > 4096) return [];
@@ -11501,7 +11519,8 @@ function measureTableRowHeights(tbl, memo) {
11501
11519
  // (같은 판 PDF: 두 줄 든 2행 병합 칸 내용 2882 > 저장 2564 → 둘째 행이 318 자라고 첫 행은 그대로)
11502
11520
  cells.map((c) => ({ rowAddr: c.ra, rowSpan: c.rs, height: (c.rs > 1 ? Math.max(c.h, cellContentExtent(c, memo) + c.marginT + c.marginB) : c.h) - sp * (c.rs - 1), contentH: c.rs === 1 ? cellContentExtent(c, memo) + c.marginT + c.marginB : void 0 })),
11503
11521
  nRows,
11504
- num(findChildByLocalName(tbl, "sz"), "height") - (sp > 0 ? sp * (nRows + 1) : 0) || Number.POSITIVE_INFINITY
11522
+ num(findChildByLocalName(tbl, "sz"), "height") - (sp > 0 ? sp * (nRows + 1) : 0) || Number.POSITIVE_INFINITY,
11523
+ !inCell(tbl) && !cells.some((c) => c.ra + c.rs === nRows && splitSaved(c))
11505
11524
  );
11506
11525
  if (sp > 0) {
11507
11526
  for (let r = 0; r < rows.length; r++) rows[r] += sp;
@@ -13461,7 +13480,8 @@ function planTableRows(tbl, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan, n
13461
13480
  rem = Math.max(rem, end - ls[k][0] + c.marginT + c.marginB);
13462
13481
  }
13463
13482
  if (allFit) {
13464
- if (!first && h <= pageBottom - contTop && rowCells.some((c) => cellContentExtent(c) + c.marginT + c.marginB > avail)) {
13483
+ const spanCells = cells.filter((c) => c.ra === r && c.rs > 1);
13484
+ if (!first && h <= pageBottom - contTop && [...rowCells, ...spanCells].some((c) => cellContentExtent(c) + c.marginT + c.marginB > avail)) {
13465
13485
  page++;
13466
13486
  y = contTop;
13467
13487
  first = true;
@@ -13659,9 +13679,11 @@ function shapeGeometry(o, boxX, boxY, defs, images, warn, local = false) {
13659
13679
  function linePushedBy(o, lineV, paraTop) {
13660
13680
  if (paraTop === void 0) return false;
13661
13681
  const om = findChildByLocalName(o.el, "outMargin");
13662
- return Math.abs(lineV - (num(om, "top") + o.height + num(om, "bottom")) - paraTop) <= 10;
13682
+ const pos = findChildByLocalName(o.el, "pos");
13683
+ const raw = num(pos, "vertOffset"), vo = (pos?.getAttribute("vertRelTo") ?? "PARA") === "PARA" ? Math.max(0, raw >= 2 ** 31 ? raw - 2 ** 32 : raw) : 0;
13684
+ return Math.abs(lineV - (vo + num(om, "top") + o.height + num(om, "bottom")) - paraTop) <= 10;
13663
13685
  }
13664
- function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = false, paraStartV, laterLineH) {
13686
+ function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = false, paraStartV, lineH, lineSB = 0) {
13665
13687
  const { PW, PH, ML, MT, BODY_W, BODY_H } = ctx.geom;
13666
13688
  const pos = findChildByLocalName(o.el, "pos");
13667
13689
  const om = findChildByLocalName(o.el, "outMargin");
@@ -13683,13 +13705,14 @@ function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = fals
13683
13705
  y = va === "BOTTOM" ? MT + BODY_H - h - vo : va === "CENTER" ? MT + (BODY_H - h) / 2 + vo : MT + vo;
13684
13706
  } else if (wrap === "TOP_AND_BOTTOM") {
13685
13707
  const lineV = anchorLineV ?? baseV;
13686
- const pushed = lineV - (omT + h + omB);
13687
- const below = laterLineH !== void 0 && vo + omT >= laterLineH;
13688
- const anchor = below ? lineV : stayLine !== false ? lineV - stayLine : pushed >= -100 ? pushed : paraStartV !== void 0 ? paraStartV : lineV;
13708
+ const pushed = lineV - (vo + omT + h + omB);
13709
+ const below = lineH !== void 0 && vo + omT >= lineH && !(paraStartV !== void 0 && Math.abs(pushed - paraStartV) <= 10);
13710
+ const anchor = below ? lineV - lineSB : stayLine !== false ? lineV - stayLine : pushed >= -100 ? pushed : paraStartV !== void 0 ? paraStartV : lineV;
13689
13711
  y = oy + anchor + omT + vo;
13690
13712
  } else {
13691
13713
  const origin = vrel === "PARA" && wrap === "SQUARE" ? paraStartV ?? baseV : baseV;
13692
- y = oy + Math.max(origin + vo, wrap === "SQUARE" && anchorLineV !== void 0 ? anchorLineV : -Infinity) + omT;
13714
+ const later = vrel === "PARA" && wrap === "SQUARE" && anchorLineV !== void 0 && anchorLineV > baseV;
13715
+ y = later ? oy + anchorLineV + vo + omT : oy + Math.max(origin + vo, wrap === "SQUARE" && anchorLineV !== void 0 ? anchorLineV : -Infinity) + omT;
13693
13716
  }
13694
13717
  let x;
13695
13718
  const omL = num(om, "left"), omR = num(om, "right");
@@ -14525,6 +14548,7 @@ function planLines(m, styles, numText = "") {
14525
14548
  }
14526
14549
  if (fixedTo > start) fixedW = lineNaturalWidth(m, styles, start, fixedTo).text + [...tabs.values()].reduce((a, b) => a + b, 0);
14527
14550
  let textEnd = Math.min(end, m.chars.length);
14551
+ while (textEnd > fixedTo && m.chars[textEnd - 1].br) textEnd--;
14528
14552
  while (textEnd > fixedTo && m.chars[textEnd - 1].ch === " ") textEnd--;
14529
14553
  const nat = lineNaturalWidth(m, styles, fixedTo, textEnd);
14530
14554
  for (const o of m.objs) if (o.inline && o.index >= textEnd && o.index < end) nat.obj += o.omL + o.width + o.omR;
@@ -14744,6 +14768,7 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
14744
14768
  if (gOpenOn >= 0) ctx.pages[gOpenOn].push("</g>");
14745
14769
  if (paraRegionId) ctx.parentStack.push(paraRegionId);
14746
14770
  let tbStack;
14771
+ let tbStackTop;
14747
14772
  for (const o of m.objs) {
14748
14773
  if (o.inline) {
14749
14774
  let planIdx = 0;
@@ -14788,21 +14813,26 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
14788
14813
  const sbA = m.paraPrId != null ? ctx.styles.paraGeom.get(m.paraPrId)?.spaceBefore ?? 0 : 0;
14789
14814
  if (stay && wrapA === "TOP_AND_BOTTOM" && linePushedBy(o, anchorLineV ?? baseV, pTop ?? (depth > 0 ? cellParaTop(p, ctx.styles.paraGeom) : void 0))) stay = false;
14790
14815
  const firstLine = anchorLineV === void 0 || anchorLineV === baseV;
14791
- let { x, y } = anchorObject(o, ax, oy, objBaseV, aw, ctx, anchorLineV, stay ? sbA : false, (firstLine || wrapA === "SQUARE") && pTop !== void 0 && pTop < baseV ? pTop : void 0, firstLine ? void 0 : anchorLineH);
14792
- if (depth === 0 && tbFloats >= 2 && wrapA === "TOP_AND_BOTTOM") {
14816
+ let { x, y } = anchorObject(o, ax, oy, objBaseV, aw, ctx, anchorLineV, stay ? sbA : false, (firstLine || wrapA === "SQUARE") && pTop !== void 0 && pTop < baseV ? pTop : void 0, anchorLineH, firstLine ? sbA : 0);
14817
+ let stackTop = depth === 0 ? pTop ?? 0 : cellParaTop(p, ctx.styles.paraGeom);
14818
+ if (tbFloats >= 2 && wrapA === "TOP_AND_BOTTOM" && stackTop !== void 0) {
14793
14819
  if (!tbStack) {
14794
14820
  tbStack = /* @__PURE__ */ new Map();
14795
- let below = 0;
14821
+ const placed = [];
14796
14822
  const stackable = m.objs.filter((q) => !q.inline && (q.el.getAttribute("textWrap") ?? "TOP_AND_BOTTOM") === "TOP_AND_BOTTOM" && (findChildByLocalName(q.el, "pos")?.getAttribute("vertRelTo") ?? "PARA") === "PARA" && findChildByLocalName(q.el, "pos")?.getAttribute("allowOverlap") !== "1");
14797
14823
  for (const q of stackable.length >= 2 ? stackable.sort((a, b) => a.index - b.index) : []) {
14798
- const omQ = findChildByLocalName(q.el, "outMargin"), raw = num(findChildByLocalName(q.el, "pos"), "vertOffset");
14799
- const top = Math.max(below, raw >= 2 ** 31 ? raw - 2 ** 32 : raw);
14824
+ const posQ = findChildByLocalName(q.el, "pos"), omQ = findChildByLocalName(q.el, "outMargin"), raw = num(posQ, "vertOffset");
14825
+ const x0 = num(posQ, "horzOffset"), x1 = x0 + num(omQ, "left") + q.width + num(omQ, "right");
14826
+ const below = Math.max(0, ...placed.filter((r) => r.x0 < x1 && x0 < r.x1).map((r) => r.bottom));
14827
+ const top = Math.max(below, depth > 0 ? Math.max(0, raw) : raw);
14800
14828
  tbStack.set(q.el, top + num(omQ, "top"));
14801
- below = top + num(omQ, "top") + (q.tag === "tbl" ? Math.max(q.height, measureTableHeight(q.el, ctx.extentMemo)) : q.height) + num(omQ, "bottom");
14829
+ placed.push({ x0, x1, bottom: top + num(omQ, "top") + (q.tag === "tbl" ? Math.max(q.height, measureTableHeight(q.el, ctx.extentMemo)) : q.height) + num(omQ, "bottom") });
14802
14830
  }
14831
+ if (depth > 0 && placed.length) tbStackTop = Math.max(stackTop, baseV - Math.max(...placed.map((r) => r.bottom)));
14803
14832
  }
14833
+ if (depth > 0 && tbStackTop !== void 0) stackTop = tbStackTop;
14804
14834
  const st = tbStack.get(o.el);
14805
- if (st !== void 0) y = oy + (pTop ?? 0) + st;
14835
+ if (st !== void 0) y = oy + stackTop + st;
14806
14836
  }
14807
14837
  const moved = ctx.objPlace?.get(o.el);
14808
14838
  if (moved) {
@@ -15025,7 +15055,7 @@ function drawTable(tbl, tx, ty, ctx, depth) {
15025
15055
  const slack = ctx.geom.PH - ctx.geom.MT - ctx.geom.BODY_H;
15026
15056
  const splitHere = depth === 1 || !!ctx.splitCell && findChildByLocalName(tbl, "pos")?.getAttribute("treatAsChar") !== "1";
15027
15057
  const plan = splitHere ? planTableRows(tbl, cells, rowH, ty, ctx.geom.MT, ctx.geom.BODY_H, slack, cellFloatSpan(ctx.geom.MT, ctx.geom.BODY_H, ctx.extentMemo, slack), depth !== 1, depth !== 1 && ctx.splitContMT !== void 0 ? ctx.splitContMT : ctx.geom.MT) : rowH.map((h, r) => [{ page: 0, y: ty + rowY[r], h }]);
15028
- const splitSaved = ctx.splitCell;
15058
+ const splitSaved2 = ctx.splitCell;
15029
15059
  ctx.splitCell = false;
15030
15060
  for (const pc of plan.flat()) for (const [el, py] of pc.place ?? []) (ctx.objPlace ??= /* @__PURE__ */ new Map()).set(el, { page: startPage + pc.page, y: py });
15031
15061
  const contPages = [...new Set(plan.flat().map((pc) => pc.page).filter((pg) => pg > 0))].map((pg) => startPage + pg);
@@ -15145,7 +15175,7 @@ function drawTable(tbl, tx, ty, ctx, depth) {
15145
15175
  if (bf.right) emit(ctx, edgeLine(g.x + g.w, g.y, g.x + g.w, g.y + g.h, bf.right));
15146
15176
  }
15147
15177
  ctx.page = startPage;
15148
- ctx.splitCell = splitSaved;
15178
+ ctx.splitCell = splitSaved2;
15149
15179
  ctx.parentStack.pop();
15150
15180
  emit(ctx, "</g>");
15151
15181
  }
@@ -15304,6 +15334,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15304
15334
  }
15305
15335
  const paraSegPages = /* @__PURE__ */ new Map();
15306
15336
  const paraTops = /* @__PURE__ */ new Map();
15337
+ const backPlace = /* @__PURE__ */ new Map();
15307
15338
  const geom0 = ctxBase.styles.paraGeom;
15308
15339
  let tableEndPage = -1;
15309
15340
  let nPages = 1;
@@ -15315,6 +15346,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15315
15346
  let cur = 0, col = 0;
15316
15347
  let pendingEnd = 0, pendingEndY = 0;
15317
15348
  let lastEnd = 0, lastPage = -1;
15349
+ let lastSA = 0;
15318
15350
  let prevSeg;
15319
15351
  for (const p of elements(root)) {
15320
15352
  if (ln(p) !== "p") continue;
@@ -15352,6 +15384,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15352
15384
  if (prevSeg.p !== p) {
15353
15385
  lastPage = cur;
15354
15386
  lastEnd = v;
15387
+ lastSA = 0;
15355
15388
  }
15356
15389
  }
15357
15390
  }
@@ -15365,11 +15398,13 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15365
15398
  prevEnd = v + num(s, "vertsize") + num(s, "spacing");
15366
15399
  }
15367
15400
  paraSegPages.set(p, pagesOf);
15368
- if (segEls.length) paraTops.set(p, pagesOf[0] === lastPage ? lastEnd : 0);
15401
+ const prevEnd0 = lastEnd, prevPage0 = lastPage;
15402
+ if (segEls.length) paraTops.set(p, pagesOf[0] === lastPage ? lastEnd + lastSA : 0);
15369
15403
  if (segEls.length) {
15370
15404
  const ls = segEls[segEls.length - 1];
15371
15405
  lastEnd = num(ls, "vertpos") + num(ls, "vertsize") + num(ls, "spacing");
15372
15406
  lastPage = pagesOf[pagesOf.length - 1];
15407
+ lastSA = geom0.get(p.getAttribute("paraPrIDRef") ?? "")?.spaceAfter ?? 0;
15373
15408
  }
15374
15409
  if (!localCols && segEls.length) {
15375
15410
  const m0 = buildPara(p);
@@ -15381,6 +15416,13 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15381
15416
  const segV = num(segEls[segK], "vertpos");
15382
15417
  const h = Math.max(o.height, measureTableHeight(o.el, ctxBase.extentMemo)), omT = num(om, "top"), omB = num(om, "bottom");
15383
15418
  const pushed = segV - (omT + h + omB);
15419
+ if (!o.inline && segK === 0 && pushed < -100 && prevPage0 >= 0 && pagesOf[0] === prevPage0 + 1 && (o.el.getAttribute("textWrap") ?? "TOP_AND_BOTTOM") === "TOP_AND_BOTTOM") {
15420
+ const back = tableContPages(o.el, MT + prevEnd0 + omT, MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H, cellFloatSpan(MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H));
15421
+ if (back.pages === 1 && Math.abs(back.endY - MT + omB - segV) <= 300) {
15422
+ backPlace.set(o.el, { page: prevPage0, y: MT + prevEnd0 + omT });
15423
+ continue;
15424
+ }
15425
+ }
15384
15426
  const nTb = m0.objs.filter((q) => !q.inline && (q.el.getAttribute("textWrap") ?? "TOP_AND_BOTTOM") === "TOP_AND_BOTTOM").length;
15385
15427
  const wrapP = o.el.getAttribute("textWrap") ?? "TOP_AND_BOTTOM";
15386
15428
  const pTop = paraTops.get(p), sbP = m0.paraPrId != null ? geom0.get(m0.paraPrId)?.spaceBefore ?? 0 : 0;
@@ -15388,7 +15430,8 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15388
15430
  const nonPush = wrapP !== "TOP_AND_BOTTOM" && pTop !== void 0 && segV > pTop + sbP + 100 ? pTop + sbP : void 0;
15389
15431
  const voP = Math.max(0, toInt32(pos?.getAttribute("vertOffset") ?? void 0, 0));
15390
15432
  const paraStart = segK === 0 && pTop !== void 0 && pTop < segV ? pTop : segV;
15391
- const ty = o.inline ? MT + segV + omT : nonPush !== void 0 ? MT + nonPush + omT + voP : MT + (stay ? segV - sbP : pushed >= -100 ? pushed : paraStart) + omT + voP;
15433
+ const below = !o.inline && wrapP === "TOP_AND_BOTTOM" && voP + omT >= num(segEls[segK], "textheight") && !linePushedBy(o, segV, pTop);
15434
+ const ty = o.inline ? MT + segV + omT : nonPush !== void 0 ? MT + nonPush + omT + voP : MT + (below ? segV - (segK === 0 ? sbP : 0) : stay ? segV - sbP : pushed - voP >= -100 ? pushed - voP : paraStart) + omT + voP;
15392
15435
  const span = tableContPages(o.el, ty, MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H, cellFloatSpan(MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H));
15393
15436
  const anchorPage = pagesOf[segK];
15394
15437
  const sp = !o.inline && !stay && nonPush === void 0 && segV - (omT + o.height + omB) >= -100 && pagesOf.some((pg, j) => j > segK && pg > anchorPage) ? tableContPages(o.el, MT + segV - o.height - omB, MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H, cellFloatSpan(MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H)) : void 0;
@@ -15473,6 +15516,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
15473
15516
  if (geom.mirrorDx) ctx.bodyDx = mirrorDx;
15474
15517
  ctx.cols = multiCol ? { w: colW, gap: colGap } : void 0;
15475
15518
  ctx.paraTops = paraTops;
15519
+ if (backPlace.size) ctx.objPlace = new Map([...ctx.objPlace ?? [], ...backPlace]);
15476
15520
  for (const p of elements(root)) {
15477
15521
  if (ln(p) !== "p") continue;
15478
15522
  drawPara(p, ML, MT, BODY_W, ctx, 0, paraSegPages.get(p));
@@ -15592,7 +15636,7 @@ function drawPageNumbers(root, paraPages, ctx) {
15592
15636
  const side = decl.el.getAttribute("sideChar") ?? "";
15593
15637
  const pnId = ctx.styles.pageNumCharPr ?? decl.prId;
15594
15638
  const st = (pnId != null ? ctx.styles.charPr.get(pnId) : void 0) ?? DEFAULT_CHAR;
15595
- const { PW, PH, ML, BODY_W } = ctx.geom;
15639
+ const { PH, ML, BODY_W } = ctx.geom;
15596
15640
  const pagePr = findFirst(root, "pagePr"), margin = pagePr ? findChildByLocalName(pagePr, "margin") : null;
15597
15641
  const h = 1e3;
15598
15642
  for (let page = decl.page; page < ctx.pages.length; page++) {
@@ -15600,7 +15644,7 @@ function drawPageNumbers(root, paraPages, ctx) {
15600
15644
  const n = ctx.pageBase + page + 1;
15601
15645
  const text = side ? `${side} ${formatHeadNumber2(n, decl.el.getAttribute("formatType") ?? "DIGIT")} ${side}` : formatHeadNumber2(n, decl.el.getAttribute("formatType") ?? "DIGIT");
15602
15646
  const w = measureTextWidth(text, h, 100, { faceClass: faceClassOf(st.face) });
15603
- const x = /LEFT/.test(pos) ? ML : /RIGHT/.test(pos) ? ML + BODY_W - w : (PW - w) / 2;
15647
+ const x = /LEFT/.test(pos) ? ML : /RIGHT/.test(pos) ? ML + BODY_W - w : ML + (BODY_W - w) / 2;
15604
15648
  const y = /^TOP/.test(pos) ? num(margin, "top", 5668) - 225 : num(margin, "footer", 0) > 0 ? PH - num(margin, "bottom", 4252) - 225 : PH - Math.round(num(margin, "bottom", 4252) / 2) - 243;
15605
15649
  const attrs = [`x="${pt2(x)}"`, `y="${pt2(y)}"`, `font-size="${pt2(h)}"`];
15606
15650
  if (st.fontFamily) attrs.push(`font-family="${escapeXml(st.fontFamily)}"`);
@@ -19918,4 +19962,4 @@ export {
19918
19962
  cropRect,
19919
19963
  extractRenderedRegions
19920
19964
  };
19921
- //# sourceMappingURL=chunk-LBPUPT6S.js.map
19965
+ //# sourceMappingURL=chunk-DHMBPMKC.js.map