kordoc 4.17.6 → 4.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +5 -0
  2. package/dist/{-Y6U3UTVZ.js → -X4KTLQC6.js} +11 -11
  3. package/dist/{chunk-B3RQHQCC.js → chunk-2VFZQ634.js} +2 -2
  4. package/dist/{chunk-U6NLEEIN.js → chunk-5PNQIF3V.js} +4 -4
  5. package/dist/{chunk-6A4Z6VYA.js → chunk-6N5BOPJI.js} +2 -2
  6. package/dist/{chunk-YCMPQRHV.js → chunk-6V7QRQY3.js} +4 -4
  7. package/dist/{chunk-CZOPNDTO.cjs → chunk-7DC2KL3V.cjs} +21 -21
  8. package/dist/{chunk-CZOPNDTO.cjs.map → chunk-7DC2KL3V.cjs.map} +1 -1
  9. package/dist/{chunk-MOM67IND.js → chunk-AQUNBGXH.js} +2 -2
  10. package/dist/{chunk-7R7NFGHY.js → chunk-CWJ5KY2F.js} +30 -8
  11. package/dist/chunk-CWJ5KY2F.js.map +1 -0
  12. package/dist/{chunk-ZQA7Q3GV.js → chunk-HUGBJVAA.js} +17 -6
  13. package/dist/{chunk-ZQA7Q3GV.js.map → chunk-HUGBJVAA.js.map} +1 -1
  14. package/dist/{chunk-T5O6HEHG.js → chunk-I7YWXECO.js} +2 -2
  15. package/dist/{chunk-LLFXHX7K.cjs → chunk-IUMV45TX.cjs} +12 -12
  16. package/dist/{chunk-LLFXHX7K.cjs.map → chunk-IUMV45TX.cjs.map} +1 -1
  17. package/dist/{chunk-S26THA3Q.cjs → chunk-IXAXI2S3.cjs} +3 -3
  18. package/dist/{chunk-S26THA3Q.cjs.map → chunk-IXAXI2S3.cjs.map} +1 -1
  19. package/dist/{chunk-5VHV6W7W.js → chunk-K35WIYBD.js} +2 -2
  20. package/dist/{chunk-TOCNK4VO.js → chunk-KBZ3MQJX.js} +2 -2
  21. package/dist/{chunk-AYMTRCLC.js → chunk-KXR4CTFT.js} +2 -2
  22. package/dist/{chunk-226C4AJR.js → chunk-MTTYJEKA.js} +2 -2
  23. package/dist/{chunk-HRJAAWEP.js → chunk-NQR3VKWN.js} +2 -2
  24. package/dist/{chunk-FVESLY6V.cjs → chunk-PCSOJ523.cjs} +2 -2
  25. package/dist/{chunk-FVESLY6V.cjs.map → chunk-PCSOJ523.cjs.map} +1 -1
  26. package/dist/{chunk-7F7CUU22.js → chunk-PWRY4W6Q.js} +2 -2
  27. package/dist/{chunk-L5JX2GAM.cjs → chunk-Q5N4YS3T.cjs} +21 -10
  28. package/dist/chunk-Q5N4YS3T.cjs.map +1 -0
  29. package/dist/{chunk-MOVFO74W.js → chunk-R2IFWAHI.js} +2 -2
  30. package/dist/{chunk-4LU6NGTL.cjs → chunk-SIZ63E5G.cjs} +3 -3
  31. package/dist/{chunk-4LU6NGTL.cjs.map → chunk-SIZ63E5G.cjs.map} +1 -1
  32. package/dist/{chunk-ZQBBMUFA.js → chunk-SQQ4ITJ5.js} +2 -2
  33. package/dist/{chunk-2WUE6JIT.js → chunk-TMC4A3FM.js} +17 -6
  34. package/dist/chunk-TMC4A3FM.js.map +1 -0
  35. package/dist/{chunk-ZS5KKM4L.js → chunk-UTVMLJZE.js} +21 -13
  36. package/dist/chunk-UTVMLJZE.js.map +1 -0
  37. package/dist/{chunk-BPLEMV4B.js → chunk-VDIXNEWV.js} +2 -2
  38. package/dist/{chunk-QKEPDJ2D.js → chunk-WWOTHS2E.js} +3 -3
  39. package/dist/{chunk-VHIGYTRO.js → chunk-X625PCZM.js} +3 -3
  40. package/dist/{chunk-PGHIQ6E5.js → chunk-Z4KCEERM.js} +3 -3
  41. package/dist/chunks-ACUC63N3.js +10 -0
  42. package/dist/cli.js +361 -260
  43. package/dist/cli.js.map +1 -1
  44. package/dist/{formula-B72X7SFX.js → formula-LICM6K27.js} +3 -3
  45. package/dist/{formula-U7K3K4AE.js → formula-T4Q2UHWO.js} +4 -4
  46. package/dist/{formula-3IQFGZXS.cjs → formula-W3GQC6L6.cjs} +9 -9
  47. package/dist/{formula-3IQFGZXS.cjs.map → formula-W3GQC6L6.cjs.map} +1 -1
  48. package/dist/{image-ocr-GYYVTTDG.cjs → image-ocr-7PNHBD2G.cjs} +15 -15
  49. package/dist/{image-ocr-GYYVTTDG.cjs.map → image-ocr-7PNHBD2G.cjs.map} +1 -1
  50. package/dist/{image-ocr-UGL5PWJ3.js → image-ocr-WZJURDX6.js} +6 -6
  51. package/dist/{image-ocr-YCBQ7HUD.js → image-ocr-XB2NFKGZ.js} +9 -9
  52. package/dist/index.cjs +528 -500
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.cts +8 -1
  55. package/dist/index.d.ts +8 -1
  56. package/dist/index.js +38 -10
  57. package/dist/index.js.map +1 -1
  58. package/dist/mcp.js +22 -22
  59. package/dist/{model-bundle-Z4KSW4P5.js → model-bundle-O2XYR54X.js} +5 -5
  60. package/dist/{models-HCI2GHBA.js → models-SKK3NH3V.js} +5 -5
  61. package/dist/{parser-XCHUEHOX.js → parser-4D2M5BKY.js} +11 -11
  62. package/dist/{parser-NFOHA5VI.js → parser-5G5G7HHG.js} +8 -8
  63. package/dist/{parser-MZKMFBI3.cjs → parser-PJUZSMFR.cjs} +113 -113
  64. package/dist/{parser-MZKMFBI3.cjs.map → parser-PJUZSMFR.cjs.map} +1 -1
  65. package/dist/pdf-ocr-EGWOIB6O.cjs +16 -0
  66. package/dist/{pdf-ocr-PXU6MBUZ.cjs.map → pdf-ocr-EGWOIB6O.cjs.map} +1 -1
  67. package/dist/pdf-ocr-NJTFXBRC.js +19 -0
  68. package/dist/pdf-ocr-ZXR6Q6BK.js +15 -0
  69. package/dist/{profile-io-3BZXXOIW.js → profile-io-BAQTYPK7.js} +3 -3
  70. package/dist/{rasterize-SLLX5CQN.js → rasterize-A2ZEACKV.js} +3 -3
  71. package/dist/{redact-doc-CCOUCCQA.js → redact-doc-26KN2LSZ.js} +11 -11
  72. package/dist/{render-7OLLRV4U.js → render-62ZUDMHB.js} +7 -7
  73. package/dist/seal-3GXC2API.js +10 -0
  74. package/dist/{setup-GONHHIMX.js → setup-2A3E6WRE.js} +3 -3
  75. package/dist/visual-4ZBZRMCM.js +20 -0
  76. package/dist/{watch-EWWEQI33.js → watch-D2T5FEKT.js} +12 -12
  77. package/package.json +1 -1
  78. package/dist/chunk-2WUE6JIT.js.map +0 -1
  79. package/dist/chunk-7R7NFGHY.js.map +0 -1
  80. package/dist/chunk-L5JX2GAM.cjs.map +0 -1
  81. package/dist/chunk-ZS5KKM4L.js.map +0 -1
  82. package/dist/chunks-S72SPTCL.js +0 -10
  83. package/dist/pdf-ocr-PXU6MBUZ.cjs +0 -16
  84. package/dist/pdf-ocr-QQ6MJCXT.js +0 -19
  85. package/dist/pdf-ocr-WADZZ2YQ.js +0 -15
  86. package/dist/seal-WGSATSQC.js +0 -10
  87. package/dist/visual-C5D42ZAJ.js +0 -20
  88. /package/dist/{-Y6U3UTVZ.js.map → -X4KTLQC6.js.map} +0 -0
  89. /package/dist/{chunk-B3RQHQCC.js.map → chunk-2VFZQ634.js.map} +0 -0
  90. /package/dist/{chunk-U6NLEEIN.js.map → chunk-5PNQIF3V.js.map} +0 -0
  91. /package/dist/{chunk-6A4Z6VYA.js.map → chunk-6N5BOPJI.js.map} +0 -0
  92. /package/dist/{chunk-YCMPQRHV.js.map → chunk-6V7QRQY3.js.map} +0 -0
  93. /package/dist/{chunk-MOM67IND.js.map → chunk-AQUNBGXH.js.map} +0 -0
  94. /package/dist/{chunk-T5O6HEHG.js.map → chunk-I7YWXECO.js.map} +0 -0
  95. /package/dist/{chunk-5VHV6W7W.js.map → chunk-K35WIYBD.js.map} +0 -0
  96. /package/dist/{chunk-TOCNK4VO.js.map → chunk-KBZ3MQJX.js.map} +0 -0
  97. /package/dist/{chunk-AYMTRCLC.js.map → chunk-KXR4CTFT.js.map} +0 -0
  98. /package/dist/{chunk-226C4AJR.js.map → chunk-MTTYJEKA.js.map} +0 -0
  99. /package/dist/{chunk-HRJAAWEP.js.map → chunk-NQR3VKWN.js.map} +0 -0
  100. /package/dist/{chunk-7F7CUU22.js.map → chunk-PWRY4W6Q.js.map} +0 -0
  101. /package/dist/{chunk-MOVFO74W.js.map → chunk-R2IFWAHI.js.map} +0 -0
  102. /package/dist/{chunk-ZQBBMUFA.js.map → chunk-SQQ4ITJ5.js.map} +0 -0
  103. /package/dist/{chunk-BPLEMV4B.js.map → chunk-VDIXNEWV.js.map} +0 -0
  104. /package/dist/{chunk-QKEPDJ2D.js.map → chunk-WWOTHS2E.js.map} +0 -0
  105. /package/dist/{chunk-VHIGYTRO.js.map → chunk-X625PCZM.js.map} +0 -0
  106. /package/dist/{chunk-PGHIQ6E5.js.map → chunk-Z4KCEERM.js.map} +0 -0
  107. /package/dist/{chunks-S72SPTCL.js.map → chunks-ACUC63N3.js.map} +0 -0
  108. /package/dist/{formula-B72X7SFX.js.map → formula-LICM6K27.js.map} +0 -0
  109. /package/dist/{formula-U7K3K4AE.js.map → formula-T4Q2UHWO.js.map} +0 -0
  110. /package/dist/{image-ocr-UGL5PWJ3.js.map → image-ocr-WZJURDX6.js.map} +0 -0
  111. /package/dist/{image-ocr-YCBQ7HUD.js.map → image-ocr-XB2NFKGZ.js.map} +0 -0
  112. /package/dist/{model-bundle-Z4KSW4P5.js.map → model-bundle-O2XYR54X.js.map} +0 -0
  113. /package/dist/{models-HCI2GHBA.js.map → models-SKK3NH3V.js.map} +0 -0
  114. /package/dist/{parser-XCHUEHOX.js.map → parser-4D2M5BKY.js.map} +0 -0
  115. /package/dist/{parser-NFOHA5VI.js.map → parser-5G5G7HHG.js.map} +0 -0
  116. /package/dist/{pdf-ocr-QQ6MJCXT.js.map → pdf-ocr-NJTFXBRC.js.map} +0 -0
  117. /package/dist/{pdf-ocr-WADZZ2YQ.js.map → pdf-ocr-ZXR6Q6BK.js.map} +0 -0
  118. /package/dist/{profile-io-3BZXXOIW.js.map → profile-io-BAQTYPK7.js.map} +0 -0
  119. /package/dist/{rasterize-SLLX5CQN.js.map → rasterize-A2ZEACKV.js.map} +0 -0
  120. /package/dist/{redact-doc-CCOUCCQA.js.map → redact-doc-26KN2LSZ.js.map} +0 -0
  121. /package/dist/{render-7OLLRV4U.js.map → render-62ZUDMHB.js.map} +0 -0
  122. /package/dist/{seal-WGSATSQC.js.map → seal-3GXC2API.js.map} +0 -0
  123. /package/dist/{setup-GONHHIMX.js.map → setup-2A3E6WRE.js.map} +0 -0
  124. /package/dist/{visual-C5D42ZAJ.js.map → visual-4ZBZRMCM.js.map} +0 -0
  125. /package/dist/{watch-EWWEQI33.js.map → watch-D2T5FEKT.js.map} +0 -0
