kordoc 4.22.3 → 4.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +7 -6
  2. package/dist/{-AOWV7MNY.js → -HAK3YFWW.js} +11 -11
  3. package/dist/{chunk-M2X766AY.js → chunk-36DK6AOX.js} +2 -2
  4. package/dist/{chunk-3H2IEU4V.js → chunk-3TUJ34V7.js} +2 -2
  5. package/dist/{chunk-NLGOMLGU.cjs → chunk-4X7AR4EH.cjs} +34 -28
  6. package/dist/chunk-4X7AR4EH.cjs.map +1 -0
  7. package/dist/{chunk-DKJ2RNDG.js → chunk-5ARHF54C.js} +2 -2
  8. package/dist/{chunk-6LIBF2ZB.js → chunk-A3SKXHAN.js} +2 -2
  9. package/dist/{chunk-4NQ4EZEE.js → chunk-AYV5VRHL.js} +2 -2
  10. package/dist/{chunk-SKRWKVVW.js → chunk-C5J5LDWM.js} +14 -8
  11. package/dist/{chunk-SKRWKVVW.js.map → chunk-C5J5LDWM.js.map} +1 -1
  12. package/dist/{chunk-FDFXL7VJ.js → chunk-CWBH66IQ.js} +3 -3
  13. package/dist/{chunk-MEIQ476H.js → chunk-DEFT7Z3B.js} +2 -2
  14. package/dist/{chunk-YOGMCRM7.js → chunk-EVL6HZQL.js} +80 -69
  15. package/dist/chunk-EVL6HZQL.js.map +1 -0
  16. package/dist/{chunk-O3OS6FAW.cjs → chunk-EYQLJ57Y.cjs} +3 -3
  17. package/dist/{chunk-O3OS6FAW.cjs.map → chunk-EYQLJ57Y.cjs.map} +1 -1
  18. package/dist/{chunk-3ANXRVI2.js → chunk-F3AWNFMO.js} +3 -3
  19. package/dist/{chunk-AXX5AQT4.js → chunk-FAFSBCU2.js} +4 -4
  20. package/dist/{chunk-KBGNPGVY.js → chunk-G2325K2F.js} +2 -2
  21. package/dist/{chunk-7XITVUAK.js → chunk-G4KNI7EO.js} +11 -11
  22. package/dist/{chunk-OIF5HRVP.js → chunk-HN3QMHTT.js} +15 -9
  23. package/dist/{chunk-OIF5HRVP.js.map → chunk-HN3QMHTT.js.map} +1 -1
  24. package/dist/{chunk-SJ5OZXEL.cjs → chunk-K2NWHLCD.cjs} +6 -6
  25. package/dist/{chunk-SJ5OZXEL.cjs.map → chunk-K2NWHLCD.cjs.map} +1 -1
  26. package/dist/{chunk-24YLYR6Q.js → chunk-LVVSMYG4.js} +4 -4
  27. package/dist/{chunk-MI655NV5.cjs → chunk-MJSHXESK.cjs} +2 -2
  28. package/dist/{chunk-MI655NV5.cjs.map → chunk-MJSHXESK.cjs.map} +1 -1
  29. package/dist/{chunk-VJCQOSMT.js → chunk-MYTMZSQO.js} +2 -2
  30. package/dist/{chunk-X45Q7EAC.js → chunk-Q65HT2BL.js} +2 -2
  31. package/dist/{chunk-BS2XWGT5.js → chunk-Q6SVCBMK.js} +2 -2
  32. package/dist/{chunk-6QBBGZST.js → chunk-RPSILMQY.js} +2 -2
  33. package/dist/{chunk-NJEMRAIF.cjs → chunk-S45M7IQH.cjs} +24 -24
  34. package/dist/{chunk-NJEMRAIF.cjs.map → chunk-S45M7IQH.cjs.map} +1 -1
  35. package/dist/{chunk-O5E25RHU.js → chunk-SSL3TKJY.js} +2 -2
  36. package/dist/{chunk-J5PYESLX.js → chunk-UJVVL6BI.js} +2 -2
  37. package/dist/{chunk-2BCQVQO2.cjs → chunk-VXQWAPC6.cjs} +3 -3
  38. package/dist/{chunk-2BCQVQO2.cjs.map → chunk-VXQWAPC6.cjs.map} +1 -1
  39. package/dist/{chunk-UCLDUUBX.js → chunk-WCTC3LSV.js} +2 -2
  40. package/dist/{chunk-IRNWAHHZ.js → chunk-WNW77CAY.js} +2 -2
  41. package/dist/chunks-3N7OFSA4.js +10 -0
  42. package/dist/cli.js +30 -30
  43. package/dist/{formula-5V2WG4BH.cjs → formula-JGFYGFYX.cjs} +9 -9
  44. package/dist/{formula-5V2WG4BH.cjs.map → formula-JGFYGFYX.cjs.map} +1 -1
  45. package/dist/{formula-C26FMMGO.js → formula-KSTY73DQ.js} +3 -3
  46. package/dist/{formula-W4OL33YQ.js → formula-PWAUR5PF.js} +4 -4
  47. package/dist/{image-ocr-T72HMX2W.js → image-ocr-RASJHOAK.js} +6 -6
  48. package/dist/{image-ocr-NSQ34Y6T.js → image-ocr-RPBPO3VT.js} +9 -9
  49. package/dist/{image-ocr-BELHEWPX.cjs → image-ocr-UULNAC5Y.cjs} +17 -17
  50. package/dist/{image-ocr-BELHEWPX.cjs.map → image-ocr-UULNAC5Y.cjs.map} +1 -1
  51. package/dist/index.cjs +489 -478
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.js +80 -69
  54. package/dist/index.js.map +1 -1
  55. package/dist/mcp.js +22 -22
  56. package/dist/{model-bundle-34T2LJB4.js → model-bundle-ZPQ4IFT7.js} +5 -5
  57. package/dist/{models-TQH5EM6V.js → models-YJQ5VHOR.js} +5 -5
  58. package/dist/{parse-worker-v2-YEYLILGJ.js → parse-worker-v2-7PNZYASF.js} +12 -12
  59. package/dist/{parser-E6BG3ECD.js → parser-DR6ZHYEB.js} +59 -10
  60. package/dist/parser-DR6ZHYEB.js.map +1 -0
  61. package/dist/{parser-SJHCBL7T.js → parser-ER3VLB37.js} +62 -13
  62. package/dist/parser-ER3VLB37.js.map +1 -0
  63. package/dist/{parser-OAXCXVQ4.cjs → parser-ZFXVZZKQ.cjs} +323 -274
  64. package/dist/parser-ZFXVZZKQ.cjs.map +1 -0
  65. package/dist/{pdf-ocr-LGPSJM22.js → pdf-ocr-BYT7XVID.js} +6 -6
  66. package/dist/{pdf-ocr-T5ASSUKK.js → pdf-ocr-DRQN5BXA.js} +9 -9
  67. package/dist/pdf-ocr-QWTGWYQT.cjs +31 -0
  68. package/dist/{pdf-ocr-RKXDY3ZA.cjs.map → pdf-ocr-QWTGWYQT.cjs.map} +1 -1
  69. package/dist/{profile-io-KMCAFTMG.js → profile-io-3QYTSPNH.js} +3 -3
  70. package/dist/{rasterize-M52AKY7R.js → rasterize-LPLWCBXV.js} +3 -3
  71. package/dist/{redact-doc-SWJC27LL.js → redact-doc-HDA6ZG3N.js} +11 -11
  72. package/dist/{render-45AB5YZR.js → render-MYZGD3SB.js} +7 -7
  73. package/dist/seal-XA5V6A6V.js +10 -0
  74. package/dist/{setup-5PBMUI6M.js → setup-EF5TQVAI.js} +3 -3
  75. package/dist/visual-DB7NJOID.js +21 -0
  76. package/dist/{watch-QOGKV52T.js → watch-PM5PRSFW.js} +12 -12
  77. package/package.json +1 -1
  78. package/dist/chunk-NLGOMLGU.cjs.map +0 -1
  79. package/dist/chunk-YOGMCRM7.js.map +0 -1
  80. package/dist/chunks-7KXTS7IV.js +0 -10
  81. package/dist/parser-E6BG3ECD.js.map +0 -1
  82. package/dist/parser-OAXCXVQ4.cjs.map +0 -1
  83. package/dist/parser-SJHCBL7T.js.map +0 -1
  84. package/dist/pdf-ocr-RKXDY3ZA.cjs +0 -31
  85. package/dist/seal-7KWG6VHS.js +0 -10
  86. package/dist/visual-OMJNXLNZ.js +0 -21
  87. /package/dist/{-AOWV7MNY.js.map → -HAK3YFWW.js.map} +0 -0
  88. /package/dist/{chunk-M2X766AY.js.map → chunk-36DK6AOX.js.map} +0 -0
  89. /package/dist/{chunk-3H2IEU4V.js.map → chunk-3TUJ34V7.js.map} +0 -0
  90. /package/dist/{chunk-DKJ2RNDG.js.map → chunk-5ARHF54C.js.map} +0 -0
  91. /package/dist/{chunk-6LIBF2ZB.js.map → chunk-A3SKXHAN.js.map} +0 -0
  92. /package/dist/{chunk-4NQ4EZEE.js.map → chunk-AYV5VRHL.js.map} +0 -0
  93. /package/dist/{chunk-FDFXL7VJ.js.map → chunk-CWBH66IQ.js.map} +0 -0
  94. /package/dist/{chunk-MEIQ476H.js.map → chunk-DEFT7Z3B.js.map} +0 -0
  95. /package/dist/{chunk-3ANXRVI2.js.map → chunk-F3AWNFMO.js.map} +0 -0
  96. /package/dist/{chunk-AXX5AQT4.js.map → chunk-FAFSBCU2.js.map} +0 -0
  97. /package/dist/{chunk-KBGNPGVY.js.map → chunk-G2325K2F.js.map} +0 -0
  98. /package/dist/{chunk-7XITVUAK.js.map → chunk-G4KNI7EO.js.map} +0 -0
  99. /package/dist/{chunk-24YLYR6Q.js.map → chunk-LVVSMYG4.js.map} +0 -0
  100. /package/dist/{chunk-VJCQOSMT.js.map → chunk-MYTMZSQO.js.map} +0 -0
  101. /package/dist/{chunk-X45Q7EAC.js.map → chunk-Q65HT2BL.js.map} +0 -0
  102. /package/dist/{chunk-BS2XWGT5.js.map → chunk-Q6SVCBMK.js.map} +0 -0
  103. /package/dist/{chunk-6QBBGZST.js.map → chunk-RPSILMQY.js.map} +0 -0
  104. /package/dist/{chunk-O5E25RHU.js.map → chunk-SSL3TKJY.js.map} +0 -0
  105. /package/dist/{chunk-J5PYESLX.js.map → chunk-UJVVL6BI.js.map} +0 -0
  106. /package/dist/{chunk-UCLDUUBX.js.map → chunk-WCTC3LSV.js.map} +0 -0
  107. /package/dist/{chunk-IRNWAHHZ.js.map → chunk-WNW77CAY.js.map} +0 -0
  108. /package/dist/{chunks-7KXTS7IV.js.map → chunks-3N7OFSA4.js.map} +0 -0
  109. /package/dist/{formula-C26FMMGO.js.map → formula-KSTY73DQ.js.map} +0 -0
  110. /package/dist/{formula-W4OL33YQ.js.map → formula-PWAUR5PF.js.map} +0 -0
  111. /package/dist/{image-ocr-T72HMX2W.js.map → image-ocr-RASJHOAK.js.map} +0 -0
  112. /package/dist/{image-ocr-NSQ34Y6T.js.map → image-ocr-RPBPO3VT.js.map} +0 -0
  113. /package/dist/{model-bundle-34T2LJB4.js.map → model-bundle-ZPQ4IFT7.js.map} +0 -0
  114. /package/dist/{models-TQH5EM6V.js.map → models-YJQ5VHOR.js.map} +0 -0
  115. /package/dist/{parse-worker-v2-YEYLILGJ.js.map → parse-worker-v2-7PNZYASF.js.map} +0 -0
  116. /package/dist/{pdf-ocr-LGPSJM22.js.map → pdf-ocr-BYT7XVID.js.map} +0 -0
  117. /package/dist/{pdf-ocr-T5ASSUKK.js.map → pdf-ocr-DRQN5BXA.js.map} +0 -0
  118. /package/dist/{profile-io-KMCAFTMG.js.map → profile-io-3QYTSPNH.js.map} +0 -0
  119. /package/dist/{rasterize-M52AKY7R.js.map → rasterize-LPLWCBXV.js.map} +0 -0
  120. /package/dist/{redact-doc-SWJC27LL.js.map → redact-doc-HDA6ZG3N.js.map} +0 -0
  121. /package/dist/{render-45AB5YZR.js.map → render-MYZGD3SB.js.map} +0 -0
  122. /package/dist/{seal-7KWG6VHS.js.map → seal-XA5V6A6V.js.map} +0 -0
  123. /package/dist/{setup-5PBMUI6M.js.map → setup-EF5TQVAI.js.map} +0 -0
  124. /package/dist/{visual-OMJNXLNZ.js.map → visual-DB7NJOID.js.map} +0 -0
  125. /package/dist/{watch-QOGKV52T.js.map → watch-PM5PRSFW.js.map} +0 -0
