kordoc 4.18.4 → 4.18.6

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 (119) hide show
  1. package/dist/{-DDAVBMHD.js → -DE2KWCGY.js} +11 -11
  2. package/dist/{chunk-4IBY5LTJ.js → chunk-3KLL62JC.js} +2 -2
  3. package/dist/{chunk-IAXGGQGD.js → chunk-3QJPAKDQ.js} +2 -2
  4. package/dist/{chunk-274ZPMHK.js → chunk-4DVAKBXW.js} +2 -2
  5. package/dist/{chunk-OIUSF2VA.cjs → chunk-4JMV3G4Y.cjs} +12 -12
  6. package/dist/{chunk-OIUSF2VA.cjs.map → chunk-4JMV3G4Y.cjs.map} +1 -1
  7. package/dist/{chunk-3WLZOJIE.cjs → chunk-5TUGAXAI.cjs} +6 -6
  8. package/dist/{chunk-3WLZOJIE.cjs.map → chunk-5TUGAXAI.cjs.map} +1 -1
  9. package/dist/{chunk-7GR2GCJF.js → chunk-6N5TBPPV.js} +2 -2
  10. package/dist/{chunk-XG4SYOZL.js → chunk-7P2JOHWA.js} +2 -2
  11. package/dist/{chunk-DUV7Y6IQ.js → chunk-BY7UEIZH.js} +3 -3
  12. package/dist/{chunk-TMJVD6FW.js → chunk-CWJJTCCH.js} +2 -2
  13. package/dist/{chunk-HRJJDNRD.js → chunk-DVLKNRAA.js} +2 -2
  14. package/dist/{chunk-AVIZ55NQ.cjs → chunk-FJI44TS5.cjs} +3 -3
  15. package/dist/{chunk-AVIZ55NQ.cjs.map → chunk-FJI44TS5.cjs.map} +1 -1
  16. package/dist/{chunk-VTVK2JMI.js → chunk-FVF57U3O.js} +2 -2
  17. package/dist/{chunk-Z2PPDQK2.js → chunk-GJJVMC2G.js} +2 -2
  18. package/dist/{chunk-RCI7LY4N.js → chunk-I5RRAR64.js} +4 -4
  19. package/dist/{chunk-ELOPDQES.js → chunk-IW2WVEZU.js} +2 -2
  20. package/dist/{chunk-E2644XCO.cjs → chunk-J5HIKXQF.cjs} +142 -45
  21. package/dist/chunk-J5HIKXQF.cjs.map +1 -0
  22. package/dist/{chunk-MXA6YW2W.js → chunk-JYX46LZT.js} +111 -94
  23. package/dist/chunk-JYX46LZT.js.map +1 -0
  24. package/dist/{chunk-T2BJPT6D.js → chunk-LW5SNBU7.js} +2 -2
  25. package/dist/{chunk-F5YVCJVF.js → chunk-NM6WGVOR.js} +2 -2
  26. package/dist/{chunk-F2GDLA45.js → chunk-OWKGNWRS.js} +10 -10
  27. package/dist/{chunk-QVCHFCT2.js → chunk-PFXSGQNN.js} +2 -2
  28. package/dist/{chunk-V5X4LLVM.js → chunk-PMPAREFJ.js} +6 -6
  29. package/dist/{chunk-LGF2IO66.js → chunk-QND3QFIX.js} +2 -2
  30. package/dist/{chunk-IBQCK4F3.js → chunk-SYWZ3SRQ.js} +3 -3
  31. package/dist/{chunk-KUUSP6OS.js → chunk-T45W6EIA.js} +191 -14
  32. package/dist/chunk-T45W6EIA.js.map +1 -0
  33. package/dist/{chunk-YCY2R4FM.js → chunk-TOHCMCDL.js} +2 -2
  34. package/dist/{chunk-3XSP7V5P.cjs → chunk-UIPMCOHH.cjs} +2 -2
  35. package/dist/{chunk-3XSP7V5P.cjs.map → chunk-UIPMCOHH.cjs.map} +1 -1
  36. package/dist/{chunk-SVNBZEL6.cjs → chunk-UUK2TZQ2.cjs} +3 -3
  37. package/dist/{chunk-SVNBZEL6.cjs.map → chunk-UUK2TZQ2.cjs.map} +1 -1
  38. package/dist/chunks-3NIK3E7X.js +10 -0
  39. package/dist/cli.js +33 -27
  40. package/dist/cli.js.map +1 -1
  41. package/dist/{formula-HQFZEXFF.js → formula-P77ISY24.js} +3 -3
  42. package/dist/{formula-YYJQBKEN.cjs → formula-QQZ62X3A.cjs} +9 -9
  43. package/dist/{formula-YYJQBKEN.cjs.map → formula-QQZ62X3A.cjs.map} +1 -1
  44. package/dist/{formula-7ZOZ5QJ6.js → formula-XQXGM25B.js} +4 -4
  45. package/dist/{image-ocr-4BGX2EJJ.js → image-ocr-7FIUVJN6.js} +6 -6
  46. package/dist/{image-ocr-RK3HJVCI.js → image-ocr-LCEJXRAW.js} +9 -9
  47. package/dist/{image-ocr-CC26Q5KG.cjs → image-ocr-XILDGKJT.cjs} +15 -15
  48. package/dist/{image-ocr-CC26Q5KG.cjs.map → image-ocr-XILDGKJT.cjs.map} +1 -1
  49. package/dist/index.cjs +277 -277
  50. package/dist/index.js +5 -5
  51. package/dist/mcp.js +22 -22
  52. package/dist/{model-bundle-VHRXG63R.js → model-bundle-SQZ3W5YY.js} +5 -5
  53. package/dist/{models-G3WA24SY.js → models-JZCTRP7M.js} +5 -5
  54. package/dist/{parser-GFDGAVLV.js → parser-IKKZQMTJ.js} +8 -8
  55. package/dist/{parser-SOWTUOMK.js → parser-JCVDTWZK.js} +11 -11
  56. package/dist/{parser-BGORCLIU.cjs → parser-QHJZTPLI.cjs} +126 -126
  57. package/dist/{parser-BGORCLIU.cjs.map → parser-QHJZTPLI.cjs.map} +1 -1
  58. package/dist/pdf-ocr-53LWVES4.js +16 -0
  59. package/dist/pdf-ocr-72EYTUTO.cjs +17 -0
  60. package/dist/{pdf-ocr-EJ2HNZN6.cjs.map → pdf-ocr-72EYTUTO.cjs.map} +1 -1
  61. package/dist/pdf-ocr-EZGDVPJR.js +20 -0
  62. package/dist/{profile-io-Q2T47RVH.js → profile-io-ZOPP3ZZF.js} +3 -3
  63. package/dist/{rasterize-OAVMUTE6.js → rasterize-SSVBOWS7.js} +3 -3
  64. package/dist/{redact-doc-ECFOVR4X.js → redact-doc-NKOEXJLS.js} +11 -11
  65. package/dist/{render-NSKWZVTD.js → render-Z3UINVKW.js} +7 -7
  66. package/dist/seal-UVB4GNMX.js +10 -0
  67. package/dist/{setup-REH2KZP2.js → setup-XFGSO4EL.js} +3 -3
  68. package/dist/visual-WKOKF77U.js +20 -0
  69. package/dist/{watch-JXDUZYBY.js → watch-OYDMGGU6.js} +12 -12
  70. package/package.json +1 -1
  71. package/dist/chunk-E2644XCO.cjs.map +0 -1
  72. package/dist/chunk-KUUSP6OS.js.map +0 -1
  73. package/dist/chunk-MXA6YW2W.js.map +0 -1
  74. package/dist/chunks-5QTTAT5T.js +0 -10
  75. package/dist/pdf-ocr-7IOOVR2I.js +0 -20
  76. package/dist/pdf-ocr-EJ2HNZN6.cjs +0 -17
  77. package/dist/pdf-ocr-RACAZU3N.js +0 -16
  78. package/dist/seal-A4MG7MPQ.js +0 -10
  79. package/dist/visual-B56WQAGW.js +0 -20
  80. /package/dist/{-DDAVBMHD.js.map → -DE2KWCGY.js.map} +0 -0
  81. /package/dist/{chunk-4IBY5LTJ.js.map → chunk-3KLL62JC.js.map} +0 -0
  82. /package/dist/{chunk-IAXGGQGD.js.map → chunk-3QJPAKDQ.js.map} +0 -0
  83. /package/dist/{chunk-274ZPMHK.js.map → chunk-4DVAKBXW.js.map} +0 -0
  84. /package/dist/{chunk-7GR2GCJF.js.map → chunk-6N5TBPPV.js.map} +0 -0
  85. /package/dist/{chunk-XG4SYOZL.js.map → chunk-7P2JOHWA.js.map} +0 -0
  86. /package/dist/{chunk-DUV7Y6IQ.js.map → chunk-BY7UEIZH.js.map} +0 -0
  87. /package/dist/{chunk-TMJVD6FW.js.map → chunk-CWJJTCCH.js.map} +0 -0
  88. /package/dist/{chunk-HRJJDNRD.js.map → chunk-DVLKNRAA.js.map} +0 -0
  89. /package/dist/{chunk-VTVK2JMI.js.map → chunk-FVF57U3O.js.map} +0 -0
  90. /package/dist/{chunk-Z2PPDQK2.js.map → chunk-GJJVMC2G.js.map} +0 -0
  91. /package/dist/{chunk-RCI7LY4N.js.map → chunk-I5RRAR64.js.map} +0 -0
  92. /package/dist/{chunk-ELOPDQES.js.map → chunk-IW2WVEZU.js.map} +0 -0
  93. /package/dist/{chunk-T2BJPT6D.js.map → chunk-LW5SNBU7.js.map} +0 -0
  94. /package/dist/{chunk-F5YVCJVF.js.map → chunk-NM6WGVOR.js.map} +0 -0
  95. /package/dist/{chunk-F2GDLA45.js.map → chunk-OWKGNWRS.js.map} +0 -0
  96. /package/dist/{chunk-QVCHFCT2.js.map → chunk-PFXSGQNN.js.map} +0 -0
  97. /package/dist/{chunk-V5X4LLVM.js.map → chunk-PMPAREFJ.js.map} +0 -0
  98. /package/dist/{chunk-LGF2IO66.js.map → chunk-QND3QFIX.js.map} +0 -0
  99. /package/dist/{chunk-IBQCK4F3.js.map → chunk-SYWZ3SRQ.js.map} +0 -0
  100. /package/dist/{chunk-YCY2R4FM.js.map → chunk-TOHCMCDL.js.map} +0 -0
  101. /package/dist/{chunks-5QTTAT5T.js.map → chunks-3NIK3E7X.js.map} +0 -0
  102. /package/dist/{formula-HQFZEXFF.js.map → formula-P77ISY24.js.map} +0 -0
  103. /package/dist/{formula-7ZOZ5QJ6.js.map → formula-XQXGM25B.js.map} +0 -0
  104. /package/dist/{image-ocr-4BGX2EJJ.js.map → image-ocr-7FIUVJN6.js.map} +0 -0
  105. /package/dist/{image-ocr-RK3HJVCI.js.map → image-ocr-LCEJXRAW.js.map} +0 -0
  106. /package/dist/{model-bundle-VHRXG63R.js.map → model-bundle-SQZ3W5YY.js.map} +0 -0
  107. /package/dist/{models-G3WA24SY.js.map → models-JZCTRP7M.js.map} +0 -0
  108. /package/dist/{parser-GFDGAVLV.js.map → parser-IKKZQMTJ.js.map} +0 -0
  109. /package/dist/{parser-SOWTUOMK.js.map → parser-JCVDTWZK.js.map} +0 -0
  110. /package/dist/{pdf-ocr-7IOOVR2I.js.map → pdf-ocr-53LWVES4.js.map} +0 -0
  111. /package/dist/{pdf-ocr-RACAZU3N.js.map → pdf-ocr-EZGDVPJR.js.map} +0 -0
  112. /package/dist/{profile-io-Q2T47RVH.js.map → profile-io-ZOPP3ZZF.js.map} +0 -0
  113. /package/dist/{rasterize-OAVMUTE6.js.map → rasterize-SSVBOWS7.js.map} +0 -0
  114. /package/dist/{redact-doc-ECFOVR4X.js.map → redact-doc-NKOEXJLS.js.map} +0 -0
  115. /package/dist/{render-NSKWZVTD.js.map → render-Z3UINVKW.js.map} +0 -0
  116. /package/dist/{seal-A4MG7MPQ.js.map → seal-UVB4GNMX.js.map} +0 -0
  117. /package/dist/{setup-REH2KZP2.js.map → setup-XFGSO4EL.js.map} +0 -0
  118. /package/dist/{visual-B56WQAGW.js.map → visual-WKOKF77U.js.map} +0 -0
  119. /package/dist/{watch-JXDUZYBY.js.map → watch-OYDMGGU6.js.map} +0 -0