package/README.md CHANGED
@@ -342,11 +342,16 @@ for (const p of r.pageQuality ?? []) if (p.needsOcr) console.log(`p${p.page} 검
342
342
 
343
343
  ## 💻 CLI
344
344
 
345
+ [병렬 변환 성능 측정과 제한 사항](docs/parallel-batch.md)
346
+
347
+ `--jobs N`은 상주 프로세스 N개로 파일 단위 병렬 변환을 실행합니다(기본 1). `--jobs > 1`의 다중 입력은 `-d`가 필요하며, 확장자를 제외한 파일 이름이 서로 달라야 합니다. 일부 파일이 실패해도 나머지는 계속 처리하고 종료 코드는 실패로 설정합니다. 완료 로그와 실패 JSON은 완료 순서로 나옵니다. 프로세스 수만큼 메모리 사용이 늘고, 작은 파일은 오히려 느릴 수 있습니다. OCR은 자체 네이티브 스레드도 사용합니다. 단일 문서의 페이지 병렬화나 JavaScript/MCP API 변경은 포함하지 않습니다.
348
+
345
349
  ```bash
346
350
  # 변환
347
351
  npx kordoc 사업계획서.hwpx # 터미널 출력
348
352
  npx kordoc 보고서.hwp -o 보고서.md # 파일 저장 (그림은 images/보고서/)
349
353
  npx kordoc *.pdf -d ./변환결과/ # 일괄 변환
354
+ npx kordoc *.pdf --jobs 4 -d ./변환결과/ # 병렬 변환 (상주 프로세스 4개)
350
355
  npx kordoc 검토서.hwpx --format json # JSON (blocks + pages + metadata)
351
356
  npx kordoc 검토서.pdf --format chunks # RAG 구조 청크 JSON (breadcrumb + 표 독립 청크)
352
357
  npx kordoc 보고서.hwpx --pages 1-3 # 쪽 범위
@@ -50,17 +50,17 @@ import {
50
50
  unknownFontWarnings,
51
51
  usesGaejosikMunche,
52
52
  validateHwpx
53
- } from "./chunk-ZS5KKM4L.js";
53
+ } from "./chunk-UTVMLJZE.js";
54
54
  import {
55
55
  blocksToPages
56
- } from "./chunk-7F7CUU22.js";
56
+ } from "./chunk-PWRY4W6Q.js";
57
57
  import {
58
58
  applySplices,
59
59
  buildParagraphSplices,
60
60
  buildRangeSplices,
61
61
  placeSealHwpx,
62
62
  scanSectionXml
63
- } from "./chunk-PGHIQ6E5.js";
63
+ } from "./chunk-Z4KCEERM.js";
64
64
  import {
65
65
  DEFAULT_REDACT_RULES,
66
66
  redactMarkdown,
@@ -68,7 +68,7 @@ import {
68
68
  } from "./chunk-3WSNLH4B.js";
69
69
  import {
70
70
  blocksToChunks
71
- } from "./chunk-B3RQHQCC.js";
71
+ } from "./chunk-2VFZQ634.js";
72
72
  import {
73
73
  SPACE_EM_FIXED,
74
74
  SPACE_EM_FONT,
@@ -93,20 +93,20 @@ import {
93
93
  renderSceneToHtml,
94
94
  simulateWrap,
95
95
  simulateWrapKeepWord
96
- } from "./chunk-7R7NFGHY.js";
96
+ } from "./chunk-CWJ5KY2F.js";
97
97
  import "./chunk-7FCNOKOR.js";