package/dist/mcp.js CHANGED
@@ -38,33 +38,33 @@ import {
38
38
  resolveBuiltinTemplate,
39
39
  unknownFontWarnings,
40
40
  usesGaejosikMunche
41
- } from "./chunk-7XITVUAK.js";
42
- import "./chunk-6LIBF2ZB.js";
41
+ } from "./chunk-G4KNI7EO.js";
42
+ import "./chunk-A3SKXHAN.js";
43
43
  import {
44
44
  detectFormat,
45
45
  detectOle2Format,
46
46
  detectZipFormat,
47
47
  extractHwp5MetadataOnly
48
- } from "./chunk-YOGMCRM7.js";
49
- import "./chunk-6QBBGZST.js";
50
- import "./chunk-KBGNPGVY.js";
48
+ } from "./chunk-EVL6HZQL.js";
49
+ import "./chunk-RPSILMQY.js";
50
+ import "./chunk-G2325K2F.js";
51
51
  import "./chunk-VKVDMH7X.js";
52
52
  import "./chunk-VQFA55IC.js";
53
53
  import "./chunk-BHVOY6V4.js";
54
- import "./chunk-4NQ4EZEE.js";
54
+ import "./chunk-AYV5VRHL.js";
55
55
  import {
56
56
  blocksToMarkdown
57
- } from "./chunk-BS2XWGT5.js";
57
+ } from "./chunk-Q6SVCBMK.js";
58
58
  import {
59
59
  assertWithinRoot,
60
60
  getAccessRoot,
61
61
  isOfflineMode
62
- } from "./chunk-3H2IEU4V.js";
62
+ } from "./chunk-3TUJ34V7.js";
63
63
  import {
64
64
  extractFormFields,
65
65
  fillWithUniqueGuard
66
- } from "./chunk-3ANXRVI2.js";
67
- import "./chunk-UCLDUUBX.js";
66
+ } from "./chunk-F3AWNFMO.js";
67
+ import "./chunk-WCTC3LSV.js";
68
68
  import {
69
69
  KordocError,
70
70
  VERSION,
@@ -72,7 +72,7 @@ import {
72
72
  routeConsoleToStderr,
73
73
  sanitizeError,
74
74
  toArrayBuffer
75
- } from "./chunk-DKJ2RNDG.js";
75
+ } from "./chunk-5ARHF54C.js";
76
76
  import "./chunk-3WSNLH4B.js";
