kordoc 4.18.13 → 4.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +2 -1
  2. package/dist/{-DC2OO5KO.js → -I3DEUQUC.js} +11 -11
  3. package/dist/{chunk-K6WSMTVU.cjs → chunk-34RIECIF.cjs} +2 -2
  4. package/dist/{chunk-K6WSMTVU.cjs.map → chunk-34RIECIF.cjs.map} +1 -1
  5. package/dist/{chunk-EBXJ45VZ.js → chunk-5B55S4JU.js} +2 -2
  6. package/dist/{chunk-EBXJ45VZ.js.map → chunk-5B55S4JU.js.map} +1 -1
  7. package/dist/{chunk-6CQZMVXW.cjs → chunk-5ZSQ2ZIH.cjs} +3 -3
  8. package/dist/{chunk-6CQZMVXW.cjs.map → chunk-5ZSQ2ZIH.cjs.map} +1 -1
  9. package/dist/{chunk-GGMIPTM5.cjs → chunk-7TVRQJXI.cjs} +12 -12
  10. package/dist/{chunk-GGMIPTM5.cjs.map → chunk-7TVRQJXI.cjs.map} +1 -1
  11. package/dist/{chunk-6AYTYTFY.js → chunk-AAE765MK.js} +3 -3
  12. package/dist/{chunk-ISC2TH24.js → chunk-AMDDV4CI.js} +2 -2
  13. package/dist/{chunk-GUH6HYSZ.js → chunk-C4JHZNRL.js} +25 -22
  14. package/dist/chunk-C4JHZNRL.js.map +1 -0
  15. package/dist/{chunk-EZSWBHHI.js → chunk-CR4RXHXO.js} +2 -2
  16. package/dist/{chunk-32ZUIHSY.js → chunk-DEYCTP2S.js} +3 -3
  17. package/dist/{chunk-SVIOP7PE.js → chunk-DGXGVC4Z.js} +7 -7
  18. package/dist/{chunk-SVIOP7PE.js.map → chunk-DGXGVC4Z.js.map} +1 -1
  19. package/dist/{chunk-JPSLMPFI.js → chunk-DH75ZUYF.js} +95 -11
  20. package/dist/chunk-DH75ZUYF.js.map +1 -0
  21. package/dist/{chunk-DHEUQXXR.js → chunk-FJE3TMZ7.js} +2 -2
  22. package/dist/{chunk-ZNY5BRV6.js → chunk-GCYLNOTJ.js} +4 -4
  23. package/dist/{chunk-GSW7W7AL.js → chunk-GYQVQF2J.js} +7 -4
  24. package/dist/chunk-GYQVQF2J.js.map +1 -0
  25. package/dist/{chunk-7LOD4IGO.js → chunk-HFMIAMEO.js} +4 -4
  26. package/dist/{chunk-XVB3PUPJ.js → chunk-L5KNWOGR.js} +2 -2
  27. package/dist/chunk-L5KNWOGR.js.map +1 -0
  28. package/dist/{chunk-RQEDNI4P.cjs → chunk-LLVF6X5W.cjs} +3 -3
  29. package/dist/{chunk-RQEDNI4P.cjs.map → chunk-LLVF6X5W.cjs.map} +1 -1
  30. package/dist/{chunk-6FW3AZWN.cjs → chunk-LNU54ZKV.cjs} +117 -33
  31. package/dist/chunk-LNU54ZKV.cjs.map +1 -0
  32. package/dist/{chunk-IRN5SDY2.js → chunk-OMJWAJBD.js} +2 -2
  33. package/dist/{chunk-V7LKQNC4.js → chunk-QHN7N2QA.js} +2 -2
  34. package/dist/{chunk-INESPVEV.js → chunk-RYKNAYKC.js} +3 -3
  35. package/dist/{chunk-LKA7Z2NH.js → chunk-UCTD3BXH.js} +2 -2
  36. package/dist/{chunk-PN5WWW56.js → chunk-UTVNSCEI.js} +2 -2
  37. package/dist/{chunk-PN5WWW56.js.map → chunk-UTVNSCEI.js.map} +1 -1
  38. package/dist/{chunk-JWTZ3OVZ.js → chunk-VZSOPECZ.js} +2 -2
  39. package/dist/{chunk-VDEENOPW.js → chunk-W5XX2GKO.js} +2 -2
  40. package/dist/{chunk-PHMWSWHJ.js → chunk-XIWGPC3V.js} +2 -2
  41. package/dist/{chunk-JKHU7HID.js → chunk-XXUXQHUC.js} +95 -11
  42. package/dist/chunk-XXUXQHUC.js.map +1 -0
  43. package/dist/{chunk-3FGHQWJP.cjs → chunk-YV4PWWRW.cjs} +22 -22
  44. package/dist/{chunk-3FGHQWJP.cjs.map → chunk-YV4PWWRW.cjs.map} +1 -1
  45. package/dist/chunks-JPNLQOVD.js +10 -0
  46. package/dist/cli.js +39 -28
  47. package/dist/cli.js.map +1 -1
  48. package/dist/{formula-YCAO5IVW.js → formula-DUEAYGIG.js} +4 -4
  49. package/dist/{formula-DAMFHLQO.js → formula-I4MAHCTZ.js} +3 -3
  50. package/dist/{formula-HJNQGPRC.cjs → formula-L2BKGA4J.cjs} +9 -9
  51. package/dist/{formula-HJNQGPRC.cjs.map → formula-L2BKGA4J.cjs.map} +1 -1
  52. package/dist/{image-ocr-VH54SDZ7.js → image-ocr-B32G24XW.js} +6 -6
  53. package/dist/{image-ocr-PAF76DAW.js → image-ocr-NUL3JKXM.js} +9 -9
  54. package/dist/{image-ocr-AZ25IOC7.cjs → image-ocr-ZWRJZKYR.cjs} +15 -15
  55. package/dist/{image-ocr-AZ25IOC7.cjs.map → image-ocr-ZWRJZKYR.cjs.map} +1 -1
  56. package/dist/index.cjs +669 -663
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.cts +15 -2
  59. package/dist/index.d.ts +15 -2
  60. package/dist/index.js +26 -20
  61. package/dist/index.js.map +1 -1
  62. package/dist/mcp.js +25 -23
  63. package/dist/mcp.js.map +1 -1
  64. package/dist/{model-bundle-53CHDYCG.js → model-bundle-OBIKG4K5.js} +5 -5
  65. package/dist/{models-UVLAKK3M.js → models-2OZHOPPM.js} +5 -5
  66. package/dist/{parser-HWAOPQYK.cjs → parser-DMWCXX7A.cjs} +131 -129
  67. package/dist/parser-DMWCXX7A.cjs.map +1 -0
  68. package/dist/{parser-I4D3TRGU.js → parser-FDE6GQST.js} +14 -12
  69. package/dist/{parser-Z6PHB54O.js.map → parser-FDE6GQST.js.map} +1 -1
  70. package/dist/{parser-Z6PHB54O.js → parser-YW3NMSJE.js} +11 -9
  71. package/dist/{parser-I4D3TRGU.js.map → parser-YW3NMSJE.js.map} +1 -1
  72. package/dist/pdf-ocr-7MR56U4P.js +16 -0
  73. package/dist/pdf-ocr-K2OK7FNQ.cjs +17 -0
  74. package/dist/{pdf-ocr-HR6CXGTX.cjs.map → pdf-ocr-K2OK7FNQ.cjs.map} +1 -1
  75. package/dist/pdf-ocr-YHC4X67W.js +20 -0
  76. package/dist/{profile-io-WHCWCOPW.js → profile-io-6WCU4KHY.js} +3 -3
  77. package/dist/{rasterize-5DZ3DHGH.js → rasterize-X3I7SWXF.js} +3 -3
  78. package/dist/{redact-doc-RNJVMFGQ.js → redact-doc-6H7WPUQD.js} +11 -11
  79. package/dist/{render-NZ6RA6SW.js → render-PBQJGZT3.js} +7 -7
  80. package/dist/seal-E2E7CFZJ.js +10 -0
  81. package/dist/{setup-U3EQNK4Z.js → setup-UORJSR3M.js} +3 -3
  82. package/dist/visual-4GDT5BRH.js +20 -0
  83. package/dist/{watch-GB2M7XU6.js → watch-S2ZMDDZU.js} +12 -12
  84. package/package.json +3 -2
  85. package/dist/chunk-6FW3AZWN.cjs.map +0 -1
  86. package/dist/chunk-GSW7W7AL.js.map +0 -1
  87. package/dist/chunk-GUH6HYSZ.js.map +0 -1
  88. package/dist/chunk-JKHU7HID.js.map +0 -1
  89. package/dist/chunk-JPSLMPFI.js.map +0 -1
  90. package/dist/chunk-XVB3PUPJ.js.map +0 -1
  91. package/dist/chunks-JZW2TXIZ.js +0 -10
  92. package/dist/parser-HWAOPQYK.cjs.map +0 -1
  93. package/dist/pdf-ocr-F4ICXO7W.js +0 -20
  94. package/dist/pdf-ocr-HR6CXGTX.cjs +0 -17
  95. package/dist/pdf-ocr-JI3K7JIN.js +0 -16
  96. package/dist/seal-WHJ6O5HT.js +0 -10
  97. package/dist/visual-JDAS4R43.js +0 -20
  98. /package/dist/{-DC2OO5KO.js.map → -I3DEUQUC.js.map} +0 -0
  99. /package/dist/{chunk-6AYTYTFY.js.map → chunk-AAE765MK.js.map} +0 -0
  100. /package/dist/{chunk-ISC2TH24.js.map → chunk-AMDDV4CI.js.map} +0 -0
  101. /package/dist/{chunk-EZSWBHHI.js.map → chunk-CR4RXHXO.js.map} +0 -0
  102. /package/dist/{chunk-32ZUIHSY.js.map → chunk-DEYCTP2S.js.map} +0 -0
  103. /package/dist/{chunk-DHEUQXXR.js.map → chunk-FJE3TMZ7.js.map} +0 -0
  104. /package/dist/{chunk-ZNY5BRV6.js.map → chunk-GCYLNOTJ.js.map} +0 -0
  105. /package/dist/{chunk-7LOD4IGO.js.map → chunk-HFMIAMEO.js.map} +0 -0
  106. /package/dist/{chunk-IRN5SDY2.js.map → chunk-OMJWAJBD.js.map} +0 -0
  107. /package/dist/{chunk-V7LKQNC4.js.map → chunk-QHN7N2QA.js.map} +0 -0
  108. /package/dist/{chunk-INESPVEV.js.map → chunk-RYKNAYKC.js.map} +0 -0
  109. /package/dist/{chunk-LKA7Z2NH.js.map → chunk-UCTD3BXH.js.map} +0 -0
  110. /package/dist/{chunk-JWTZ3OVZ.js.map → chunk-VZSOPECZ.js.map} +0 -0
  111. /package/dist/{chunk-VDEENOPW.js.map → chunk-W5XX2GKO.js.map} +0 -0
  112. /package/dist/{chunk-PHMWSWHJ.js.map → chunk-XIWGPC3V.js.map} +0 -0
  113. /package/dist/{chunks-JZW2TXIZ.js.map → chunks-JPNLQOVD.js.map} +0 -0
  114. /package/dist/{formula-YCAO5IVW.js.map → formula-DUEAYGIG.js.map} +0 -0
  115. /package/dist/{formula-DAMFHLQO.js.map → formula-I4MAHCTZ.js.map} +0 -0
  116. /package/dist/{image-ocr-VH54SDZ7.js.map → image-ocr-B32G24XW.js.map} +0 -0
  117. /package/dist/{image-ocr-PAF76DAW.js.map → image-ocr-NUL3JKXM.js.map} +0 -0
  118. /package/dist/{model-bundle-53CHDYCG.js.map → model-bundle-OBIKG4K5.js.map} +0 -0
  119. /package/dist/{models-UVLAKK3M.js.map → models-2OZHOPPM.js.map} +0 -0
  120. /package/dist/{pdf-ocr-F4ICXO7W.js.map → pdf-ocr-7MR56U4P.js.map} +0 -0
  121. /package/dist/{pdf-ocr-JI3K7JIN.js.map → pdf-ocr-YHC4X67W.js.map} +0 -0
  122. /package/dist/{profile-io-WHCWCOPW.js.map → profile-io-6WCU4KHY.js.map} +0 -0
  123. /package/dist/{rasterize-5DZ3DHGH.js.map → rasterize-X3I7SWXF.js.map} +0 -0
  124. /package/dist/{redact-doc-RNJVMFGQ.js.map → redact-doc-6H7WPUQD.js.map} +0 -0
  125. /package/dist/{render-NZ6RA6SW.js.map → render-PBQJGZT3.js.map} +0 -0
  126. /package/dist/{seal-WHJ6O5HT.js.map → seal-E2E7CFZJ.js.map} +0 -0
  127. /package/dist/{setup-U3EQNK4Z.js.map → setup-UORJSR3M.js.map} +0 -0
  128. /package/dist/{visual-JDAS4R43.js.map → visual-4GDT5BRH.js.map} +0 -0
  129. /package/dist/{watch-GB2M7XU6.js.map → watch-S2ZMDDZU.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
3
 
4
- var _chunkRQEDNI4Pcjs = require('./chunk-RQEDNI4P.cjs');
4
+ var _chunkLLVF6X5Wcjs = require('./chunk-LLVF6X5W.cjs');
5
5
 
6
6
 
7
7
 
@@ -58,7 +58,7 @@ var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
58
58
 
59
59
 
60
60
 
61
- var _chunk3FGHQWJPcjs = require('./chunk-3FGHQWJP.cjs');
61
+ var _chunkYV4PWWRWcjs = require('./chunk-YV4PWWRW.cjs');
62
62
 
63
63
 
64
64
 
@@ -68,12 +68,13 @@ var _chunk3FGHQWJPcjs = require('./chunk-3FGHQWJP.cjs');
68
68
 
69
69
 
70
70
 
71
- var _chunk6FW3AZWNcjs = require('./chunk-6FW3AZWN.cjs');
72
- require('./chunk-6CQZMVXW.cjs');
73
71
 
72
+ var _chunkLNU54ZKVcjs = require('./chunk-LNU54ZKV.cjs');
73
+ require('./chunk-5ZSQ2ZIH.cjs');
74
74
 
75
75
 
76
- var _chunkK6WSMTVUcjs = require('./chunk-K6WSMTVU.cjs');
76
+
77
+ var _chunk34RIECIFcjs = require('./chunk-34RIECIF.cjs');
77
78
 
78
79
 
79
80
  var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
@@ -114,7 +115,7 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
114
115
  const selectedSet = new Set(selected), seen = /* @__PURE__ */ new Set();
115
116
  for (const block of selected) {
116
117
  if (seen.has(block)) continue;
117
- const frame = _chunk3FGHQWJPcjs.FRAME_READING_UNITS.get(block);
118
+ const frame = _chunkYV4PWWRWcjs.FRAME_READING_UNITS.get(block);
118
119
  const source = _optionalChain([frame, 'optionalAccess', _25 => _25.blocks, 'access', _26 => _26.every, 'call', _27 => _27((member) => selectedSet.has(member))]) ? frame.blocks : [block];
119
120
  source.forEach((member) => seen.add(member));
120
121
  const available = source.filter((member) => !hasOriginal(member));
@@ -122,13 +123,13 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
122
123
  for (const unit of units) {
123
124
  const b = unit.bbox;
124
125
  const index = blocks.findIndex((existing) => {
125
- const e = _nullishCoalesce(_optionalChain([_chunk3FGHQWJPcjs.FRAME_READING_UNITS, 'access', _28 => _28.get, 'call', _29 => _29(existing), 'optionalAccess', _30 => _30.bbox]), () => ( existing.bbox));
126
+ const e = _nullishCoalesce(_optionalChain([_chunkYV4PWWRWcjs.FRAME_READING_UNITS, 'access', _28 => _28.get, 'call', _29 => _29(existing), 'optionalAccess', _30 => _30.bbox]), () => ( existing.bbox));
126
127
  if (existing.pageNumber !== page || !e) return false;
127
128
  const beside = e.y < region.y2 && e.y + e.height > region.y1 && e.x >= region.x2 - 1;
128
129
  return e.y < b.y || beside;
129
130
  });
130
131
  const placed = unit.blocks.map((member) => member.type === "paragraph" ? { ...member, style: void 0 } : member);
131
- if (unit.atomic) _chunk3FGHQWJPcjs.recordFrameReadingUnit.call(void 0, placed, unit.bbox);
132
+ if (unit.atomic) _chunkYV4PWWRWcjs.recordFrameReadingUnit.call(void 0, placed, unit.bbox);
132
133
  blocks.splice(index < 0 ? blocks.length : index, 0, ...placed);
133
134
  added += placed.length;
134
135
  }
@@ -329,7 +330,7 @@ async function extractPageImages(page, fnArray, argsArray, pageNumber, state, wa
329
330
  const filename = `image_${String(state.imageIndex).padStart(3, "0")}.png`;
330
331
  state.seen.set(hash, filename);
331
332
  if (withBytes) {
332
- const png = _chunkRQEDNI4Pcjs.encodePng.call(void 0, w, h, rgba);
333
+ const png = _chunkLLVF6X5Wcjs.encodePng.call(void 0, w, h, rgba);
333
334
  state.totalBytes += png.length;
334
335
  images.push({ filename, data: png, mimeType: "image/png" });
335
336
  }
@@ -844,19 +845,19 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
844
845
  if (r + dr < rows) owner[r + dr][dc] = placed;
845
846
  }
846
847
  grid[r][c1] = { ...a.cell, colSpan: c2 - c1, rowSpan: a.rs };
847
- const lines = _chunk3FGHQWJPcjs.CELL_LINES.get(a.cell);
848
- if (lines) _chunk3FGHQWJPcjs.CELL_LINES.set(grid[r][c1], shift ? lines.map((l) => ({ ...l, l: l.l + shift, r: l.r + shift })) : lines);
849
- if (_chunk3FGHQWJPcjs.IMAGE_CELLS.has(a.cell)) _chunk3FGHQWJPcjs.IMAGE_CELLS.add(grid[r][c1]);
850
- const edges = _chunk6FW3AZWNcjs.CELL_EDGES.get(a.cell);
848
+ const lines = _chunkYV4PWWRWcjs.CELL_LINES.get(a.cell);
849
+ if (lines) _chunkYV4PWWRWcjs.CELL_LINES.set(grid[r][c1], shift ? lines.map((l) => ({ ...l, l: l.l + shift, r: l.r + shift })) : lines);
850
+ if (_chunkYV4PWWRWcjs.IMAGE_CELLS.has(a.cell)) _chunkYV4PWWRWcjs.IMAGE_CELLS.add(grid[r][c1]);
851
+ const edges = _chunkLNU54ZKVcjs.CELL_EDGES.get(a.cell);
851
852
  if (edges) {
852
- _chunk6FW3AZWNcjs.CELL_EDGES.set(grid[r][c1], edges);
853
+ _chunkLNU54ZKVcjs.CELL_EDGES.set(grid[r][c1], edges);
853
854
  edged = true;
854
855
  }
855
856
  return true;
856
857
  };
857
- for (const a of pa) if (!_chunk3FGHQWJPcjs.FILLER_CELLS.has(a.cell) && !place(a, pcx, 0)) return null;
858
+ for (const a of pa) if (!_chunkYV4PWWRWcjs.FILLER_CELLS.has(a.cell) && !place(a, pcx, 0)) return null;
858
859
  for (const a of ca) {
859
- if (a.r < skip || _chunk3FGHQWJPcjs.FILLER_CELLS.has(a.cell)) continue;
860
+ if (a.r < skip || _chunkYV4PWWRWcjs.FILLER_CELLS.has(a.cell)) continue;
860
861
  if (!place(a, cxU, prev.rows - skip, dx)) return null;
861
862
  }
862
863
  const first = prev.rows;
@@ -880,9 +881,9 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
880
881
  const grown = { ...above, rs: newRs };
881
882
  for (let rr = above.r; rr < above.r + newRs; rr++) for (let dc = above.c; dc < above.c + above.cs; dc++) owner[rr][dc] = grown;
882
883
  }