98
- import "./chunk-2WUE6JIT.js";
98
+ import "./chunk-TMC4A3FM.js";
99
99
  import "./chunk-VQFA55IC.js";
100
- import "./chunk-6A4Z6VYA.js";
100
+ import "./chunk-6N5BOPJI.js";
101
101
  import {
102
102
  blocksToMarkdown,
103
103
  flattenLayoutTables,
104
104
  hasStructuredCellContent
105
- } from "./chunk-5VHV6W7W.js";
106
- import "./chunk-MOM67IND.js";
105
+ } from "./chunk-K35WIYBD.js";
106
+ import "./chunk-AQUNBGXH.js";
107
107
  import {
108
108
  VERSION
109
- } from "./chunk-T5O6HEHG.js";
109
+ } from "./chunk-I7YWXECO.js";
110
110
  export {
111
111
  BUILTIN_TEMPLATES,
112
112
  DEFAULT_REDACT_RULES,
@@ -196,4 +196,4 @@ export {
196
196
  usesGaejosikMunche,
197
197
  validateHwpx
198
198
  };
199
- //# sourceMappingURL=-Y6U3UTVZ.js.map
199
+ //# sourceMappingURL=-X4KTLQC6.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  blocksToMarkdown
4
- } from "./chunk-5VHV6W7W.js";
4
+ } from "./chunk-K35WIYBD.js";
5
5
 
