kordoc 4.22.5 → 4.22.7

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 (151) hide show
  1. package/NOTICE +23 -0
  2. package/README.md +12 -10
  3. package/dist/{-WFRWBH7T.js → -O7EP5UQ2.js} +12 -12
  4. package/dist/{chunk-DN55FTJP.js → chunk-5S4UCIGP.js} +2 -2
  5. package/dist/{chunk-63N6CEJE.js → chunk-5VCZDP2K.js} +2 -2
  6. package/dist/{chunk-35ZHXEJA.js → chunk-6U2O5LAV.js} +3 -3
  7. package/dist/{chunk-TOUJCO2P.js → chunk-BFAYABLC.js} +120 -28
  8. package/dist/chunk-BFAYABLC.js.map +1 -0
  9. package/dist/{chunk-CW67DAAH.js → chunk-BHSATDA7.js} +12 -3
  10. package/dist/chunk-BHSATDA7.js.map +1 -0
  11. package/dist/{chunk-PSORL4PA.js → chunk-BIF35Q4D.js} +21 -16
  12. package/dist/chunk-BIF35Q4D.js.map +1 -0
  13. package/dist/{chunk-BHVOY6V4.js → chunk-BYMPPVT3.js} +9 -5
  14. package/dist/chunk-BYMPPVT3.js.map +1 -0
  15. package/dist/{chunk-LE4VHWIT.js → chunk-CEOOL37E.js} +4 -4
  16. package/dist/{chunk-4SUB43EJ.cjs → chunk-CIDWITQN.cjs} +24 -24
  17. package/dist/chunk-CIDWITQN.cjs.map +1 -0
  18. package/dist/{chunk-RYKDIUHT.js → chunk-CRMEBMMW.js} +5 -5
  19. package/dist/{chunk-52HIK4C2.js → chunk-CVKSBUIO.js} +4 -3
  20. package/dist/chunk-CVKSBUIO.js.map +1 -0
  21. package/dist/{chunk-U3GUZQ54.js → chunk-D4YBFNWK.js} +35 -75
  22. package/dist/chunk-D4YBFNWK.js.map +1 -0
  23. package/dist/{chunk-4TWN7PWJ.js → chunk-DFBGN2TG.js} +2 -2
  24. package/dist/{chunk-HLPMC7L4.js → chunk-DLAPQKGK.js} +13 -5
  25. package/dist/chunk-DLAPQKGK.js.map +1 -0
  26. package/dist/{chunk-C3REGEQO.js → chunk-DXJRDFCT.js} +2 -2
  27. package/dist/{chunk-C3REGEQO.js.map → chunk-DXJRDFCT.js.map} +1 -1
  28. package/dist/{chunk-UCK6WGHY.cjs → chunk-F537QK7M.cjs} +3 -3
  29. package/dist/chunk-F537QK7M.cjs.map +1 -0
  30. package/dist/{chunk-AS25R4EU.cjs → chunk-FJ45NNLA.cjs} +2 -2
  31. package/dist/chunk-FJ45NNLA.cjs.map +1 -0
  32. package/dist/chunk-GS7T56RP.cjs.map +1 -1
  33. package/dist/chunk-J55UQC5H.cjs.map +1 -1
  34. package/dist/{chunk-3G3TLZDK.js → chunk-OTCH63U3.js} +2 -2
  35. package/dist/{chunk-6MQKNB6K.js → chunk-PILIRK7O.js} +3 -3
  36. package/dist/{chunk-CRSTBATY.js → chunk-QYFBXJGK.js} +2 -2
  37. package/dist/{chunk-C6B5GWN7.cjs → chunk-R3T4RTQL.cjs} +183 -175
  38. package/dist/chunk-R3T4RTQL.cjs.map +1 -0
  39. package/dist/{chunk-SETAYS6P.js → chunk-RHHRVPLL.js} +2 -2
  40. package/dist/{chunk-YG4GFQB7.cjs → chunk-S34OVRKD.cjs} +125 -33
  41. package/dist/chunk-S34OVRKD.cjs.map +1 -0
  42. package/dist/chunk-TK3FDAEE.cjs.map +1 -1
  43. package/dist/{chunk-N6KXGIIN.cjs → chunk-TN4SSNES.cjs} +3 -3
  44. package/dist/chunk-TN4SSNES.cjs.map +1 -0
  45. package/dist/{chunk-3BR7VKWL.js → chunk-V2SJJHJH.js} +112 -24
  46. package/dist/chunk-V2SJJHJH.js.map +1 -0
  47. package/dist/{chunk-6MCC2XNB.js → chunk-VYH2ATWU.js} +2 -2
  48. package/dist/{chunk-2L3Q7REU.js → chunk-WBR62IXV.js} +3 -3
  49. package/dist/{chunk-3YEL7P4L.js → chunk-YVRARYLN.js} +2 -2
  50. package/dist/{chunk-T7OZ7X6A.js → chunk-ZNSWN4JM.js} +2 -2
  51. package/dist/{chunk-CO7O3ZT6.js → chunk-ZW3RY4YT.js} +2 -2
  52. package/dist/chunks-MPPNEL5A.js +10 -0
  53. package/dist/cli.js +33 -33
  54. package/dist/cli.js.map +1 -1
  55. package/dist/{formula-QZGTF3DZ.cjs → formula-3M6U2J7S.cjs} +9 -9
  56. package/dist/formula-3M6U2J7S.cjs.map +1 -0
  57. package/dist/{formula-FSVHUQ6Y.js → formula-EQ2KQA5T.js} +4 -4
  58. package/dist/{formula-L625ULJP.js → formula-RH55FUJF.js} +3 -3
  59. package/dist/{image-ocr-AELVAU75.cjs → image-ocr-DP4YTLGN.cjs} +17 -17
  60. package/dist/image-ocr-DP4YTLGN.cjs.map +1 -0
  61. package/dist/{image-ocr-QTZNBP5V.js → image-ocr-KIKAO43E.js} +10 -10
  62. package/dist/{image-ocr-KE3RUS3R.js → image-ocr-LO2GZKA5.js} +6 -6
  63. package/dist/index.cjs +492 -522
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.d.cts +4 -2
  66. package/dist/index.d.ts +4 -2
  67. package/dist/index.js +41 -71
  68. package/dist/index.js.map +1 -1
  69. package/dist/mcp.js +23 -23
  70. package/dist/{model-bundle-F6TU6ZAV.js → model-bundle-EAQ6LWS5.js} +5 -5
  71. package/dist/{models-ZHNNVH2W.js → models-ZN6JAI4Q.js} +7 -5
  72. package/dist/page-range-QHHFTL7X.cjs.map +1 -1
  73. package/dist/{parse-worker-v2-KQRG3NQO.js → parse-worker-v2-UKFFINUH.js} +14 -14
  74. package/dist/parse-worker-v2-UKFFINUH.js.map +1 -0
  75. package/dist/{parser-WNDH2X6N.cjs → parser-CGKXEB3U.cjs} +592 -173
  76. package/dist/parser-CGKXEB3U.cjs.map +1 -0
  77. package/dist/{parser-RVMH4PUB.js → parser-DFV3VDWX.js} +452 -33
  78. package/dist/parser-DFV3VDWX.js.map +1 -0
  79. package/dist/{parser-WBKVRDPV.js → parser-TJFS44BI.js} +447 -28
  80. package/dist/parser-TJFS44BI.js.map +1 -0
  81. package/dist/{pdf-ocr-X5XLGL5J.js → pdf-ocr-CATVQJ2I.js} +6 -6
  82. package/dist/{pdf-ocr-ZP2CUWSO.js → pdf-ocr-EQXJAKHB.js} +10 -10
  83. package/dist/pdf-ocr-U5MFMNCW.cjs +31 -0
  84. package/dist/pdf-ocr-U5MFMNCW.cjs.map +1 -0
  85. package/dist/{profile-io-B4VSI4LW.js → profile-io-5IG6SSMK.js} +3 -3
  86. package/dist/{rasterize-Y7NVUVXU.js → rasterize-W4TJFQBT.js} +3 -3
  87. package/dist/{redact-doc-GIBTFWCO.js → redact-doc-LZ3PY2LX.js} +12 -12
  88. package/dist/{render-JVCGYRRO.js → render-N2QA335I.js} +7 -7
  89. package/dist/seal-FYJZMW4G.js +10 -0
  90. package/dist/{setup-7L7EQPMG.js → setup-5Y2UAWZG.js} +3 -3
  91. package/dist/visual-VQGE67RU.js +21 -0
  92. package/dist/{watch-VYMFGX72.js → watch-2MLCRQZQ.js} +13 -13
  93. package/package.json +1 -1
  94. package/dist/chunk-3BR7VKWL.js.map +0 -1
  95. package/dist/chunk-4SUB43EJ.cjs.map +0 -1
  96. package/dist/chunk-52HIK4C2.js.map +0 -1
  97. package/dist/chunk-AS25R4EU.cjs.map +0 -1
  98. package/dist/chunk-BHVOY6V4.js.map +0 -1
  99. package/dist/chunk-C6B5GWN7.cjs.map +0 -1
  100. package/dist/chunk-CW67DAAH.js.map +0 -1
  101. package/dist/chunk-HLPMC7L4.js.map +0 -1
  102. package/dist/chunk-N6KXGIIN.cjs.map +0 -1
  103. package/dist/chunk-PSORL4PA.js.map +0 -1
  104. package/dist/chunk-TOUJCO2P.js.map +0 -1
  105. package/dist/chunk-U3GUZQ54.js.map +0 -1
  106. package/dist/chunk-UCK6WGHY.cjs.map +0 -1
  107. package/dist/chunk-YG4GFQB7.cjs.map +0 -1
  108. package/dist/chunks-NXABWR6G.js +0 -10
  109. package/dist/formula-QZGTF3DZ.cjs.map +0 -1
  110. package/dist/image-ocr-AELVAU75.cjs.map +0 -1
  111. package/dist/parse-worker-v2-KQRG3NQO.js.map +0 -1
  112. package/dist/parser-RVMH4PUB.js.map +0 -1
  113. package/dist/parser-WBKVRDPV.js.map +0 -1
  114. package/dist/parser-WNDH2X6N.cjs.map +0 -1
  115. package/dist/pdf-ocr-IOUZTPPH.cjs +0 -31
  116. package/dist/pdf-ocr-IOUZTPPH.cjs.map +0 -1
  117. package/dist/seal-WNX2ZJTK.js +0 -10
  118. package/dist/visual-VPWPXIHN.js +0 -21
  119. /package/dist/{-WFRWBH7T.js.map → -O7EP5UQ2.js.map} +0 -0
  120. /package/dist/{chunk-DN55FTJP.js.map → chunk-5S4UCIGP.js.map} +0 -0
  121. /package/dist/{chunk-63N6CEJE.js.map → chunk-5VCZDP2K.js.map} +0 -0
  122. /package/dist/{chunk-35ZHXEJA.js.map → chunk-6U2O5LAV.js.map} +0 -0
  123. /package/dist/{chunk-LE4VHWIT.js.map → chunk-CEOOL37E.js.map} +0 -0
  124. /package/dist/{chunk-RYKDIUHT.js.map → chunk-CRMEBMMW.js.map} +0 -0
  125. /package/dist/{chunk-4TWN7PWJ.js.map → chunk-DFBGN2TG.js.map} +0 -0
  126. /package/dist/{chunk-3G3TLZDK.js.map → chunk-OTCH63U3.js.map} +0 -0
  127. /package/dist/{chunk-6MQKNB6K.js.map → chunk-PILIRK7O.js.map} +0 -0
  128. /package/dist/{chunk-CRSTBATY.js.map → chunk-QYFBXJGK.js.map} +0 -0
  129. /package/dist/{chunk-SETAYS6P.js.map → chunk-RHHRVPLL.js.map} +0 -0
  130. /package/dist/{chunk-6MCC2XNB.js.map → chunk-VYH2ATWU.js.map} +0 -0
  131. /package/dist/{chunk-2L3Q7REU.js.map → chunk-WBR62IXV.js.map} +0 -0
  132. /package/dist/{chunk-3YEL7P4L.js.map → chunk-YVRARYLN.js.map} +0 -0
  133. /package/dist/{chunk-T7OZ7X6A.js.map → chunk-ZNSWN4JM.js.map} +0 -0
  134. /package/dist/{chunk-CO7O3ZT6.js.map → chunk-ZW3RY4YT.js.map} +0 -0
  135. /package/dist/{chunks-NXABWR6G.js.map → chunks-MPPNEL5A.js.map} +0 -0
  136. /package/dist/{formula-FSVHUQ6Y.js.map → formula-EQ2KQA5T.js.map} +0 -0
  137. /package/dist/{formula-L625ULJP.js.map → formula-RH55FUJF.js.map} +0 -0
  138. /package/dist/{image-ocr-QTZNBP5V.js.map → image-ocr-KIKAO43E.js.map} +0 -0
  139. /package/dist/{image-ocr-KE3RUS3R.js.map → image-ocr-LO2GZKA5.js.map} +0 -0
  140. /package/dist/{model-bundle-F6TU6ZAV.js.map → model-bundle-EAQ6LWS5.js.map} +0 -0
  141. /package/dist/{models-ZHNNVH2W.js.map → models-ZN6JAI4Q.js.map} +0 -0
  142. /package/dist/{pdf-ocr-X5XLGL5J.js.map → pdf-ocr-CATVQJ2I.js.map} +0 -0
  143. /package/dist/{pdf-ocr-ZP2CUWSO.js.map → pdf-ocr-EQXJAKHB.js.map} +0 -0
  144. /package/dist/{profile-io-B4VSI4LW.js.map → profile-io-5IG6SSMK.js.map} +0 -0
  145. /package/dist/{rasterize-Y7NVUVXU.js.map → rasterize-W4TJFQBT.js.map} +0 -0
  146. /package/dist/{redact-doc-GIBTFWCO.js.map → redact-doc-LZ3PY2LX.js.map} +0 -0
  147. /package/dist/{render-JVCGYRRO.js.map → render-N2QA335I.js.map} +0 -0
  148. /package/dist/{seal-WNX2ZJTK.js.map → seal-FYJZMW4G.js.map} +0 -0
  149. /package/dist/{setup-7L7EQPMG.js.map → setup-5Y2UAWZG.js.map} +0 -0
  150. /package/dist/{visual-VPWPXIHN.js.map → visual-VQGE67RU.js.map} +0 -0
  151. /package/dist/{watch-VYMFGX72.js.map → watch-2MLCRQZQ.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -204,8 +204,10 @@ interface ParseOptions {
204
204
  ocrDet?: "mobile" | "server" | OcrModelFile;
205
205
  /** 글줄 검출 입력 긴 변(px, 32~4096 정수). 기본 960 (PP-OCRv5 공식 resize_long) — 키우면 작은 글자를 더 잡고 느려진다 */
206
206
  ocrDetLongSide?: number;
207
- /** 내장 OCR 글자 인식 모델을 로컬 ONNX 로 바꾼다(미세조정 rec 등) — `path` 절대 경로 + `sha256` 필수. 출력 클래스 수가 사전 + 2 여야 한다 */
208
- ocrRec?: OcrModelFile;
207
+ /** 내장 OCR 글자 인식 모델. 기본은 PP-OCRv5 korean rec. `"handwriting"`: 손글씨·공문서 데이터로 추가 학습한 한국어 rec(~15MB,
208
+ * 첫 사용 시 다운로드 — 수기 서류용, 내장 사전 그대로). 객체: 로컬 ONNX 파일(미세조정 rec 등) — `path` 절대 경로 + `sha256` 필수.
209
+ * 출력 클래스 수가 사전 + 2 여야 한다 */
210
+ ocrRec?: "handwriting" | OcrModelFile;
209
211
  /** 글자 인식 사전(PaddleOCR inference.yml 의 `PostProcess.character_dict`)을 로컬 파일로 — `path` 절대 경로 + `sha256` 필수.
210
212
  * 지정 안 하면 내장 한국어 사전(11,945자) */
211
213
  ocrRecDict?: OcrModelFile;
package/dist/index.d.ts CHANGED
@@ -204,8 +204,10 @@ interface ParseOptions {
204
204
  ocrDet?: "mobile" | "server" | OcrModelFile;
205
205
  /** 글줄 검출 입력 긴 변(px, 32~4096 정수). 기본 960 (PP-OCRv5 공식 resize_long) — 키우면 작은 글자를 더 잡고 느려진다 */
206
206
  ocrDetLongSide?: number;
207
- /** 내장 OCR 글자 인식 모델을 로컬 ONNX 로 바꾼다(미세조정 rec 등) — `path` 절대 경로 + `sha256` 필수. 출력 클래스 수가 사전 + 2 여야 한다 */
208
- ocrRec?: OcrModelFile;
207
+ /** 내장 OCR 글자 인식 모델. 기본은 PP-OCRv5 korean rec. `"handwriting"`: 손글씨·공문서 데이터로 추가 학습한 한국어 rec(~15MB,
208
+ * 첫 사용 시 다운로드 — 수기 서류용, 내장 사전 그대로). 객체: 로컬 ONNX 파일(미세조정 rec 등) — `path` 절대 경로 + `sha256` 필수.
209
+ * 출력 클래스 수가 사전 + 2 여야 한다 */
210
+ ocrRec?: "handwriting" | OcrModelFile;
209
211
  /** 글자 인식 사전(PaddleOCR inference.yml 의 `PostProcess.character_dict`)을 로컬 파일로 — `path` 절대 경로 + `sha256` 필수.
210
212
  * 지정 안 하면 내장 한국어 사전(11,945자) */
211
213
  ocrRecDict?: OcrModelFile;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  blocksToPages,
3
3
  bmpToPng,
4
4
  inlineImagesIntoMarkdown
5
- } from "./chunk-CRSTBATY.js";
5
+ } from "./chunk-QYFBXJGK.js";
6
6
  import {
7
7
  parsePageRange
8
8
  } from "./chunk-V4BH5SRQ.js";
@@ -17,6 +17,9 @@ import {
17
17
  assignTableIds,
18
18
  blocksToMarkdown,
19
19
  buildTable,
20
+ circledHangul,
21
+ circledNumber,
22
+ composeText,
20
23
  convertTableToText,
21
24
  dedupeRunningHeaders,
22
25
  escapeGfm,
@@ -24,12 +27,15 @@ import {
24
27
  escapeLiteralDollar,
25
28
  escapeLiteralTags,
26
29
  flattenLayoutTables,
30
+ hangulAmount,
31
+ hangulOrdinal,
27
32
  hasStructuredCellContent,
28
33
  mapPuaText,
29
34
  markNonLayoutTable,
30
35
  noteSuffix,
31
36
  noteTableHtml,
32
37
  plainScripts,
38
+ romanNumeral,
33
39
  sanitizeText,
34
40
  stripScriptTags,
35
41
  tidyScriptTags,
@@ -37,7 +43,7 @@ import {
37
43
  validateOcrOptions,
38
44
  visibleText,
39
45
  wrapScript
40
- } from "./chunk-TOUJCO2P.js";
46
+ } from "./chunk-BFAYABLC.js";
41
47
  import {
42
48
  KordocError,
43
49
  OPTIONAL_DEP_INSTALL_HINT,
@@ -55,7 +61,7 @@ import {
55
61
  toArrayBuffer,
56
62
  unescapeHtml,
57
63
  unzipLimitBytes
58
- } from "./chunk-T7OZ7X6A.js";
64
+ } from "./chunk-ZNSWN4JM.js";
59
65
 
60
66
  // src/plain-markdown.ts
61
67
  function toPlainMarkdown(md2) {
@@ -1623,59 +1629,6 @@ function hmlToLatex(hmlEqStr) {
1623
1629
  return out;
1624
1630
  }
1625
1631
 
1626
- // src/shared/numbering.ts
1627
- var HANGUL_INITIALS = [0, 2, 3, 5, 6, 7, 9, 11, 12, 14, 15, 16, 17, 18];
1628
- var HANGUL_MEDIALS = [0, 4, 8, 13, 18, 20];
1629
- function hangulOrdinal(n) {
1630
- const cols = HANGUL_INITIALS.length;
1631
- const vowel = HANGUL_MEDIALS[Math.min(Math.floor(n / cols), HANGUL_MEDIALS.length - 1)];
1632
- const init = HANGUL_INITIALS[n % cols];
1633
- return String.fromCodePoint(44032 + init * 588 + vowel * 28);
1634
- }
1635
- function circledNumber(n) {
1636
- if (n < 20) return String.fromCodePoint(9312 + n);
1637
- if (n < 35) return String.fromCodePoint(12881 + (n - 20));
1638
- if (n < 50) return String.fromCodePoint(12977 + (n - 35));
1639
- return `(${n + 1})`;
1640
- }
1641
- function circledHangul(n) {
1642
- return n < 14 ? String.fromCodePoint(12910 + n) : hangulOrdinal(n);
1643
- }
1644
- var AMOUNT_DIGITS = "\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C";
1645
- var AMOUNT_SMALL = ["", "\uC2ED", "\uBC31", "\uCC9C"];
1646
- var AMOUNT_BIG = ["", "\uB9CC", "\uC5B5", "\uC870", "\uACBD", "\uD574"];
1647
- function hangulAmount(n) {
1648
- const digits = String(n).replace(/\D/g, "").replace(/^0+(?=\d)/, "");
1649
- if (!digits || digits === "0") return "\uC601";
1650
- const groups = [];
1651
- for (let end = digits.length; end > 0; end -= 4) groups.unshift(digits.slice(Math.max(0, end - 4), end));
1652
- let out = "";
1653
- groups.forEach((g3, i) => {
1654
- let part = "";
1655
- const padded = g3.padStart(4, "0");
1656
- for (let k = 0; k < 4; k++) {
1657
- const d = Number(padded[k]);
1658
- if (d) part += AMOUNT_DIGITS[d] + AMOUNT_SMALL[3 - k];
1659
- }
1660
- if (part) out += part + (AMOUNT_BIG[groups.length - 1 - i] ?? "");
1661
- });
1662
- return out;
1663
- }
1664
- function romanNumeral(n, upper) {
1665
- if (n <= 0 || n > 3999) return String(n);
1666
- const values = [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
1667
- const symbols = upper ? ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"] : ["m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv", "i"];
1668
- let result = "";
1669
- let num4 = n;
1670
- for (let i = 0; i < values.length; i++) {
1671
- while (num4 >= values[i]) {
1672
- result += symbols[i];
1673
- num4 -= values[i];
1674
- }
1675
- }
1676
- return result;
1677
- }
1678
-
1679
1632
  // src/hwpx/para-heading.ts
1680
1633
  var HANGUL_JAMO_SEQ = "\u3131\u3134\u3137\u3139\u3141\u3142\u3145\u3147\u3148\u314A\u314B\u314C\u314D\u314E";
1681
1634
  function formatHeadNumber(n, numFormat) {
@@ -2923,6 +2876,10 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2923
2876
  case "tbl":
2924
2877
  if (isInlineTbl(child)) text += "";
2925
2878
  break;
2879
+ // 글자 겹치기 — 겹친 글은 composeText 속성에 있어 종전엔 통째로 빠졌다(법령 서식 원 번호 ⑯·⑰, 시험지 네모 번호 10)
2880
+ case "compose":
2881
+ if (!isInDeletedRange(ctx)) text += escapeLiteralTags(escapeLiteralDollar(composeText(child.getAttribute("composeText") ?? "", (child.getAttribute("circleType") ?? "CHAR") !== "CHAR")));
2882
+ break;
2926
2883
  // 양식 선택 상자·라디오 단추 — 한컴이 그리는 상자 기호와 캡션 글 (종전엔 통째로 빠졌다: form-002 "원천기술형"·서울 결재 "부분공개")
2927
2884
  // 지운 구간의 양식 단추·수식은 글처럼 내지 않는다 (최종본)
2928
2885
  case "checkBtn":
@@ -5704,14 +5661,19 @@ function applyCtrlEffect(ctrl, records, ctx) {
5704
5661
  ctx.warnings.push({ page: ctx.page, message: "\uC2A4\uD0B5\uB41C OLE \uAC1C\uCCB4", code: "SKIPPED_OLE" });
5705
5662
  return;
5706
5663
  }
5707
- // 숨은 설명/단 정의/쪽번호 위치/감추기/찾아보기/책갈피/글자겹침/덧말 — 본문 텍스트 없음 또는 의도적 스킵
5664
+ // 글자 겹침 — ctrl id 뒤 글자 수(WORD)·겹친 글자(WCHAR[n])·테두리 종류(BYTE, 0 = 없음). 종전엔 건너뛰어 법령 서식 원 번호(⑯·⑰)가 빠졌다
5665
+ case CTRL_TCPS: {
5666
+ const d = ctrl.data, n = d.length >= 6 ? d.readUInt16LE(4) : 0;
5667
+ if (n > 0 && d.length >= 6 + 2 * n) ctrl.inlineText = composeText(d.toString("utf16le", 6, 6 + 2 * n), (d[6 + 2 * n] ?? 0) !== 0);
5668
+ return;
5669
+ }
5670
+ // 숨은 설명/단 정의/쪽번호 위치/감추기/찾아보기/책갈피/덧말 — 본문 텍스트 없음 또는 의도적 스킵
5708
5671
  case CTRL_TCMT:
5709
5672
  case CTRL_COLD:
5710
5673
  case CTRL_PGNP:
5711
5674
  case CTRL_PGHD:
5712
5675
  case CTRL_IDXM:
5713
5676
  case CTRL_BOKM:
5714
- case CTRL_TCPS:
5715
5677
  case CTRL_TDUT:
5716
5678
  case CTRL_FORM:
5717
5679
  return;
@@ -24642,7 +24604,7 @@ var MIN_SIDE = 24;
24642
24604
  async function ocrEmbeddedImages(blocks, options, warnings) {
24643
24605
  const ocr = options?.ocr;
24644
24606
  if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
24645
- const { parseImageDocument } = await import("./image-ocr-KE3RUS3R.js");
24607
+ const { parseImageDocument } = await import("./image-ocr-LO2GZKA5.js");
24646
24608
  let inserted = false, unreadable = 0;
24647
24609
  let failed = null;
24648
24610
  const walk = async (list, depth) => {
@@ -42596,7 +42558,8 @@ function parseRenderStyles(headXml, opts) {
42596
42558
  const before2024 = opts?.appMajor !== void 0 && opts.appMajor > 0 && opts.appMajor < 13;
42597
42559
  const major = opts?.appMajor ?? 0, build = opts?.appBuild ?? 0;
42598
42560
  const halfQuote = major === 12 && build >= 4605 || major === 13 && build >= 3901 || major > 13;
42599
- const styles = { charPr: /* @__PURE__ */ new Map(), paraAlign: /* @__PURE__ */ new Map(), paraGeom: /* @__PURE__ */ new Map(), borderFill: /* @__PURE__ */ new Map(), ...before2024 ? { before2024 } : {} };
42561
+ const early2024 = major === 13 && build > 0 && build < 3622;
42562
+ const styles = { charPr: /* @__PURE__ */ new Map(), paraAlign: /* @__PURE__ */ new Map(), paraGeom: /* @__PURE__ */ new Map(), borderFill: /* @__PURE__ */ new Map(), ...before2024 ? { before2024 } : {}, ...early2024 ? { early2024 } : {} };
42600
42563
  const doc = createXmlParser().parseFromString(headXml, "text/xml");
42601
42564
  const root = doc.documentElement;
42602
42565
  if (!root) return styles;
@@ -50356,13 +50319,15 @@ function splitTableRows(tbl2, top, lim, bodyH, styles, notes) {
50356
50319
  const rows = measureTableRowHeights(tbl2);
50357
50320
  if (rows.length === 0) return void 0;
50358
50321
  const outT = num2(om, "top");
50322
+ const cap = captionOf(tbl2);
50323
+ const capTop = cap?.side === "TOP" ? cap.h + cap.gap : 0, capBottom = cap?.side === "BOTTOM" ? cap.h + cap.gap : 0;
50359
50324
  let headH = 0;
50360
50325
  if (tbl2.getAttribute("repeatHeader") === "1") {
50361
50326
  const heads = /* @__PURE__ */ new Set();
50362
50327
  for (const c of collectCells(tbl2)) if (c.el.getAttribute("header") === "1") for (let r = c.ra; r < c.ra + c.rs; r++) heads.add(r);
50363
50328
  for (let r = 0; heads.has(r) && r < rows.length; r++) headH += rows[r];
50364
50329
  }
50365
- let y = top + outT, floor = lim, moved = false;
50330
+ let y = top + outT + capTop, floor = lim, moved = false;
50366
50331
  const rowNoteLines = rows.map(() => []);
50367
50332
  let allN = 0, allS = 0;
50368
50333
  if (notes) for (const c of collectCells(tbl2)) for (const fn of Array.from(c.el.getElementsByTagName("hp:footNote"))) {
@@ -50385,7 +50350,8 @@ function splitTableRows(tbl2, top, lim, bodyH, styles, notes) {
50385
50350
  if (mode === "CELL") {
50386
50351
  const from = /* @__PURE__ */ new Map(), bases = /* @__PURE__ */ new Map();
50387
50352
  while (y + h + outB > fl() && bodyH - outT - outB > 0) {
50388
- const rem = cellRowRemainder(cells, r, fl() - outB - y - (moved ? 100 : 20) - 2 * sp, from, record, bases, carries, styles, bodyH - outT - outB);
50353
+ const rem = cellRowRemainder(cells, r, fl() - outB - y - (moved ? 100 : 20) - 2 * sp, from, record, bases, carries, styles, bodyH - outT - outB, fl() - outB - y - 101 - 2 * sp);
50354
+ if (rem === 0 && r === rows.length - 1) break;
50389
50355
  if (rem === void 0 || rem + sp + (r === rows.length - 1 ? sp : 0) >= h) {
50390
50356
  if (moved && y === outT + headH) break;
50391
50357
  if (!moved && r === 0) splitWhole = true;
@@ -50414,9 +50380,9 @@ function splitTableRows(tbl2, top, lim, bodyH, styles, notes) {
50414
50380
  if (record) rebaseSplitCells(record, carries, styles);
50415
50381
  if (moved) splitNotesLast = { n: allN, s: Math.max(0, allS - placed) };
50416
50382
  splitMovedLast = moved;
50417
- return y + outB;
50383
+ return y + capBottom + outB;
50418
50384
  }
50419
- function cellRowRemainder(cells, row, avail, from, record, bases, carries, styles, contH = 0) {
50385
+ function cellRowRemainder(cells, row, avail, from, record, bases, carries, styles, contH = 0, piece = Infinity) {
50420
50386
  let rem = 0, any = false, placed = false;
50421
50387
  const cuts = [];
50422
50388
  for (const c of cells) {
@@ -50484,6 +50450,7 @@ function cellRowRemainder(cells, row, avail, from, record, bases, carries, style
50484
50450
  }
50485
50451
  cuts.push([c.el, base + lines[k][0], nb]);
50486
50452
  rem = Math.max(rem, end + base - nb + c.marginT + c.marginB);
50453
+ if (off === 0 && /^(CENTER|BOTTOM)$/.test(c.sub.getAttribute("vertAlign") ?? "")) rem = Math.max(rem, c.h - piece);
50487
50454
  }
50488
50455
  if (!(any && placed)) return void 0;
50489
50456
  for (const [el, v, nb] of cuts) {
@@ -51012,7 +50979,7 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
51012
50979
  const NO_WRAP = 1e9;
51013
50980
  const intentPos = geom.marginIntent >= avail ? 0 : Math.max(0, geom.marginIntent);
51014
50981
  const firstWrapWidth = squeeze ? NO_WRAP : Math.max(500, avail - (styles.before2024 && bulletW > 0 ? Math.max(intentPos, bulletW) : intentPos + bulletW));
51015
- const condenseUse = !styles.before2024 && (geom.number || geom.bullet) ? 0 : geom.condense;
50982
+ const condenseUse = !styles.before2024 && !styles.early2024 && (geom.number || geom.bullet) ? 0 : geom.condense;
51016
50983
  for (const r of rightTabFit) {
51017
50984
  const edge = avail - bulletW;
51018
50985
  if (r.x + widths[r.wi] + r.after > edge && edge - r.x - r.after >= 0) widths[r.wi] = edge - r.x - r.after;
@@ -51042,7 +51009,8 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
51042
51009
  const wrapAttr = o.el.getAttribute("textWrap") ?? "";
51043
51010
  if (wrapAttr === "BEHIND_TEXT" || wrapAttr === "IN_FRONT_OF_TEXT") continue;
51044
51011
  const vertRel = pos?.getAttribute("vertRelTo") ?? "PARA";
51045
- if (vertRel === "PAPER" && bodyFlow && wrapAttr !== "TOP_AND_BOTTOM") {
51012
+ const paperBand = wrapAttr === "TOP_AND_BOTTOM" && (pos?.getAttribute("vertAlign") ?? "TOP") === "TOP";
51013
+ if (vertRel === "PAPER" && bodyFlow && (wrapAttr !== "TOP_AND_BOTTOM" || paperBand)) {
51046
51014
  const [oxL, oyT, paperW] = paperOrigin(p);
51047
51015
  const hRel2 = pos?.getAttribute("horzRelTo") ?? "COLUMN", hAlign2 = pos?.getAttribute("horzAlign") ?? "LEFT";
51048
51016
  const ho2 = num3(pos, "horzOffset"), base2 = hRel2 === "PAPER" ? -oxL : hRel2 === "PARA" ? marginL : 0, span3 = hRel2 === "PAPER" ? paperW : hRel2 === "PARA" ? avail : areaW;
@@ -51050,7 +51018,7 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
51050
51018
  const vo0 = Math.max(0, num3(pos, "vertOffset")), top2 = vertRel === "PAPER" ? vo0 - oyT : vo0;
51051
51019
  const omLx2 = num3(om, "left"), omRx2 = num3(om, "right");
51052
51020
  const xs2 = hAlign2 === "RIGHT" ? x02 - omRx2 : hAlign2 === "CENTER" ? x02 : x02 + omLx2;
51053
- zones.push({ top: top2, bottom: top2 + outT + effHOf(o) + outB, left: xs2 - omLx2, right: xs2 + o.width + omRx2, flow: o.el.getAttribute("textFlow") ?? "BOTH_SIDES", anchor: o.index });
51021
+ zones.push({ top: top2, bottom: top2 + outT + effHOf(o) + outB, left: paperBand ? -1e9 : xs2 - omLx2, right: paperBand ? 1e9 : xs2 + o.width + omRx2, flow: o.el.getAttribute("textFlow") ?? "BOTH_SIDES", anchor: o.index });
51054
51022
  continue;
51055
51023
  }
51056
51024
  if (vertRel === "PAGE" || vertRel === "PAPER") continue;
@@ -51538,7 +51506,9 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
51538
51506
  }
51539
51507
  }
51540
51508
  if (explicitBreak || firstOver || orphan || bodyH > 0 && startV > 0 && lines.length === 0 && res.paraBottom > bodyH && paraH <= bodyH) {
51541
- if (zones.length) {
51509
+ const own = zones.length > zonesBefore;
51510
+ zones.length = zonesBefore;
51511
+ if (zones.length || own) {
51542
51512
  carryZones(zones, bodyH, areaW === counter.bodyW);
51543
51513
  const lsa = findChildByLocalName(p, "linesegarray");
51544
51514
  if (lsa) p.removeChild(lsa);
@@ -51585,7 +51555,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
51585
51555
  } else {
51586
51556
  cursorV = (res.floatFloor > 0 && off === 0 ? res.textBottom : res.paraBottom) + off;
51587
51557
  if (res.floatFloor > 0 && off === 0) floatFloor = res.floatFloor;
51588
- const split = bodyH > 0 && off === 0 && (res.paraBottom > lim || squareTableOver(p, startV, lim)) ? splitFloatTableRemainder(p, startV, limOwn, bodyH, styles, false, { n0: pageNotes + fnsOwn.length, s0: pageFoot + ownSum, area: footArea }) : void 0;
51558
+ const split = bodyH > 0 && off === 0 && (res.paraBottom > lim || squareTableOver(p, startV, lim)) ? splitFloatTableRemainder(p, startV - (g3?.spaceBefore ?? 0), limOwn, bodyH, styles, false, { n0: pageNotes + fnsOwn.length, s0: pageFoot + ownSum, area: footArea }) : void 0;
51589
51559
  const tEl = split !== void 0 && splitWhole ? m0Objs(p) : void 0;
51590
51560
  const tVo = tEl ? num3(findChildByLocalName(tEl, "pos"), "vertOffset") : 0;
51591
51561
  const tOm = tEl ? findChildByLocalName(tEl, "outMargin") : null;
@@ -54849,7 +54819,7 @@ function scriptsOff(r, off) {
54849
54819
  }
54850
54820
  async function parseImage(buffer, options) {
54851
54821
  try {
54852
- const { parseImageDocument } = await import("./image-ocr-KE3RUS3R.js");
54822
+ const { parseImageDocument } = await import("./image-ocr-LO2GZKA5.js");
54853
54823
  const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
54854
54824
  stripScriptTags({ blocks });
54855
54825
  return {
@@ -54913,7 +54883,7 @@ async function parseHwp(buffer, options) {
54913
54883
  async function parsePdf(buffer, options) {
54914
54884
  let parsePdfDocument;
54915
54885
  try {
54916
- const mod = await import("./parser-WBKVRDPV.js");
54886
+ const mod = await import("./parser-TJFS44BI.js");
54917
54887
  parsePdfDocument = mod.parsePdfDocument;
54918
54888
  } catch {
54919
54889
  return {