883
- for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null) _chunk3FGHQWJPcjs.FILLER_CELLS.add(grid[r][c]);
884
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null) _chunkYV4PWWRWcjs.FILLER_CELLS.add(grid[r][c]);
884
885
  if (edged) {
885
- for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null) _chunk6FW3AZWNcjs.CELL_EDGES.set(grid[r][c], _chunk3FGHQWJPcjs.NO_EDGES);
886
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null) _chunkLNU54ZKVcjs.CELL_EDGES.set(grid[r][c], _chunkYV4PWWRWcjs.NO_EDGES);
886
887
  }
887
888
  for (let c = 0; c < cols && U[c + 1] <= pcx[0] + PART_COL_TOL; c++) {
888
889
  let r = prev.rows;
@@ -891,7 +892,7 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
891
892
  for (let rr = 0; rr < r; rr++) owner[rr][c] = through;
892
893
  }
893
894
  const table = { rows, cols, cells: grid, hasHeader: prev.hasHeader, ...prev.caption ? { caption: prev.caption } : {} };
894
- const pr = _chunk3FGHQWJPcjs.ROW_RULES.get(prev), cr = _chunk3FGHQWJPcjs.ROW_RULES.get(curr);
895
+ const pr = _chunkYV4PWWRWcjs.ROW_RULES.get(prev), cr = _chunkYV4PWWRWcjs.ROW_RULES.get(curr);
895
896
  const shifted = dx !== 0;
896
897
  const cut = {
897
898
  open: !!pr && !!cr && !pr.bottom && !cr.top && pr.innerOpen + cr.innerOpen === 0 && pr.innerRuled + cr.innerRuled > 0,
@@ -902,7 +903,7 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
902
903
  if (rows > prev.rows && !split && prevBottom !== void 0 && mergeStraddlingCells(table, owner, prev.rows, prevBottom, lex, U)) split = mergeSplitRow(table, owner, prev.rows, U, true, { ...cut, open: false });
903
904
  if (pr && cr) {
904
905
  const cutRuled = pr.bottom || cr.top;
905
- _chunk3FGHQWJPcjs.ROW_RULES.set(table, { top: pr.top, bottom: cr.bottom, innerRuled: pr.innerRuled + cr.innerRuled + (!split && cutRuled ? 1 : 0), innerOpen: pr.innerOpen + cr.innerOpen + (!split && !cutRuled ? 1 : 0) });
906
+ _chunkYV4PWWRWcjs.ROW_RULES.set(table, { top: pr.top, bottom: cr.bottom, innerRuled: pr.innerRuled + cr.innerRuled + (!split && cutRuled ? 1 : 0), innerOpen: pr.innerOpen + cr.innerOpen + (!split && !cutRuled ? 1 : 0) });
906
907
  }
907
908
  return { table, colXs: U, split, header: ca.filter((a) => a.r < skip && a.cell.text.trim()).length >= 2 };
908
909
  }
