kordoc 4.22.4 → 4.22.5
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.
- package/README.md +8 -7
- package/dist/{-HAK3YFWW.js → -WFRWBH7T.js} +11 -11
- package/dist/{chunk-F3AWNFMO.js → chunk-2L3Q7REU.js} +3 -3
- package/dist/{chunk-CWBH66IQ.js → chunk-35ZHXEJA.js} +3 -3
- package/dist/{chunk-Q6SVCBMK.js → chunk-3BR7VKWL.js} +2 -2
- package/dist/{chunk-G2325K2F.js → chunk-3G3TLZDK.js} +2 -2
- package/dist/{chunk-36DK6AOX.js → chunk-3YEL7P4L.js} +2 -2
- package/dist/{chunk-S45M7IQH.cjs → chunk-4SUB43EJ.cjs} +24 -24
- package/dist/{chunk-S45M7IQH.cjs.map → chunk-4SUB43EJ.cjs.map} +1 -1
- package/dist/{chunk-5ARHF54C.js → chunk-4TWN7PWJ.js} +2 -2
- package/dist/{chunk-WCTC3LSV.js → chunk-52HIK4C2.js} +4 -3
- package/dist/chunk-52HIK4C2.js.map +1 -0
- package/dist/{chunk-3TUJ34V7.js → chunk-63N6CEJE.js} +2 -2
- package/dist/{chunk-DEFT7Z3B.js → chunk-6MCC2XNB.js} +2 -2
- package/dist/{chunk-C5J5LDWM.js → chunk-6MQKNB6K.js} +4 -3
- package/dist/chunk-6MQKNB6K.js.map +1 -0
- package/dist/{chunk-MJSHXESK.cjs → chunk-AS25R4EU.cjs} +2 -2
- package/dist/{chunk-MJSHXESK.cjs.map → chunk-AS25R4EU.cjs.map} +1 -1
- package/dist/{chunk-AYV5VRHL.js → chunk-C3REGEQO.js} +2 -2
- package/dist/{chunk-4X7AR4EH.cjs → chunk-C6B5GWN7.cjs} +24 -23
- package/dist/chunk-C6B5GWN7.cjs.map +1 -0
- package/dist/{chunk-A3SKXHAN.js → chunk-CO7O3ZT6.js} +2 -2
- package/dist/{chunk-WNW77CAY.js → chunk-CRSTBATY.js} +2 -2
- package/dist/{chunk-MYTMZSQO.js → chunk-CW67DAAH.js} +2 -2
- package/dist/{chunk-RPSILMQY.js → chunk-DN55FTJP.js} +2 -2
- package/dist/{chunk-HN3QMHTT.js → chunk-HLPMC7L4.js} +5 -4
- package/dist/chunk-HLPMC7L4.js.map +1 -0
- package/dist/{chunk-LVVSMYG4.js → chunk-LE4VHWIT.js} +4 -4
- package/dist/{chunk-VXQWAPC6.cjs → chunk-N6KXGIIN.cjs} +3 -3
- package/dist/{chunk-VXQWAPC6.cjs.map → chunk-N6KXGIIN.cjs.map} +1 -1
- package/dist/{chunk-G4KNI7EO.js → chunk-PSORL4PA.js} +11 -11
- package/dist/{chunk-FAFSBCU2.js → chunk-RYKDIUHT.js} +4 -4
- package/dist/{chunk-SSL3TKJY.js → chunk-SETAYS6P.js} +2 -2
- package/dist/{chunk-Q65HT2BL.js → chunk-T7OZ7X6A.js} +2 -2
- package/dist/{chunk-UJVVL6BI.js → chunk-TOUJCO2P.js} +2 -2
- package/dist/{chunk-EVL6HZQL.js → chunk-U3GUZQ54.js} +1286 -1279
- package/dist/chunk-U3GUZQ54.js.map +1 -0
- package/dist/{chunk-EYQLJ57Y.cjs → chunk-UCK6WGHY.cjs} +3 -3
- package/dist/{chunk-EYQLJ57Y.cjs.map → chunk-UCK6WGHY.cjs.map} +1 -1
- package/dist/{chunk-K2NWHLCD.cjs → chunk-YG4GFQB7.cjs} +6 -6
- package/dist/{chunk-K2NWHLCD.cjs.map → chunk-YG4GFQB7.cjs.map} +1 -1
- package/dist/chunks-NXABWR6G.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-PWAUR5PF.js → formula-FSVHUQ6Y.js} +4 -4
- package/dist/{formula-KSTY73DQ.js → formula-L625ULJP.js} +3 -3
- package/dist/{formula-JGFYGFYX.cjs → formula-QZGTF3DZ.cjs} +9 -9
- package/dist/{formula-JGFYGFYX.cjs.map → formula-QZGTF3DZ.cjs.map} +1 -1
- package/dist/{image-ocr-UULNAC5Y.cjs → image-ocr-AELVAU75.cjs} +17 -17
- package/dist/{image-ocr-UULNAC5Y.cjs.map → image-ocr-AELVAU75.cjs.map} +1 -1
- package/dist/{image-ocr-RASJHOAK.js → image-ocr-KE3RUS3R.js} +6 -6
- package/dist/{image-ocr-RPBPO3VT.js → image-ocr-QTZNBP5V.js} +9 -9
- package/dist/index.cjs +790 -782
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +249 -241
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-ZPQ4IFT7.js → model-bundle-F6TU6ZAV.js} +5 -5
- package/dist/{models-YJQ5VHOR.js → models-ZHNNVH2W.js} +5 -5
- package/dist/{parse-worker-v2-7PNZYASF.js → parse-worker-v2-KQRG3NQO.js} +12 -12
- package/dist/{parser-ER3VLB37.js → parser-RVMH4PUB.js} +133 -20
- package/dist/parser-RVMH4PUB.js.map +1 -0
- package/dist/{parser-DR6ZHYEB.js → parser-WBKVRDPV.js} +129 -16
- package/dist/parser-WBKVRDPV.js.map +1 -0
- package/dist/{parser-ZFXVZZKQ.cjs → parser-WNDH2X6N.cjs} +397 -284
- package/dist/parser-WNDH2X6N.cjs.map +1 -0
- package/dist/pdf-ocr-IOUZTPPH.cjs +31 -0
- package/dist/{pdf-ocr-QWTGWYQT.cjs.map → pdf-ocr-IOUZTPPH.cjs.map} +1 -1
- package/dist/{pdf-ocr-BYT7XVID.js → pdf-ocr-X5XLGL5J.js} +6 -6
- package/dist/{pdf-ocr-DRQN5BXA.js → pdf-ocr-ZP2CUWSO.js} +9 -9
- package/dist/{profile-io-3QYTSPNH.js → profile-io-B4VSI4LW.js} +3 -3
- package/dist/{rasterize-LPLWCBXV.js → rasterize-Y7NVUVXU.js} +3 -3
- package/dist/{redact-doc-HDA6ZG3N.js → redact-doc-GIBTFWCO.js} +11 -11
- package/dist/{render-MYZGD3SB.js → render-JVCGYRRO.js} +7 -7
- package/dist/seal-WNX2ZJTK.js +10 -0
- package/dist/{setup-EF5TQVAI.js → setup-7L7EQPMG.js} +3 -3
- package/dist/visual-VPWPXIHN.js +21 -0
- package/dist/{watch-PM5PRSFW.js → watch-VYMFGX72.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-4X7AR4EH.cjs.map +0 -1
- package/dist/chunk-C5J5LDWM.js.map +0 -1
- package/dist/chunk-EVL6HZQL.js.map +0 -1
- package/dist/chunk-HN3QMHTT.js.map +0 -1
- package/dist/chunk-WCTC3LSV.js.map +0 -1
- package/dist/chunks-3N7OFSA4.js +0 -10
- package/dist/parser-DR6ZHYEB.js.map +0 -1
- package/dist/parser-ER3VLB37.js.map +0 -1
- package/dist/parser-ZFXVZZKQ.cjs.map +0 -1
- package/dist/pdf-ocr-QWTGWYQT.cjs +0 -31
- package/dist/seal-XA5V6A6V.js +0 -10
- package/dist/visual-DB7NJOID.js +0 -21
- /package/dist/{-HAK3YFWW.js.map → -WFRWBH7T.js.map} +0 -0
- /package/dist/{chunk-F3AWNFMO.js.map → chunk-2L3Q7REU.js.map} +0 -0
- /package/dist/{chunk-CWBH66IQ.js.map → chunk-35ZHXEJA.js.map} +0 -0
- /package/dist/{chunk-Q6SVCBMK.js.map → chunk-3BR7VKWL.js.map} +0 -0
- /package/dist/{chunk-G2325K2F.js.map → chunk-3G3TLZDK.js.map} +0 -0
- /package/dist/{chunk-36DK6AOX.js.map → chunk-3YEL7P4L.js.map} +0 -0
- /package/dist/{chunk-5ARHF54C.js.map → chunk-4TWN7PWJ.js.map} +0 -0
- /package/dist/{chunk-3TUJ34V7.js.map → chunk-63N6CEJE.js.map} +0 -0
- /package/dist/{chunk-DEFT7Z3B.js.map → chunk-6MCC2XNB.js.map} +0 -0
- /package/dist/{chunk-AYV5VRHL.js.map → chunk-C3REGEQO.js.map} +0 -0
- /package/dist/{chunk-A3SKXHAN.js.map → chunk-CO7O3ZT6.js.map} +0 -0
- /package/dist/{chunk-WNW77CAY.js.map → chunk-CRSTBATY.js.map} +0 -0
- /package/dist/{chunk-MYTMZSQO.js.map → chunk-CW67DAAH.js.map} +0 -0
- /package/dist/{chunk-RPSILMQY.js.map → chunk-DN55FTJP.js.map} +0 -0
- /package/dist/{chunk-LVVSMYG4.js.map → chunk-LE4VHWIT.js.map} +0 -0
- /package/dist/{chunk-G4KNI7EO.js.map → chunk-PSORL4PA.js.map} +0 -0
- /package/dist/{chunk-FAFSBCU2.js.map → chunk-RYKDIUHT.js.map} +0 -0
- /package/dist/{chunk-SSL3TKJY.js.map → chunk-SETAYS6P.js.map} +0 -0
- /package/dist/{chunk-Q65HT2BL.js.map → chunk-T7OZ7X6A.js.map} +0 -0
- /package/dist/{chunk-UJVVL6BI.js.map → chunk-TOUJCO2P.js.map} +0 -0
- /package/dist/{chunks-3N7OFSA4.js.map → chunks-NXABWR6G.js.map} +0 -0
- /package/dist/{formula-PWAUR5PF.js.map → formula-FSVHUQ6Y.js.map} +0 -0
- /package/dist/{formula-KSTY73DQ.js.map → formula-L625ULJP.js.map} +0 -0
- /package/dist/{image-ocr-RASJHOAK.js.map → image-ocr-KE3RUS3R.js.map} +0 -0
- /package/dist/{image-ocr-RPBPO3VT.js.map → image-ocr-QTZNBP5V.js.map} +0 -0
- /package/dist/{model-bundle-ZPQ4IFT7.js.map → model-bundle-F6TU6ZAV.js.map} +0 -0
- /package/dist/{models-YJQ5VHOR.js.map → models-ZHNNVH2W.js.map} +0 -0
- /package/dist/{parse-worker-v2-7PNZYASF.js.map → parse-worker-v2-KQRG3NQO.js.map} +0 -0
- /package/dist/{pdf-ocr-BYT7XVID.js.map → pdf-ocr-X5XLGL5J.js.map} +0 -0
- /package/dist/{pdf-ocr-DRQN5BXA.js.map → pdf-ocr-ZP2CUWSO.js.map} +0 -0
- /package/dist/{profile-io-3QYTSPNH.js.map → profile-io-B4VSI4LW.js.map} +0 -0
- /package/dist/{rasterize-LPLWCBXV.js.map → rasterize-Y7NVUVXU.js.map} +0 -0
- /package/dist/{redact-doc-HDA6ZG3N.js.map → redact-doc-GIBTFWCO.js.map} +0 -0
- /package/dist/{render-MYZGD3SB.js.map → render-JVCGYRRO.js.map} +0 -0
- /package/dist/{seal-XA5V6A6V.js.map → seal-WNX2ZJTK.js.map} +0 -0
- /package/dist/{setup-EF5TQVAI.js.map → setup-7L7EQPMG.js.map} +0 -0
- /package/dist/{visual-DB7NJOID.js.map → visual-VPWPXIHN.js.map} +0 -0
- /package/dist/{watch-PM5PRSFW.js.map → watch-VYMFGX72.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-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-PSORL4PA.js";
|
|
42
|
+
import "./chunk-CO7O3ZT6.js";
|
|
43
43
|
import {
|
|
44
44
|
detectFormat,
|
|
45
45
|
detectOle2Format,
|
|
46
46
|
detectZipFormat,
|
|
47
47
|
extractHwp5MetadataOnly
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-U3GUZQ54.js";
|
|
49
|
+
import "./chunk-DN55FTJP.js";
|
|
50
|
+
import "./chunk-3G3TLZDK.js";
|
|
51
51
|
import "./chunk-VKVDMH7X.js";
|
|
52
52
|
import "./chunk-VQFA55IC.js";
|
|
53
53
|
import "./chunk-BHVOY6V4.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-C3REGEQO.js";
|
|
55
55
|
import {
|
|
56
56
|
blocksToMarkdown
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-3BR7VKWL.js";
|
|
58
58
|
import {
|
|
59
59
|
assertWithinRoot,
|
|
60
60
|
getAccessRoot,
|
|
61
61
|
isOfflineMode
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-63N6CEJE.js";
|
|
63
63
|
import {
|
|
64
64
|
extractFormFields,
|
|
65
65
|
fillWithUniqueGuard
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-
|
|
66
|
+
} from "./chunk-2L3Q7REU.js";
|
|
67
|
+
import "./chunk-52HIK4C2.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-
|
|
75
|
+
} from "./chunk-4TWN7PWJ.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-
|
|
374
|
+
const { extractPdfMetadataOnly } = await import("./parser-RVMH4PUB.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-
|
|
551
|
+
const { blocksToChunks } = await import("./chunks-NXABWR6G.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-
|
|
821
|
+
const { placeSealHwpx } = await import("./seal-WNX2ZJTK.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-
|
|
938
|
+
const { redactDocument } = await import("./redact-doc-GIBTFWCO.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-
|
|
1012
|
+
const { renderHwpxToSvg } = await import("./render-JVCGYRRO.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-
|
|
1024
|
+
const { rasterizeSvg } = await import("./rasterize-Y7NVUVXU.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-
|
|
1039
|
+
const { renderDocument } = await import("./render-JVCGYRRO.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-
|
|
1089
|
+
const { extractRenderedRegions } = await import("./render-JVCGYRRO.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-
|
|
1125
|
+
const { extractTables } = await import("./visual-VPWPXIHN.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("./-
|
|
1182
|
+
const { hwpxToProfile } = await import("./-WFRWBH7T.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-
|
|
1295
|
+
const { parseFormatProfileJson } = await import("./profile-io-B4VSI4LW.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-
|
|
4
|
+
} from "./chunk-CW67DAAH.js";
|
|
5
5
|
import {
|
|
6
6
|
ALL_FORMULA_MODELS,
|
|
7
7
|
getModelStatusIn,
|
|
8
8
|
getModelsDir
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-3YEL7P4L.js";
|
|
10
|
+
import "./chunk-63N6CEJE.js";
|
|
11
|
+
import "./chunk-4TWN7PWJ.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-
|
|
104
|
+
//# sourceMappingURL=model-bundle-F6TU6ZAV.js.map
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
ocrSourcePath,
|
|
17
17
|
parseCharacterDict,
|
|
18
18
|
resolveOcrModels
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-CW67DAAH.js";
|
|
20
|
+
import "./chunk-3YEL7P4L.js";
|
|
21
|
+
import "./chunk-63N6CEJE.js";
|
|
22
|
+
import "./chunk-4TWN7PWJ.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-
|
|
41
|
+
//# sourceMappingURL=models-ZHNNVH2W.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
parseWorkerFile
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-35ZHXEJA.js";
|
|
5
|
+
import "./chunk-PSORL4PA.js";
|
|
6
|
+
import "./chunk-CO7O3ZT6.js";
|
|
7
|
+
import "./chunk-U3GUZQ54.js";
|
|
8
|
+
import "./chunk-DN55FTJP.js";
|
|
9
|
+
import "./chunk-3G3TLZDK.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-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-C3REGEQO.js";
|
|
16
|
+
import "./chunk-3BR7VKWL.js";
|
|
17
|
+
import "./chunk-2L3Q7REU.js";
|
|
18
|
+
import "./chunk-52HIK4C2.js";
|
|
19
19
|
import {
|
|
20
20
|
VERSION,
|
|
21
21
|
sanitizeError
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4TWN7PWJ.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-
|
|
314
|
+
//# sourceMappingURL=parse-worker-v2-KQRG3NQO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToPages
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3G3TLZDK.js";
|
|
5
5
|
import {
|
|
6
6
|
encodePng
|
|
7
7
|
} from "./chunk-VKVDMH7X.js";
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
stripAbsorbedRunningLines,
|
|
63
63
|
trimTrailingEmptyTableCols,
|
|
64
64
|
wrapJoiner
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-6MQKNB6K.js";
|
|
66
66
|
import {
|
|
67
67
|
validateOcrOptions
|
|
68
68
|
} from "./chunk-BHVOY6V4.js";
|
|
@@ -74,23 +74,24 @@ import {
|
|
|
74
74
|
escapeLiteralTags,
|
|
75
75
|
stripScriptTags,
|
|
76
76
|
unframeLayoutTables
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-C3REGEQO.js";
|
|
78
78
|
import {
|
|
79
79
|
WINGDINGS,
|
|
80
80
|
assignTableIds,
|
|
81
81
|
blocksToMarkdown,
|
|
82
|
-
escapeLiteralDollar
|
|
83
|
-
|
|
82
|
+
escapeLiteralDollar,
|
|
83
|
+
mapPuaText
|
|
84
|
+
} from "./chunk-3BR7VKWL.js";
|
|
84
85
|
import {
|
|
85
86
|
ocrModelsCached,
|
|
86
87
|
resolveOcrModels
|
|
87
|
-
} from "./chunk-
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import "./chunk-
|
|
88
|
+
} from "./chunk-CW67DAAH.js";
|
|
89
|
+
import "./chunk-3YEL7P4L.js";
|
|
90
|
+
import "./chunk-63N6CEJE.js";
|
|
90
91
|
import {
|
|
91
92
|
KordocError,
|
|
92
93
|
sanitizeHref
|
|
93
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-4TWN7PWJ.js";
|
|
94
95
|
|
|
95
96
|
// src/pdf/image-extract.ts
|
|
96
97
|
import { createHash } from "crypto";
|
|
@@ -633,6 +634,68 @@ var alignedLabels = (label, value, count) => {
|
|
|
633
634
|
return next++ < V.length;
|
|
634
635
|
});
|
|
635
636
|
};
|
|
637
|
+
function partialAlignedLabelCells(table, owner, first) {
|
|
638
|
+
const pageOf = (a) => CELL_PAGES.get(a.cell ?? table.cells[a.r][a.c]) ?? (a.r < first ? -1 : -2);
|
|
639
|
+
const pairs = [];
|
|
640
|
+
let carried = false;
|
|
641
|
+
for (let c = 0; c < table.cols; ) {
|
|
642
|
+
const u = owner[first - 1]?.[c], d = owner[first]?.[c];
|
|
643
|
+
if (u && u === d) {
|
|
644
|
+
carried = true;
|
|
645
|
+
c = u.c + u.cs;
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
const upper = u ? table.cells[u.r][u.c] : void 0, lower = d ? table.cells[d.r][d.c] : void 0;
|
|
649
|
+
if (!upper?.text.trim() && !lower?.text.trim()) {
|
|
650
|
+
c++;
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
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) || !textOf(upper) || !textOf(lower)) return;
|
|
654
|
+
pairs.push({ c, cs: u.cs, upper, lower });
|
|
655
|
+
c += u.cs;
|
|
656
|
+
}
|
|
657
|
+
if (!carried || pairs.length !== 3) return;
|
|
658
|
+
const keyed = pairs.filter((p) => labelsOf(p.upper) && labelsOf(p.lower));
|
|
659
|
+
if (keyed.length !== 1) return;
|
|
660
|
+
const label = keyed[0], value = pairs.find((p) => p.c === label.c + label.cs), context = pairs.find((p) => p.c + p.cs === label.c);
|
|
661
|
+
if (!value || !context || value === context || textOf(context.upper).replace(/\s+/g, "") === textOf(context.lower).replace(/\s+/g, "") || !CELL_EDGES.get(context.upper)?.b || !CELL_EDGES.get(context.lower)?.t) return;
|
|
662
|
+
const U = labelsOf(label.upper), D = labelsOf(label.lower), sequence = [...U, ...D];
|
|
663
|
+
if (D.length < 2 || sequence.length < 3 || new Set(sequence).size !== sequence.length || !alignedLabels(label.upper, value.upper, U.length)) return;
|
|
664
|
+
const L = CELL_LINES.get(label.lower), V = CELL_LINES.get(value.lower);
|
|
665
|
+
if (!L || !V || L.length !== D.length) return;
|
|
666
|
+
let next = V.findIndex((v) => Math.abs(v.y - L[0].y) <= 1);
|
|
667
|
+
if (next <= 0 || !V.slice(0, next).every((v) => v.y > L[0].y + 1) || !L.every((l) => {
|
|
668
|
+
while (next < V.length && Math.abs(l.y - V[next].y) > 1) next++;
|
|
669
|
+
return next++ < V.length;
|
|
670
|
+
})) return;
|
|
671
|
+
let peers = 0, shared = false;
|
|
672
|
+
for (let r = 0; r < table.rows; r++) {
|
|
673
|
+
if (r === first - 1 || r === first) continue;
|
|
674
|
+
const l = owner[r]?.[label.c], v = owner[r]?.[value.c];
|
|
675
|
+
if (!l || !v || l.r !== r || v.r !== r || l.c !== label.c || v.c !== value.c || l.cs !== label.cs || v.cs !== value.cs || l.rs !== v.rs) continue;
|
|
676
|
+
const lc = table.cells[r][l.c], vc = table.cells[r][v.c];
|
|
677
|
+
const list = labelsOf(lc);
|
|
678
|
+
if (!plain(lc) || !plain(vc) || !textOf(vc) || !list || pageOf(l) !== pageOf(v)) continue;
|
|
679
|
+
if (l.rs === 1) {
|
|
680
|
+
if (list.join("|") === sequence.join("|") && alignedLabels(lc, vc, list.length)) peers++;
|
|
681
|
+
continue;
|
|
682
|
+
}
|
|
683
|
+
if (list.length < 3 || new Set(list).size !== list.length) continue;
|
|
684
|
+
const visible = CELL_LINES.get(lc)?.length ?? 0, values = CELL_LINES.get(vc);
|
|
685
|
+
if (visible < 3 || visible > list.length || !values || !alignedLabels(lc, vc, visible)) continue;
|
|
686
|
+
const top = Math.max(...values.map((v2) => v2.y)), bottom = Math.min(...values.map((v2) => v2.y));
|
|
687
|
+
const contexts = [];
|
|
688
|
+
for (let rr = r; rr < r + l.rs && rr < table.rows; rr++) {
|
|
689
|
+
const a = owner[rr]?.[context.c], cell = a ? table.cells[a.r][a.c] : void 0;
|
|
690
|
+
if (!a || a.r !== rr || a.c !== context.c || a.cs !== context.cs || a.rs !== 1 || !cell || !plain(cell) || !textOf(cell) || pageOf(a) !== pageOf(l)) break;
|
|
691
|
+
const lines = CELL_LINES.get(cell);
|
|
692
|
+
if (!lines?.length || lines.some((line) => line.y > top + 1 || line.y < bottom - 1)) break;
|
|
693
|
+
contexts.push(textOf(cell).replace(/\s+/g, ""));
|
|
694
|
+
}
|
|
695
|
+
if (new Set(contexts).size >= 2) shared = true;
|
|
696
|
+
}
|
|
697
|
+
return peers >= 2 && shared ? { context, label, value } : void 0;
|
|
698
|
+
}
|
|
636
699
|
function matchesCompleteAlignedLabelListRow(table, owner, first) {
|
|
637
700
|
const pairs = [];
|
|
638
701
|
let carried = false;
|
|
@@ -962,6 +1025,17 @@ function markJoinedPages(table, prev, curr) {
|
|
|
962
1025
|
}
|
|
963
1026
|
});
|
|
964
1027
|
const cr = pt.rows - 1 - off, page = cp[cr];
|
|
1028
|
+
if (cr === -1 && table.cols === pt.cols && pt.cols === ct.cols) {
|
|
1029
|
+
const tailPage = cp[0];
|
|
1030
|
+
if (tailPage === void 0 || tailPage === prev.pageNumber) return;
|
|
1031
|
+
for (let r = 0; r < pt.rows; r++) for (const { cell, c } of rows[r]) {
|
|
1032
|
+
const head = ptRows[r]?.find((s) => s.c === c)?.cell, tail = ctRows[0]?.find((s) => s.c === c)?.cell;
|
|
1033
|
+
if (!head?.text.trim() || !tail?.text.trim() || cell.blocks?.length || cell.colSpan !== head.colSpan || cell.colSpan !== tail.colSpan || cell.rowSpan <= head.rowSpan || r + head.rowSpan !== pt.rows || r + cell.rowSpan <= pt.rows || !cell.text.startsWith(head.text.trimEnd()) || !cell.text.trimEnd().endsWith(tail.text.trimEnd())) continue;
|
|
1034
|
+
const from = head.text.trimEnd().length, at = cell.text.indexOf(tail.text.trim().slice(0, 20), from);
|
|
1035
|
+
if (at >= from) setSplits(cell, [...relocate(head, cell), { at, page: tailPage }, ...relocate(tail, cell, at)]);
|
|
1036
|
+
}
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
965
1039
|
if (cr < 0 || page === void 0 || page === prev.pageNumber) return;
|
|
966
1040
|
const tails = ctRows[cr].filter((s) => s.cell.text.trim());
|
|
967
1041
|
for (const { cell } of ctRows[cr]) for (const b of cell.blocks ?? []) b.pageNumber ??= page;
|
|
@@ -1012,6 +1086,17 @@ function splitCrossPageRows(t, pageNumber) {
|
|
|
1012
1086
|
};
|
|
1013
1087
|
const e = Math.max(...splits.map((s) => r + s.cell.rowSpan - 1));
|
|
1014
1088
|
const cells = t.cells.map((row2) => row2.slice());
|
|
1089
|
+
const cut = pages.findIndex((p, rr) => rr > r && p !== pages[r]);
|
|
1090
|
+
if (cut > r && splits.every((s) => cut < r + s.cell.rowSpan && pages[cut] === s.split.page)) {
|
|
1091
|
+
for (const { cell, c, split } of splits) {
|
|
1092
|
+
cells[r][c] = clone(cell, { ...split.head, rowSpan: cut - r });
|
|
1093
|
+
const tail = { ...cell, ...split.tail, rowSpan: r + cell.rowSpan - cut };
|
|
1094
|
+
CELL_PAGES.set(tail, split.page);
|
|
1095
|
+
setSplits(tail, split.rest);
|
|
1096
|
+
cells[cut][c] = tail;
|
|
1097
|
+
}
|
|
1098
|
+
return splitCrossPageRows({ ...t, cells }, pageNumber);
|
|
1099
|
+
}
|
|
1015
1100
|
const row = Array.from({ length: t.cols }, () => ({ text: "", colSpan: 1, rowSpan: 1 }));
|
|
1016
1101
|
for (const { cell, c, split } of splits) {
|
|
1017
1102
|
cells[r][c] = clone(cell, split.head);
|
|
@@ -1189,15 +1274,18 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
|
|
|
1189
1274
|
ruled: !!pr && !!cr && pr.bottom && cr.top,
|
|
1190
1275
|
list: !shifted ? "any" : skip > 0 && ca.filter((a) => a.r < skip && a.cell.text.trim()).length < 2 ? "none" : "multi"
|
|
1191
1276
|
};
|
|
1192
|
-
let
|
|
1193
|
-
if (
|
|
1277
|
+
let partial = !skip && cols === prev.cols && cols === curr.cols && cut.ruled && prevBottom !== void 0 ? partialAlignedLabelCells(table, owner, first) : void 0;
|
|
1278
|
+
if (partial && (continuesAcross(partial.context.upper, partial.context.lower, U[partial.context.c], U[partial.context.c + partial.context.cs]) || clauseContinues(partial.context.upper, partial.context.lower) || quantityContinues(partial.context.upper, partial.context.lower) || !continuesAcross(partial.value.upper, partial.value.lower, U[partial.value.c], U[partial.value.c + partial.value.cs]) || startsNewItem(partial.value.upper.text, partial.value.lower.text))) partial = void 0;
|
|
1279
|
+
const selected = partial ? /* @__PURE__ */ new Set([partial.label.c, partial.value.c]) : void 0;
|
|
1280
|
+
let split = !selected && rows > prev.rows && mergeSplitRow(table, owner, prev.rows, U, false, cut);
|
|
1281
|
+
if (rows > prev.rows && !split && prevBottom !== void 0 && mergeStraddlingCells(table, owner, prev.rows, prevBottom, lex, U, selected) && !selected) split = mergeSplitRow(table, owner, prev.rows, U, true, { ...cut, open: false });
|
|
1194
1282
|
if (pr && cr) {
|
|
1195
1283
|
const cutRuled = pr.bottom || cr.top;
|
|
1196
1284
|
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) });
|
|
1197
1285
|
}
|
|
1198
1286
|
return { table, colXs: U, split, header: ca.filter((a) => a.r < skip && a.cell.text.trim()).length >= 2 };
|
|
1199
1287
|
}
|
|
1200
|
-
function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs) {
|
|
1288
|
+
function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs, selected) {
|
|
1201
1289
|
const last = first - 1;
|
|
1202
1290
|
const straddles = owner[first].some((o, c) => o !== null && o === owner[last][c]);
|
|
1203
1291
|
let firstNew = table.cols;
|
|
@@ -1254,6 +1342,7 @@ function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs) {
|
|
|
1254
1342
|
c = u.c + u.cs;
|
|
1255
1343
|
if (!d || d === u || u.r + u.rs - 1 !== last || d.r !== first || d.c !== u.c || d.cs !== u.cs) continue;
|
|
1256
1344
|
const a = table.cells[u.r][u.c], b = table.cells[first][d.c];
|
|
1345
|
+
if (selected && !selected.has(u.c)) continue;
|
|
1257
1346
|
const flowsOn = itemBreak && straddles && !!colXs && hasContent(a) && hasContent(b) && longLastLine(a) && !startsNewItem(a.text, b.text) && continuesAcross(a, b, colXs[u.c], colXs[u.c + u.cs]);
|
|
1258
1347
|
const openSeam = hasContent(a) && hasContent(b) && hasOpenCellSeam(a, b) && !owner.some((row, r) => {
|
|
1259
1348
|
if (!r || r === first) return false;
|
|
@@ -1262,7 +1351,7 @@ function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs) {
|
|
|
1262
1351
|
const ue = CELL_EDGES.get(table.cells[up.r][up.c]), de = CELL_EDGES.get(table.cells[down.r][down.c]);
|
|
1263
1352
|
return !!ue && !!de && !ue.b && !de.t;
|
|
1264
1353
|
});
|
|
1265
|
-
if (!openSeam && !flowsOn && !crossed.has(shape(u, d)) && !(u.rs >= 2 && u.c + u.cs <= firstNew && hasContent(a) && !hasContent(b))) {
|
|
1354
|
+
if (!selected && !openSeam && !flowsOn && !crossed.has(shape(u, d)) && !(u.rs >= 2 && u.c + u.cs <= firstNew && hasContent(a) && !hasContent(b))) {
|
|
1266
1355
|
if (!straddles && !midWord) continue;
|
|
1267
1356
|
if (u.r >= last && d.rs < 2) continue;
|
|
1268
1357
|
const U = CELL_LINES.get(a);
|
|
@@ -1902,6 +1991,30 @@ function fillNestedContinuation(blocks, at) {
|
|
|
1902
1991
|
|
|
1903
1992
|
// src/pdf/symbol-glyphs.ts
|
|
1904
1993
|
import { OPS as OPS3 } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
1994
|
+
|
|
1995
|
+
// src/pdf/known-font-glyphs.ts
|
|
1996
|
+
import { createHash as createHash2 } from "crypto";
|
|
1997
|
+
var HCR_DOT = "bb7a2a3ab48d5bfdfd9582c0fb6525401c3a7f1851bb1c1bdb45048be95d1599";
|
|
1998
|
+
var BATANG_NUMBERS = [
|
|
1999
|
+
"8a4af2cf2dfe3238b4e2b35af976746216ade6e89cd3c55ec1e43bca532379b9",
|
|
2000
|
+
"7332dcab9d77002bdb92723a7fa4afa963ad01601f6328fbedd7289798fb77d0",
|
|
2001
|
+
"e7cc725807eae1ae0311898429629931f5924ade91a876c899b0c5bd109b325b",
|
|
2002
|
+
"3956a9db6baa74ef40ff93291ef5c42245cd4b36d613e5c956e307f347705adb",
|
|
2003
|
+
"8340732dc5f6a75a6808e87749ae9e9e7d54f4299f86eabbfaedd95da10ad447",
|
|
2004
|
+
"1412a79bd9ed7fdb34a8f04c29e341230a3bef649fb7b44a58ea6a56da0f3e44"
|
|
2005
|
+
];
|
|
2006
|
+
function knownFontGlyph(name, outline, width) {
|
|
2007
|
+
const face = name?.replace(/^[A-Z]{6}\+/, "");
|
|
2008
|
+
const dot = face === "HCRDotum" && width === 970 && outline.upm === 1e3;
|
|
2009
|
+
const number = (face === "Haansoft Batang" || face === "Haansoft-Batang") && width === 1e3 && outline.upm === 1024;
|
|
2010
|
+
if (!dot && !number) return null;
|
|
2011
|
+
const signature = createHash2("sha256").update(JSON.stringify([outline.upm, width, outline.contours])).digest("hex");
|
|
2012
|
+
if (dot) return signature === HCR_DOT ? mapPuaText(String.fromCodePoint(983791)) : null;
|
|
2013
|
+
const index = BATANG_NUMBERS.indexOf(signature);
|
|
2014
|
+
return index < 0 ? null : mapPuaText(String.fromCodePoint(983729 + index));
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
// src/pdf/symbol-glyphs.ts
|
|
1905
2018
|
var NO_UNICODE = "\uF000";
|
|
1906
2019
|
var u16 = (b, o) => b[o] << 8 | b[o + 1];
|
|
1907
2020
|
var i16 = (b, o) => {
|
|
@@ -2065,14 +2178,14 @@ function restoreUnmappedGlyphs(items, fnArray, argsArray, fontObj) {
|
|
|
2065
2178
|
for (const g2 of args[0]) {
|
|
2066
2179
|
const glyph = g2;
|
|
2067
2180
|
if (!glyph || glyph.unicode !== NO_UNICODE || typeof glyph.fontChar !== "string") continue;
|
|
2068
|
-
const key = font + "\0" + glyph.fontChar;
|
|
2181
|
+
const key = font + "\0" + glyph.fontChar + "\0" + typeof glyph.width + ":" + String(glyph.width);
|
|
2069
2182
|
if (!cache.has(key)) {
|
|
2070
2183
|
let sym = null;
|
|
2071
2184
|
try {
|
|
2072
|
-
const
|
|
2185
|
+
const source = fontObj(font), data = source?.data;
|
|
2073
2186
|
const code = glyph.fontChar.codePointAt(0);
|
|
2074
2187
|
const outline = data && code !== void 0 ? readOutline(data, code) : null;
|
|
2075
|
-
if (outline) sym = classifyOutline(outline);
|
|
2188
|
+
if (outline) sym = knownFontGlyph(source?.name, outline, glyph.width) ?? classifyOutline(outline);
|
|
2076
2189
|
} catch {
|
|
2077
2190
|
}
|
|
2078
2191
|
cache.set(key, sym);
|
|
@@ -3482,7 +3595,7 @@ function mergeLinkRuns(markdown) {
|
|
|
3482
3595
|
|
|
3483
3596
|
// src/pdf/formula-ocr.ts
|
|
3484
3597
|
async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
|
|
3485
|
-
const formulaMod = await import("./formula-
|
|
3598
|
+
const formulaMod = await import("./formula-FSVHUQ6Y.js");
|
|
3486
3599
|
const { FormulaPipeline, ensureFormulaModels } = formulaMod;
|
|
3487
3600
|
await ensureFormulaModels((p) => {
|
|
3488
3601
|
if (p.phase === "download" && p.total) {
|
|
@@ -3908,10 +4021,10 @@ async function parsePdfDocument(buffer, options) {
|
|
|
3908
4021
|
}
|
|
3909
4022
|
if (targets.size > 0) {
|
|
3910
4023
|
try {
|
|
3911
|
-
const { runPdfOcr } = await import("./pdf-ocr-
|
|
4024
|
+
const { runPdfOcr } = await import("./pdf-ocr-ZP2CUWSO.js");
|
|
3912
4025
|
const mode = typeof options?.ocr === "function" ? options.ocr : "builtin";
|
|
3913
4026
|
const regionPages = new Map([...ocrRegions].filter(([p]) => options?.ocr !== "force" && !isImageBased && !pageQuality.find((q) => q.page === p)?.needsOcr));
|
|
3914
|
-
const { builtinOcrConfig } = await import("./pdf-ocr-
|
|
4027
|
+
const { builtinOcrConfig } = await import("./pdf-ocr-ZP2CUWSO.js");
|
|
3915
4028
|
const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, options?.onProgress, options?.tables !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut);
|
|
3916
4029
|
for (const obs of ocrPageBlocks.values()) stripScriptTags({ blocks: obs });
|
|
3917
4030
|
if (ocrPageBlocks.size > 0) {
|
|
@@ -4156,4 +4269,4 @@ export {
|
|
|
4156
4269
|
parsePdfDocument,
|
|
4157
4270
|
removeHeaderFooterBlocks
|
|
4158
4271
|
};
|
|
4159
|
-
//# sourceMappingURL=parser-
|
|
4272
|
+
//# sourceMappingURL=parser-RVMH4PUB.js.map
|