@@ -4,15 +4,15 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk3WLZOJIEcjs = require('./chunk-3WLZOJIE.cjs');
7
+ var _chunk5TUGAXAIcjs = require('./chunk-5TUGAXAI.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkAVIZ55NQcjs = require('./chunk-AVIZ55NQ.cjs');
11
+ var _chunkFJI44TS5cjs = require('./chunk-FJI44TS5.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunk3XSP7V5Pcjs = require('./chunk-3XSP7V5P.cjs');
15
+ var _chunkUIPMCOHHcjs = require('./chunk-UIPMCOHH.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 _chunkAVIZ55NQcjs.getModelsDir.call(void 0, "ppocr");
43
+ return _chunkFJI44TS5cjs.getModelsDir.call(void 0, "ppocr");
44
44
  }
45
45
  async function ensureOcrModels(onProgress) {
46
- return _chunkAVIZ55NQcjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
46
+ return _chunkFJI44TS5cjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
47
47
  }
48
48
  async function ocrModelsCached() {
49
49
  const dir = getOcrModelsDir();
@@ -2091,7 +2091,7 @@ function tagScripts(text, lines) {
2091
2091
  const [s, e, kind] = marks[m];
2092
2092
  out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
2093
2093
  }
2094
- return _chunk3WLZOJIEcjs.tidyScriptTags.call(void 0, out);
2094
+ return _chunk5TUGAXAIcjs.tidyScriptTags.call(void 0, out);
2095
2095
  }
2096
2096
 
2097
2097
  // src/pdf/line-wrap.ts
@@ -3644,9 +3644,9 @@ function detectHeadings(blocks, medianFontSize) {
3644
3644
  if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
3645
3645
  const ratio = block.style.fontSize / medianFontSize;
3646
3646
  let level = 0;
3647
- if (ratio >= _chunk3WLZOJIEcjs.HEADING_RATIO_H1) level = 1;
3648
- else if (ratio >= _chunk3WLZOJIEcjs.HEADING_RATIO_H2) level = 2;
3649
- else if (ratio >= _chunk3WLZOJIEcjs.HEADING_RATIO_H3) level = 3;
3647
+ if (ratio >= _chunk5TUGAXAIcjs.HEADING_RATIO_H1) level = 1;
3648
+ else if (ratio >= _chunk5TUGAXAIcjs.HEADING_RATIO_H2) level = 2;
3649
+ else if (ratio >= _chunk5TUGAXAIcjs.HEADING_RATIO_H3) level = 3;
3650
3650
  if (level > 0) {
3651
3651
  block.type = "heading";
3652
3652
  block.level = level;
@@ -3659,7 +3659,7 @@ function isChapterNumber(block, next, medianFontSize) {
3659
3659
  const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _96 => _96.style, 'optionalAccess', _97 => _97.fontSize]), () => ( 0));
3660
3660
  const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _98 => _98.text, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()]), () => ( ""));