6
6
  // src/chunks.ts
7
7
  var LIST_MARKER_RE = /^(?:[□■◇◆○◎●◦ㅇ•▪▸▶※-]|\d{1,3}[.)]|[가나다라마바사아자차카타파하][.)]|\([가나다라마바사아자차카타파하0-9]{1,3}\)|[①-⑳㉮-㉻㈎-㈛])\s/;
@@ -79,4 +79,4 @@ function blocksToChunks(blocks, options) {
79
79
  export {
80
80
  blocksToChunks
81
81
  };
82
- //# sourceMappingURL=chunk-B3RQHQCC.js.map
82
+ //# sourceMappingURL=chunk-2VFZQ634.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  extractPageBlocksWithLines
4
- } from "./chunk-QKEPDJ2D.js";
4
+ } from "./chunk-WWOTHS2E.js";
5
5
  import {
6
6
  OCR_DET_MODEL,
7
7
  OCR_REC_DICT,
@@ -9,10 +9,10 @@ import {
9
9
  ensureOcrModels,
10
10
  getOcrModelsDir,
11
11
  parseCharacterDict
12
- } from "./chunk-MOVFO74W.js";
12
+ } from "./chunk-R2IFWAHI.js";
13
13
  import {
14
14
  OPTIONAL_DEP_INSTALL_HINT
15
- } from "./chunk-T5O6HEHG.js";
15
+ } from "./chunk-I7YWXECO.js";
16
16
 