77
77
 
78
78
  // src/mcp.ts
@@ -371,7 +371,7 @@ ${markdown}`);
371
371
  break;
372
372
  case "pdf":
373
373
  try {
374
- const { extractPdfMetadataOnly } = await import("./parser-SJHCBL7T.js");
374
+ const { extractPdfMetadataOnly } = await import("./parser-ER3VLB37.js");
375
375
  metadata = await extractPdfMetadataOnly(buffer);
376
376
  } catch {
377
377
  metadata = void 0;
@@ -548,7 +548,7 @@ ${tableMarkdown}` }]
548
548
  if (!parsed.success) {
549
549
  return { content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}` }], isError: true };
550
550
  }
551
- const { blocksToChunks } = await import("./chunks-7KXTS7IV.js");
551
+ const { blocksToChunks } = await import("./chunks-3N7OFSA4.js");
552
552
  const chunks = blocksToChunks(parsed.blocks, { granularity, includeTableCells: include_table_cells });
553
553
  return { content: [{ type: "text", text: capResponseText(JSON.stringify(chunks, null, 2)) }] };
554
554
  } catch (err) {
@@ -818,7 +818,7 @@ ${previewMd}` }]
818
818
  }
819
819
  const image = new Uint8Array(await readFile2(imgResolved));