3661
3661
  const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _101 => _101.bbox]);
3662
- return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _102 => _102.text, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunk3WLZOJIEcjs.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;
3662
+ return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _102 => _102.text, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunk5TUGAXAIcjs.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;
3663
3663
  }
3664
3664
  function mergeStackedHeadingLines(blocks, medianFontSize) {
3665
3665
  for (let i = 0; i < blocks.length - 1; ) {
@@ -4888,6 +4888,7 @@ function detectClusterTables(items, pageNum, rejected) {
4888
4888
  });
4889
4889
  }
4890
4890
  var SIDE_TAB_MIN = 6;
4891
+ var SIDE_TAB_CAP_GROUPS = /* @__PURE__ */ new WeakMap();
4891
4892
  function sideTabGlyphs(items) {
4892
4893
  const found = /* @__PURE__ */ new Set();
4893
4894
  const singles = items.filter((i) => i.fontSize > 0 && [...i.text.trim()].length === 1);
@@ -4933,11 +4934,22 @@ function sideTabGlyphs(items) {
4933
4934
  if (!others.length) continue;
4934
4935
  const left = Math.min(...col.map((i) => i.x)), right = Math.max(...col.map((i) => i.x + i.w));
4935
4936
  const rest = items.filter((i) => !members.has(i) && i.text.trim());
4936
- const outside = rest.every((i) => i.x >= right + fs) || rest.every((i) => i.x + i.w <= left - fs);
4937
+ const cap = (i) => i.y > top && i.y - top <= fs * 3 && i.w <= fs * 3 && i.fontSize <= fs * 3 && [...i.text.trim()].length <= 3 && Math.abs(i.x + i.w / 2 - (left + right) / 2) <= fs * 0.5;
4938
+ const bodyRest = rest.filter((i) => !cap(i));
4939
+ const outside = bodyRest.every((i) => i.x >= right + fs) || bodyRest.every((i) => i.x + i.w <= left - fs);
4937
4940
  if (!outside) continue;
4938
4941
  const alone = col.filter((g) => !others.some((i) => Math.abs(i.y - g.y) <= Y_TOL)).length;
4939
4942
  if (alone < col.length * 0.4) continue;
4940
- for (const g of col) found.add(g);
4943
+ const legacyOutside = rest.every((i) => i.x >= right + fs) || rest.every((i) => i.x + i.w <= left - fs);
4944
+ const head = !legacyOutside ? rest.find(cap) : void 0;
4945
+ for (const g of col) {
4946
+ found.add(g);
4947
+ if (head) {
4948
+ const caps = _nullishCoalesce(SIDE_TAB_CAP_GROUPS.get(found), () => ( /* @__PURE__ */ new Map()));
4949
+ caps.set(g, head);
4950
+ SIDE_TAB_CAP_GROUPS.set(found, caps);
4951
+ }
4952
+ }
4941
4953
  }
4942
4954
  return found;
4943
4955
  }