17
17
  // src/ocr/ruling-lines.ts
18
18
  var INK_LUMA_MAX = 205;
@@ -2061,4 +2061,4 @@ export {
2061
2061
  runPdfOcr,
2062
2062
  ocrItemsToBlocks
2063
2063
  };
2064
- //# sourceMappingURL=chunk-U6NLEEIN.js.map
2064
+ //# sourceMappingURL=chunk-5PNQIF3V.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  KordocError,
4
4
  unzipLimitBytes
5
- } from "./chunk-T5O6HEHG.js";
5
+ } from "./chunk-I7YWXECO.js";
6
6
 
7
7
  // src/hwpx/parser-shared.ts
8
8
  import { DOMParser } from "@xmldom/xmldom";
@@ -336,4 +336,4 @@ export {
336
336
  hwpFaceToCssStack,
337
337
  parseRenderStyles
338
338
  };
339
- //# sourceMappingURL=chunk-6A4Z6VYA.js.map
339
+ //# sourceMappingURL=chunk-6N5BOPJI.js.map
@@ -4,15 +4,15 @@ import {
4
4
  HEADING_RATIO_H2,
5
5
  HEADING_RATIO_H3,
6
6
  tidyScriptTags
7
- } from "./chunk-ZQA7Q3GV.js";
7
+ } from "./chunk-HUGBJVAA.js";
8
8
  import {
9
9
  ensureModelsIn,
10
10
  getModelsDir
11
- } from "./chunk-AYMTRCLC.js";
11
+ } from "./chunk-KXR4CTFT.js";
12
12
  import {
13
13
  safeMax,
14
14
  safeMin
15
- } from "./chunk-BPLEMV4B.js";
15
+ } from "./chunk-VDIXNEWV.js";
16
16
 