@@ -956,7 +957,7 @@ function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs) {
956
957
  if (!crossed.has(shape(u, d)) && !(u.rs >= 2 && u.c + u.cs <= firstNew && hasContent(a) && !hasContent(b))) {
957
958
  if (!straddles && !midWord) continue;
958
959
  if (u.r >= last && d.rs < 2) continue;
959
- const U = _chunk3FGHQWJPcjs.CELL_LINES.get(a);
960
+ const U = _chunkYV4PWWRWcjs.CELL_LINES.get(a);
960
961
  if (!_optionalChain([U, 'optionalAccess', _62 => _62.length]) || !hasContent(b)) continue;
961
962
  if (!(straddles && filledToBottom(U, prevBottom) && clauseContinues(a, b))) {
962
963
  if (U.length > STRADDLE_MAX_LINES) continue;
@@ -1003,7 +1004,7 @@ function nextItemHead(prev, next) {
1003
1004
  return false;
1004
1005
  }
1005
1006
  function continuesAcross(u, d, x1, x2) {
1006
- const U = _chunk3FGHQWJPcjs.CELL_LINES.get(u), D = _chunk3FGHQWJPcjs.CELL_LINES.get(d);
1007
+ const U = _chunkYV4PWWRWcjs.CELL_LINES.get(u), D = _chunkYV4PWWRWcjs.CELL_LINES.get(d);
1007
1008
  if (!_optionalChain([U, 'optionalAccess', _63 => _63.length]) || !_optionalChain([D, 'optionalAccess', _64 => _64.length])) return false;
1008
1009
  const last = U[U.length - 1];
1009
1010
  const fs = last.h || 10;
@@ -1021,7 +1022,7 @@ function continuesAcross(u, d, x1, x2) {
1021
1022
  if (U.length === 1 && x2 - last.r > Math.max(FULL_LINE_EDGE_MIN, SINGLE_LINE_WORD_GAP * fs)) return false;
1022
1023
  const indented = last.l - minL >= HANGING_MIN * fs;
1023
1024
  if (last.r - last.l < FULL_LINE_MIN_FRAC * (indented ? x2 - last.l : x2 - x1)) return false;
1024
- const newItem = _chunk3FGHQWJPcjs.startsNewItem.call(void 0, u.text, d.text);
1025
+ const newItem = _chunkYV4PWWRWcjs.startsNewItem.call(void 0, u.text, d.text);
1025
1026
  const all = D.length ? U.concat(D) : U;
1026
1027
  const leftAligned = (l) => maxR - l.r > SHORT_LINE_GAP * fs && (l.l - minL <= fs || !newItem && all.some((o) => o !== l && Math.abs(o.l - l.l) <= HANGING_TOL && Math.abs(o.r - l.r) >= HANGING_MIN * fs));
1027
1028
  const hanging = U.length >= 2 && U.every((l) => maxR - l.r <= FULL_LINE_TOL * fs) && indented && Math.abs(D[0].l - last.l) <= HANGING_TOL;
@@ -1038,10 +1039,10 @@ function outlineContinues(u, d) {
1038
1039
  return U.length >= 2 && D.length >= 1 && U.some((l) => OUTLINE_HEAD.test(l)) && OUTLINE_ITEM.test(D[0]);
1039
1040
  }
1040
1041
  function lineEnded(c, x1, x2, next) {
1041
- const L = _chunk3FGHQWJPcjs.CELL_LINES.get(c);
1042
+ const L = _chunkYV4PWWRWcjs.CELL_LINES.get(c);
1042
1043
  if (!L || L.length !== 1) return false;
1043
1044
  const l = L[0], h = l.h || 10;
1044
- const d0 = next ? _optionalChain([_chunk3FGHQWJPcjs.CELL_LINES, 'access', _65 => _65.get, 'call', _66 => _66(next), 'optionalAccess', _67 => _67[0]]) : void 0;
1045
+ const d0 = next ? _optionalChain([_chunkYV4PWWRWcjs.CELL_LINES, 'access', _65 => _65.get, 'call', _66 => _66(next), 'optionalAccess', _67 => _67[0]]) : void 0;
1045
1046
  if (d0 && d0.l - l.l >= HANGING_MIN * h) return false;
1046
1047
  return x2 - l.r - (l.l - x1) >= Math.max(LABEL_ROOM, firstWordUnits(_nullishCoalesce(_optionalChain([next, 'optionalAccess', _68 => _68.text]), () => ( "")))) * h;
1047
1048
  }
@@ -1057,9 +1058,9 @@ function appendCell(a, b) {
1057
1058
  a.blocks = [...asBlocks(a), ...asBlocks(b)];
1058
1059
  }
1059
1060
  if (b.text.trim()) a.text = a.text.trim() ? a.text + "\n" + b.text : b.text;
1060
- _chunk3FGHQWJPcjs.joinCellEdges.call(void 0, a, b);
1061
+ _chunkYV4PWWRWcjs.joinCellEdges.call(void 0, a, b);
1061
1062
  }
1062
- var hasContent = (cell) => !!cell.text.trim() || !!_optionalChain([cell, 'access', _75 => _75.blocks, 'optionalAccess', _76 => _76.length]) || _chunk3FGHQWJPcjs.IMAGE_CELLS.has(cell);
1063
+ var hasContent = (cell) => !!cell.text.trim() || !!_optionalChain([cell, 'access', _75 => _75.blocks, 'optionalAccess', _76 => _76.length]) || _chunkYV4PWWRWcjs.IMAGE_CELLS.has(cell);
1063
1064
  var CLAUSE_OPEN_ENDING = /(?:하는|되는|하고|하며|하여|되어|되고|되며|이며|으며|어야|아야|여야)$/;
1064
1065
  var batchim = (ch) => {
1065
1066
  const k = ch.charCodeAt(0) - 44032;
@@ -1067,13 +1068,13 @@ var batchim = (ch) => {
1067
1068
  };
1068
1069
  function clauseContinues(u, d) {
1069
1070
  const tail = _nullishCoalesce(flowText(u.text).trim().split(/\s+/).pop(), () => ( "")), head = flowText(d.text).trim();
1070
- if (!/^[가-힣]{2,}$/.test(tail) || !/^[가-힣]/.test(head) || _chunk3FGHQWJPcjs.startsNewItem.call(void 0, u.text, head)) return false;
1071
+ if (!/^[가-힣]{2,}$/.test(tail) || !/^[가-힣]/.test(head) || _chunkYV4PWWRWcjs.startsNewItem.call(void 0, u.text, head)) return false;
1071
1072
  const last = tail[tail.length - 1], before = tail[tail.length - 2];
1072
1073
  return last === "\uC744" && batchim(before) || last === "\uB97C" && !batchim(before) || CLAUSE_OPEN_ENDING.test(tail);
1073
1074
  }
1074
1075
  function wordOverflows(u, d, x1, x2) {
1075
- const U = _chunk3FGHQWJPcjs.CELL_LINES.get(u);
1076
- if (!_optionalChain([U, 'optionalAccess', _77 => _77.length]) || _chunk3FGHQWJPcjs.startsNewItem.call(void 0, u.text, d.text)) return false;
1076
+ const U = _chunkYV4PWWRWcjs.CELL_LINES.get(u);
1077
+ if (!_optionalChain([U, 'optionalAccess', _77 => _77.length]) || _chunkYV4PWWRWcjs.startsNewItem.call(void 0, u.text, d.text)) return false;
1077
1078
  const last = U[U.length - 1], units = firstWordUnits(d.text);
1078
1079
  return units > 0 && last.r - last.l + units * (last.h || 10) > x2 - x1;
1079
1080
  }
@@ -1133,7 +1134,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1133
1134
  if (!carriedSplit) {
1134
1135
  const norm = (c) => flowText(c.text).replace(/\s+/g, "");
1135
1136
  if (pairs.some(([u, d]) => hasContent(d.cell) && norm(cell(d)) !== norm(cell(u)) && lineEnded(cell(u), colXs[u.c], colXs[u.c + u.cs], cell(d)))) return false;
1136
- const oneLine = (c) => _optionalChain([_chunk3FGHQWJPcjs.CELL_LINES, 'access', _79 => _79.get, 'call', _80 => _80(c), 'optionalAccess', _81 => _81.length]) === 1;
1137
+ const oneLine = (c) => _optionalChain([_chunkYV4PWWRWcjs.CELL_LINES, 'access', _79 => _79.get, 'call', _80 => _80(c), 'optionalAccess', _81 => _81.length]) === 1;
1137
1138
  if (pairs.some(([u, d]) => nextItemHead(cell(u).text, cell(d).text)) && pairs.some(([u, d]) => hasContent(u.cell) && hasContent(d.cell) && oneLine(cell(u)) && oneLine(cell(d)) && norm(cell(u)) !== norm(cell(d)))) return false;
1138
1139
  const flows = ([u, d]) => continuesAcross(cell(u), cell(d), colXs[u.c], colXs[u.c + u.cs]) || clauseContinues(cell(u), cell(d));
1139
1140
  if (!(cut.open && !newCell)) {
@@ -1217,19 +1218,19 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
1217
1218
  placeJoined(blocks, i, j, joined);
1218
1219
  continue;
1219
1220
  }
1220
- if (_chunk3FGHQWJPcjs.EMPTY_PARTS.has(curr.table)) {
1221
+ if (_chunkYV4PWWRWcjs.EMPTY_PARTS.has(curr.table)) {
1221
1222
  blocks.splice(j, 1);
1222
1223
  i++;
1223
1224
  continue;
1224
1225
  }
1225
1226
  if (joined === null) continue;
1226
- if (prev.table.cols !== curr.table.cols || prev.table.renderAsTable !== curr.table.renderAsTable || _chunk3FGHQWJPcjs.EMPTY_PARTS.has(prev.table)) continue;
1227
+ if (prev.table.cols !== curr.table.cols || prev.table.renderAsTable !== curr.table.renderAsTable || _chunkYV4PWWRWcjs.EMPTY_PARTS.has(prev.table)) continue;
1227
1228
  const width = Math.max(prev.bbox.width, curr.bbox.width, 1);
1228
1229
  const leftDiff = Math.abs(prev.bbox.x - curr.bbox.x);
1229
1230
  const rightDiff = Math.abs(prev.bbox.x + prev.bbox.width - (curr.bbox.x + curr.bbox.width));
1230
1231
  if (leftDiff > width * NEIGHBOR_TABLE_EPSILON || rightDiff > width * NEIGHBOR_TABLE_EPSILON) continue;
1231
- const px = _chunk3FGHQWJPcjs.TABLE_COLXS.get(prev.table), cx = _chunk3FGHQWJPcjs.TABLE_COLXS.get(curr.table);
1232
- if (px && cx && !shiftedSame(px, cx, !_chunk3FGHQWJPcjs.CLIP_TABLES.has(prev.table) && !_chunk3FGHQWJPcjs.CLIP_TABLES.has(curr.table))) continue;
1232
+ const px = _chunkYV4PWWRWcjs.TABLE_COLXS.get(prev.table), cx = _chunkYV4PWWRWcjs.TABLE_COLXS.get(curr.table);
1233
+ if (px && cx && !shiftedSame(px, cx, !_chunkYV4PWWRWcjs.CLIP_TABLES.has(prev.table) && !_chunkYV4PWWRWcjs.CLIP_TABLES.has(curr.table))) continue;
1233
1234
  if (!rowTextsEqual(prev.table.cells[0], curr.table.cells[0]) && sameHeadShape(prev.table.cells[0], curr.table.cells[0])) continue;
1234
1235
  let currCells = curr.table.cells;
1235
1236
  const headRows = repeatedHeaderRows(prev.table, curr.table);
@@ -1240,16 +1241,16 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
1240
1241
  blocks.splice(j, 1);
1241
1242
  continue;
1242
1243
  }
1243
- if (px && cx && !_chunk3FGHQWJPcjs.CLIP_TABLES.has(prev.table) && !_chunk3FGHQWJPcjs.CLIP_TABLES.has(curr.table) && currCells.length < curr.table.cells.length && curr.table.cells[0].filter((c) => c.text.trim()).length >= 2 && prev.table.cells.at(-1).concat(currCells[0]).every((c) => c.rowSpan === 1 && c.colSpan === 1 && _chunk3FGHQWJPcjs.CELL_LINES.has(c))) {
1244
+ if (px && cx && !_chunkYV4PWWRWcjs.CLIP_TABLES.has(prev.table) && !_chunkYV4PWWRWcjs.CLIP_TABLES.has(curr.table) && currCells.length < curr.table.cells.length && curr.table.cells[0].filter((c) => c.text.trim()).length >= 2 && prev.table.cells.at(-1).concat(currCells[0]).every((c) => c.rowSpan === 1 && c.colSpan === 1 && _chunkYV4PWWRWcjs.CELL_LINES.has(c))) {
1244
1245
  const dx = px[0] - cx[0];
1245
1246
  const part = joinSplitParts(prev.table, px, curr.table, cx.map((x) => x + dx), dx, void 0, lex);
1246
1247
  if (_optionalChain([part, 'optionalAccess', _98 => _98.split]) && part.table.rows === prev.table.rows + currCells.length - 1) {
1247
1248
  const last = prev.table.rows - 1;
1248
1249
  for (let c = 0; c < part.table.cols; c++) {
1249
- const U = _chunk3FGHQWJPcjs.CELL_LINES.get(prev.table.cells[last][c]), D = _chunk3FGHQWJPcjs.CELL_LINES.get(currCells[0][c]);
1250
- _chunk3FGHQWJPcjs.CELL_LINES.set(part.table.cells[last][c], U.concat(D.map((l) => ({ ...l, l: l.l + dx, r: l.r + dx }))));
1250
+ const U = _chunkYV4PWWRWcjs.CELL_LINES.get(prev.table.cells[last][c]), D = _chunkYV4PWWRWcjs.CELL_LINES.get(currCells[0][c]);
1251
+ _chunkYV4PWWRWcjs.CELL_LINES.set(part.table.cells[last][c], U.concat(D.map((l) => ({ ...l, l: l.l + dx, r: l.r + dx }))));
1251
1252
  }
1252
- _chunk3FGHQWJPcjs.TABLE_COLXS.set(part.table, part.colXs);
1253
+ _chunkYV4PWWRWcjs.TABLE_COLXS.set(part.table, part.colXs);
1253
1254
  placeJoined(blocks, i, j, part.table);
1254
1255
  continue;
1255
1256
  }
@@ -1262,20 +1263,20 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
1262
1263
  caption: prev.table.caption,
1263
1264
  ...prev.table.renderAsTable ? { renderAsTable: true } : {}
1264
1265
  };
1265
- if (_nullishCoalesce(px, () => ( cx))) _chunk3FGHQWJPcjs.TABLE_COLXS.set(merged, _nullishCoalesce(px, () => ( cx)));
1266
- if (_chunk3FGHQWJPcjs.CLIP_TABLES.has(prev.table) || _chunk3FGHQWJPcjs.CLIP_TABLES.has(curr.table)) _chunk3FGHQWJPcjs.CLIP_TABLES.add(merged);
1266
+ if (_nullishCoalesce(px, () => ( cx))) _chunkYV4PWWRWcjs.TABLE_COLXS.set(merged, _nullishCoalesce(px, () => ( cx)));
1267
+ if (_chunkYV4PWWRWcjs.CLIP_TABLES.has(prev.table) || _chunkYV4PWWRWcjs.CLIP_TABLES.has(curr.table)) _chunkYV4PWWRWcjs.CLIP_TABLES.add(merged);
1267
1268
  placeJoined(blocks, i, j, merged);
1268
1269
  }
1269
1270
  for (let i = blocks.length - 1; i >= 0; i--) {
1270
1271
  const t = blocks[i].table;
1271
- if (blocks[i].type === "table" && t && _chunk3FGHQWJPcjs.EMPTY_PARTS.has(t)) blocks.splice(i, 1);
1272
+ if (blocks[i].type === "table" && t && _chunkYV4PWWRWcjs.EMPTY_PARTS.has(t)) blocks.splice(i, 1);
1272
1273
  }
1273
1274
  }
1274
1275
  function mergeColumnFlow(blocks, pageHeights, lex) {
1275
1276
  if (!pageHeights) return;
1276
1277
  for (let i = 0; i < blocks.length; i++) {
1277
1278
  const L = blocks[i];
1278
- if (L.type !== "table" || !L.table || !L.bbox || !L.pageNumber || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(L.table) || _chunk3FGHQWJPcjs.EMPTY_PARTS.has(L.table)) continue;
1279
+ if (L.type !== "table" || !L.table || !L.bbox || !L.pageNumber || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(L.table) || _chunkYV4PWWRWcjs.EMPTY_PARTS.has(L.table)) continue;
1279
1280
  const ph = pageHeights.get(L.pageNumber);
1280
1281
  if (!ph || L.bbox.y > ph * PAGE_EDGE_BAND) continue;
1281
1282
  let s0 = i, s1 = i;
@@ -1304,8 +1305,8 @@ function mergeColumnFlow(blocks, pageHeights, lex) {
1304
1305
  }
1305
1306
  function joinClipParts(prev, curr, pageHeights, lex) {
1306
1307
  const pt = prev.table, ct = curr.table;
1307
- if (!_chunk3FGHQWJPcjs.CLIP_TABLES.has(pt) || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(ct)) return null;
1308
- const px = _chunk3FGHQWJPcjs.TABLE_COLXS.get(pt), cx = _chunk3FGHQWJPcjs.TABLE_COLXS.get(ct);
1308
+ if (!_chunkYV4PWWRWcjs.CLIP_TABLES.has(pt) || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(ct)) return null;
1309
+ const px = _chunkYV4PWWRWcjs.TABLE_COLXS.get(pt), cx = _chunkYV4PWWRWcjs.TABLE_COLXS.get(ct);
1309
1310
  if (!px || !cx) return null;
1310
1311
  let xs = cx, shifted = false, dx = 0, foreign = false, within = false;
1311
1312
  if (!shiftedSame(px, cx, false)) {
@@ -1321,15 +1322,15 @@ function joinClipParts(prev, curr, pageHeights, lex) {
1321
1322
  const inner = b.slice(1, -1).map((x) => x + dx);
1322
1323
  return inner.length > 0 && !inner.some((x) => px.some((p) => Math.abs(p - x) <= CONTINUATION_COL_TOL));
1323
1324
  };
1324
- foreign = unrelated(cx) && unrelated(_nullishCoalesce(_chunk3FGHQWJPcjs.PART_COLXS.get(ct), () => ( cx))) && (headingRow(_nullishCoalesce(ct.cells[0], () => ( []))) || px.length > FOREIGN_FIRST_ROW_CELLS && anchorsOf(ct).filter((a) => a.r === 0).length >= FOREIGN_FIRST_ROW_CELLS);
1325
+ foreign = unrelated(cx) && unrelated(_nullishCoalesce(_chunkYV4PWWRWcjs.PART_COLXS.get(ct), () => ( cx))) && (headingRow(_nullishCoalesce(ct.cells[0], () => ( []))) || px.length > FOREIGN_FIRST_ROW_CELLS && anchorsOf(ct).filter((a) => a.r === 0).length >= FOREIGN_FIRST_ROW_CELLS);
1325
1326
  }
1326
1327
  const res = joinSplitParts(pt, px, ct, xs, dx, _optionalChain([prev, 'access', _103 => _103.bbox, 'optionalAccess', _104 => _104.y]), lex);
1327
1328
  if (!res || (shifted || foreign || within) && !res.split && !res.header) return null;
1328
- _chunk3FGHQWJPcjs.TABLE_COLXS.set(res.table, res.colXs);
1329
- const ys = _chunk3FGHQWJPcjs.TABLE_ROWYS.get(pt);
1330
- if (ys) _chunk3FGHQWJPcjs.TABLE_ROWYS.set(res.table, ys);
1331
- _chunk3FGHQWJPcjs.PART_COLXS.set(res.table, _nullishCoalesce(_chunk3FGHQWJPcjs.PART_COLXS.get(pt), () => ( px)));
1332
- _chunk3FGHQWJPcjs.CLIP_TABLES.add(res.table);
1329
+ _chunkYV4PWWRWcjs.TABLE_COLXS.set(res.table, res.colXs);
1330
+ const ys = _chunkYV4PWWRWcjs.TABLE_ROWYS.get(pt);
1331
+ if (ys) _chunkYV4PWWRWcjs.TABLE_ROWYS.set(res.table, ys);
1332
+ _chunkYV4PWWRWcjs.PART_COLXS.set(res.table, _nullishCoalesce(_chunkYV4PWWRWcjs.PART_COLXS.get(pt), () => ( px)));
1333
+ _chunkYV4PWWRWcjs.CLIP_TABLES.add(res.table);
1333
1334
  return res.table;
1334
1335
  }
1335
1336
  function prevLacksLeftCols(prev, px, xs, pageHeights) {
@@ -1353,12 +1354,12 @@ function looksContinued(prev, curr, pageHeights) {
1353
1354
  return filled.length >= 2 && filled.every((t) => t === filled[0]);
1354
1355
  }
1355
1356
  function pushedLead(prev, curr) {
1356
- if (!_chunk3FGHQWJPcjs.CLIP_TABLES.has(prev.table) || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(curr.table)) return false;
1357
+ if (!_chunkYV4PWWRWcjs.CLIP_TABLES.has(prev.table) || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(curr.table)) return false;
1357
1358
  const lead = leadRows(curr.table);
1358
1359
  return lead.image && lead.height > prev.bbox.y;
1359
1360
  }
1360
1361
  function leadRows(t) {
1361
- const ys = _chunk3FGHQWJPcjs.TABLE_ROWYS.get(t);
1362
+ const ys = _chunkYV4PWWRWcjs.TABLE_ROWYS.get(t);
1362
1363
  if (!ys || ys.length < 2) return { height: 0, image: false };
1363
1364
  const anchors = anchorsOf(t);
1364
1365
  let end = 1, image = false;
@@ -1366,17 +1367,17 @@ function leadRows(t) {
1366
1367
  for (const a of anchors) {
1367
1368
  if (a.r !== r) continue;
1368
1369
  end = Math.max(end, r + a.rs);
1369
- if (_chunk3FGHQWJPcjs.IMAGE_CELLS.has(a.cell)) image = true;
1370
+ if (_chunkYV4PWWRWcjs.IMAGE_CELLS.has(a.cell)) image = true;
1370
1371
  }
1371
1372
  }
1372
1373
  return { height: ys[0] - ys[Math.min(end, ys.length - 1)], image };
1373
1374
  }
1374
1375
  function tailOf(b) {
1375
- const t = b.table && _chunk3FGHQWJPcjs.TABLE_TAIL.get(b.table);
1376
+ const t = b.table && _chunkYV4PWWRWcjs.TABLE_TAIL.get(b.table);
1376
1377
  return t && b.bbox ? { ...b, pageNumber: t.page, bbox: { ...b.bbox, page: t.page, y: t.y, height: t.height } } : b;
1377
1378
  }
1378
1379
  function firstRowSig(t) {
1379
- const x = _chunk3FGHQWJPcjs.TABLE_COLXS.get(t);
1380
+ const x = _chunkYV4PWWRWcjs.TABLE_COLXS.get(t);
1380
1381
  if (!x || x.length !== t.cols + 1) return null;
1381
1382
  return anchorsOf(t).filter((a) => a.r === 0).map((a) => ({ x1: x[a.c], x2: x[a.c + a.cs], t: flowText(a.cell.text).replace(/\s+/g, "") }));
1382
1383
  }
@@ -1429,7 +1430,7 @@ function chainHead(blocks, i, pageHeights) {
1429
1430
  if (pb.pageNumber !== (_nullishCoalesce(cur.pageNumber, () => ( 0))) - 1) break;
1430
1431
  if (!blocks.slice(p + 1, k).every((b) => besideOwn(b, pb, cur) || insideTable(b, pb) || pageNumberBetween(b, pb, cur, pageHeights))) break;
1431
1432
  if (!looksContinued(pb, cur, pageHeights)) break;
1432
- const px = _chunk3FGHQWJPcjs.TABLE_COLXS.get(pb.table), cx = _chunk3FGHQWJPcjs.TABLE_COLXS.get(cur.table);
1433
+ const px = _chunkYV4PWWRWcjs.TABLE_COLXS.get(pb.table), cx = _chunkYV4PWWRWcjs.TABLE_COLXS.get(cur.table);
1433
1434
  if (!px || !cx) break;
1434
1435
  const dx = px[px.length - 1] - cx[cx.length - 1];
1435
1436
  if (!shiftedSame(px, cx) && !px.some((x) => Math.abs(x - (cx[0] + dx)) <= CONTINUATION_COL_TOL) && !prevLacksLeftCols(pb, px, cx, pageHeights)) break;
@@ -1500,7 +1501,7 @@ var RESTART_LOOKBACK_PAGES = 5;
1500
1501
  var COL_MATCH_TOL = 0.5;
1501
1502
  var CONTINUED_TABLE_PAGE_BAND = 0.16;
1502
1503
  function lastRowCell(t, x1, x2) {
1503
- const xs = _chunk3FGHQWJPcjs.TABLE_COLXS.get(t);
1504
+ const xs = _chunkYV4PWWRWcjs.TABLE_COLXS.get(t);
1504
1505
  const covered = /* @__PURE__ */ new Set();
1505
1506
  for (let r = 0; r < t.rows; r++) {
1506
1507
  for (let c = 0; c < t.cols; c++) {
@@ -1518,7 +1519,7 @@ var cellBlocks = (cell, pageNumber) => _nullishCoalesce(cell.blocks, () => ( cel
1518
1519
  function mergeContinuedCells(blocks, pageHeights) {
1519
1520
  for (let j = blocks.length - 1; j > 0; j--) {
1520
1521
  const part = blocks[j];
1521
- const from = part.table ? _chunk3FGHQWJPcjs.CONT_PARTS.get(part.table) : void 0;
1522
+ const from = part.table ? _chunkYV4PWWRWcjs.CONT_PARTS.get(part.table) : void 0;
1522
1523
  if (!from || !part.table) continue;
1523
1524
  let i = j - 1;
1524
1525
  while (i >= 0 && blocks[i].type !== "table") i--;
@@ -1530,11 +1531,11 @@ function mergeContinuedCells(blocks, pageHeights) {
1530
1531
  const at = cell.blocks || add.blocks ? cellBlocks(cell, prev.pageNumber).length : -1;
1531
1532
  if (cell.blocks || add.blocks) cell.blocks = [...cellBlocks(cell, prev.pageNumber), ...cellBlocks(add, part.pageNumber)];
1532
1533
  cell.text = [cell.text, add.text].filter((s) => s.trim()).join("\n");
1533
- _chunk3FGHQWJPcjs.joinCellEdges.call(void 0, cell, add);
1534
- const lines = _chunk3FGHQWJPcjs.CELL_LINES.get(add);
1535
- if (_optionalChain([lines, 'optionalAccess', _128 => _128.length])) _chunk3FGHQWJPcjs.CELL_LINES.set(cell, [..._nullishCoalesce(_chunk3FGHQWJPcjs.CELL_LINES.get(cell), () => ( [])), ...lines]);
1536
- if (part.pageNumber && part.bbox) _chunk3FGHQWJPcjs.TABLE_TAIL.set(prev.table, _nullishCoalesce(_chunk3FGHQWJPcjs.TABLE_TAIL.get(part.table), () => ( { page: part.pageNumber, y: part.bbox.y, height: part.bbox.height })));
1537
- if (cell.text.trim() || _optionalChain([cell, 'access', _129 => _129.blocks, 'optionalAccess', _130 => _130.length])) _chunk3FGHQWJPcjs.EMPTY_PARTS.delete(prev.table);
1534
+ _chunkYV4PWWRWcjs.joinCellEdges.call(void 0, cell, add);
1535
+ const lines = _chunkYV4PWWRWcjs.CELL_LINES.get(add);
1536
+ if (_optionalChain([lines, 'optionalAccess', _128 => _128.length])) _chunkYV4PWWRWcjs.CELL_LINES.set(cell, [..._nullishCoalesce(_chunkYV4PWWRWcjs.CELL_LINES.get(cell), () => ( [])), ...lines]);
1537
+ if (part.pageNumber && part.bbox) _chunkYV4PWWRWcjs.TABLE_TAIL.set(prev.table, _nullishCoalesce(_chunkYV4PWWRWcjs.TABLE_TAIL.get(part.table), () => ( { page: part.pageNumber, y: part.bbox.y, height: part.bbox.height })));
1538
+ if (cell.text.trim() || _optionalChain([cell, 'access', _129 => _129.blocks, 'optionalAccess', _130 => _130.length])) _chunkYV4PWWRWcjs.EMPTY_PARTS.delete(prev.table);
1538
1539
  blocks.splice(j, 1);
1539
1540
  if (cell.blocks && at > 0) {
1540
1541
  const nextAt = cell.blocks[at];
@@ -1546,11 +1547,11 @@ function mergeContinuedCells(blocks, pageHeights) {
1546
1547
  }
1547
1548
  function unwrapContinuedTable(blocks, at, pageHeights) {
1548
1549
  const prev = blocks[at - 1], frame = blocks[at];
1549
- if (!_optionalChain([prev, 'optionalAccess', _131 => _131.table]) || !_optionalChain([frame, 'optionalAccess', _132 => _132.table]) || frame.table.rows !== 1 || frame.table.cols !== 1 || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(frame.table)) return;
1550
+ if (!_optionalChain([prev, 'optionalAccess', _131 => _131.table]) || !_optionalChain([frame, 'optionalAccess', _132 => _132.table]) || frame.table.rows !== 1 || frame.table.cols !== 1 || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(frame.table)) return;
1550
1551
  const inner = _optionalChain([frame, 'access', _133 => _133.table, 'access', _134 => _134.cells, 'access', _135 => _135[0], 'optionalAccess', _136 => _136[0], 'optionalAccess', _137 => _137.blocks]);
1551
1552
  const next = _optionalChain([inner, 'optionalAccess', _138 => _138[0]]);
1552
- if (!inner || !_optionalChain([next, 'optionalAccess', _139 => _139.table]) || !prev.bbox || !next.bbox || !prev.pageNumber || next.pageNumber !== prev.pageNumber + 1 || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(prev.table) || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(next.table) || prev.table.cols !== next.table.cols) return;
1553
- const px = _chunk3FGHQWJPcjs.TABLE_COLXS.get(prev.table), nx = _chunk3FGHQWJPcjs.TABLE_COLXS.get(next.table);
1553
+ if (!inner || !_optionalChain([next, 'optionalAccess', _139 => _139.table]) || !prev.bbox || !next.bbox || !prev.pageNumber || next.pageNumber !== prev.pageNumber + 1 || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(prev.table) || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(next.table) || prev.table.cols !== next.table.cols) return;
1554
+ const px = _chunkYV4PWWRWcjs.TABLE_COLXS.get(prev.table), nx = _chunkYV4PWWRWcjs.TABLE_COLXS.get(next.table);
1554
1555
  if (!px || !nx || px.length !== nx.length || px.some((x, i) => Math.abs(x - nx[i]) > COL_MATCH_TOL)) return;
1555
1556
  const ph = _optionalChain([pageHeights, 'optionalAccess', _140 => _140.get, 'call', _141 => _141(prev.pageNumber)]), nh = _optionalChain([pageHeights, 'optionalAccess', _142 => _142.get, 'call', _143 => _143(next.pageNumber)]);
1556
1557
  if (!ph || !nh || prev.bbox.y > ph * CONTINUED_TABLE_PAGE_BAND || next.bbox.y + next.bbox.height < nh * (1 - CONTINUED_TABLE_PAGE_BAND)) return;
@@ -1559,14 +1560,14 @@ function unwrapContinuedTable(blocks, at, pageHeights) {
1559
1560
  function fillNestedContinuation(blocks, at) {
1560
1561
  const prev = blocks[at - 1], next = blocks[at];
1561
1562
  const t = _optionalChain([prev, 'optionalAccess', _144 => _144.table]), u = _optionalChain([next, 'optionalAccess', _145 => _145.table]);
1562
- if (!t || !u || u.rows !== 1 || u.cols !== 1 || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(t) || !_chunk3FGHQWJPcjs.CLIP_TABLES.has(u) || next.pageNumber !== (_nullishCoalesce(prev.pageNumber, () => ( 0))) + 1) return;
1563
- const xs = _chunk3FGHQWJPcjs.TABLE_COLXS.get(u);
1563
+ if (!t || !u || u.rows !== 1 || u.cols !== 1 || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(t) || !_chunkYV4PWWRWcjs.CLIP_TABLES.has(u) || next.pageNumber !== (_nullishCoalesce(prev.pageNumber, () => ( 0))) + 1) return;
1564
+ const xs = _chunkYV4PWWRWcjs.TABLE_COLXS.get(u);
1564
1565
  const cell = xs ? lastRowCell(t, xs[0], xs[xs.length - 1]) : void 0;
1565
1566
  const add = _optionalChain([u, 'access', _146 => _146.cells, 'access', _147 => _147[0], 'optionalAccess', _148 => _148[0]]);
1566
1567
  if (!cell || !add || cell.text.trim() || _optionalChain([cell, 'access', _149 => _149.blocks, 'optionalAccess', _150 => _150.length])) return;
1567
1568
  cell.text = add.text;
1568
1569
  if (add.blocks) cell.blocks = add.blocks;
1569
- _chunk3FGHQWJPcjs.joinCellEdges.call(void 0, cell, add);
1570
+ _chunkYV4PWWRWcjs.joinCellEdges.call(void 0, cell, add);
1570
1571
  blocks.splice(at, 1);
1571
1572
  }
1572
1573
 
@@ -1586,15 +1587,15 @@ function selectionContextPages(selected, pageCount) {
1586
1587
  function marginContextBlocks(raw, page, view) {
1587
1588
  const [x1, y1, x2, y2] = view;
1588
1589
  const width = x2 - x1, height = y2 - y1;
1589
- const items = _chunk3FGHQWJPcjs.filterHiddenText.call(void 0, _chunk3FGHQWJPcjs.normalizeItems.call(void 0, raw), width, height, x1, y1).visible;
1590
+ const items = _chunkYV4PWWRWcjs.filterHiddenText.call(void 0, _chunkYV4PWWRWcjs.normalizeItems.call(void 0, raw), width, height, x1, y1).visible;
1590
1591
  for (const item of items) {
1591
1592
  item.x -= x1;
1592
1593
  item.y -= y1;
1593
1594
  }
1594
- return _chunk3FGHQWJPcjs.groupByY.call(void 0, items).flatMap((line) => {
1595
- const bbox = _chunk3FGHQWJPcjs.computeBBox.call(void 0, line, page);
1595
+ return _chunkYV4PWWRWcjs.groupByY.call(void 0, items).flatMap((line) => {
1596
+ const bbox = _chunkYV4PWWRWcjs.computeBBox.call(void 0, line, page);
1596
1597
  if (bbox.y + bbox.height < height * 0.88 && bbox.y > height * 0.12) return [];
1597
- return [{ type: "paragraph", text: _chunk3FGHQWJPcjs.mergeLineSimple.call(void 0, line), pageNumber: page, bbox, style: _chunk3FGHQWJPcjs.dominantStyle.call(void 0, line) }];
1598
+ return [{ type: "paragraph", text: _chunkYV4PWWRWcjs.mergeLineSimple.call(void 0, line), pageNumber: page, bbox, style: _chunkYV4PWWRWcjs.dominantStyle.call(void 0, line) }];
1598
1599
  });
1599
1600
  }
1600
1601
 
@@ -1630,7 +1631,7 @@ var WINANSI_REVERSE = {
1630
1631
  };
1631
1632
  function symbolFontTable(fontName) {
1632
1633
  if (!fontName) return void 0;
1633
- if (/wingdings(?![\s-]*[23])/i.test(fontName)) return _chunk6FW3AZWNcjs.WINGDINGS;
1634
+ if (/wingdings(?![\s-]*[23])/i.test(fontName)) return _chunkLNU54ZKVcjs.WINGDINGS;
1634
1635
  return void 0;
1635
1636
  }
1636
1637
  function remapSymbolText(text, table) {
@@ -2646,7 +2647,7 @@ function demoteNonHeadingRoles(blocks, pageHeights, faceNames) {
2646
2647
  if (block.type !== "heading" || !block.text) continue;
2647
2648
  const text = block.text.replace(/<[^>]+>/g, "").trim();
2648
2649
  const fsz = _nullishCoalesce(_optionalChain([block, 'access', _214 => _214.style, 'optionalAccess', _215 => _215.fontSize]), () => ( 0));
2649
- const tocEntry = i > 0 && _chunk3FGHQWJPcjs.TOC_BLOCKS.has(blocks[i - 1]) && _chunk3FGHQWJPcjs.TOC_BLOCKS.has(blocks[i + 1]);
2650
+ const tocEntry = i > 0 && _chunkYV4PWWRWcjs.TOC_BLOCKS.has(blocks[i - 1]) && _chunkYV4PWWRWcjs.TOC_BLOCKS.has(blocks[i + 1]);
2650
2651
  const page = _nullishCoalesce(byPage.get(_nullishCoalesce(block.pageNumber, () => ( 0))), () => ( []));
2651
2652
  const proseStyle = _optionalChain([block, 'access', _216 => _216.style, 'optionalAccess', _217 => _217.fontName]) && bodyStyle.get(_nullishCoalesce(block.pageNumber, () => ( 0))) === `${block.style.fontName}:${block.style.fontSize}` && text.length > 60;
2652
2653
  const next = blocks[i + 1];
@@ -2729,7 +2730,7 @@ function splitSingleCellTables(blocks) {
2729
2730
  const out = [];
2730
2731
  for (const b of blocks) {
2731
2732
  const t = b.type === "table" ? b.table : void 0;
2732
- const title = t && _chunk3FGHQWJPcjs.FRAME_TITLE_BLOCKS.get(t);
2733
+ const title = t && _chunkYV4PWWRWcjs.FRAME_TITLE_BLOCKS.get(t);
2733
2734
  if (title) {
2734
2735
  out.push({ ...title, text: `${t.cells[0][0].text.trim()} ${t.cells[0][2].text.trim()}` });
2735
2736
  continue;
@@ -2765,7 +2766,7 @@ function joinLatinCellWraps(blocks) {
2765
2766
  const lines = cell.text.split("\n");
2766
2767
  const out = [lines[0]];
2767
2768
  for (const line of lines.slice(1)) {
2768
- if (_chunk3FGHQWJPcjs.latinSoftWrap.call(void 0, out[out.length - 1], line)) out[out.length - 1] = out[out.length - 1].trimEnd() + " " + line.trim();
2769
+ if (_chunkYV4PWWRWcjs.latinSoftWrap.call(void 0, out[out.length - 1], line)) out[out.length - 1] = out[out.length - 1].trimEnd() + " " + line.trim();
2769
2770
  else out.push(line);
2770
2771
  }
2771
2772
  cell.text = out.join("\n");
@@ -2785,10 +2786,10 @@ function cleanPdfText(text, opts) {
2785
2786
  ).replace(/^(?!\| ---).*$/gm, (line) => {
2786
2787
  if (/^\s*\${1,2}.+\${1,2}\s*$/.test(line)) return line;
2787
2788
  if (line.startsWith("|")) {
2788
- return line.replace(/(?:\\.|[^|\\])+/g, (cell) => cell.split("<br>").map((seg) => seg.replace(/\S(?:.*\S)?/, (t) => _chunk3FGHQWJPcjs.collapseEvenSpacing.call(void 0, t, false))).join("<br>"));
2789
+ return line.replace(/(?:\\.|[^|\\])+/g, (cell) => cell.split("<br>").map((seg) => seg.replace(/\S(?:.*\S)?/, (t) => _chunkYV4PWWRWcjs.collapseEvenSpacing.call(void 0, t, false))).join("<br>"));
2789
2790
  }
2790
2791
  const mark = _nullishCoalesce(_optionalChain([/^(?:#{1,6}|-) /, 'access', _297 => _297.exec, 'call', _298 => _298(line), 'optionalAccess', _299 => _299[0]]), () => ( ""));
2791
- return mark + _chunk3FGHQWJPcjs.collapseEvenSpacing.call(void 0, line.slice(mark.length), false);
2792
+ return mark + _chunkYV4PWWRWcjs.collapseEvenSpacing.call(void 0, line.slice(mark.length), false);
2792
2793
  }).replace(/\\~\\~/g, "~~").replace(/~~~~/g, "").replace(/<u>\s*<\/u>/g, "").replace(/<(sup|sub)>\s*<\/\1>/g, "").replace(/\n{3,}/g, "\n\n").trim();
2793
2794
  }
2794
2795
  function startsWithMarker(line) {
@@ -2820,7 +2821,7 @@ function mergeKoreanLines(text) {
2820
2821
  continue;
2821
2822
  }
2822
2823
  if (/[가-힣·,\-]$/.test(prev) && /^[가-힣(]/.test(curr) && !startsWithMarker(curr) && !isStandaloneHeader(prev) && !startsWithMarker(prev)) {
2823
- result[result.length - 1] = prev + _chunk3FGHQWJPcjs.wrapJoiner.call(void 0, prev, curr) + curr;
2824
+ result[result.length - 1] = prev + _chunkYV4PWWRWcjs.wrapJoiner.call(void 0, prev, curr) + curr;
2824
2825
  } else {
2825
2826
  result.push(curr);
2826
2827
  }
@@ -2836,7 +2837,7 @@ function applyLinkAnnotations(items, annots) {
2836
2837
  const wrapped = /* @__PURE__ */ new Set();
2837
2838
  for (const a of annots) {
2838
2839
  if (a.subtype !== "Link" || !a.url || !a.rect || a.rect.length < 4) continue;
2839
- const url = _chunkK6WSMTVUcjs.sanitizeHref.call(void 0, a.url);
2840
+ const url = _chunk34RIECIFcjs.sanitizeHref.call(void 0, a.url);
2840
2841
  if (!url) continue;
2841
2842
  const x1 = Math.min(a.rect[0], a.rect[2]), x2 = Math.max(a.rect[0], a.rect[2]);
2842
2843
  const y1 = Math.min(a.rect[1], a.rect[3]), y2 = Math.max(a.rect[1], a.rect[3]);
@@ -2877,7 +2878,7 @@ function mergeLinkRuns(markdown) {
2877
2878
 
2878
2879
  // src/pdf/formula-ocr.ts
2879
2880
  async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
2880
- const formulaMod = await Promise.resolve().then(() => _interopRequireWildcard(require("./formula-HJNQGPRC.cjs")));
2881
+ const formulaMod = await Promise.resolve().then(() => _interopRequireWildcard(require("./formula-L2BKGA4J.cjs")));
2881
2882
  const { FormulaPipeline, ensureFormulaModels } = formulaMod;
2882
2883
  await ensureFormulaModels((p) => {
2883
2884
  if (p.phase === "download" && p.total) {
@@ -3068,13 +3069,13 @@ async function loadPdfWithTimeout(buffer) {
3068
3069
  try {
3069
3070
  return await Promise.race([
3070
3071
  loadingTask.promise.catch((e) => {
3071
- if (e instanceof Error && e.name === "PasswordException") throw new (0, _chunkK6WSMTVUcjs.KordocError)("\uC554\uD638\uB85C \uBCF4\uD638\uB41C PDF \uD30C\uC77C\uC785\uB2C8\uB2E4 (PDF \uC5F4\uAE30 \uC554\uD638\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)");
3072
+ if (e instanceof Error && e.name === "PasswordException") throw new (0, _chunk34RIECIFcjs.KordocError)("\uC554\uD638\uB85C \uBCF4\uD638\uB41C PDF \uD30C\uC77C\uC785\uB2C8\uB2E4 (PDF \uC5F4\uAE30 \uC554\uD638\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)");
3072
3073
  throw e;
3073
3074
  }),
3074
3075
  new Promise((_, reject) => {
3075
3076
  timer = setTimeout(() => {
3076
3077
  loadingTask.destroy();
3077
- reject(new (0, _chunkK6WSMTVUcjs.KordocError)("PDF \uB85C\uB529 \uD0C0\uC784\uC544\uC6C3 (30\uCD08 \uCD08\uACFC)"));
3078
+ reject(new (0, _chunk34RIECIFcjs.KordocError)("PDF \uB85C\uB529 \uD0C0\uC784\uC544\uC6C3 (30\uCD08 \uCD08\uACFC)"));
3078
3079
  }, PDF_LOAD_TIMEOUT_MS);
3079
3080
  })
3080
3081
  ]);
@@ -3084,12 +3085,12 @@ async function loadPdfWithTimeout(buffer) {
3084
3085
  }
3085
3086
  async function parsePdfDocument(buffer, options) {
3086
3087
  const formulaBuffer = _optionalChain([options, 'optionalAccess', _300 => _300.formulaOcr]) ? buffer : null;
3087
- const autoOcr = _optionalChain([options, 'optionalAccess', _301 => _301.ocr]) === void 0 && await _chunk3FGHQWJPcjs.ocrModelsCached.call(void 0, );
3088
+ const autoOcr = _optionalChain([options, 'optionalAccess', _301 => _301.ocr]) === void 0 && await _chunkYV4PWWRWcjs.ocrModelsCached.call(void 0, );
3088
3089
  const ocrBuffer = _optionalChain([options, 'optionalAccess', _302 => _302.ocr]) || autoOcr ? buffer : null;
3089
3090
  const doc = await loadPdfWithTimeout(buffer);
3090
3091
  try {
3091
3092
  const pageCount = doc.numPages;
3092
- if (pageCount === 0) throw new (0, _chunkK6WSMTVUcjs.KordocError)("PDF\uC5D0 \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
3093
+ if (pageCount === 0) throw new (0, _chunk34RIECIFcjs.KordocError)("PDF\uC5D0 \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
3093
3094
  const metadata = { pageCount, pageMode: "layout" };
3094
3095
  await extractPdfMetadata(doc, metadata);
3095
3096
  const blocks = [];
@@ -3118,7 +3119,7 @@ async function parsePdfDocument(buffer, options) {
3118
3119
  const pageImageBlocks = /* @__PURE__ */ new Map();
3119
3120
  const carry = {};
3120
3121
  const vectorPageOps = /* @__PURE__ */ new Map();
3121
- const wrapLexicon = new (0, _chunk3FGHQWJPcjs.WrapLexicon)();
3122
+ const wrapLexicon = new (0, _chunkYV4PWWRWcjs.WrapLexicon)();
3122
3123
  const noteMarks = /* @__PURE__ */ new Map();
3123
3124
  const headerContext = [];
3124
3125
  if (pageFilter && _optionalChain([options, 'optionalAccess', _305 => _305.removeHeaderFooter]) !== false && pageFilter.size < effectivePageCount) {
@@ -3163,8 +3164,8 @@ async function parsePdfDocument(buffer, options) {
3163
3164
  restoreTrackedSpacing(rawItems, rawOps.fnArray, rawOps.argsArray);
3164
3165
  markSyntheticSpaces(rawItems, rawOps.fnArray, rawOps.argsArray);
3165
3166
  const occluded = occludedTextItems(rawItems, rawOps.fnArray, rawOps.argsArray);
3166
- const items = _chunk3FGHQWJPcjs.normalizeItems.call(void 0, occluded.size ? rawItems.filter((it) => !occluded.has(it)) : rawItems);
3167
- const filtered = _chunk3FGHQWJPcjs.filterHiddenText.call(void 0, items, pageW, pageH, viewX1, viewY1);
3167
+ const items = _chunkYV4PWWRWcjs.normalizeItems.call(void 0, occluded.size ? rawItems.filter((it) => !occluded.has(it)) : rawItems);
3168
+ const filtered = _chunkYV4PWWRWcjs.filterHiddenText.call(void 0, items, pageW, pageH, viewX1, viewY1);
3168
3169
  const joined = joinVerticalColumns(filtered.visible);
3169
3170
  const visible = dropTabLeaderDots(joined);
3170
3171
  const hiddenCount = filtered.hiddenCount + occluded.size;
@@ -3190,7 +3191,7 @@ async function parsePdfDocument(buffer, options) {
3190
3191
  } : rawOps;
3191
3192
  remapSymbolFontItems(visible, (loadedName) => _optionalChain([fontObj, 'call', _312 => _312(loadedName), 'optionalAccess', _313 => _313.name]));
3192
3193
  remapControlGlyphs(visible, differencesOf);
3193
- await _chunk3FGHQWJPcjs.restoreImageBullets.call(void 0, visible, page, opList.fnArray, opList.argsArray, imageBulletShapes);
3194
+ await _chunkYV4PWWRWcjs.restoreImageBullets.call(void 0, visible, page, opList.fnArray, opList.argsArray, imageBulletShapes);
3194
3195
  const faces = /* @__PURE__ */ new Map();
3195
3196
  for (const it of visible) {
3196
3197
  if (!it.fontName) continue;
@@ -3203,12 +3204,12 @@ async function parsePdfDocument(buffer, options) {
3203
3204
  it.fontName = face;
3204
3205
  if (!faceNames.has(face)) faceNames.set(face, (_nullishCoalesce(_optionalChain([fontObj, 'call', _315 => _315(face), 'optionalAccess', _316 => _316.name]), () => ( ""))).replace(/^[A-Z]{6}\+/, ""));
3205
3206
  }
3206
- for (const it of visible) if (it.text.includes("$")) it.text = _chunk6FW3AZWNcjs.escapeLiteralDollar.call(void 0, it.text);
3207
- for (const it of visible) if (it.text.includes("<")) it.text = _chunk6FW3AZWNcjs.escapeLiteralTags.call(void 0, it.text);
3207
+ for (const it of visible) if (it.text.includes("$")) it.text = _chunkLNU54ZKVcjs.escapeLiteralDollar.call(void 0, it.text);
3208
+ for (const it of visible) if (it.text.includes("<")) it.text = _chunkLNU54ZKVcjs.escapeLiteralTags.call(void 0, it.text);
3208
3209
  wrapEquationRuns(visible, (face) => faceNames.get(face));
3209
3210
  const pageArea = pageW * pageH;
3210
3211
  if (pageArea > 0) {
3211
- const imageRegions = _chunk3FGHQWJPcjs.extractImageRegions.call(void 0, opList.fnArray, opList.argsArray);
3212
+ const imageRegions = _chunkYV4PWWRWcjs.extractImageRegions.call(void 0, opList.fnArray, opList.argsArray);
3212
3213
  let uncovered = 0;
3213
3214
  for (const r of imageRegions) {
3214
3215
  const area = (r.x2 - r.x1) * (r.y2 - r.y1);
@@ -3234,11 +3235,11 @@ async function parsePdfDocument(buffer, options) {
3234
3235
  if (uncovered > 0) skippedImagePages.set(i, uncovered);
3235
3236
  }
3236
3237
  const marks = superscriptNoteMarks(visible);
3237
- if (marks.length) noteMarks.set(i, { marks, seps: footnoteSeparators(_chunk3FGHQWJPcjs.extractLines.call(void 0, opList.fnArray, opList.argsArray).horizontals, pageW, pageH) });
3238
+ if (marks.length) noteMarks.set(i, { marks, seps: footnoteSeparators(_chunkYV4PWWRWcjs.extractLines.call(void 0, opList.fnArray, opList.argsArray).horizontals, pageW, pageH) });
3238
3239
  const stamp = marginStamp(visible);
3239
3240
  const flow = stamp.length ? visible.filter((it) => !stamp.includes(it)) : visible;
3240
- const rightArrows = _optionalChain([options, 'optionalAccess', _317 => _317.tables]) !== false ? await _chunk3FGHQWJPcjs.detectRightArrowRegions.call(void 0, page, opList.fnArray, opList.argsArray, imageArrowDirections) : [];
3241
- const pageBlocks = orderTwoUpPage(_chunk3FGHQWJPcjs.extractPageBlocksWithLines.call(void 0, flow, i, opList, pageW, pageH, void 0, _optionalChain([options, 'optionalAccess', _318 => _318.tables]) !== false, carry, wrapLexicon, rightArrows), pageW, pageH);
3241
+ const rightArrows = _optionalChain([options, 'optionalAccess', _317 => _317.tables]) !== false ? await _chunkYV4PWWRWcjs.detectRightArrowRegions.call(void 0, page, opList.fnArray, opList.argsArray, imageArrowDirections) : [];
3242
+ const pageBlocks = orderTwoUpPage(_chunkYV4PWWRWcjs.extractPageBlocksWithLines.call(void 0, flow, i, opList, pageW, pageH, void 0, _optionalChain([options, 'optionalAccess', _318 => _318.tables]) !== false, carry, wrapLexicon, rightArrows), pageW, pageH);
3242
3243
  if (stamp.length) pageBlocks.unshift({ type: "paragraph", text: [...stamp].sort((a, b) => a.y - b.y).map((it) => it.text).join(" "), pageNumber: i });
3243
3244
  for (const b of pageBlocks) blocks.push(b);
3244
3245
  try {
@@ -3264,11 +3265,11 @@ async function parsePdfDocument(buffer, options) {
3264
3265
  if (_optionalChain([options, 'optionalAccess', _320 => _320.ocr]) && quality.ocrReason === "vector_text" && page.rotate % 360 === 0 && page.view[0] === 0 && page.view[1] === 0) {
3265
3266
  vectorPageOps.set(i, ocrVectorOps(opList, vector.paths));
3266
3267
  }
3267
- if (totalTextBytes > MAX_TOTAL_TEXT) throw new (0, _chunkK6WSMTVUcjs.KordocError)("\uD14D\uC2A4\uD2B8 \uCD94\uCD9C \uD06C\uAE30 \uCD08\uACFC");
3268
+ if (totalTextBytes > MAX_TOTAL_TEXT) throw new (0, _chunk34RIECIFcjs.KordocError)("\uD14D\uC2A4\uD2B8 \uCD94\uCD9C \uD06C\uAE30 \uCD08\uACFC");
3268
3269
  parsedPages++;
3269
3270
  _optionalChain([options, 'optionalAccess', _321 => _321.onProgress, 'optionalCall', _322 => _322(parsedPages, totalTarget)]);
3270
3271
  } catch (pageErr) {
3271
- if (pageErr instanceof _chunkK6WSMTVUcjs.KordocError) throw pageErr;
3272
+ if (pageErr instanceof _chunk34RIECIFcjs.KordocError) throw pageErr;
3272
3273
  warnings.push({ page: i, message: `\uD398\uC774\uC9C0 ${i} \uD30C\uC2F1 \uC2E4\uD328: ${pageErr instanceof Error ? pageErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
3273
3274
  } finally {
3274
3275
  _optionalChain([loadedPage, 'optionalAccess', _323 => _323.cleanup, 'call', _324 => _324()]);
@@ -3298,11 +3299,11 @@ async function parsePdfDocument(buffer, options) {
3298
3299
  }
3299
3300
  if (targets.size > 0) {
3300
3301
  try {
3301
- const { runPdfOcr } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pdf-ocr-HR6CXGTX.cjs")));
3302
+ const { runPdfOcr } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pdf-ocr-K2OK7FNQ.cjs")));
3302
3303
  const mode = typeof _optionalChain([options, 'optionalAccess', _329 => _329.ocr]) === "function" ? options.ocr : "builtin";
3303
3304
  const regionPages = new Map([...ocrRegions].filter(([p]) => _optionalChain([options, 'optionalAccess', _330 => _330.ocr]) !== "force" && !isImageBased && !_optionalChain([pageQuality, 'access', _331 => _331.find, 'call', _332 => _332((q) => q.page === p), 'optionalAccess', _333 => _333.needsOcr])));
3304
3305
  const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, _optionalChain([options, 'optionalAccess', _334 => _334.onProgress]), _optionalChain([options, 'optionalAccess', _335 => _335.tables]) !== false, vectorPageOps, regionPages);
3305
- for (const obs of ocrPageBlocks.values()) _chunk6FW3AZWNcjs.stripScriptTags.call(void 0, { blocks: obs });
3306
+ for (const obs of ocrPageBlocks.values()) _chunkLNU54ZKVcjs.stripScriptTags.call(void 0, { blocks: obs });
3306
3307
  if (ocrPageBlocks.size > 0) {
3307
3308
  const replacePages = /* @__PURE__ */ new Set();
3308
3309
  for (const [p, obs] of ocrPageBlocks) {
@@ -3366,11 +3367,11 @@ async function parsePdfDocument(buffer, options) {
3366
3367
  }
3367
3368
  }
3368
3369
  if (_optionalChain([options, 'optionalAccess', _343 => _343.removeHeaderFooter]) !== false && (parsedPageCount >= 3 || headerContext.length)) {
3369
- const removed = _chunk3FGHQWJPcjs.removeHeaderFooterBlocks.call(void 0, blocks, pageHeights, warnings, noteMarks, false, headerContext);
3370
+ const removed = _chunkYV4PWWRWcjs.removeHeaderFooterBlocks.call(void 0, blocks, pageHeights, warnings, noteMarks, false, headerContext);
3370
3371
  for (let ri = removed.length - 1; ri >= 0; ri--) {
3371
3372
  blocks.splice(removed[ri], 1);
3372
3373
  }
3373
- const kept = _chunk3FGHQWJPcjs.removeSideTabs.call(void 0, blocks, pageWidths);
3374
+ const kept = _chunkYV4PWWRWcjs.removeSideTabs.call(void 0, blocks, pageWidths);
3374
3375
  if (kept !== blocks) {
3375
3376
  blocks.length = 0;
3376
3377
  blocks.push(...kept);
@@ -3379,12 +3380,12 @@ async function parsePdfDocument(buffer, options) {
3379
3380
  mergeContinuedCells(blocks, pageHeights);
3380
3381
  mergeCrossPageTables(blocks, pageHeights, wrapLexicon);
3381
3382
  if (_optionalChain([options, 'optionalAccess', _344 => _344.removeHeaderFooter]) !== false && parsedPageCount >= 3) {
3382
- const boxes = _chunk3FGHQWJPcjs.removeHeaderFooterBlocks.call(void 0, blocks, pageHeights, warnings, noteMarks, true);
3383
+ const boxes = _chunkYV4PWWRWcjs.removeHeaderFooterBlocks.call(void 0, blocks, pageHeights, warnings, noteMarks, true);
3383
3384
  for (let ri = boxes.length - 1; ri >= 0; ri--) blocks.splice(boxes[ri], 1);
3384
3385
  }
3385
3386
  splitContactTables(blocks);
3386
- if (!_optionalChain([options, 'optionalAccess', _345 => _345.keepTrailingEmptyCols])) _chunk3FGHQWJPcjs.trimTrailingEmptyTableCols.call(void 0, blocks);
3387
- _chunk3FGHQWJPcjs.joinPageBreakWraps.call(void 0, blocks, wrapLexicon);
3387
+ if (!_optionalChain([options, 'optionalAccess', _345 => _345.keepTrailingEmptyCols])) _chunkYV4PWWRWcjs.trimTrailingEmptyTableCols.call(void 0, blocks);
3388
+ _chunkYV4PWWRWcjs.joinPageBreakWraps.call(void 0, blocks, wrapLexicon);
3388
3389
  injectPageImageBlocks(blocks, pageImageBlocks);
3389
3390
  if (_optionalChain([options, 'optionalAccess', _346 => _346.formulaOcr]) && formulaBuffer) {
3390
3391
  try {
@@ -3396,21 +3397,21 @@ async function parsePdfDocument(buffer, options) {
3396
3397
  });
3397
3398
  }
3398
3399
  }
3399
- const medianFontSize = _chunk3FGHQWJPcjs.computeMedianFontSizeFromFreq.call(void 0, fontSizeFreq);
3400
+ const medianFontSize = _chunkYV4PWWRWcjs.computeMedianFontSizeFromFreq.call(void 0, fontSizeFreq);
3400
3401
  if (medianFontSize > 0) {
3401
- _chunk3FGHQWJPcjs.detectHeadings.call(void 0, blocks, medianFontSize);
3402
- }
3403
- _chunk3FGHQWJPcjs.detectDocumentStyleHeadings.call(void 0, blocks);
3404
- _chunk3FGHQWJPcjs.detectTypographyHeadings.call(void 0, blocks);
3405
- _chunk3FGHQWJPcjs.detectSiblingStyleHeadings.call(void 0, blocks);
3406
- _chunk3FGHQWJPcjs.detectRepeatedPageLabels.call(void 0, blocks);
3407
- _chunk3FGHQWJPcjs.detectPageLeadHeadings.call(void 0, blocks);
3408
- _chunk3FGHQWJPcjs.mergeStackedHeadingLines.call(void 0, blocks, medianFontSize);
3409
- _chunk3FGHQWJPcjs.refineDocumentStyleHeadings.call(void 0, blocks);
3410
- _chunk3FGHQWJPcjs.detectMarkerHeadings.call(void 0, blocks);
3402
+ _chunkYV4PWWRWcjs.detectHeadings.call(void 0, blocks, medianFontSize);
3403
+ }
3404
+ _chunkYV4PWWRWcjs.detectDocumentStyleHeadings.call(void 0, blocks);
3405
+ _chunkYV4PWWRWcjs.detectTypographyHeadings.call(void 0, blocks);
3406
+ _chunkYV4PWWRWcjs.detectSiblingStyleHeadings.call(void 0, blocks);
3407
+ _chunkYV4PWWRWcjs.detectRepeatedPageLabels.call(void 0, blocks);
3408
+ _chunkYV4PWWRWcjs.detectPageLeadHeadings.call(void 0, blocks);
3409
+ _chunkYV4PWWRWcjs.mergeStackedHeadingLines.call(void 0, blocks, medianFontSize);
3410
+ _chunkYV4PWWRWcjs.refineDocumentStyleHeadings.call(void 0, blocks);
3411
+ _chunkYV4PWWRWcjs.detectMarkerHeadings.call(void 0, blocks);
3411
3412
  demoteNonHeadingRoles(blocks, pageHeights, faceNames);
3412
- _chunk3FGHQWJPcjs.detectTableCaptions.call(void 0, blocks);
3413
- _chunk3FGHQWJPcjs.detectKoreanListBlocks.call(void 0, blocks);
3413
+ _chunkYV4PWWRWcjs.detectTableCaptions.call(void 0, blocks);
3414
+ _chunkYV4PWWRWcjs.detectKoreanListBlocks.call(void 0, blocks);
3414
3415
  const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
3415
3416
  sanitizeBlockControlChars(blocks);
3416
3417
  let outBlocks = splitSingleCellTables(blocks);
@@ -3432,17 +3433,17 @@ async function parsePdfDocument(buffer, options) {
3432
3433
  const shown = /* @__PURE__ */ new Map();
3433
3434
  const markContent = (bs) => {
3434
3435
  for (const b of _nullishCoalesce(bs, () => ( []))) if (b.table) for (const row of b.table.cells) for (const c of row) {
3435
- if (_chunk3FGHQWJPcjs.IMAGE_CELLS.has(c)) _chunk6FW3AZWNcjs.CONTENT_CELLS.add(c);
3436
+ if (_chunkYV4PWWRWcjs.IMAGE_CELLS.has(c)) _chunkLNU54ZKVcjs.CONTENT_CELLS.add(c);
3436
3437
  markContent(c.blocks);
3437
3438
  }
3438
3439
  };
3439
3440
  const visual = (bs) => bs.flatMap((b) => {
3440
3441
  if (b.type !== "table") return [b];
3441
- if (!hancom && b.table && _chunk3FGHQWJPcjs.CLIP_TABLES.has(b.table)) return [b];
3442
+ if (!hancom && b.table && _chunkYV4PWWRWcjs.CLIP_TABLES.has(b.table)) return [b];
3442
3443
  let v = shown.get(b);
3443
3444
  if (!v) {
3444
3445
  markContent([b]);
3445
- shown.set(b, v = _chunk6FW3AZWNcjs.unframeLayoutTables.call(void 0, [b], !!_optionalChain([options, 'optionalAccess', _350 => _350.keepTrailingEmptyCols])));
3446
+ shown.set(b, v = _chunkLNU54ZKVcjs.unframeLayoutTables.call(void 0, [b], !!_optionalChain([options, 'optionalAccess', _350 => _350.keepTrailingEmptyCols])));
3446
3447
  }
3447
3448
  return v;
3448
3449
  });
@@ -3451,11 +3452,12 @@ async function parsePdfDocument(buffer, options) {
3451
3452
  blocks.length = 0;
3452
3453
  for (const b of kept) blocks.push(b);
3453
3454
  }
3454
- const finishMarkdown = (bs) => mergeLinkRuns(cleanPdfText(_chunk6FW3AZWNcjs.blocksToMarkdown.call(void 0, bs), { keepLoneNumbers: true }));
3455
+ const finishMarkdown = (bs) => mergeLinkRuns(cleanPdfText(_chunkLNU54ZKVcjs.blocksToMarkdown.call(void 0, bs, { tableFormat: _optionalChain([options, 'optionalAccess', _351 => _351.tableFormat]) }), { keepLoneNumbers: true }));
3456
+ if (_optionalChain([options, 'optionalAccess', _352 => _352.tableFormat]) === "gfm") _chunkLNU54ZKVcjs.assignTableIds.call(void 0, blocks);
3455
3457
  let markdown = finishMarkdown(outBlocks);
3456
3458
  return {
3457
3459
  markdown,
3458
- pages: _chunkRQEDNI4Pcjs.blocksToPages.call(void 0, _chunk3FGHQWJPcjs.splitPageBreakWraps.call(void 0, outBlocks), finishMarkdown),
3460
+ pages: _chunkLLVF6X5Wcjs.blocksToPages.call(void 0, _chunkYV4PWWRWcjs.splitPageBreakWraps.call(void 0, outBlocks), finishMarkdown),
3459
3461
  blocks,
3460
3462
  metadata,
3461
3463
  outline: outline.length > 0 ? outline : void 0,
@@ -3473,7 +3475,7 @@ async function parsePdfDocument(buffer, options) {
3473
3475
  async function extractPdfMetadata(doc, metadata) {
3474
3476
  try {
3475
3477
  const result = await doc.getMetadata();
3476
- if (!_optionalChain([result, 'optionalAccess', _351 => _351.info])) return;
3478
+ if (!_optionalChain([result, 'optionalAccess', _353 => _353.info])) return;
3477
3479
  const info = result.info;
3478
3480
  if (typeof info.Title === "string" && info.Title.trim()) metadata.title = info.Title.trim();
3479
3481
  if (typeof info.Author === "string" && info.Author.trim()) metadata.author = info.Author.trim();
@@ -3489,8 +3491,8 @@ async function extractPdfMetadata(doc, metadata) {
3489
3491
  }
3490
3492
  async function isHancomPdf(doc) {
3491
3493
  try {
3492
- const info = await _asyncOptionalChain([(await doc.getMetadata()), 'optionalAccess', async _352 => _352.info]);
3493
- return [_optionalChain([info, 'optionalAccess', _353 => _353.Producer]), _optionalChain([info, 'optionalAccess', _354 => _354.Creator])].some((v) => typeof v === "string" && /^\s*(?:hancom\b|hwp\b)/i.test(v));
3494
+ const info = await _asyncOptionalChain([(await doc.getMetadata()), 'optionalAccess', async _354 => _354.info]);
3495
+ return [_optionalChain([info, 'optionalAccess', _355 => _355.Producer]), _optionalChain([info, 'optionalAccess', _356 => _356.Creator])].some((v) => typeof v === "string" && /^\s*(?:hancom\b|hwp\b)/i.test(v));
3494
3496
  } catch (e9) {
3495
3497
  return false;
3496
3498
  }
@@ -3534,5 +3536,5 @@ function marginStamp(items) {
3534
3536
 
3535
3537
 
3536
3538
 
3537
- exports.PDFJS_DOCUMENT_OPTIONS = PDFJS_DOCUMENT_OPTIONS; exports.cleanPdfText = cleanPdfText; exports.detectKoreanListBlocks = _chunk3FGHQWJPcjs.detectKoreanListBlocks; exports.detectTableCaptions = _chunk3FGHQWJPcjs.detectTableCaptions; exports.extractPdfMetadataOnly = extractPdfMetadataOnly; exports.mergeCrossPageTables = mergeCrossPageTables; exports.ocrImageRegions = ocrImageRegions; exports.parsePdfDocument = parsePdfDocument; exports.removeHeaderFooterBlocks = _chunk3FGHQWJPcjs.removeHeaderFooterBlocks;
3538
- //# sourceMappingURL=parser-HWAOPQYK.cjs.map
3539
+ exports.PDFJS_DOCUMENT_OPTIONS = PDFJS_DOCUMENT_OPTIONS; exports.cleanPdfText = cleanPdfText; exports.detectKoreanListBlocks = _chunkYV4PWWRWcjs.detectKoreanListBlocks; exports.detectTableCaptions = _chunkYV4PWWRWcjs.detectTableCaptions; exports.extractPdfMetadataOnly = extractPdfMetadataOnly; exports.mergeCrossPageTables = mergeCrossPageTables; exports.ocrImageRegions = ocrImageRegions; exports.parsePdfDocument = parsePdfDocument; exports.removeHeaderFooterBlocks = _chunkYV4PWWRWcjs.removeHeaderFooterBlocks;
3540
+ //# sourceMappingURL=parser-DMWCXX7A.cjs.map