@@ -5959,16 +5971,16 @@ function isProseSpread(items) {
5959
5971
  for (let i = 1; i < sorted.length; i++) {
5960
5972
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
5961
5973
  }
5962
- const maxGap = _chunk3XSP7V5Pcjs.safeMax.call(void 0, gaps);
5974
+ const maxGap = _chunkUIPMCOHHcjs.safeMax.call(void 0, gaps);
5963
5975
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
5964
5976
  if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
5965
- const minGap = _chunk3XSP7V5Pcjs.safeMin.call(void 0, gaps);
5977
+ const minGap = _chunkUIPMCOHHcjs.safeMin.call(void 0, gaps);
5966
5978
  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;
5967
5979
  }
5968
5980
  function detectColumns(yLines) {
5969
5981
  const allItems = yLines.flat();
5970
5982
  if (allItems.length === 0) return null;
5971
- const pageWidth = _chunk3XSP7V5Pcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunk3XSP7V5Pcjs.safeMin.call(void 0, allItems.map((i) => i.x));
5983
+ const pageWidth = _chunkUIPMCOHHcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkUIPMCOHHcjs.safeMin.call(void 0, allItems.map((i) => i.x));
5972
5984
  if (pageWidth < 100) return null;
5973
5985
  let bigoLineIdx = -1;
5974
5986
  for (let i = 0; i < yLines.length; i++) {
@@ -6438,12 +6450,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
6438
6450
  }
6439
6451
  function takeClipCellEdges(from, to) {
6440
6452
  const e = CLIP_CELL_EDGES.get(from);
6441
- if (e) _chunk3WLZOJIEcjs.CELL_EDGES.set(to, e);
6453
+ if (e) _chunk5TUGAXAIcjs.CELL_EDGES.set(to, e);
6442
6454
  }
6443
6455
  function joinCellEdges(a, b) {
6444
- const u = _chunk3WLZOJIEcjs.CELL_EDGES.get(a), d = _chunk3WLZOJIEcjs.CELL_EDGES.get(b);
6456
+ const u = _chunk5TUGAXAIcjs.CELL_EDGES.get(a), d = _chunk5TUGAXAIcjs.CELL_EDGES.get(b);
6445
6457
  if (!u || !d) return;
6446
- _chunk3WLZOJIEcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
6458
+ _chunk5TUGAXAIcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
6447
6459
  }
6448
6460
 
6449
6461
  // src/pdf/table-unit-row.ts
@@ -6459,7 +6471,7 @@ function rebuildUnitLine(items, grid) {
6459
6471
  function prependUnitRow(cells, cols, line, usedItems) {
6460
6472
  const text = cleanCellText(line.map((item) => item.text).join(""));
6461
6473
  cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
6462
- for (const cell of cells[0]) _chunk3WLZOJIEcjs.CELL_EDGES.set(cell, NO_EDGES);
6474
+ for (const cell of cells[0]) _chunk5TUGAXAIcjs.CELL_EDGES.set(cell, NO_EDGES);
6463
6475
  for (const item of line) usedItems.add(item);
6464
6476
  }
6465
6477
  function attachUnitRow(items, grid, cells, cols, usedItems) {
@@ -6901,12 +6913,61 @@ function frameLayoutBoxes(blocks) {
6901
6913
  }
6902
6914
  return boxes;
6903
6915
  }
6916
+ function takeFrameSpanningText(items, cutX, pageNum, lex) {
6917
+ let minX = Infinity, maxR = -Infinity;
6918
+ for (const item of items) {
6919
+ minX = Math.min(minX, item.x);
6920
+ maxR = Math.max(maxR, item.x + item.w);
6921
+ }
6922
+ const span = maxR - minX;
6923
+ const rows = groupByY([...items].sort((a, b) => b.y - a.y || a.x - b.x)).map((line) => {
6924
+ const runs = [];
6925
+ for (const item of [...line].sort((a, b) => a.x - b.x)) {
6926
+ const run = runs[runs.length - 1], prev = _optionalChain([run, 'optionalAccess', _315 => _315[run.length - 1]]);
6927
+ if (prev && item.x - (prev.x + prev.w) <= Math.max(prev.fontSize, item.fontSize) * 0.6) run.push(item);
6928
+ else runs.push([item]);
6929
+ }
6930
+ return runs;
6931
+ });
6932
+ const taken = /* @__PURE__ */ new Set(), blocks = [];
6933
+ for (let r = 0; r < rows.length; r++) for (const run of rows[r]) {
6934
+ if (taken.has(run[0]) || run[0].x >= cutX || Math.max(...run.map((i) => i.x + i.w)) <= cutX) continue;
6935
+ const lines = [run], fs = Math.max(...run.map((i) => i.fontSize));
6936
+ const left = run[0].x, right = Math.max(...run.map((i) => i.x + i.w));
6937
+ if (right - left < span * 0.75) continue;
6938
+ let prevY = run[0].y;
6939
+ for (let next = r + 1; next < rows.length && rows[next].length === 1; next++) {
6940
+ const tail = rows[next][0], y = tail[0].y;
6941
+ if (taken.has(tail[0]) || prevY - y > fs * 1.8 || tail[0].x < left - 1 || tail[0].x > left + fs * 2 || tail.some((i) => Math.abs(i.fontSize - fs) > fs * 0.15) || Math.max(...tail.map((i) => i.x + i.w)) > right + 1) break;
6942
+ lines.push(tail);
6943
+ prevY = y;
6944
+ }
6945
+ for (const line of lines) for (const item of line) taken.add(item);
6946
+ pushLineParagraphs(blocks, mergeSuperscriptLines(lines), pageNum, lex);
6947
+ }
6948
+ let keep = 0;
6949
+ for (const item of items) if (!taken.has(item)) items[keep++] = item;
6950
+ items.length = keep;
6951
+ return blocks;
6952
+ }
6953
+ function frameColumnTextBands(items, spanning, cutX) {
6954
+ const tops = spanning.filter((b) => b.bbox).map((b) => b.bbox.y + b.bbox.height).sort((a, b) => b - a);
6955
+ const bands = /* @__PURE__ */ new Map();
6956
+ for (const item of items) {
6957
+ let band = 0;
6958
+ while (band < tops.length && tops[band] > item.y + item.h) band++;
6959
+ const sides = _nullishCoalesce(bands.get(band), () => ( [[], [], []]));
6960
+ sides[item.x + item.w <= cutX ? 0 : item.x >= cutX ? 2 : 1].push(item);
6961
+ bands.set(band, sides);
6962
+ }
6963
+ return [...bands].sort((a, b) => a[0] - b[0]).flatMap(([, sides]) => sides.filter((side) => side.length));
6964
+ }
6904
6965
  function groupFrameParagraphUnits(units, frames) {
6905
6966
  const source = /* @__PURE__ */ new Map();
6906
6967
  for (const unit of units) for (const block of unit) source.set(block, unit);
6907
6968
  const members = /* @__PURE__ */ new Map(), emitted = /* @__PURE__ */ new Set();
6908
6969
  for (const frame of frames) {
6909
- if (frame.length < 2 || frame.some((block) => block.type !== "paragraph" || _optionalChain([source, 'access', _315 => _315.get, 'call', _316 => _316(block), 'optionalAccess', _317 => _317.length]) !== 1)) continue;
6970
+ if (frame.length < 2 || frame.some((block) => block.type !== "paragraph" || _optionalChain([source, 'access', _316 => _316.get, 'call', _317 => _317(block), 'optionalAccess', _318 => _318.length]) !== 1)) continue;
6910
6971
  for (const block of frame) members.set(block, frame);
6911
6972
  }
6912
6973
  const out = [];
@@ -6919,7 +6980,7 @@ function groupFrameParagraphUnits(units, frames) {
6919
6980
  }
6920
6981
  }
6921
6982
  for (const unit of out) {
6922
- if (unit.length < 2 || _optionalChain([FRAME_READING_UNITS, 'access', _318 => _318.get, 'call', _319 => _319(unit[0]), 'optionalAccess', _320 => _320.blocks]) === unit) continue;
6983
+ if (unit.length < 2 || _optionalChain([FRAME_READING_UNITS, 'access', _319 => _319.get, 'call', _320 => _320(unit[0]), 'optionalAccess', _321 => _321.blocks]) === unit) continue;
6923
6984
  const bs = unit.map((b) => b.bbox).filter((b) => !!b);
6924
6985
  if (bs.length !== unit.length) continue;
6925
6986
  const x = Math.min(...bs.map((b) => b.x)), y = Math.min(...bs.map((b) => b.y));
@@ -6936,14 +6997,14 @@ function groupFrameParagraphUnits(units, frames) {
6936
6997
  function recordFrameTitle(table, source, pageNum) {
6937
6998
  if (!CLIP_TABLES.has(table) || table.rows !== 1 || table.cols !== 3 || source.length < 2) return;
6938
6999
  const cells = table.cells[0];
6939
- if (cells.length !== 3 || cells.some((c) => c.colSpan !== 1 || c.rowSpan !== 1 || _optionalChain([c, 'access', _321 => _321.blocks, 'optionalAccess', _322 => _322.length]) || c.text.includes("\n"))) return;
7000
+ if (cells.length !== 3 || cells.some((c) => c.colSpan !== 1 || c.rowSpan !== 1 || _optionalChain([c, 'access', _322 => _322.blocks, 'optionalAccess', _323 => _323.length]) || c.text.includes("\n"))) return;
6940
7001
  const [label, spacer, title] = cells;
6941
7002
  if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
6942
7003
  if (cells.some((c) => {
6943
- const e = _chunk3WLZOJIEcjs.CELL_EDGES.get(c);
7004
+ const e = _chunk5TUGAXAIcjs.CELL_EDGES.get(c);
6944
7005
  return !e || e.t || e.b || e.l || e.r;
6945
7006
  })) return;
6946
- const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _323 => _323.fontSize]), () => ( 0));
7007
+ const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _324 => _324.fontSize]), () => ( 0));
6947
7008
  if (!xs || xs.length !== 4 || fs <= 0) return;