17
17
  // src/ocr/models.ts
18
18
  import { join } from "path";
@@ -7611,4 +7611,4 @@ export {
7611
7611
  joinCellEdges,
7612
7612
  extractPageBlocksWithLines
7613
7613
  };
7614
- //# sourceMappingURL=chunk-YCMPQRHV.js.map
7614
+ //# sourceMappingURL=chunk-6V7QRQY3.js.map
@@ -4,15 +4,15 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkL5JX2GAMcjs = require('./chunk-L5JX2GAM.cjs');
7
+ var _chunkQ5N4YS3Tcjs = require('./chunk-Q5N4YS3T.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunk4LU6NGTLcjs = require('./chunk-4LU6NGTL.cjs');
11
+ var _chunkSIZ63E5Gcjs = require('./chunk-SIZ63E5G.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkFVESLY6Vcjs = require('./chunk-FVESLY6V.cjs');
15
+ var _chunkPCSOJ523cjs = require('./chunk-PCSOJ523.cjs');
16
16
 
17
17
  // src/ocr/models.ts
18
18
  var _path = require('path');
@@ -40,10 +40,10 @@ var OCR_REC_DICT = {
40
40
  };
41
41
  var ALL_OCR_MODELS = [OCR_DET_MODEL, OCR_REC_MODEL, OCR_REC_DICT];
42
42
  function getOcrModelsDir() {
43
- return _chunk4LU6NGTLcjs.getModelsDir.call(void 0, "ppocr");
43
+ return _chunkSIZ63E5Gcjs.getModelsDir.call(void 0, "ppocr");
44
44
  }
45
45
  async function ensureOcrModels(onProgress) {
46
- return _chunk4LU6NGTLcjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
46
+ return _chunkSIZ63E5Gcjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
47
47
  }
48
48
  async function ocrModelsCached() {
49
49
  const dir = getOcrModelsDir();
@@ -2090,7 +2090,7 @@ function tagScripts(text, lines) {
2090
2090
  const [s, e, kind] = marks[m];
2091
2091
  out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
2092
2092
  }
2093
- return _chunkL5JX2GAMcjs.tidyScriptTags.call(void 0, out);
2093
+ return _chunkQ5N4YS3Tcjs.tidyScriptTags.call(void 0, out);
2094
2094
  }
2095
2095
 
2096
2096
  // src/pdf/line-wrap.ts
@@ -3641,9 +3641,9 @@ function detectHeadings(blocks, medianFontSize) {
3641
3641
  if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
3642
3642
  const ratio = block.style.fontSize / medianFontSize;
3643
3643
  let level = 0;
3644
- if (ratio >= _chunkL5JX2GAMcjs.HEADING_RATIO_H1) level = 1;
3645
- else if (ratio >= _chunkL5JX2GAMcjs.HEADING_RATIO_H2) level = 2;
3646
- else if (ratio >= _chunkL5JX2GAMcjs.HEADING_RATIO_H3) level = 3;
3644
+ if (ratio >= _chunkQ5N4YS3Tcjs.HEADING_RATIO_H1) level = 1;
3645
+ else if (ratio >= _chunkQ5N4YS3Tcjs.HEADING_RATIO_H2) level = 2;
3646
+ else if (ratio >= _chunkQ5N4YS3Tcjs.HEADING_RATIO_H3) level = 3;
3647
3647
  if (level > 0) {
3648
3648
  block.type = "heading";
3649
3649
  block.level = level;
@@ -3656,7 +3656,7 @@ function isChapterNumber(block, next, medianFontSize) {
3656
3656
  const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _94 => _94.style, 'optionalAccess', _95 => _95.fontSize]), () => ( 0));
3657
3657
  const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _96 => _96.text, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()]), () => ( ""));
3658
3658
  const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _99 => _99.bbox]);
3659
- return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _100 => _100.text, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkL5JX2GAMcjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
3659
+ return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _100 => _100.text, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkQ5N4YS3Tcjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
3660
3660
  }