820
820
  const ext = extname2(imgResolved).slice(1).toLowerCase();
821
- const { placeSealHwpx } = await import("./seal-7KWG6VHS.js");
821
+ const { placeSealHwpx } = await import("./seal-XA5V6A6V.js");
822
822
  const result = await placeSealHwpx(buffer, [{
823
823
  anchor,
824
824
  occurrence,
@@ -935,7 +935,7 @@ ${previewMd}` }]
935
935
  if (outPath && await isSameFile(outPath, resolved)) {
936
936
  return { content: [{ type: "text", text: "output_path\uAC00 \uC785\uB825 \uD30C\uC77C\uACFC \uAC19\uC2B5\uB2C8\uB2E4 \u2014 \uC6D0\uBCF8\uC744 \uB36E\uC5B4\uC4F0\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uB978 \uACBD\uB85C\uB97C \uC9C0\uC815\uD558\uC138\uC694." }], isError: true };
937
937
  }
938
- const { redactDocument } = await import("./redact-doc-SWJC27LL.js");
938
+ const { redactDocument } = await import("./redact-doc-HDA6ZG3N.js");
939
939
  const r = await redactDocument(buffer, { rules, maskChar: mask_char, filePath: file_path, dryRun: dry_run });
940
940
  const MAX_LINES = 50;
941
941
  const listed = r.fileHits.length > 0 ? r.fileHits.map((h) => ` - [${h.rule}] ${h.masked} (${h.where} @ ${h.part})`) : r.markdownHits.map((h) => ` - [${h.rule}] ${h.masked}`);
@@ -1009,7 +1009,7 @@ function registerRenderTools(server2) {
1009
1009
  const { buffer, resolved } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1010
1010
  const isHwp5 = resolved.toLowerCase().endsWith(".hwp");
1011
1011
  if (!isHwp5 && !pages && (format === "png" || format === "svg")) {
1012
- const { renderHwpxToSvg } = await import("./render-45AB5YZR.js");
1012
+ const { renderHwpxToSvg } = await import("./render-MYZGD3SB.js");
1013
1013
  const result = await renderHwpxToSvg(buffer, { highlights, reflow: true, reflowMode: reflow_mode });
1014
1014
  const summary2 = [
1015
1015
  `\uB80C\uB354 \uC644\uB8CC: ${result.pageCount}\uD398\uC774\uC9C0, ${Math.round(result.width)}x${Math.round(result.height)}pt (\uD14D\uC2A4\uD2B8 ${result.stats.texts}\xB7\uC774\uBBF8\uC9C0 ${result.stats.images}\xB7\uD45C ${result.stats.tables})`,
@@ -1021,7 +1021,7 @@ function registerRenderTools(server2) {
1021
1021
  summary2.push(`\uC800\uC7A5: ${outPath}`);
1022
1022
  return { content: [{ type: "text", text: summary2.join("\n") }] };
1023
1023
  }
1024
- const { rasterizeSvg } = await import("./rasterize-M52AKY7R.js");
1024
+ const { rasterizeSvg } = await import("./rasterize-LPLWCBXV.js");
1025
1025
  const raster = await rasterizeSvg(result.svg, result.width, result.height, max_width_px ? { maxWidthPx: max_width_px } : void 0);
1026
1026
  if (outPath) {
1027
1027
  await mkdir2(dirname3(outPath), { recursive: true });
@@ -1036,7 +1036,7 @@ function registerRenderTools(server2) {
1036
1036
  ]
1037
1037
  };
1038
1038
  }
1039
- const { renderDocument } = await import("./render-45AB5YZR.js");
1039
+ const { renderDocument } = await import("./render-MYZGD3SB.js");
1040
1040
  const { scene, assets } = await renderDocument(buffer, { format, pages, highlights, reflow: true, reflowMode: reflow_mode, maxWidthPx: max_width_px });
1041
1041
  const summary = [
1042
1042
  `\uB80C\uB354 \uC644\uB8CC: \uBB38\uC11C ${scene.pages.length}\uD398\uC774\uC9C0 \uC911 ${assets.filter((a) => a.page !== void 0).length || 1}\uAC74 (\uD14D\uC2A4\uD2B8 ${scene.stats.texts}\xB7\uC774\uBBF8\uC9C0 ${scene.stats.images}\xB7\uD45C ${scene.stats.tables}\xB7\uB3C4\uD615 ${scene.stats.shapes})`,
@@ -1086,7 +1086,7 @@ function registerRenderTools(server2) {
1086
1086
  try {
1087
1087
  const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1088
1088
  const dir = safeOutputPath(join2(output_dir, "regions.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]regions\.json$/, "");
1089
- const { extractRenderedRegions } = await import("./render-45AB5YZR.js");
1089
+ const { extractRenderedRegions } = await import("./render-MYZGD3SB.js");
1090
1090
  const regions = await extractRenderedRegions(buffer, { types: target, format, pages, paddingPt: padding_pt, reflow: true });
1091
1091
  await mkdir2(dir, { recursive: true });
1092
1092
  const ext = format === "jpeg" ? "jpg" : "png";
@@ -1122,7 +1122,7 @@ function registerRenderTools(server2) {
1122
1122
  }
1123
1123
  const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1124
1124
  const dir = output_dir ? safeOutputPath(join2(output_dir, "tables.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]tables\.json$/, "") : void 0;
1125
- const { extractTables } = await import("./visual-OMJNXLNZ.js");
1125
+ const { extractTables } = await import("./visual-DB7NJOID.js");
1126
1126
  const tables = await extractTables(buffer, { policy: visual, format, paddingPt: padding_pt });
1127
1127
  if (dir) await mkdir2(dir, { recursive: true });
1128
1128
  const ext = format === "jpeg" ? "jpg" : "png";
@@ -1179,7 +1179,7 @@ function registerGenerateTools(server2) {
1179
1179
  try {
1180
1180
  const out = safeOutputPath(output_path, PROFILE_EXTENSIONS);
1181
1181
  const { buffer } = await readValidatedFile(hwpx_path);
1182
- const { hwpxToProfile } = await import("./-AOWV7MNY.js");
1182
+ const { hwpxToProfile } = await import("./-HAK3YFWW.js");
1183
1183
  const profile = await hwpxToProfile(buffer);
1184
1184
  await mkdir3(dirname4(out), { recursive: true });
1185
1185
  await writeOutputFile(out, JSON.stringify(profile, null, 2));
@@ -1292,7 +1292,7 @@ function registerGenerateTools(server2) {
1292
1292
  }
1293
1293
  let profile;
1294
1294
  if (profile_path) {
1295
- const { parseFormatProfileJson } = await import("./profile-io-KMCAFTMG.js");
1295
+ const { parseFormatProfileJson } = await import("./profile-io-3QYTSPNH.js");
1296
1296
  profile = parseFormatProfileJson(await readFile3(safePath(profile_path, PROFILE_EXTENSIONS), "utf-8"));
1297
1297
  }
1298
1298
  const out = safeOutputPath(output_path, /* @__PURE__ */ new Set([".hwpx"]));
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ALL_OCR_MODELS
4
- } from "./chunk-VJCQOSMT.js";
4
+ } from "./chunk-MYTMZSQO.js";
5
5
  import {
6
6
  ALL_FORMULA_MODELS,
7
7
  getModelStatusIn,
8
8
  getModelsDir
9
- } from "./chunk-M2X766AY.js";
10
- import "./chunk-3H2IEU4V.js";
11
- import "./chunk-DKJ2RNDG.js";
9
+ } from "./chunk-36DK6AOX.js";
10
+ import "./chunk-3TUJ34V7.js";
11
+ import "./chunk-5ARHF54C.js";
12
12
 
13
13
  // src/shared/model-bundle.ts
14
14
  import { copyFile, mkdir } from "fs/promises";
@@ -101,4 +101,4 @@ export {
101
101
  importModels,
102
102
  modelCacheStatus
103
103
  };
104
- //# sourceMappingURL=model-bundle-34T2LJB4.js.map
104
+ //# sourceMappingURL=model-bundle-ZPQ4IFT7.js.map
@@ -16,10 +16,10 @@ import {
16
16
  ocrSourcePath,
17
17
  parseCharacterDict,
18
18
  resolveOcrModels
19
- } from "./chunk-VJCQOSMT.js";
20
- import "./chunk-M2X766AY.js";
21
- import "./chunk-3H2IEU4V.js";
22
- import "./chunk-DKJ2RNDG.js";
19
+ } from "./chunk-MYTMZSQO.js";
20
+ import "./chunk-36DK6AOX.js";
21
+ import "./chunk-3TUJ34V7.js";
22
+ import "./chunk-5ARHF54C.js";
23
23
  export {
24
24
  ALL_OCR_MODELS,
25
25
  DEFAULT_OCR_MODELS,
@@ -38,4 +38,4 @@ export {
38
38
  parseCharacterDict,
39
39
  resolveOcrModels
40
40
  };
41
- //# sourceMappingURL=models-TQH5EM6V.js.map
41
+ //# sourceMappingURL=models-YJQ5VHOR.js.map
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  parseWorkerFile
4
- } from "./chunk-FDFXL7VJ.js";
5
- import "./chunk-7XITVUAK.js";
6
- import "./chunk-6LIBF2ZB.js";
7
- import "./chunk-YOGMCRM7.js";
8
- import "./chunk-6QBBGZST.js";
9
- import "./chunk-KBGNPGVY.js";
4
+ } from "./chunk-CWBH66IQ.js";
5
+ import "./chunk-G4KNI7EO.js";
6
+ import "./chunk-A3SKXHAN.js";
7
+ import "./chunk-EVL6HZQL.js";
8
+ import "./chunk-RPSILMQY.js";
9
+ import "./chunk-G2325K2F.js";
10
10
  import "./chunk-VKVDMH7X.js";
11
11
  import "./chunk-VQFA55IC.js";
12
12
  import {
13
13
  validateOcrOptions
14
14
  } from "./chunk-BHVOY6V4.js";
15
- import "./chunk-4NQ4EZEE.js";
16
- import "./chunk-BS2XWGT5.js";
17
- import "./chunk-3ANXRVI2.js";
18
- import "./chunk-UCLDUUBX.js";
15
+ import "./chunk-AYV5VRHL.js";
16
+ import "./chunk-Q6SVCBMK.js";
17
+ import "./chunk-F3AWNFMO.js";
18
+ import "./chunk-WCTC3LSV.js";
19
19
  import {
20
20
  VERSION,
21
21
  sanitizeError
22
- } from "./chunk-DKJ2RNDG.js";
22
+ } from "./chunk-5ARHF54C.js";
23
23
  import "./chunk-3WSNLH4B.js";
24
24
 
25
25
  // src/cli/parse-worker-v2.ts
@@ -311,4 +311,4 @@ export {
311
311
  runParseWorkerV2,
312
312
  toParseOptions
313
313
  };
314
- //# sourceMappingURL=parse-worker-v2-YEYLILGJ.js.map
314
+ //# sourceMappingURL=parse-worker-v2-7PNZYASF.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  blocksToPages,
3
3
  encodePng
4
- } from "./chunk-IRNWAHHZ.js";
4
+ } from "./chunk-WNW77CAY.js";
5
5
  import {
6
6
  hasRequestedPagesAfter,
7
7
  parsePageRange
@@ -61,7 +61,7 @@ import {
61
61
  stripAbsorbedRunningLines,
62
62
  trimTrailingEmptyTableCols,
63
63
  wrapJoiner
64
- } from "./chunk-OIF5HRVP.js";
64
+ } from "./chunk-HN3QMHTT.js";
65
65
  import {
66
66
  CELL_BASELINES,
67
67
  CELL_EDGES,
@@ -75,12 +75,12 @@ import {
75
75
  stripScriptTags,
76
76
  unframeLayoutTables,
77
77
  validateOcrOptions
78
- } from "./chunk-J5PYESLX.js";
79
- import "./chunk-O5E25RHU.js";
78
+ } from "./chunk-UJVVL6BI.js";
79
+ import "./chunk-SSL3TKJY.js";
80
80
  import {
81
81
  KordocError,
82
82
  sanitizeHref
83
- } from "./chunk-X45Q7EAC.js";
83
+ } from "./chunk-Q65HT2BL.js";
84
84
 
85
85
  // src/pdf/image-extract.ts
86
86
  import { createHash } from "crypto";
@@ -611,6 +611,55 @@ function ocrVectorOps(opList, paths) {
611
611
  // src/pdf/split-row-pattern.ts
612
612
  var textOf = (cell) => cell.text.replace(/<\/?u>|~~/g, "").trim();
613
613
  var plain = (cell) => !cell.blocks?.length && !IMAGE_CELLS.has(cell);
614
+ var labelsOf = (cell) => {
615
+ const labels = textOf(cell).split("\n").map((s) => s.trim()).filter(Boolean);
616
+ return labels.length && labels.every((s) => /^\p{L}[\p{L}\p{N} ]{0,15}[::]$/u.test(s)) ? labels.map((s) => s.replace(/\s+/g, "").replace(/:/g, ":")) : void 0;
617
+ };
618
+ var alignedLabels = (label, value, count) => {
619
+ const L = CELL_LINES.get(label), V = CELL_LINES.get(value);
620
+ let next = 0;
621
+ return !!L && !!V && L.length === count && V.length >= count && Math.abs(L[0].y - V[0].y) <= 1 && L.every((l) => {
622
+ while (next < V.length && Math.abs(l.y - V[next].y) > 1) next++;
623
+ return next++ < V.length;
624
+ });
625
+ };
626
+ function matchesCompleteAlignedLabelListRow(table, owner, first) {
627
+ const pairs = [];
628
+ let carried = false;
629
+ for (let c = 0; c < table.cols; ) {
630
+ const u = owner[first - 1]?.[c], d = owner[first]?.[c];
631
+ if (u && u === d) {
632
+ carried = true;
633
+ c = u.c + u.cs;
634
+ continue;
635
+ }
636
+ const upper = u ? table.cells[u.r][u.c] : void 0, lower = d ? table.cells[d.r][d.c] : void 0;
637
+ if (!upper?.text.trim() && !lower?.text.trim()) {
638
+ c++;
639
+ continue;
640
+ }
641
+ if (!u || !d || !upper || !lower || u.r !== first - 1 || d.r !== first || u.c !== c || d.c !== c || u.rs !== 1 || d.rs !== 1 || u.cs !== d.cs || !plain(upper) || !plain(lower)) return false;
642
+ pairs.push({ c, cs: u.cs, upper, lower });
643
+ c += u.cs;
644
+ }
645
+ const filled = pairs.filter((p) => textOf(p.upper) && textOf(p.lower));
646
+ if (!carried || filled.length !== 2) return false;
647
+ const keyed = filled.filter((p) => labelsOf(p.upper) && labelsOf(p.lower));
648
+ if (keyed.length !== 1) return false;
649
+ const label = keyed[0], value = filled.find((p) => p !== label);
650
+ const U = labelsOf(label.upper), D = labelsOf(label.lower), sequence = [...U, ...D];
651
+ if (D.length < 2 || sequence.length < 3 || new Set(sequence).size !== sequence.length || value.c !== label.c + label.cs || pairs.some((p) => p !== label && p !== value && textOf(p.lower)) || !pairs.some((p) => p.c < label.c && textOf(p.upper) && !textOf(p.lower)) || !alignedLabels(label.upper, value.upper, U.length) || !alignedLabels(label.lower, value.lower, D.length)) return false;
652
+ let peers = 0;
653
+ for (let r = 0; r < table.rows; r++) {
654
+ if (r === first - 1 || r === first) continue;
655
+ const L = owner[r]?.[label.c], V = owner[r]?.[value.c];
656
+ if (L?.r !== r || V?.r !== r || L.c !== label.c || V.c !== value.c || L.rs !== 1 || V.rs !== 1 || L.cs !== label.cs || V.cs !== value.cs) continue;
657
+ const l = table.cells[r][label.c], v = table.cells[r][value.c];
658
+ if (!plain(l) || !plain(v) || !textOf(v) || labelsOf(l)?.join("|") !== sequence.join("|") || !alignedLabels(l, v, sequence.length)) continue;
659
+ if (++peers >= 2) return true;
660
+ }
661
+ return false;
662
+ }
614
663
  function matchesIndependentRowPair(table, owner, first) {
615
664
  const norm = (cell) => textOf(cell).replace(/\s+/g, "");
616
665
  const pairs = [];
@@ -1395,7 +1444,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1395
1444
  if (!(cut.open && !newCell)) {
1396
1445
  if (pairs.some((p) => p[1].rs > 1 && !flows(p))) return false;
1397
1446
  const one = pairs.filter(([, d]) => d.rs === 1);
1398
- if (!matchesCompleteSiblingRow(table, owner, first) && !matchesCompleteRubricRow(table, owner, first) && !(cut.ruled && matchesCompleteContextRow(table, owner, first)) && !outlineOnly(pairs, cell) && !one.some(flows) && (cut.list === "none" || !one.some(([u, d]) => listContinues(cell(u), cell(d), cut.list === "multi")))) return false;
1447
+ if (!matchesCompleteSiblingRow(table, owner, first) && !matchesCompleteRubricRow(table, owner, first) && !(cut.ruled && (matchesCompleteContextRow(table, owner, first) || matchesCompleteAlignedLabelListRow(table, owner, first))) && !outlineOnly(pairs, cell) && !one.some(flows) && (cut.list === "none" || !one.some(([u, d]) => listContinues(cell(u), cell(d), cut.list === "multi")))) return false;
1399
1448
  }
1400
1449
  }
1401
1450
  for (const [u, d] of pairs) {
@@ -3423,7 +3472,7 @@ function mergeLinkRuns(markdown) {
3423
3472
 
3424
3473
  // src/pdf/formula-ocr.ts
3425
3474
  async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
3426
- const formulaMod = await import("./formula-C26FMMGO.js");
3475
+ const formulaMod = await import("./formula-KSTY73DQ.js");
3427
3476
  const { FormulaPipeline, ensureFormulaModels } = formulaMod;
3428
3477
  await ensureFormulaModels((p) => {
3429
3478
  if (p.phase === "download" && p.total) {
@@ -3849,10 +3898,10 @@ async function parsePdfDocument(buffer, options) {
3849
3898
  }
3850
3899
  if (targets.size > 0) {
3851
3900
  try {
3852
- const { runPdfOcr } = await import("./pdf-ocr-LGPSJM22.js");
3901
+ const { runPdfOcr } = await import("./pdf-ocr-BYT7XVID.js");
3853
3902
  const mode = typeof options?.ocr === "function" ? options.ocr : "builtin";
3854
3903
  const regionPages = new Map([...ocrRegions].filter(([p]) => options?.ocr !== "force" && !isImageBased && !pageQuality.find((q) => q.page === p)?.needsOcr));
3855
- const { builtinOcrConfig } = await import("./pdf-ocr-LGPSJM22.js");
3904
+ const { builtinOcrConfig } = await import("./pdf-ocr-BYT7XVID.js");
3856
3905
  const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, options?.onProgress, options?.tables !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut);
3857
3906
  for (const obs of ocrPageBlocks.values()) stripScriptTags({ blocks: obs });
3858
3907
  if (ocrPageBlocks.size > 0) {
@@ -4097,4 +4146,4 @@ export {
4097
4146
  parsePdfDocument,
4098
4147
  removeHeaderFooterBlocks
4099
4148
  };
4100
- //# sourceMappingURL=parser-E6BG3ECD.js.map
4149
+ //# sourceMappingURL=parser-DR6ZHYEB.js.map