6948
7009
  const width = xs[3] - xs[0], gap = xs[2] - xs[1];
6949
7010
  if (width < fs * 12 || gap <= 0 || gap > fs * 1.5 || xs[1] - xs[0] > width * 0.25 || xs[3] - xs[2] < width * 0.6) return;
@@ -7001,7 +7062,7 @@ function extendNestedShadedHeaders(clipGrids, lineGrids, horizontals, verticals,
7001
7062
  const extended = [];
7002
7063
  for (let i = 0; i < clipGrids.length; i++) {
7003
7064
  const c = clipGrids[i], parent = c.clipParent;
7004
- if (!parent || c.rowYs.length !== 2 || c.colXs.length < 3 || !_optionalChain([c, 'access', _324 => _324.cells, 'optionalAccess', _325 => _325.length]) || c.cells.some((cell) => cell.filler || cell.rowSpan !== 1 || cell.colSpan !== 1)) continue;
7065
+ if (!parent || c.rowYs.length !== 2 || c.colXs.length < 3 || !_optionalChain([c, 'access', _325 => _325.cells, 'optionalAccess', _326 => _326.length]) || c.cells.some((cell) => cell.filler || cell.rowSpan !== 1 || cell.colSpan !== 1)) continue;
7005
7066
  if (!clipGrids.some((g) => g.rowYs.length === 2 && g.colXs.length === 2 && near(g.bbox.x1, parent.x1) && near(g.bbox.x2, parent.x2) && near(g.bbox.y1, parent.y1) && near(g.bbox.y2, parent.y2))) continue;
7006
7067
  if (!c.cells.every((cell) => fills.some((f) => near(f.x1, cell.bbox.x1) && near(f.x2, cell.bbox.x2) && near(f.y1, cell.bbox.y1) && near(f.y2, cell.bbox.y2)))) continue;
7007
7068
  const host = lineGrids.find((l) => l.rowYs.length > 2 && l.colXs.length === c.colXs.length && c.colXs.every((x, k) => near(x, l.colXs[k])) && c.rowYs.every((y, k) => near(y, l.rowYs[k])) && contains3(parent, l.bbox) && l.rowYs.every((y) => horizontals.some((h) => near(h.y1, y) && near(h.x1, l.bbox.x1) && near(h.x2, l.bbox.x2))) && l.colXs.every((x) => verticals.some((v) => near(v.x1, x) && v.y1 <= l.bbox.y1 + 1.5 && v.y2 >= l.bbox.y2 - 1.5)) && !clipGrids.some((o) => o !== c && !contains3(o.bbox, l.bbox) && Math.min(o.bbox.x2, l.bbox.x2) > Math.max(o.bbox.x1, l.bbox.x1) && Math.min(o.bbox.y2, l.bbox.y2) > Math.max(o.bbox.y1, l.bbox.y1)));
@@ -7013,6 +7074,41 @@ function extendNestedShadedHeaders(clipGrids, lineGrids, horizontals, verticals,
7013
7074
  return extended;
7014
7075
  }
7015
7076
 
7077
+ // src/pdf/side-tab-blocks.ts
7078
+ function attachSideTabBlocks(tab, body, pageNum) {
7079
+ const ordered = [...tab].sort((a, b) => b.y - a.y);
7080
+ const caps = SIDE_TAB_CAP_GROUPS.get(tab);
7081
+ const block = (items) => ({
7082
+ type: "paragraph",
7083
+ text: mergeLineSimple(items).trim(),
7084
+ pageNumber: pageNum,
7085
+ bbox: computeBBox(items, pageNum),
7086
+ style: dominantStyle(items)
7087
+ });
7088
+ const prefix = ordered.filter((g) => !_optionalChain([caps, 'optionalAccess', _327 => _327.has, 'call', _328 => _328(g)])).map((g) => ({
7089
+ type: "paragraph",
7090
+ text: g.text.trim(),
7091
+ pageNumber: pageNum,
7092
+ bbox: computeBBox([g], pageNum),
7093
+ style: dominantStyle([g])
7094
+ }));
7095
+ const groups = /* @__PURE__ */ new Map();
7096
+ for (const g of ordered) {
7097
+ const cap = _optionalChain([caps, 'optionalAccess', _329 => _329.get, 'call', _330 => _330(g)]);
7098
+ if (cap) groups.set(cap, [..._nullishCoalesce(groups.get(cap), () => ( [])), g]);
7099
+ }
7100
+ for (const [cap, glyphs] of groups) {
7101
+ const blocks = groupByY(glyphs).map(block);
7102
+ const anchor = body.reduce((best, b, i) => {
7103
+ const box = b.bbox;
7104
+ if (b.type === "image" || b.type === "separator" || !box || !b.text && !b.table || box.x > cap.x + 1 || box.x + box.width < cap.x + cap.w - 1 || box.y > cap.y + 1 || box.y + box.height < cap.y + cap.fontSize - 1) return best;
7105
+ return best < 0 || box.width * box.height < body[best].bbox.width * body[best].bbox.height ? i : best;
7106
+ }, -1);
7107
+ body.splice(anchor >= 0 ? anchor + 1 : body.length, 0, ...blocks);
7108
+ }
7109
+ return [...prefix, ...body];
7110
+ }
7111
+
7016
7112
  // src/pdf/page-regions.ts
7017
7113
  function splitTwoColumnProse(items, cutX) {
7018
7114
  const left = [];
@@ -7189,7 +7285,7 @@ function stackedTableBands(items) {
7189
7285
  const caption = (start, end) => lines.slice(start, end).some((line) => /^Table\s+\d+\s*[:.]/i.test(mergeLineSimple(line).trim()));
7190
7286
  while (runs.length > 0 && !caption(runs[runs.length - 1].end, lines.length)) runs.pop();
7191
7287
  if (runs.length < 2) return null;
7192
- if (runs.some((run, i) => !caption(run.end, _nullishCoalesce(_optionalChain([runs, 'access', _326 => _326[i + 1], 'optionalAccess', _327 => _327.start]), () => ( lines.length))))) return null;
7288
+ if (runs.some((run, i) => !caption(run.end, _nullishCoalesce(_optionalChain([runs, 'access', _331 => _331[i + 1], 'optionalAccess', _332 => _332.start]), () => ( lines.length))))) return null;
7193
7289
  const tables = runs.map((run) => lines.slice(run.start, run.end).flat());
7194
7290
  const between = runs.slice(0, -1).map((run, i) => lines.slice(run.end, runs[i + 1].start).flat());
7195
7291
  const tail = lines.slice(runs[runs.length - 1].end);
@@ -7347,8 +7443,8 @@ function extractPageBlocksWithLines(items, pageNum, opList, pageWidth, pageHeigh
7347
7443
  }
7348
7444
  const tab = sideTabGlyphs(items);
7349
7445
  if (tab.size) {
7350
- const glyphs = [...tab].sort((a, b) => b.y - a.y).map((g) => ({ type: "paragraph", text: g.text.trim(), pageNumber: pageNum, bbox: computeBBox([g], pageNum), style: dominantStyle([g]) }));
7351
- return [...glyphs, ...extractPageBlocksWithLines(items.filter((i) => !tab.has(i)), pageNum, opList, pageWidth, pageHeight, extraLines, detectTables, carry, lexicon, verifiedRightArrows)];
7446
+ const body = extractPageBlocksWithLines(items.filter((i) => !tab.has(i)), pageNum, opList, pageWidth, pageHeight, extraLines, detectTables, carry, lexicon, verifiedRightArrows);
7447
+ return attachSideTabBlocks(tab, body, pageNum);
7352
7448
  }
7353
7449
  const lex = _nullishCoalesce(lexicon, () => ( new WrapLexicon()));
7354
7450
  for (const line of streamLines(items)) lex.addLine(mergeLineSimple(line));
@@ -7358,7 +7454,7 @@ function extractPageBlocksWithLines(items, pageNum, opList, pageWidth, pageHeigh
7358
7454
  const filled = fillBlanks(items, horizontals, verticals);
7359
7455
  items = filled.items;
7360
7456
  horizontals = filled.horizontals;
7361
- const prevPage = _optionalChain([carry, 'optionalAccess', _328 => _328.page]) === pageNum - 1 ? carry.clip : void 0;
7457
+ const prevPage = _optionalChain([carry, 'optionalAccess', _333 => _333.page]) === pageNum - 1 ? carry.clip : void 0;
7362
7458
  const clipResult = detectTables ? buildClipCellGrids(extracted.clipRects, horizontals, verticals, pageWidth, pageHeight, items.map((it) => ({ x: it.x + it.w / 2, y: it.y + it.h / 2 })), extracted.fillRects, prevPage) : { grids: [], containers: [], page: void 0 };
7363
7459
  if (carry) {
7364
7460
  carry.page = pageNum;
@@ -7626,14 +7722,14 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7626
7722
  if (!assignedItems.has(textItems[ti])) usedItems.delete(tableItems[ti]);
7627
7723
  }
7628
7724
  }
7629
- if (unitLine.length > 0 && rebuiltUsed && !/^\s*\(\s*단위\s*[::]/.test(_nullishCoalesce(_optionalChain([finalGrid, 'access', _329 => _329[0], 'optionalAccess', _330 => _330[0], 'optionalAccess', _331 => _331.text]), () => ( "")))) {
7725
+ if (unitLine.length > 0 && rebuiltUsed && !/^\s*\(\s*단위\s*[::]/.test(_nullishCoalesce(_optionalChain([finalGrid, 'access', _334 => _334[0], 'optionalAccess', _335 => _335[0], 'optionalAccess', _336 => _336.text]), () => ( "")))) {
7630
7726
  prependUnitRow(finalGrid, numCols, unitLine, usedItems);
7631
7727
  finalRows++;
7632
7728
  }
7633
7729
  if (!rebuiltUsed && attachUnitRow(items, grid, finalGrid, numCols, usedItems)) finalRows++;
7634
7730
  let semanticOneColumn = false;
7635
7731
  if (!grid.cells && !nestedAttached && numCols === 1 && numGridRows >= 2) {
7636
- const populatedRows = finalGrid.filter((row) => _optionalChain([row, 'access', _332 => _332[0], 'optionalAccess', _333 => _333.text, 'access', _334 => _334.trim, 'call', _335 => _335()]));
7732
+ const populatedRows = finalGrid.filter((row) => _optionalChain([row, 'access', _337 => _337[0], 'optionalAccess', _338 => _338.text, 'access', _339 => _339.trim, 'call', _340 => _340()]));
7637
7733
  if (populatedRows.length >= 4) {
7638
7734
  const fontSizes = tableItems.map((item) => item.fontSize).filter((size) => size > 0).sort((a, b) => a - b);
7639
7735
  const medianFont = _nullishCoalesce(fontSizes[Math.floor(fontSizes.length / 2)], () => ( 0));
@@ -7719,7 +7815,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7719
7815
  height: grid.bbox.y2 - grid.bbox.y1
7720
7816
  };
7721
7817
  if (numRows === 1 && numCols === 1 && gridW < pageWidth * 0.35) {
7722
- const prose = _nullishCoalesce(_optionalChain([finalGrid, 'access', _336 => _336[0], 'optionalAccess', _337 => _337[0], 'optionalAccess', _338 => _338.text]), () => ( ""));
7818
+ const prose = _nullishCoalesce(_optionalChain([finalGrid, 'access', _341 => _341[0], 'optionalAccess', _342 => _342[0], 'optionalAccess', _343 => _343.text]), () => ( ""));
7723
7819
  const besideLines = (side) => new Set(side.map((it) => Math.round(it.y / 3))).size;
7724
7820
  const rightLines = items.filter((it) => it.x >= grid.bbox.x2 + 3 && it.y >= grid.bbox.y1 && it.y <= grid.bbox.y2);
7725
7821
  const leftLines = items.filter((it) => it.x + it.w <= grid.bbox.x1 - 3 && it.y >= grid.bbox.y1 && it.y <= grid.bbox.y2);
@@ -7738,8 +7834,8 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7738
7834
  }
7739
7835
  }
7740
7836
  if (!grid.cells && !nestedAttached && shouldDemoteTable(irTable)) {
7741
- const paragraphs = numRows === 1 && numCols === 1 ? _optionalChain([irTable, 'access', _339 => _339.cells, 'access', _340 => _340[0], 'optionalAccess', _341 => _341[0], 'optionalAccess', _342 => _342.blocks]) : void 0;
7742
- if (_optionalChain([paragraphs, 'optionalAccess', _343 => _343.length])) {
7837
+ const paragraphs = numRows === 1 && numCols === 1 ? _optionalChain([irTable, 'access', _344 => _344.cells, 'access', _345 => _345[0], 'optionalAccess', _346 => _346[0], 'optionalAccess', _347 => _347.blocks]) : void 0;
7838
+ if (_optionalChain([paragraphs, 'optionalAccess', _348 => _348.length])) {
7743
7839
  blocks.push(...paragraphs);
7744
7840
  frameParagraphUnits.push(paragraphs);
7745
7841
  recordFrameReadingUnit(paragraphs, tableBbox);
@@ -7780,7 +7876,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7780
7876
  const proseColumns = findTwoColumnProseCutX(clusterItems) !== null || detectPersistentColumnGutter(remaining.map((i) => ({ x: i.x, y: i.y, w: i.w, h: i.h > 0 ? i.h : i.fontSize }))) !== null;
7781
7877
  const clusterResults = (proseColumns ? [] : detectClusterTables(clusterItems, pageNum)).filter((cr) => {
7782
7878
  const b = cr.bbox;
7783
- return !blocks.some((x) => x.type === "paragraph" && x.bbox && (_nullishCoalesce(_optionalChain([x, 'access', _344 => _344.text, 'optionalAccess', _345 => _345.match, 'call', _346 => _346(/\p{L}/gu), 'optionalAccess', _347 => _347.length]), () => ( 0))) >= 10 && Math.min(x.bbox.x + x.bbox.width, b.x + b.width) - Math.max(x.bbox.x, b.x) >= 0.8 * b.width && x.bbox.y >= b.y - 2 && x.bbox.y + x.bbox.height <= b.y + b.height + 2);
7879
+ return !blocks.some((x) => x.type === "paragraph" && x.bbox && (_nullishCoalesce(_optionalChain([x, 'access', _349 => _349.text, 'optionalAccess', _350 => _350.match, 'call', _351 => _351(/\p{L}/gu), 'optionalAccess', _352 => _352.length]), () => ( 0))) >= 10 && Math.min(x.bbox.x + x.bbox.width, b.x + b.width) - Math.max(x.bbox.x, b.x) >= 0.8 * b.width && x.bbox.y >= b.y - 2 && x.bbox.y + x.bbox.height <= b.y + b.height + 2);
7784
7880
  });
7785
7881
  if (clusterResults.length > 0) {
7786
7882
  const ciToIdx = /* @__PURE__ */ new Map();
@@ -7811,14 +7907,15 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7811
7907
  if (remaining.length > 0) {
7812
7908
  if (gutterX !== null) {
7813
7909
  const gx = gutterX;
7910
+ const spanning = detectListBlocks(takeFrameSpanningText(remaining, gx, pageNum, lex));
7911
+ for (const block of spanning) {
7912
+ finalTextBlocks.push(block);
7913
+ groupSizes.push(1);
7914
+ }
7814
7915
  const allY = remaining.map((i) => i.y);
7815
- const pageH = _chunk3XSP7V5Pcjs.safeMax.call(void 0, allY) - _chunk3XSP7V5Pcjs.safeMin.call(void 0, allY);
7916
+ const pageH = _chunkUIPMCOHHcjs.safeMax.call(void 0, allY) - _chunkUIPMCOHHcjs.safeMin.call(void 0, allY);
7816
7917
  const gapThreshold = Math.max(15, pageH * 0.03);
7817
- const sides = [
7818
- remaining.filter((i) => i.x + i.w <= gx),
7819
- remaining.filter((i) => i.x < gx && i.x + i.w > gx),
7820
- remaining.filter((i) => i.x >= gx)
7821
- ];
7918
+ const sides = frameColumnTextBands(remaining, spanning, gx);
7822
7919
  const textBlocks = [];
7823
7920
  for (const side of sides) {
7824
7921
  if (side.length === 0) continue;
@@ -7829,10 +7926,10 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
7829
7926
  groupSizes.push(groupBlocks.length);
7830
7927
  }
7831
7928
  }
7832
- finalTextBlocks = detectListBlocks(textBlocks);
7929
+ finalTextBlocks.push(...detectListBlocks(textBlocks));
7833
7930
  } else {
7834
7931
  const allY = remaining.map((i) => i.y);
7835
- const pageH = _chunk3XSP7V5Pcjs.safeMax.call(void 0, allY) - _chunk3XSP7V5Pcjs.safeMin.call(void 0, allY);
7932
+ const pageH = _chunkUIPMCOHHcjs.safeMax.call(void 0, allY) - _chunkUIPMCOHHcjs.safeMin.call(void 0, allY);
7836
7933
  const groups = xyCutOrder(remaining, Math.max(15, pageH * 0.03));
7837
7934
  const textBlocks = [];
7838
7935
  for (const group of groups) {
@@ -8157,7 +8254,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
8157
8254
  blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
8158
8255
  } else {
8159
8256
  const allY = items.map((i) => i.y);
8160
- const pageHeight = _chunk3XSP7V5Pcjs.safeMax.call(void 0, allY) - _chunk3XSP7V5Pcjs.safeMin.call(void 0, allY);
8257
+ const pageHeight = _chunkUIPMCOHHcjs.safeMax.call(void 0, allY) - _chunkUIPMCOHHcjs.safeMin.call(void 0, allY);
8161
8258
  const gapThreshold = Math.max(15, pageHeight * 0.03);
8162
8259
  const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold);
8163
8260
  for (const group of orderedGroups) {
@@ -8235,4 +8332,4 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
8235
8332
 
8236
8333
 
8237
8334
  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.computeBBox = computeBBox; exports.dominantStyle = dominantStyle; exports.normalizeItems = normalizeItems; exports.groupByY = groupByY; exports.mergeLineSimple = mergeLineSimple; 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.FRAME_TITLE_BLOCKS = FRAME_TITLE_BLOCKS; 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.FRAME_READING_UNITS = FRAME_READING_UNITS; exports.recordFrameReadingUnit = recordFrameReadingUnit; exports.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines;
8238
- //# sourceMappingURL=chunk-E2644XCO.cjs.map
8335
+ //# sourceMappingURL=chunk-J5HIKXQF.cjs.map