3661
3661
  function mergeStackedHeadingLines(blocks, medianFontSize) {
3662
3662
  for (let i = 0; i < blocks.length - 1; ) {
@@ -5565,16 +5565,16 @@ function isProseSpread(items) {
5565
5565
  for (let i = 1; i < sorted.length; i++) {
5566
5566
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
5567
5567
  }
5568
- const maxGap = _chunkFVESLY6Vcjs.safeMax.call(void 0, gaps);
5568
+ const maxGap = _chunkPCSOJ523cjs.safeMax.call(void 0, gaps);
5569
5569
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
5570
5570
  if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
5571
- const minGap = _chunkFVESLY6Vcjs.safeMin.call(void 0, gaps);
5571
+ const minGap = _chunkPCSOJ523cjs.safeMin.call(void 0, gaps);
5572
5572
  return minGap > 0 && maxGap - minGap <= Math.max(2, maxGap * 0.15) && items.filter((i) => /^\P{L}*\p{Ll}/u.test(i.text)).length * 2 >= items.length;
5573
5573
  }
5574
5574
  function detectColumns(yLines) {
5575
5575
  const allItems = yLines.flat();
5576
5576
  if (allItems.length === 0) return null;
5577
- const pageWidth = _chunkFVESLY6Vcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkFVESLY6Vcjs.safeMin.call(void 0, allItems.map((i) => i.x));
5577
+ const pageWidth = _chunkPCSOJ523cjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkPCSOJ523cjs.safeMin.call(void 0, allItems.map((i) => i.x));
5578
5578
  if (pageWidth < 100) return null;
5579
5579
  let bigoLineIdx = -1;
5580
5580
  for (let i = 0; i < yLines.length; i++) {
@@ -6012,12 +6012,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
6012
6012
  }
6013
6013
  function takeClipCellEdges(from, to) {
6014
6014
  const e = CLIP_CELL_EDGES.get(from);
6015
- if (e) _chunkL5JX2GAMcjs.CELL_EDGES.set(to, e);
6015
+ if (e) _chunkQ5N4YS3Tcjs.CELL_EDGES.set(to, e);
6016
6016
  }
6017
6017
  function joinCellEdges(a, b) {
6018
- const u = _chunkL5JX2GAMcjs.CELL_EDGES.get(a), d = _chunkL5JX2GAMcjs.CELL_EDGES.get(b);
6018
+ const u = _chunkQ5N4YS3Tcjs.CELL_EDGES.get(a), d = _chunkQ5N4YS3Tcjs.CELL_EDGES.get(b);
6019
6019
  if (!u || !d) return;
6020
- _chunkL5JX2GAMcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
6020
+ _chunkQ5N4YS3Tcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
6021
6021
  }
6022
6022
 
6023
6023
  // src/pdf/table-unit-row.ts
@@ -6033,7 +6033,7 @@ function rebuildUnitLine(items, grid) {
6033
6033
  function prependUnitRow(cells, cols, line, usedItems) {
6034
6034
  const text = cleanCellText(line.map((item) => item.text).join(""));
6035
6035
  cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
6036
- for (const cell of cells[0]) _chunkL5JX2GAMcjs.CELL_EDGES.set(cell, NO_EDGES);
6036
+ for (const cell of cells[0]) _chunkQ5N4YS3Tcjs.CELL_EDGES.set(cell, NO_EDGES);
6037
6037
  for (const item of line) usedItems.add(item);
6038
6038
  }
6039
6039
  function attachUnitRow(items, grid, cells, cols, usedItems) {
@@ -7204,7 +7204,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7204
7204
  if (gutterX !== null) {
7205
7205
  const gx = gutterX;
7206
7206
  const allY = remaining.map((i) => i.y);
7207
- const pageH = _chunkFVESLY6Vcjs.safeMax.call(void 0, allY) - _chunkFVESLY6Vcjs.safeMin.call(void 0, allY);
7207
+ const pageH = _chunkPCSOJ523cjs.safeMax.call(void 0, allY) - _chunkPCSOJ523cjs.safeMin.call(void 0, allY);
7208
7208
  const gapThreshold = Math.max(15, pageH * 0.03);
7209
7209
  const sides = [
7210
7210
  remaining.filter((i) => i.x + i.w <= gx),
@@ -7224,7 +7224,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7224
7224
  finalTextBlocks = detectListBlocks(textBlocks);
7225
7225
  } else {
7226
7226
  const allY = remaining.map((i) => i.y);
7227
- const pageH = _chunkFVESLY6Vcjs.safeMax.call(void 0, allY) - _chunkFVESLY6Vcjs.safeMin.call(void 0, allY);
7227
+ const pageH = _chunkPCSOJ523cjs.safeMax.call(void 0, allY) - _chunkPCSOJ523cjs.safeMin.call(void 0, allY);
7228
7228
  const groups = xyCutOrder(remaining, Math.max(15, pageH * 0.03));
7229
7229
  const textBlocks = [];
7230
7230
  for (const group of groups) {
@@ -7543,7 +7543,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
7543
7543
  blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
7544
7544
  } else {
7545
7545
  const allY = items.map((i) => i.y);
7546
- const pageHeight = _chunkFVESLY6Vcjs.safeMax.call(void 0, allY) - _chunkFVESLY6Vcjs.safeMin.call(void 0, allY);
7546
+ const pageHeight = _chunkPCSOJ523cjs.safeMax.call(void 0, allY) - _chunkPCSOJ523cjs.safeMin.call(void 0, allY);
7547
7547
  const gapThreshold = Math.max(15, pageHeight * 0.03);
7548
7548
  const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold);
7549
7549
  for (const group of orderedGroups) {
@@ -7611,4 +7611,4 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
7611
7611
 
7612
7612
 
7613
7613
  exports.OCR_DET_MODEL = OCR_DET_MODEL; exports.OCR_REC_MODEL = OCR_REC_MODEL; exports.OCR_REC_DICT = OCR_REC_DICT; exports.getOcrModelsDir = getOcrModelsDir; exports.ensureOcrModels = ensureOcrModels; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; exports.filterHiddenText = filterHiddenText; exports.collapseEvenSpacing = collapseEvenSpacing; exports.normalizeItems = normalizeItems; exports.WrapLexicon = WrapLexicon; exports.startsNewItem = startsNewItem; exports.wrapJoiner = wrapJoiner; exports.joinPageBreakWraps = joinPageBreakWraps; exports.latinSoftWrap = latinSoftWrap; exports.TOC_BLOCKS = TOC_BLOCKS; exports.computeMedianFontSizeFromFreq = computeMedianFontSizeFromFreq; exports.detectHeadings = detectHeadings; exports.mergeStackedHeadingLines = mergeStackedHeadingLines; exports.detectTypographyHeadings = detectTypographyHeadings; exports.detectDocumentStyleHeadings = detectDocumentStyleHeadings; exports.detectSiblingStyleHeadings = detectSiblingStyleHeadings; exports.detectRepeatedPageLabels = detectRepeatedPageLabels; exports.detectPageLeadHeadings = detectPageLeadHeadings; exports.refineDocumentStyleHeadings = refineDocumentStyleHeadings; exports.detectMarkerHeadings = detectMarkerHeadings; exports.detectTableCaptions = detectTableCaptions; exports.detectKoreanListBlocks = detectKoreanListBlocks; exports.removeHeaderFooterBlocks = removeHeaderFooterBlocks; exports.CLIP_TABLES = CLIP_TABLES; exports.TABLE_COLXS = TABLE_COLXS; exports.TABLE_ROWYS = TABLE_ROWYS; exports.TABLE_TAIL = TABLE_TAIL; exports.PART_COLXS = PART_COLXS; exports.EMPTY_PARTS = EMPTY_PARTS; exports.IMAGE_CELLS = IMAGE_CELLS; exports.FILLER_CELLS = FILLER_CELLS; exports.CONT_PARTS = CONT_PARTS; exports.CELL_LINES = CELL_LINES; exports.ROW_RULES = ROW_RULES; exports.trimTrailingEmptyTableCols = trimTrailingEmptyTableCols; exports.NO_EDGES = NO_EDGES; exports.joinCellEdges = joinCellEdges; exports.extractPageBlocksWithLines = extractPageBlocksWithLines;
7614
- //# sourceMappingURL=chunk-CZOPNDTO.cjs.map
7614
+ //# sourceMappingURL=chunk-7DC2KL3V.cjs.map