kordoc 4.24.73 → 4.24.74
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/NOTICE +17 -0
- package/README.md +3 -3
- package/dist/{-CNXSUEGZ.js → -U7FV47XK.js} +25 -23
- package/dist/{chunk-S6K222FM.js → chunk-2HHE3D4S.js} +2 -2
- package/dist/{chunk-IV6UP7MO.js → chunk-2SMYX3L4.js} +2 -2
- package/dist/{chunk-X4HNVXJI.js → chunk-2ZZCE4EM.js} +2 -2
- package/dist/{chunk-GHHVT4Q5.js → chunk-3O3KTZ7H.js} +38 -7
- package/dist/chunk-3O3KTZ7H.js.map +1 -0
- package/dist/{chunk-TTIJTR5Z.js → chunk-3PTQBVDC.js} +6 -6
- package/dist/{chunk-QLUFTCAE.cjs → chunk-4TDUZ6UN.cjs} +126 -39
- package/dist/chunk-4TDUZ6UN.cjs.map +1 -0
- package/dist/{chunk-JY4YMR6F.js → chunk-4VOOFNBK.js} +122 -35
- package/dist/chunk-4VOOFNBK.js.map +1 -0
- package/dist/{chunk-ARVHYL3V.cjs → chunk-56KADCSC.cjs} +39 -8
- package/dist/chunk-56KADCSC.cjs.map +1 -0
- package/dist/{chunk-CGOCVSWC.js → chunk-5CGWJW3U.js} +3 -3
- package/dist/chunk-5IEMZTNA.js +107 -0
- package/dist/chunk-5IEMZTNA.js.map +1 -0
- package/dist/{chunk-VMM5PVOA.js → chunk-6OFHUEHR.js} +2 -2
- package/dist/{chunk-O4TKUBCF.cjs → chunk-7DB4UKU4.cjs} +3 -3
- package/dist/{chunk-O4TKUBCF.cjs.map → chunk-7DB4UKU4.cjs.map} +1 -1
- package/dist/{chunk-LUQH3SUU.cjs → chunk-A4GYP4G4.cjs} +62 -62
- package/dist/{chunk-LUQH3SUU.cjs.map → chunk-A4GYP4G4.cjs.map} +1 -1
- package/dist/{chunk-ABNK5QI2.js → chunk-AJYPIUQK.js} +2 -2
- package/dist/{chunk-UMVL776E.js → chunk-AYEDNFX7.js} +2 -2
- package/dist/chunk-CK7LADMK.js +232 -0
- package/dist/chunk-CK7LADMK.js.map +1 -0
- package/dist/{chunk-CBGH37CU.js → chunk-CRUAWSRK.js} +3 -3
- package/dist/{chunk-RJ26GRDB.js → chunk-DDWV6OTG.js} +8 -8
- package/dist/chunk-EFQPEQ43.js +45 -0
- package/dist/chunk-EFQPEQ43.js.map +1 -0
- package/dist/{chunk-2JA4FJJM.js → chunk-EYDAQBE7.js} +2 -2
- package/dist/{chunk-BK55EX56.js → chunk-FCAMCNBA.js} +4 -4
- package/dist/{chunk-5MBQW3KP.cjs → chunk-FE7463HF.cjs} +8 -8
- package/dist/{chunk-5MBQW3KP.cjs.map → chunk-FE7463HF.cjs.map} +1 -1
- package/dist/{chunk-VSWGRKTF.js → chunk-GJFS3GMY.js} +3 -3
- package/dist/{chunk-OOD35TZR.cjs → chunk-HFYDNNDB.cjs} +25 -25
- package/dist/{chunk-OOD35TZR.cjs.map → chunk-HFYDNNDB.cjs.map} +1 -1
- package/dist/chunk-HHLZQQNL.cjs +230 -0
- package/dist/chunk-HHLZQQNL.cjs.map +1 -0
- package/dist/{chunk-LMHDQWQM.js → chunk-HSDIWTFF.js} +2 -2
- package/dist/{chunk-B5F7B5NL.js → chunk-IOMH3NL4.js} +2 -2
- package/dist/{chunk-XSDVY4S6.js → chunk-KD6SFQFJ.js} +6 -6
- package/dist/{chunk-YLC25Z64.js → chunk-LGCD3V22.js} +3 -3
- package/dist/{chunk-E3G3JTXW.js → chunk-LUMA2HI3.js} +2 -2
- package/dist/{chunk-E3G3JTXW.js.map → chunk-LUMA2HI3.js.map} +1 -1
- package/dist/{chunk-BX23BOYN.js → chunk-N32TKLQ6.js} +5 -5
- package/dist/chunk-NOYOXAOE.js +230 -0
- package/dist/chunk-NOYOXAOE.js.map +1 -0
- package/dist/{chunk-A6YD5KUQ.js → chunk-NSGKHLS6.js} +104 -50
- package/dist/chunk-NSGKHLS6.js.map +1 -0
- package/dist/{chunk-MHLTXTP2.js → chunk-NT5EVBAI.js} +11 -11
- package/dist/{chunk-NQL7NCSE.js → chunk-PNAMF4RV.js} +2 -2
- package/dist/{chunk-G7QVY67O.js → chunk-PS7U47KE.js} +2 -2
- package/dist/{chunk-G7QVY67O.js.map → chunk-PS7U47KE.js.map} +1 -1
- package/dist/chunk-Q6U3VJIE.js +106 -0
- package/dist/chunk-Q6U3VJIE.js.map +1 -0
- package/dist/{chunk-S6H3ZPYQ.js → chunk-Q7CKFUYR.js} +38 -7
- package/dist/chunk-Q7CKFUYR.js.map +1 -0
- package/dist/{chunk-JDGPQVTX.js → chunk-R2EIJJ34.js} +2 -2
- package/dist/{chunk-ZH322FQG.js → chunk-RI5NWSUQ.js} +122 -35
- package/dist/chunk-RI5NWSUQ.js.map +1 -0
- package/dist/{chunk-HMHIF6QF.cjs → chunk-TOUR2SPI.cjs} +2 -2
- package/dist/{chunk-HMHIF6QF.cjs.map → chunk-TOUR2SPI.cjs.map} +1 -1
- package/dist/chunk-TV7B6DJQ.cjs +43 -0
- package/dist/chunk-TV7B6DJQ.cjs.map +1 -0
- package/dist/{chunk-AUGOG3KY.js → chunk-TXX5GDY3.js} +2 -2
- package/dist/{chunk-BUB3O7LS.js → chunk-UI4NGY4W.js} +4 -4
- package/dist/{chunk-32NWTEPA.js → chunk-UPBZ2BVU.js} +3 -3
- package/dist/{chunk-P4FHTYVX.js → chunk-VFSDX4GE.js} +2 -2
- package/dist/{chunk-376JPHHC.js → chunk-VOW7QLFA.js} +9 -9
- package/dist/{chunk-S366ICXS.js → chunk-VREPDKMC.js} +2 -2
- package/dist/chunk-VRUIVEGD.cjs +106 -0
- package/dist/chunk-VRUIVEGD.cjs.map +1 -0
- package/dist/{chunk-64QDDZO3.js → chunk-VZUIOYCU.js} +17 -14
- package/dist/chunk-VZUIOYCU.js.map +1 -0
- package/dist/{chunk-AAXWKG3C.js → chunk-WSNU2OAY.js} +2 -2
- package/dist/chunk-XJW45ICD.js +43 -0
- package/dist/chunk-XJW45ICD.js.map +1 -0
- package/dist/{chunk-ROYGVYLL.cjs → chunk-XKT4J6AG.cjs} +88 -88
- package/dist/{chunk-ROYGVYLL.cjs.map → chunk-XKT4J6AG.cjs.map} +1 -1
- package/dist/{chunk-M4QZCXT4.js → chunk-YGCR55V2.js} +8 -8
- package/dist/{chunk-MDDQRVA4.cjs → chunk-ZYSH465A.cjs} +104 -104
- package/dist/{chunk-MDDQRVA4.cjs.map → chunk-ZYSH465A.cjs.map} +1 -1
- package/dist/chunks-EVKTSUGA.js +11 -0
- package/dist/cli.js +50 -48
- package/dist/cli.js.map +1 -1
- package/dist/{detect-ALS4RBCY.js → detect-EBGOXZ66.js} +8 -4
- package/dist/{detect-LCFITDPT.js → detect-H2VUHKJS.js} +8 -4
- package/dist/detect-W6JF4PI4.cjs +31 -0
- package/dist/detect-W6JF4PI4.cjs.map +1 -0
- package/dist/{formula-AORKEC66.cjs → formula-CXRJQ5FS.cjs} +9 -9
- package/dist/{formula-AORKEC66.cjs.map → formula-CXRJQ5FS.cjs.map} +1 -1
- package/dist/{formula-IP2SLKUY.js → formula-JZZKJXHR.js} +3 -3
- package/dist/{formula-7Q6CKLK2.js → formula-TE5U7IPG.js} +4 -4
- package/dist/generator-CKTUVW7V.js +11 -0
- package/dist/generator-EVRLN745.cjs +12 -0
- package/dist/{generator-BPEAWT2P.cjs.map → generator-EVRLN745.cjs.map} +1 -1
- package/dist/generator-Q5M3CZPW.js +18 -0
- package/dist/{hancom-J2SWJYM6.cjs → hancom-GYOFLPQZ.cjs} +5 -5
- package/dist/{hancom-J2SWJYM6.cjs.map → hancom-GYOFLPQZ.cjs.map} +1 -1
- package/dist/{hancom-P34JL3HX.js → hancom-JHPB6VOJ.js} +2 -2
- package/dist/{hancom-DVWCKSEN.js → hancom-UFNCFHMZ.js} +2 -2
- package/dist/{image-ocr-7EOTOS42.js → image-ocr-CYVL5C2B.js} +96 -26
- package/dist/image-ocr-CYVL5C2B.js.map +1 -0
- package/dist/{image-ocr-5RBEPJPK.js → image-ocr-YPZTKLHR.js} +93 -23
- package/dist/image-ocr-YPZTKLHR.js.map +1 -0
- package/dist/image-ocr-YYC2JENT.cjs +284 -0
- package/dist/image-ocr-YYC2JENT.cjs.map +1 -0
- package/dist/index.cjs +1223 -1166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +102 -45
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +43 -41
- package/dist/mcp.js.map +1 -1
- package/dist/memo-FOTH3KQZ.js +17 -0
- package/dist/{model-bundle-7YL3PW4N.js → model-bundle-PJXVN44L.js} +5 -5
- package/dist/{models-ZXDUWX64.js → models-GGI6Z7WG.js} +5 -5
- package/dist/{parse-worker-v2-SGBIWVYJ.js → parse-worker-v2-22KSHQGB.js} +26 -24
- package/dist/{parse-worker-v2-SGBIWVYJ.js.map → parse-worker-v2-22KSHQGB.js.map} +1 -1
- package/dist/{parser-HZANYZZA.js → parser-7WVQ4BOA.js} +20 -18
- package/dist/{parser-HZANYZZA.js.map → parser-7WVQ4BOA.js.map} +1 -1
- package/dist/{parser-RYPZ245J.js → parser-M3T5WYXG.js} +17 -15
- package/dist/{parser-RYPZ245J.js.map → parser-M3T5WYXG.js.map} +1 -1
- package/dist/{parser-6M4IIKSU.cjs → parser-YJYGGUJP.cjs} +172 -170
- package/dist/parser-YJYGGUJP.cjs.map +1 -0
- package/dist/{pdf-ocr-J5BIUOOQ.js → pdf-ocr-T7XAXRHM.js} +6 -6
- package/dist/pdf-ocr-TBGICSC2.cjs +43 -0
- package/dist/{pdf-ocr-26AWXUHX.cjs.map → pdf-ocr-TBGICSC2.cjs.map} +1 -1
- package/dist/{pdf-ocr-VMB4NOXR.js → pdf-ocr-ZS6UGPZE.js} +9 -9
- package/dist/{profile-io-F6WUV5PU.js → profile-io-BRKSGV5H.js} +3 -3
- package/dist/{rasterize-AFUYHCSP.js → rasterize-NE7ODEL3.js} +3 -3
- package/dist/{redact-doc-UKYOAVBS.js → redact-doc-QMKBSH77.js} +25 -23
- package/dist/{redact-doc-UKYOAVBS.js.map → redact-doc-QMKBSH77.js.map} +1 -1
- package/dist/{render-VRZS47LX.js → render-YUUT36B3.js} +14 -14
- package/dist/{rewrite-fallback-PNSM4XRC.js → rewrite-fallback-VMIWMLXI.js} +15 -15
- package/dist/seal-WH555ZEQ.js +16 -0
- package/dist/{setup-VV6ERJGY.js → setup-EINQOQZN.js} +3 -3
- package/dist/to-hwpx-4VONWOHX.js +21 -0
- package/dist/to-hwpx-FL6MGYNQ.cjs +16 -0
- package/dist/{to-hwpx-3OWX37Q4.cjs.map → to-hwpx-FL6MGYNQ.cjs.map} +1 -1
- package/dist/{to-hwpx-YYMXNCCW.js → to-hwpx-RGSKEFZO.js} +5 -5
- package/dist/visual-TROK2J5W.js +40 -0
- package/dist/{watch-BTAIN7LZ.js → watch-LNCWW6C5.js} +26 -24
- package/dist/{watch-BTAIN7LZ.js.map → watch-LNCWW6C5.js.map} +1 -1
- package/package.json +6 -1
- package/dist/chunk-64QDDZO3.js.map +0 -1
- package/dist/chunk-6NZ32OTX.cjs +0 -149
- package/dist/chunk-6NZ32OTX.cjs.map +0 -1
- package/dist/chunk-A6YD5KUQ.js.map +0 -1
- package/dist/chunk-ARVHYL3V.cjs.map +0 -1
- package/dist/chunk-FU6ZDWCI.js +0 -151
- package/dist/chunk-FU6ZDWCI.js.map +0 -1
- package/dist/chunk-GHHVT4Q5.js.map +0 -1
- package/dist/chunk-JY4YMR6F.js.map +0 -1
- package/dist/chunk-QLUFTCAE.cjs.map +0 -1
- package/dist/chunk-S6H3ZPYQ.js.map +0 -1
- package/dist/chunk-UJELMNOU.js +0 -149
- package/dist/chunk-UJELMNOU.js.map +0 -1
- package/dist/chunk-ZH322FQG.js.map +0 -1
- package/dist/chunks-7XYOWREB.js +0 -11
- package/dist/detect-V75ERMYL.cjs +0 -27
- package/dist/detect-V75ERMYL.cjs.map +0 -1
- package/dist/generator-BPEAWT2P.cjs +0 -12
- package/dist/generator-NLWOHWUW.js +0 -18
- package/dist/generator-VBJWJI3E.js +0 -11
- package/dist/image-ocr-3CJ4KVOT.cjs +0 -214
- package/dist/image-ocr-3CJ4KVOT.cjs.map +0 -1
- package/dist/image-ocr-5RBEPJPK.js.map +0 -1
- package/dist/image-ocr-7EOTOS42.js.map +0 -1
- package/dist/memo-ARHG3OC5.js +0 -17
- package/dist/parser-6M4IIKSU.cjs.map +0 -1
- package/dist/pdf-ocr-26AWXUHX.cjs +0 -43
- package/dist/seal-CJOUVTMN.js +0 -16
- package/dist/to-hwpx-3OWX37Q4.cjs +0 -16
- package/dist/to-hwpx-WBMWA54L.js +0 -21
- package/dist/visual-YY2BPPCJ.js +0 -38
- /package/dist/{-CNXSUEGZ.js.map → -U7FV47XK.js.map} +0 -0
- /package/dist/{chunk-S6K222FM.js.map → chunk-2HHE3D4S.js.map} +0 -0
- /package/dist/{chunk-IV6UP7MO.js.map → chunk-2SMYX3L4.js.map} +0 -0
- /package/dist/{chunk-X4HNVXJI.js.map → chunk-2ZZCE4EM.js.map} +0 -0
- /package/dist/{chunk-TTIJTR5Z.js.map → chunk-3PTQBVDC.js.map} +0 -0
- /package/dist/{chunk-CGOCVSWC.js.map → chunk-5CGWJW3U.js.map} +0 -0
- /package/dist/{chunk-VMM5PVOA.js.map → chunk-6OFHUEHR.js.map} +0 -0
- /package/dist/{chunk-ABNK5QI2.js.map → chunk-AJYPIUQK.js.map} +0 -0
- /package/dist/{chunk-UMVL776E.js.map → chunk-AYEDNFX7.js.map} +0 -0
- /package/dist/{chunk-CBGH37CU.js.map → chunk-CRUAWSRK.js.map} +0 -0
- /package/dist/{chunk-RJ26GRDB.js.map → chunk-DDWV6OTG.js.map} +0 -0
- /package/dist/{chunk-2JA4FJJM.js.map → chunk-EYDAQBE7.js.map} +0 -0
- /package/dist/{chunk-BK55EX56.js.map → chunk-FCAMCNBA.js.map} +0 -0
- /package/dist/{chunk-VSWGRKTF.js.map → chunk-GJFS3GMY.js.map} +0 -0
- /package/dist/{chunk-LMHDQWQM.js.map → chunk-HSDIWTFF.js.map} +0 -0
- /package/dist/{chunk-B5F7B5NL.js.map → chunk-IOMH3NL4.js.map} +0 -0
- /package/dist/{chunk-XSDVY4S6.js.map → chunk-KD6SFQFJ.js.map} +0 -0
- /package/dist/{chunk-YLC25Z64.js.map → chunk-LGCD3V22.js.map} +0 -0
- /package/dist/{chunk-BX23BOYN.js.map → chunk-N32TKLQ6.js.map} +0 -0
- /package/dist/{chunk-MHLTXTP2.js.map → chunk-NT5EVBAI.js.map} +0 -0
- /package/dist/{chunk-NQL7NCSE.js.map → chunk-PNAMF4RV.js.map} +0 -0
- /package/dist/{chunk-JDGPQVTX.js.map → chunk-R2EIJJ34.js.map} +0 -0
- /package/dist/{chunk-AUGOG3KY.js.map → chunk-TXX5GDY3.js.map} +0 -0
- /package/dist/{chunk-BUB3O7LS.js.map → chunk-UI4NGY4W.js.map} +0 -0
- /package/dist/{chunk-32NWTEPA.js.map → chunk-UPBZ2BVU.js.map} +0 -0
- /package/dist/{chunk-P4FHTYVX.js.map → chunk-VFSDX4GE.js.map} +0 -0
- /package/dist/{chunk-376JPHHC.js.map → chunk-VOW7QLFA.js.map} +0 -0
- /package/dist/{chunk-S366ICXS.js.map → chunk-VREPDKMC.js.map} +0 -0
- /package/dist/{chunk-AAXWKG3C.js.map → chunk-WSNU2OAY.js.map} +0 -0
- /package/dist/{chunk-M4QZCXT4.js.map → chunk-YGCR55V2.js.map} +0 -0
- /package/dist/{chunks-7XYOWREB.js.map → chunks-EVKTSUGA.js.map} +0 -0
- /package/dist/{detect-ALS4RBCY.js.map → detect-EBGOXZ66.js.map} +0 -0
- /package/dist/{detect-LCFITDPT.js.map → detect-H2VUHKJS.js.map} +0 -0
- /package/dist/{formula-IP2SLKUY.js.map → formula-JZZKJXHR.js.map} +0 -0
- /package/dist/{formula-7Q6CKLK2.js.map → formula-TE5U7IPG.js.map} +0 -0
- /package/dist/{generator-NLWOHWUW.js.map → generator-CKTUVW7V.js.map} +0 -0
- /package/dist/{generator-VBJWJI3E.js.map → generator-Q5M3CZPW.js.map} +0 -0
- /package/dist/{hancom-P34JL3HX.js.map → hancom-JHPB6VOJ.js.map} +0 -0
- /package/dist/{hancom-DVWCKSEN.js.map → hancom-UFNCFHMZ.js.map} +0 -0
- /package/dist/{memo-ARHG3OC5.js.map → memo-FOTH3KQZ.js.map} +0 -0
- /package/dist/{model-bundle-7YL3PW4N.js.map → model-bundle-PJXVN44L.js.map} +0 -0
- /package/dist/{models-ZXDUWX64.js.map → models-GGI6Z7WG.js.map} +0 -0
- /package/dist/{pdf-ocr-J5BIUOOQ.js.map → pdf-ocr-T7XAXRHM.js.map} +0 -0
- /package/dist/{pdf-ocr-VMB4NOXR.js.map → pdf-ocr-ZS6UGPZE.js.map} +0 -0
- /package/dist/{profile-io-F6WUV5PU.js.map → profile-io-BRKSGV5H.js.map} +0 -0
- /package/dist/{rasterize-AFUYHCSP.js.map → rasterize-NE7ODEL3.js.map} +0 -0
- /package/dist/{render-VRZS47LX.js.map → render-YUUT36B3.js.map} +0 -0
- /package/dist/{rewrite-fallback-PNSM4XRC.js.map → rewrite-fallback-VMIWMLXI.js.map} +0 -0
- /package/dist/{seal-CJOUVTMN.js.map → seal-WH555ZEQ.js.map} +0 -0
- /package/dist/{setup-VV6ERJGY.js.map → setup-EINQOQZN.js.map} +0 -0
- /package/dist/{to-hwpx-WBMWA54L.js.map → to-hwpx-4VONWOHX.js.map} +0 -0
- /package/dist/{to-hwpx-YYMXNCCW.js.map → to-hwpx-RGSKEFZO.js.map} +0 -0
- /package/dist/{visual-YY2BPPCJ.js.map → visual-TROK2J5W.js.map} +0 -0
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunk4TDUZ6UNcjs = require('./chunk-4TDUZ6UN.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
var _chunkQLUFTCAEcjs = require('./chunk-QLUFTCAE.cjs');
|
|
9
9
|
|
|
10
|
+
var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
|
|
10
11
|
|
|
11
|
-
var _chunk6NZ32OTXcjs = require('./chunk-6NZ32OTX.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
var _chunkTV7B6DJQcjs = require('./chunk-TV7B6DJQ.cjs');
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
var _chunkHHLZQQNLcjs = require('./chunk-HHLZQQNL.cjs');
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
|
|
@@ -69,11 +71,11 @@ var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
|
|
|
69
71
|
|
|
70
72
|
|
|
71
73
|
|
|
72
|
-
var
|
|
74
|
+
var _chunkHFYDNNDBcjs = require('./chunk-HFYDNNDB.cjs');
|
|
73
75
|
|
|
74
76
|
|
|
75
77
|
var _chunkMMK32GPDcjs = require('./chunk-MMK32GPD.cjs');
|
|
76
|
-
require('./chunk-
|
|
78
|
+
require('./chunk-7DB4UKU4.cjs');
|
|
77
79
|
|
|
78
80
|
|
|
79
81
|
|
|
@@ -90,11 +92,11 @@ require('./chunk-O4TKUBCF.cjs');
|
|
|
90
92
|
|
|
91
93
|
|
|
92
94
|
|
|
93
|
-
var
|
|
95
|
+
var _chunkFE7463HFcjs = require('./chunk-FE7463HF.cjs');
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
|
|
97
|
-
var
|
|
99
|
+
var _chunkTOUR2SPIcjs = require('./chunk-TOUR2SPI.cjs');
|
|
98
100
|
|
|
99
101
|
|
|
100
102
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
@@ -427,7 +429,7 @@ async function extractPageImages(page, fnArray, argsArray, pageNumber, state, wa
|
|
|
427
429
|
let pristine;
|
|
428
430
|
let paintIndex = -1;
|
|
429
431
|
const regions = state.placement ? /* @__PURE__ */ new Map() : void 0;
|
|
430
|
-
if (regions)
|
|
432
|
+
if (regions) _chunkHFYDNNDBcjs.extractImageRegions.call(void 0, fnArray, argsArray, false, regions);
|
|
431
433
|
const placed = (block, i) => {
|
|
432
434
|
const r = _optionalChain([regions, 'optionalAccess', _4 => _4.get, 'call', _5 => _5(i)]);
|
|
433
435
|
if (r) block.bbox = { page: pageNumber, x: r.x1, y: r.y1, width: r.x2 - r.x1, height: r.y2 - r.y1 };
|
|
@@ -509,7 +511,7 @@ async function extractPageImages(page, fnArray, argsArray, pageNumber, state, wa
|
|
|
509
511
|
if (state.seen.has(hash)) continue;
|
|
510
512
|
const rgba = toRgba(imgData, withBytes || !!readQr || state.dropBlank);
|
|
511
513
|
if (!rgba) continue;
|
|
512
|
-
if (state.dropBlank &&
|
|
514
|
+
if (state.dropBlank && _chunk4TDUZ6UNcjs.isBlankRgba.call(void 0, rgba)) {
|
|
513
515
|
state.seen.set(hash, "");
|
|
514
516
|
continue;
|
|
515
517
|
}
|
|
@@ -553,7 +555,7 @@ async function capReached(state, pageNumber, warnings) {
|
|
|
553
555
|
async function pushImage(state, filename, w, h, rgba, images) {
|
|
554
556
|
if (!webpable(state, w, h)) {
|
|
555
557
|
if (state.webp) state.oversize++;
|
|
556
|
-
const png =
|
|
558
|
+
const png = _chunkHHLZQQNLcjs.encodePng.call(void 0, w, h, rgba);
|
|
557
559
|
state.totalBytes += png.length;
|
|
558
560
|
images.push({ filename, data: png, mimeType: "image/png" });
|
|
559
561
|
return;
|
|
@@ -568,7 +570,7 @@ async function pushImage(state, filename, w, h, rgba, images) {
|
|
|
568
570
|
},
|
|
569
571
|
// 실패해도 파싱은 계속한다 — 그 그림만 PNG 로. 블록의 이름은 flushPdfImages 가 바꾼다
|
|
570
572
|
() => {
|
|
571
|
-
image.data =
|
|
573
|
+
image.data = _chunkHHLZQQNLcjs.encodePng.call(void 0, w, h, rgba);
|
|
572
574
|
image.mimeType = "image/png";
|
|
573
575
|
image.filename = filename.replace(/\.webp$/, ".png");
|
|
574
576
|
state.totalBytes += image.data.length;
|
|
@@ -609,7 +611,7 @@ async function extractPdfiumImage(image, pageNumber, state, warnings, withBytes,
|
|
|
609
611
|
const hash = `${w}x${h}kPh${contentHash(rgba)}`;
|
|
610
612
|
state.rawKeys.set(image.raw, hash);
|
|
611
613
|
if (state.seen.has(hash)) return null;
|
|
612
|
-
if (state.dropBlank &&
|
|
614
|
+
if (state.dropBlank && _chunk4TDUZ6UNcjs.isBlankRgba.call(void 0, rgba)) {
|
|
613
615
|
state.seen.set(hash, "");
|
|
614
616
|
return null;
|
|
615
617
|
}
|
|
@@ -1057,13 +1059,13 @@ function ocrVectorOps(opList, paths) {
|
|
|
1057
1059
|
|
|
1058
1060
|
// src/pdf/split-row-pattern.ts
|
|
1059
1061
|
var textOf = (cell) => cell.text.replace(/<\/?u>|~~/g, "").trim();
|
|
1060
|
-
var plain = (cell) => !_optionalChain([cell, 'access', _31 => _31.blocks, 'optionalAccess', _32 => _32.length]) && !
|
|
1062
|
+
var plain = (cell) => !_optionalChain([cell, 'access', _31 => _31.blocks, 'optionalAccess', _32 => _32.length]) && !_chunkHFYDNNDBcjs.IMAGE_CELLS.has(cell);
|
|
1061
1063
|
var labelsOf = (cell) => {
|
|
1062
1064
|
const labels = textOf(cell).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
1063
1065
|
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;
|
|
1064
1066
|
};
|
|
1065
1067
|
var alignedLabels = (label, value, count) => {
|
|
1066
|
-
const L =
|
|
1068
|
+
const L = _chunkHFYDNNDBcjs.CELL_LINES.get(label), V = _chunkHFYDNNDBcjs.CELL_LINES.get(value);
|
|
1067
1069
|
let next = 0;
|
|
1068
1070
|
return !!L && !!V && L.length === count && V.length >= count && Math.abs(L[0].y - V[0].y) <= 1 && L.every((l) => {
|
|
1069
1071
|
while (next < V.length && Math.abs(l.y - V[next].y) > 1) next++;
|
|
@@ -1071,7 +1073,7 @@ var alignedLabels = (label, value, count) => {
|
|
|
1071
1073
|
});
|
|
1072
1074
|
};
|
|
1073
1075
|
function partialAlignedLabelCells(table, owner, first) {
|
|
1074
|
-
const pageOf = (a) => _nullishCoalesce(
|
|
1076
|
+
const pageOf = (a) => _nullishCoalesce(_chunkFE7463HFcjs.CELL_PAGES.get(_nullishCoalesce(a.cell, () => ( table.cells[a.r][a.c]))), () => ( (a.r < first ? -1 : -2)));
|
|
1075
1077
|
const pairs = [];
|
|
1076
1078
|
let carried = false;
|
|
1077
1079
|
for (let c = 0; c < table.cols; ) {
|
|
@@ -1094,10 +1096,10 @@ function partialAlignedLabelCells(table, owner, first) {
|
|
|
1094
1096
|
const keyed = pairs.filter((p) => labelsOf(p.upper) && labelsOf(p.lower));
|
|
1095
1097
|
if (keyed.length !== 1) return;
|
|
1096
1098
|
const label = keyed[0], value = pairs.find((p) => p.c === label.c + label.cs), context = pairs.find((p) => p.c + p.cs === label.c);
|
|
1097
|
-
if (!value || !context || value === context || textOf(context.upper).replace(/\s+/g, "") === textOf(context.lower).replace(/\s+/g, "") || !_optionalChain([
|
|
1099
|
+
if (!value || !context || value === context || textOf(context.upper).replace(/\s+/g, "") === textOf(context.lower).replace(/\s+/g, "") || !_optionalChain([_chunkFE7463HFcjs.CELL_EDGES, 'access', _43 => _43.get, 'call', _44 => _44(context.upper), 'optionalAccess', _45 => _45.b]) || !_optionalChain([_chunkFE7463HFcjs.CELL_EDGES, 'access', _46 => _46.get, 'call', _47 => _47(context.lower), 'optionalAccess', _48 => _48.t])) return;
|
|
1098
1100
|
const U = labelsOf(label.upper), D = labelsOf(label.lower), sequence = [...U, ...D];
|
|
1099
1101
|
if (D.length < 2 || sequence.length < 3 || new Set(sequence).size !== sequence.length || !alignedLabels(label.upper, value.upper, U.length)) return;
|
|
1100
|
-
const L =
|
|
1102
|
+
const L = _chunkHFYDNNDBcjs.CELL_LINES.get(label.lower), V = _chunkHFYDNNDBcjs.CELL_LINES.get(value.lower);
|
|
1101
1103
|
if (!L || !V || L.length !== D.length) return;
|
|
1102
1104
|
let next = V.findIndex((v) => Math.abs(v.y - L[0].y) <= 1);
|
|
1103
1105
|
if (next <= 0 || !V.slice(0, next).every((v) => v.y > L[0].y + 1) || !L.every((l) => {
|
|
@@ -1117,14 +1119,14 @@ function partialAlignedLabelCells(table, owner, first) {
|
|
|
1117
1119
|
continue;
|
|
1118
1120
|
}
|
|
1119
1121
|
if (list.length < 3 || new Set(list).size !== list.length) continue;
|
|
1120
|
-
const visible = _nullishCoalesce(_optionalChain([
|
|
1122
|
+
const visible = _nullishCoalesce(_optionalChain([_chunkHFYDNNDBcjs.CELL_LINES, 'access', _53 => _53.get, 'call', _54 => _54(lc), 'optionalAccess', _55 => _55.length]), () => ( 0)), values = _chunkHFYDNNDBcjs.CELL_LINES.get(vc);
|
|
1121
1123
|
if (visible < 3 || visible > list.length || !values || !alignedLabels(lc, vc, visible)) continue;
|
|
1122
1124
|
const top = Math.max(...values.map((v2) => v2.y)), bottom = Math.min(...values.map((v2) => v2.y));
|
|
1123
1125
|
const contexts = [];
|
|
1124
1126
|
for (let rr = r; rr < r + l.rs && rr < table.rows; rr++) {
|
|
1125
1127
|
const a = _optionalChain([owner, 'access', _56 => _56[rr], 'optionalAccess', _57 => _57[context.c]]), cell = a ? table.cells[a.r][a.c] : void 0;
|
|
1126
1128
|
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;
|
|
1127
|
-
const lines =
|
|
1129
|
+
const lines = _chunkHFYDNNDBcjs.CELL_LINES.get(cell);
|
|
1128
1130
|
if (!_optionalChain([lines, 'optionalAccess', _58 => _58.length]) || lines.some((line) => line.y > top + 1 || line.y < bottom - 1)) break;
|
|
1129
1131
|
contexts.push(textOf(cell).replace(/\s+/g, ""));
|
|
1130
1132
|
}
|
|
@@ -1426,7 +1428,7 @@ function rowStarts(t) {
|
|
|
1426
1428
|
}
|
|
1427
1429
|
var covering = (t, r) => rowStarts(t).slice(0, r + 1).flatMap((starts, rr) => starts.filter((s) => rr + s.cell.rowSpan > r).map((s) => s.cell));
|
|
1428
1430
|
function cellPage(cell) {
|
|
1429
|
-
const p =
|
|
1431
|
+
const p = _chunkFE7463HFcjs.CELL_PAGES.get(cell);
|
|
1430
1432
|
if (p !== void 0 || !_optionalChain([cell, 'access', _125 => _125.blocks, 'optionalAccess', _126 => _126.length]) || cell.blocks.some((b) => b.pageNumber === void 0)) return p;
|
|
1431
1433
|
return Math.min(...cell.blocks.map((b) => b.pageNumber));
|
|
1432
1434
|
}
|
|
@@ -1455,7 +1457,7 @@ function markJoinedPages(table, prev, curr) {
|
|
|
1455
1457
|
rows.forEach((starts, r) => {
|
|
1456
1458
|
const page2 = r < pt.rows ? pp[r] : cp[r - off];
|
|
1457
1459
|
for (const { cell } of starts) {
|
|
1458
|
-
if (page2 !== void 0 && page2 !== prev.pageNumber)
|
|
1460
|
+
if (page2 !== void 0 && page2 !== prev.pageNumber) _chunkFE7463HFcjs.CELL_PAGES.set(cell, page2);
|
|
1459
1461
|
const src = _optionalChain([(r < pt.rows ? ptRows[r] : ctRows[r - off]), 'optionalAccess', _129 => _129.find, 'call', _130 => _130((s) => s.cell !== cell && s.cell.text === cell.text && CELL_SPLITS.has(s.cell))]);
|
|
1460
1462
|
if (src) setSplits(cell, relocate(src.cell, cell));
|
|
1461
1463
|
}
|
|
@@ -1515,8 +1517,8 @@ function splitCrossPageRows(t, pageNumber) {
|
|
|
1515
1517
|
if (!splits.length) continue;
|
|
1516
1518
|
const clone = (cell, patch) => {
|
|
1517
1519
|
const out = { ...cell, ...patch };
|
|
1518
|
-
const p =
|
|
1519
|
-
if (p !== void 0)
|
|
1520
|
+
const p = _chunkFE7463HFcjs.CELL_PAGES.get(cell);
|
|
1521
|
+
if (p !== void 0) _chunkFE7463HFcjs.CELL_PAGES.set(out, p);
|
|
1520
1522
|
if (!("text" in patch) && CELL_SPLITS.has(cell)) CELL_SPLITS.set(out, CELL_SPLITS.get(cell));
|
|
1521
1523
|
return out;
|
|
1522
1524
|
};
|
|
@@ -1527,7 +1529,7 @@ function splitCrossPageRows(t, pageNumber) {
|
|
|
1527
1529
|
for (const { cell, c, split } of splits) {
|
|
1528
1530
|
cells[r][c] = clone(cell, { ...split.head, rowSpan: cut - r });
|
|
1529
1531
|
const tail = { ...cell, ...split.tail, rowSpan: r + cell.rowSpan - cut };
|
|
1530
|
-
|
|
1532
|
+
_chunkFE7463HFcjs.CELL_PAGES.set(tail, split.page);
|
|
1531
1533
|
setSplits(tail, split.rest);
|
|
1532
1534
|
cells[cut][c] = tail;
|
|
1533
1535
|
}
|
|
@@ -1537,7 +1539,7 @@ function splitCrossPageRows(t, pageNumber) {
|
|
|
1537
1539
|
for (const { cell, c, split } of splits) {
|
|
1538
1540
|
cells[r][c] = clone(cell, split.head);
|
|
1539
1541
|
const tail = { ...cell, ...split.tail, rowSpan: 1 };
|
|
1540
|
-
|
|
1542
|
+
_chunkFE7463HFcjs.CELL_PAGES.set(tail, split.page);
|
|
1541
1543
|
setSplits(tail, split.rest);
|
|
1542
1544
|
row[c] = tail;
|
|
1543
1545
|
}
|
|
@@ -1628,7 +1630,7 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
|
|
|
1628
1630
|
if (cols < 1) return null;
|
|
1629
1631
|
const pa = anchorsOf(prev), ca = anchorsOf(curr);
|
|
1630
1632
|
const cutOpen = (() => {
|
|
1631
|
-
const u =
|
|
1633
|
+
const u = _chunkHFYDNNDBcjs.ROW_RULES.get(prev), d = _chunkHFYDNNDBcjs.ROW_RULES.get(curr);
|
|
1632
1634
|
return !!u && !!d && !u.bottom && !d.top;
|
|
1633
1635
|
})();
|
|
1634
1636
|
let skip = 0, head = 0;
|
|
@@ -1660,19 +1662,19 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
|
|
|
1660
1662
|
if (r + dr < rows) owner[r + dr][dc] = placed;
|
|
1661
1663
|
}
|
|
1662
1664
|
grid[r][c1] = { ...a.cell, colSpan: c2 - c1, rowSpan: a.rs };
|
|
1663
|
-
const lines =
|
|
1664
|
-
if (lines)
|
|
1665
|
-
if (
|
|
1666
|
-
const edges =
|
|
1665
|
+
const lines = _chunkHFYDNNDBcjs.CELL_LINES.get(a.cell);
|
|
1666
|
+
if (lines) _chunkHFYDNNDBcjs.CELL_LINES.set(grid[r][c1], shift ? lines.map((l) => ({ ...l, l: l.l + shift, r: l.r + shift })) : lines);
|
|
1667
|
+
if (_chunkHFYDNNDBcjs.IMAGE_CELLS.has(a.cell)) _chunkHFYDNNDBcjs.IMAGE_CELLS.add(grid[r][c1]);
|
|
1668
|
+
const edges = _chunkFE7463HFcjs.CELL_EDGES.get(a.cell);
|
|
1667
1669
|
if (edges) {
|
|
1668
|
-
|
|
1670
|
+
_chunkFE7463HFcjs.CELL_EDGES.set(grid[r][c1], edges);
|
|
1669
1671
|
edged = true;
|
|
1670
1672
|
}
|
|
1671
1673
|
return true;
|
|
1672
1674
|
};
|
|
1673
|
-
for (const a of pa) if (!
|
|
1675
|
+
for (const a of pa) if (!_chunkHFYDNNDBcjs.FILLER_CELLS.has(a.cell) && !place(a, pcx, 0)) return null;
|
|
1674
1676
|
for (const a of ca) {
|
|
1675
|
-
if (a.r < skip ||
|
|
1677
|
+
if (a.r < skip || _chunkHFYDNNDBcjs.FILLER_CELLS.has(a.cell)) continue;
|
|
1676
1678
|
if (!place(a, cxU, prev.rows - skip, dx)) return null;
|
|
1677
1679
|
}
|
|
1678
1680
|
const first = prev.rows;
|
|
@@ -1696,9 +1698,9 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
|
|
|
1696
1698
|
const grown = { ...above, rs: newRs };
|
|
1697
1699
|
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;
|
|
1698
1700
|
}
|
|
1699
|
-
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null)
|
|
1701
|
+
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null) _chunkHFYDNNDBcjs.FILLER_CELLS.add(grid[r][c]);
|
|
1700
1702
|
if (edged) {
|
|
1701
|
-
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null)
|
|
1703
|
+
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) if (owner[r][c] === null) _chunkFE7463HFcjs.CELL_EDGES.set(grid[r][c], _chunkHFYDNNDBcjs.NO_EDGES);
|
|
1702
1704
|
}
|
|
1703
1705
|
for (let c = 0; c < cols && U[c + 1] <= pcx[0] + PART_COL_TOL; c++) {
|
|
1704
1706
|
let r = prev.rows;
|
|
@@ -1707,7 +1709,7 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
|
|
|
1707
1709
|
for (let rr = 0; rr < r; rr++) owner[rr][c] = through;
|
|
1708
1710
|
}
|
|
1709
1711
|
const table = { rows, cols, cells: grid, hasHeader: prev.hasHeader, ...prev.caption ? { caption: prev.caption } : {} };
|
|
1710
|
-
const pr =
|
|
1712
|
+
const pr = _chunkHFYDNNDBcjs.ROW_RULES.get(prev), cr = _chunkHFYDNNDBcjs.ROW_RULES.get(curr);
|
|
1711
1713
|
const shifted = dx !== 0;
|
|
1712
1714
|
const cut = {
|
|
1713
1715
|
open: !!pr && !!cr && !pr.bottom && !cr.top && pr.innerOpen + cr.innerOpen === 0 && pr.innerRuled + cr.innerRuled > 0,
|
|
@@ -1715,13 +1717,13 @@ function joinSplitParts(prev, pcx, curr, ccx, dx = 0, prevBottom, lex) {
|
|
|
1715
1717
|
list: !shifted ? "any" : skip > 0 && ca.filter((a) => a.r < skip && a.cell.text.trim()).length < 2 ? "none" : "multi"
|
|
1716
1718
|
};
|
|
1717
1719
|
let partial = !skip && cols === prev.cols && cols === curr.cols && cut.ruled && prevBottom !== void 0 ? partialAlignedLabelCells(table, owner, first) : void 0;
|
|
1718
|
-
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]) ||
|
|
1720
|
+
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]) || _chunkHFYDNNDBcjs.startsNewItem.call(void 0, partial.value.upper.text, partial.value.lower.text))) partial = void 0;
|
|
1719
1721
|
const selected = partial ? /* @__PURE__ */ new Set([partial.label.c, partial.value.c]) : void 0;
|
|
1720
1722
|
let split = !selected && rows > prev.rows && mergeSplitRow(table, owner, prev.rows, U, false, cut);
|
|
1721
1723
|
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 });
|
|
1722
1724
|
if (pr && cr) {
|
|
1723
1725
|
const cutRuled = pr.bottom || cr.top;
|
|
1724
|
-
|
|
1726
|
+
_chunkHFYDNNDBcjs.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) });
|
|
1725
1727
|
}
|
|
1726
1728
|
return { table, colXs: U, split, header: ca.filter((a) => a.r < skip && a.cell.text.trim()).length >= 2 };
|
|
1727
1729
|
}
|
|
@@ -1783,18 +1785,18 @@ function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs, selec
|
|
|
1783
1785
|
if (!d || d === u || u.r + u.rs - 1 !== last || d.r !== first || d.c !== u.c || d.cs !== u.cs) continue;
|
|
1784
1786
|
const a = table.cells[u.r][u.c], b = table.cells[first][d.c];
|
|
1785
1787
|
if (selected && !selected.has(u.c)) continue;
|
|
1786
|
-
const flowsOn = itemBreak && straddles && !!colXs && hasContent(a) && hasContent(b) && longLastLine(a) && !
|
|
1787
|
-
const openSeam = hasContent(a) && hasContent(b) &&
|
|
1788
|
+
const flowsOn = itemBreak && straddles && !!colXs && hasContent(a) && hasContent(b) && longLastLine(a) && !_chunkHFYDNNDBcjs.startsNewItem.call(void 0, a.text, b.text) && continuesAcross(a, b, colXs[u.c], colXs[u.c + u.cs]);
|
|
1789
|
+
const openSeam = hasContent(a) && hasContent(b) && _chunkHFYDNNDBcjs.hasOpenCellSeam.call(void 0, a, b) && !owner.some((row, r) => {
|
|
1788
1790
|
if (!r || r === first) return false;
|
|
1789
1791
|
const up = owner[r - 1][u.c], down = row[u.c];
|
|
1790
1792
|
if (!up || !down || up === down || up.c !== u.c || down.c !== u.c || up.cs !== u.cs || down.cs !== u.cs) return false;
|
|
1791
|
-
const ue =
|
|
1793
|
+
const ue = _chunkFE7463HFcjs.CELL_EDGES.get(table.cells[up.r][up.c]), de = _chunkFE7463HFcjs.CELL_EDGES.get(table.cells[down.r][down.c]);
|
|
1792
1794
|
return !!ue && !!de && !ue.b && !de.t;
|
|
1793
1795
|
});
|
|
1794
1796
|
if (!selected && !openSeam && !flowsOn && !crossed.has(shape(u, d)) && !(u.rs >= 2 && u.c + u.cs <= firstNew && hasContent(a) && !hasContent(b))) {
|
|
1795
1797
|
if (!straddles && !midWord) continue;
|
|
1796
1798
|
if (u.r >= last && d.rs < 2) continue;
|
|
1797
|
-
const U =
|
|
1799
|
+
const U = _chunkHFYDNNDBcjs.CELL_LINES.get(a);
|
|
1798
1800
|
if (!_optionalChain([U, 'optionalAccess', _156 => _156.length]) || !hasContent(b)) continue;
|
|
1799
1801
|
if (!(straddles && filledToBottom(U, prevBottom) && clauseContinues(a, b))) {
|
|
1800
1802
|
if (U.length > STRADDLE_MAX_LINES) continue;
|
|
@@ -1812,7 +1814,7 @@ function mergeStraddlingCells(table, owner, first, prevBottom, lex, colXs, selec
|
|
|
1812
1814
|
return merged;
|
|
1813
1815
|
}
|
|
1814
1816
|
function longLastLine(c) {
|
|
1815
|
-
const L =
|
|
1817
|
+
const L = _chunkHFYDNNDBcjs.CELL_LINES.get(c), l = _optionalChain([L, 'optionalAccess', _157 => _157[L.length - 1]]);
|
|
1816
1818
|
return !!l && l.r - l.l >= 6 * (l.h || 10);
|
|
1817
1819
|
}
|
|
1818
1820
|
function filledToBottom(U, bottom) {
|
|
@@ -1845,7 +1847,7 @@ function nextItemHead(prev, next) {
|
|
|
1845
1847
|
return false;
|
|
1846
1848
|
}
|
|
1847
1849
|
function continuesAcross(u, d, x1, x2) {
|
|
1848
|
-
const U =
|
|
1850
|
+
const U = _chunkHFYDNNDBcjs.CELL_LINES.get(u), D = _chunkHFYDNNDBcjs.CELL_LINES.get(d);
|
|
1849
1851
|
if (!_optionalChain([U, 'optionalAccess', _158 => _158.length]) || !_optionalChain([D, 'optionalAccess', _159 => _159.length])) return false;
|
|
1850
1852
|
const last = U[U.length - 1];
|
|
1851
1853
|
const fs = last.h || 10;
|
|
@@ -1863,7 +1865,7 @@ function continuesAcross(u, d, x1, x2) {
|
|
|
1863
1865
|
if (U.length === 1 && x2 - last.r > Math.max(FULL_LINE_EDGE_MIN, SINGLE_LINE_WORD_GAP * fs)) return false;
|
|
1864
1866
|
const indented = last.l - minL >= HANGING_MIN * fs;
|
|
1865
1867
|
if (last.r - last.l < FULL_LINE_MIN_FRAC * (indented ? x2 - last.l : x2 - x1)) return false;
|
|
1866
|
-
const newItem =
|
|
1868
|
+
const newItem = _chunkHFYDNNDBcjs.startsNewItem.call(void 0, u.text, d.text);
|
|
1867
1869
|
const all = D.length ? U.concat(D) : U;
|
|
1868
1870
|
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));
|
|
1869
1871
|
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;
|
|
@@ -1880,10 +1882,10 @@ function outlineContinues(u, d) {
|
|
|
1880
1882
|
return U.length >= 2 && D.length >= 1 && U.some((l) => OUTLINE_HEAD.test(l)) && OUTLINE_ITEM.test(D[0]);
|
|
1881
1883
|
}
|
|
1882
1884
|
function lineEnded(c, x1, x2, next) {
|
|
1883
|
-
const L =
|
|
1885
|
+
const L = _chunkHFYDNNDBcjs.CELL_LINES.get(c);
|
|
1884
1886
|
if (!L || L.length !== 1) return false;
|
|
1885
1887
|
const l = L[0], h = l.h || 10;
|
|
1886
|
-
const d0 = next ? _optionalChain([
|
|
1888
|
+
const d0 = next ? _optionalChain([_chunkHFYDNNDBcjs.CELL_LINES, 'access', _160 => _160.get, 'call', _161 => _161(next), 'optionalAccess', _162 => _162[0]]) : void 0;
|
|
1887
1889
|
if (d0 && d0.l - l.l >= HANGING_MIN * h) return false;
|
|
1888
1890
|
return x2 - l.r - (l.l - x1) >= Math.max(LABEL_ROOM, firstWordUnits(_nullishCoalesce(_optionalChain([next, 'optionalAccess', _163 => _163.text]), () => ( "")))) * h;
|
|
1889
1891
|
}
|
|
@@ -1894,15 +1896,15 @@ function firstWordUnits(text) {
|
|
|
1894
1896
|
return units;
|
|
1895
1897
|
}
|
|
1896
1898
|
function appendCell(a, b) {
|
|
1897
|
-
if (
|
|
1899
|
+
if (_chunkHFYDNNDBcjs.IMAGE_CELLS.has(b)) _chunkHFYDNNDBcjs.IMAGE_CELLS.add(a);
|
|
1898
1900
|
if (_optionalChain([a, 'access', _164 => _164.blocks, 'optionalAccess', _165 => _165.length]) || _optionalChain([b, 'access', _166 => _166.blocks, 'optionalAccess', _167 => _167.length])) {
|
|
1899
1901
|
const asBlocks = (c) => _optionalChain([c, 'access', _168 => _168.blocks, 'optionalAccess', _169 => _169.length]) ? c.blocks : c.text.split("\n").map((l) => l.trim()).filter(Boolean).map((text) => ({ type: "paragraph", text }));
|
|
1900
1902
|
a.blocks = [...asBlocks(a), ...asBlocks(b)];
|
|
1901
1903
|
}
|
|
1902
1904
|
if (b.text.trim()) a.text = a.text.trim() ? a.text + "\n" + b.text : b.text;
|
|
1903
|
-
|
|
1905
|
+
_chunkHFYDNNDBcjs.joinCellEdges.call(void 0, a, b);
|
|
1904
1906
|
}
|
|
1905
|
-
var hasContent = (cell) => !!cell.text.trim() || !!_optionalChain([cell, 'access', _170 => _170.blocks, 'optionalAccess', _171 => _171.length]) ||
|
|
1907
|
+
var hasContent = (cell) => !!cell.text.trim() || !!_optionalChain([cell, 'access', _170 => _170.blocks, 'optionalAccess', _171 => _171.length]) || _chunkHFYDNNDBcjs.IMAGE_CELLS.has(cell);
|
|
1906
1908
|
var CLAUSE_OPEN_ENDING = /(?:하는|되는|하고|하며|하여|되어|되고|되며|이며|으며|어야|아야|여야)$/;
|
|
1907
1909
|
var batchim = (ch) => {
|
|
1908
1910
|
const k = ch.charCodeAt(0) - 44032;
|
|
@@ -1910,7 +1912,7 @@ var batchim = (ch) => {
|
|
|
1910
1912
|
};
|
|
1911
1913
|
function clauseContinues(u, d) {
|
|
1912
1914
|
const tail = _nullishCoalesce(flowText(u.text).trim().split(/\s+/).pop(), () => ( "")), head = flowText(d.text).trim();
|
|
1913
|
-
if (!/^[가-힣]{2,}$/.test(tail) || !/^[가-힣]/.test(head) ||
|
|
1915
|
+
if (!/^[가-힣]{2,}$/.test(tail) || !/^[가-힣]/.test(head) || _chunkHFYDNNDBcjs.startsNewItem.call(void 0, u.text, head)) return false;
|
|
1914
1916
|
const last = tail[tail.length - 1], before = tail[tail.length - 2];
|
|
1915
1917
|
return last === "\uC744" && batchim(before) || last === "\uB97C" && !batchim(before) || CLAUSE_OPEN_ENDING.test(tail);
|
|
1916
1918
|
}
|
|
@@ -1918,8 +1920,8 @@ function quantityContinues(u, d) {
|
|
|
1918
1920
|
return /\d[\d,.]*\s*(?:%|[가-힣]{1,2})?$/.test(flowText(u.text).trim()) && /^(?:미만|이상|이하|초과)(?![가-힣])/.test(flowText(d.text).trim());
|
|
1919
1921
|
}
|
|
1920
1922
|
function wordOverflows(u, d, x1, x2) {
|
|
1921
|
-
const U =
|
|
1922
|
-
if (!_optionalChain([U, 'optionalAccess', _172 => _172.length]) ||
|
|
1923
|
+
const U = _chunkHFYDNNDBcjs.CELL_LINES.get(u);
|
|
1924
|
+
if (!_optionalChain([U, 'optionalAccess', _172 => _172.length]) || _chunkHFYDNNDBcjs.startsNewItem.call(void 0, u.text, d.text)) return false;
|
|
1923
1925
|
const last = U[U.length - 1], units = firstWordUnits(d.text);
|
|
1924
1926
|
return units > 0 && last.r - last.l + units * (last.h || 10) > x2 - x1;
|
|
1925
1927
|
}
|
|
@@ -1988,7 +1990,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
|
|
|
1988
1990
|
if (!carriedSplit && !band) {
|
|
1989
1991
|
const norm = (c) => flowText(c.text).replace(/\s+/g, "");
|
|
1990
1992
|
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;
|
|
1991
|
-
const oneLine = (c) => _optionalChain([
|
|
1993
|
+
const oneLine = (c) => _optionalChain([_chunkHFYDNNDBcjs.CELL_LINES, 'access', _174 => _174.get, 'call', _175 => _175(c), 'optionalAccess', _176 => _176.length]) === 1;
|
|
1992
1994
|
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;
|
|
1993
1995
|
if (cut.ruled && pairs.some(([u, d]) => u.rs >= 2 && hasContent(u.cell) && hasContent(d.cell) && oneLine(cell(u)) && oneLine(cell(d)) && norm(cell(u)) !== norm(cell(d)))) return false;
|
|
1994
1996
|
const flows = ([u, d]) => continuesAcross(cell(u), cell(d), colXs[u.c], colXs[u.c + u.cs]) || clauseContinues(cell(u), cell(d)) || quantityContinues(cell(u), cell(d));
|
|
@@ -2081,19 +2083,19 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
|
|
|
2081
2083
|
placeJoined(blocks, i, j, joined);
|
|
2082
2084
|
continue;
|
|
2083
2085
|
}
|
|
2084
|
-
if (
|
|
2086
|
+
if (_chunkHFYDNNDBcjs.EMPTY_PARTS.has(curr.table)) {
|
|
2085
2087
|
blocks.splice(j, 1);
|
|
2086
2088
|
i++;
|
|
2087
2089
|
continue;
|
|
2088
2090
|
}
|
|
2089
2091
|
if (joined === null) continue;
|
|
2090
|
-
if (prev.table.cols !== curr.table.cols || prev.table.renderAsTable !== curr.table.renderAsTable ||
|
|
2092
|
+
if (prev.table.cols !== curr.table.cols || prev.table.renderAsTable !== curr.table.renderAsTable || _chunkHFYDNNDBcjs.EMPTY_PARTS.has(prev.table)) continue;
|
|
2091
2093
|
const width = Math.max(prev.bbox.width, curr.bbox.width, 1);
|
|
2092
2094
|
const leftDiff = Math.abs(prev.bbox.x - curr.bbox.x);
|
|
2093
2095
|
const rightDiff = Math.abs(prev.bbox.x + prev.bbox.width - (curr.bbox.x + curr.bbox.width));
|
|
2094
2096
|
if (leftDiff > width * NEIGHBOR_TABLE_EPSILON || rightDiff > width * NEIGHBOR_TABLE_EPSILON) continue;
|
|
2095
|
-
const px =
|
|
2096
|
-
if (px && cx && !shiftedSame(px, cx, !
|
|
2097
|
+
const px = _chunkHFYDNNDBcjs.TABLE_COLXS.get(prev.table), cx = _chunkHFYDNNDBcjs.TABLE_COLXS.get(curr.table);
|
|
2098
|
+
if (px && cx && !shiftedSame(px, cx, !_chunkHFYDNNDBcjs.CLIP_TABLES.has(prev.table) && !_chunkHFYDNNDBcjs.CLIP_TABLES.has(curr.table))) continue;
|
|
2097
2099
|
if (!px !== !cx) continue;
|
|
2098
2100
|
if (!rowTextsEqual(prev.table.cells[0], curr.table.cells[0]) && sameHeadShape(prev.table.cells[0], curr.table.cells[0])) continue;
|
|
2099
2101
|
let currCells = curr.table.cells;
|
|
@@ -2105,16 +2107,16 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
|
|
|
2105
2107
|
blocks.splice(j, 1);
|
|
2106
2108
|
continue;
|
|
2107
2109
|
}
|
|
2108
|
-
if (px && cx && !
|
|
2110
|
+
if (px && cx && !_chunkHFYDNNDBcjs.CLIP_TABLES.has(prev.table) && !_chunkHFYDNNDBcjs.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 && _chunkHFYDNNDBcjs.CELL_LINES.has(c))) {
|
|
2109
2111
|
const dx = px[0] - cx[0];
|
|
2110
2112
|
const part = joinSplitParts(prev.table, px, curr.table, cx.map((x) => x + dx), dx, void 0, lex);
|
|
2111
2113
|
if (_optionalChain([part, 'optionalAccess', _197 => _197.split]) && part.table.rows === prev.table.rows + currCells.length - 1) {
|
|
2112
2114
|
const last = prev.table.rows - 1;
|
|
2113
2115
|
for (let c = 0; c < part.table.cols; c++) {
|
|
2114
|
-
const U =
|
|
2115
|
-
|
|
2116
|
+
const U = _chunkHFYDNNDBcjs.CELL_LINES.get(prev.table.cells[last][c]), D = _chunkHFYDNNDBcjs.CELL_LINES.get(currCells[0][c]);
|
|
2117
|
+
_chunkHFYDNNDBcjs.CELL_LINES.set(part.table.cells[last][c], U.concat(D.map((l) => ({ ...l, l: l.l + dx, r: l.r + dx }))));
|
|
2116
2118
|
}
|
|
2117
|
-
|
|
2119
|
+
_chunkHFYDNNDBcjs.TABLE_COLXS.set(part.table, part.colXs);
|
|
2118
2120
|
placeJoined(blocks, i, j, part.table);
|
|
2119
2121
|
continue;
|
|
2120
2122
|
}
|
|
@@ -2127,20 +2129,20 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
|
|
|
2127
2129
|
caption: prev.table.caption,
|
|
2128
2130
|
...prev.table.renderAsTable ? { renderAsTable: true } : {}
|
|
2129
2131
|
};
|
|
2130
|
-
if (_nullishCoalesce(px, () => ( cx)))
|
|
2131
|
-
if (
|
|
2132
|
+
if (_nullishCoalesce(px, () => ( cx))) _chunkHFYDNNDBcjs.TABLE_COLXS.set(merged, _nullishCoalesce(px, () => ( cx)));
|
|
2133
|
+
if (_chunkHFYDNNDBcjs.CLIP_TABLES.has(prev.table) || _chunkHFYDNNDBcjs.CLIP_TABLES.has(curr.table)) _chunkHFYDNNDBcjs.CLIP_TABLES.add(merged);
|
|
2132
2134
|
placeJoined(blocks, i, j, merged);
|
|
2133
2135
|
}
|
|
2134
2136
|
for (let i = blocks.length - 1; i >= 0; i--) {
|
|
2135
2137
|
const t = blocks[i].table;
|
|
2136
|
-
if (blocks[i].type === "table" && t &&
|
|
2138
|
+
if (blocks[i].type === "table" && t && _chunkHFYDNNDBcjs.EMPTY_PARTS.has(t)) blocks.splice(i, 1);
|
|
2137
2139
|
}
|
|
2138
2140
|
}
|
|
2139
2141
|
function mergeColumnFlow(blocks, pageHeights, lex) {
|
|
2140
2142
|
if (!pageHeights) return;
|
|
2141
2143
|
for (let i = 0; i < blocks.length; i++) {
|
|
2142
2144
|
const L = blocks[i];
|
|
2143
|
-
if (L.type !== "table" || !L.table || !L.bbox || !L.pageNumber || !
|
|
2145
|
+
if (L.type !== "table" || !L.table || !L.bbox || !L.pageNumber || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(L.table) || _chunkHFYDNNDBcjs.EMPTY_PARTS.has(L.table)) continue;
|
|
2144
2146
|
const ph = pageHeights.get(L.pageNumber);
|
|
2145
2147
|
if (!ph || L.bbox.y > ph * PAGE_EDGE_BAND) continue;
|
|
2146
2148
|
let s0 = i, s1 = i;
|
|
@@ -2159,8 +2161,8 @@ function mergeColumnFlow(blocks, pageHeights, lex) {
|
|
|
2159
2161
|
if (Math.abs(R.bbox.width - L.bbox.width) > Math.max(R.bbox.width, L.bbox.width) * NEIGHBOR_TABLE_EPSILON) continue;
|
|
2160
2162
|
if (!looksContinued(L, R) || restartsTable(blocks, i, R.table, pageHeights)) continue;
|
|
2161
2163
|
const rt = R.table;
|
|
2162
|
-
if (rt.rows === 1 && rt.cols === 1 && !
|
|
2163
|
-
const px =
|
|
2164
|
+
if (rt.rows === 1 && rt.cols === 1 && !_chunkHFYDNNDBcjs.CLIP_TABLES.has(rt) && L.table.rows >= 2) {
|
|
2165
|
+
const px = _chunkHFYDNNDBcjs.TABLE_COLXS.get(L.table), lb = L.bbox;
|
|
2164
2166
|
const dx = lb.x + lb.width - (R.bbox.x + R.bbox.width);
|
|
2165
2167
|
const last = L.table.cells[L.table.rows - 1];
|
|
2166
2168
|
let col = 0;
|
|
@@ -2189,8 +2191,8 @@ function mergeColumnFlow(blocks, pageHeights, lex) {
|
|
|
2189
2191
|
}
|
|
2190
2192
|
function joinClipParts(prev, curr, pageHeights, lex) {
|
|
2191
2193
|
const pt = prev.table, ct = curr.table;
|
|
2192
|
-
if (!
|
|
2193
|
-
const px =
|
|
2194
|
+
if (!_chunkHFYDNNDBcjs.CLIP_TABLES.has(pt) || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(ct)) return null;
|
|
2195
|
+
const px = _chunkHFYDNNDBcjs.TABLE_COLXS.get(pt), cx = _chunkHFYDNNDBcjs.TABLE_COLXS.get(ct);
|
|
2194
2196
|
if (!px || !cx) return null;
|
|
2195
2197
|
let xs = cx, shifted = false, dx = 0, foreign = false, within = false;
|
|
2196
2198
|
if (!shiftedSame(px, cx, false)) {
|
|
@@ -2206,15 +2208,15 @@ function joinClipParts(prev, curr, pageHeights, lex) {
|
|
|
2206
2208
|
const inner = b.slice(1, -1).map((x) => x + dx);
|
|
2207
2209
|
return inner.length > 0 && !inner.some((x) => px.some((p) => Math.abs(p - x) <= CONTINUATION_COL_TOL));
|
|
2208
2210
|
};
|
|
2209
|
-
foreign = unrelated(cx) && unrelated(_nullishCoalesce(
|
|
2211
|
+
foreign = unrelated(cx) && unrelated(_nullishCoalesce(_chunkHFYDNNDBcjs.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);
|
|
2210
2212
|
}
|
|
2211
2213
|
const res = joinSplitParts(pt, px, ct, xs, dx, _optionalChain([prev, 'access', _202 => _202.bbox, 'optionalAccess', _203 => _203.y]), lex);
|
|
2212
2214
|
if (!res || (shifted || foreign || within) && !res.split && !res.header) return null;
|
|
2213
|
-
|
|
2214
|
-
const ys =
|
|
2215
|
-
if (ys)
|
|
2216
|
-
|
|
2217
|
-
|
|
2215
|
+
_chunkHFYDNNDBcjs.TABLE_COLXS.set(res.table, res.colXs);
|
|
2216
|
+
const ys = _chunkHFYDNNDBcjs.TABLE_ROWYS.get(pt);
|
|
2217
|
+
if (ys) _chunkHFYDNNDBcjs.TABLE_ROWYS.set(res.table, ys);
|
|
2218
|
+
_chunkHFYDNNDBcjs.PART_COLXS.set(res.table, _nullishCoalesce(_chunkHFYDNNDBcjs.PART_COLXS.get(pt), () => ( px)));
|
|
2219
|
+
_chunkHFYDNNDBcjs.CLIP_TABLES.add(res.table);
|
|
2218
2220
|
return res.table;
|
|
2219
2221
|
}
|
|
2220
2222
|
function prevLacksLeftCols(prev, px, xs, pageHeights) {
|
|
@@ -2238,12 +2240,12 @@ function looksContinued(prev, curr, pageHeights) {
|
|
|
2238
2240
|
return filled.length >= 2 && filled.every((t) => t === filled[0]);
|
|
2239
2241
|
}
|
|
2240
2242
|
function pushedLead(prev, curr) {
|
|
2241
|
-
if (!
|
|
2243
|
+
if (!_chunkHFYDNNDBcjs.CLIP_TABLES.has(prev.table) || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(curr.table)) return false;
|
|
2242
2244
|
const lead = leadRows(curr.table);
|
|
2243
2245
|
return lead.image && lead.height > prev.bbox.y;
|
|
2244
2246
|
}
|
|
2245
2247
|
function leadRows(t) {
|
|
2246
|
-
const ys =
|
|
2248
|
+
const ys = _chunkHFYDNNDBcjs.TABLE_ROWYS.get(t);
|
|
2247
2249
|
if (!ys || ys.length < 2) return { height: 0, image: false };
|
|
2248
2250
|
const anchors = anchorsOf(t);
|
|
2249
2251
|
let end = 1, image = false;
|
|
@@ -2251,17 +2253,17 @@ function leadRows(t) {
|
|
|
2251
2253
|
for (const a of anchors) {
|
|
2252
2254
|
if (a.r !== r) continue;
|
|
2253
2255
|
end = Math.max(end, r + a.rs);
|
|
2254
|
-
if (
|
|
2256
|
+
if (_chunkHFYDNNDBcjs.IMAGE_CELLS.has(a.cell)) image = true;
|
|
2255
2257
|
}
|
|
2256
2258
|
}
|
|
2257
2259
|
return { height: ys[0] - ys[Math.min(end, ys.length - 1)], image };
|
|
2258
2260
|
}
|
|
2259
2261
|
function tailOf(b) {
|
|
2260
|
-
const t = b.table &&
|
|
2262
|
+
const t = b.table && _chunkHFYDNNDBcjs.TABLE_TAIL.get(b.table);
|
|
2261
2263
|
return t && b.bbox ? { ...b, pageNumber: t.page, bbox: { ...b.bbox, page: t.page, y: t.y, height: t.height } } : b;
|
|
2262
2264
|
}
|
|
2263
2265
|
function firstRowSig(t) {
|
|
2264
|
-
const x =
|
|
2266
|
+
const x = _chunkHFYDNNDBcjs.TABLE_COLXS.get(t);
|
|
2265
2267
|
if (!x || x.length !== t.cols + 1) return null;
|
|
2266
2268
|
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, "") }));
|
|
2267
2269
|
}
|
|
@@ -2314,7 +2316,7 @@ function chainHead(blocks, i, pageHeights) {
|
|
|
2314
2316
|
if (pb.pageNumber !== (_nullishCoalesce(cur.pageNumber, () => ( 0))) - 1) break;
|
|
2315
2317
|
if (!blocks.slice(p + 1, k).every((b) => besideOwn(b, pb, cur) || insideTable(b, pb) || pageNumberBetween(b, pb, cur, pageHeights))) break;
|
|
2316
2318
|
if (!looksContinued(pb, cur, pageHeights)) break;
|
|
2317
|
-
const px =
|
|
2319
|
+
const px = _chunkHFYDNNDBcjs.TABLE_COLXS.get(pb.table), cx = _chunkHFYDNNDBcjs.TABLE_COLXS.get(cur.table);
|
|
2318
2320
|
if (!px || !cx) break;
|
|
2319
2321
|
const dx = px[px.length - 1] - cx[cx.length - 1];
|
|
2320
2322
|
if (!shiftedSame(px, cx) && !px.some((x) => Math.abs(x - (cx[0] + dx)) <= CONTINUATION_COL_TOL) && !prevLacksLeftCols(pb, px, cx, pageHeights)) break;
|
|
@@ -2385,7 +2387,7 @@ var RESTART_LOOKBACK_PAGES = 5;
|
|
|
2385
2387
|
var COL_MATCH_TOL = 0.5;
|
|
2386
2388
|
var CONTINUED_TABLE_PAGE_BAND = 0.16;
|
|
2387
2389
|
function lastRowCell(t, x1, x2) {
|
|
2388
|
-
const xs =
|
|
2390
|
+
const xs = _chunkHFYDNNDBcjs.TABLE_COLXS.get(t);
|
|
2389
2391
|
const covered = /* @__PURE__ */ new Set();
|
|
2390
2392
|
for (let r = 0; r < t.rows; r++) {
|
|
2391
2393
|
for (let c = 0; c < t.cols; c++) {
|
|
@@ -2403,7 +2405,7 @@ var cellBlocks = (cell, pageNumber) => _nullishCoalesce(cell.blocks, () => ( cel
|
|
|
2403
2405
|
function mergeContinuedCells(blocks, pageHeights) {
|
|
2404
2406
|
for (let j = blocks.length - 1; j > 0; j--) {
|
|
2405
2407
|
const part = blocks[j];
|
|
2406
|
-
const from = part.table ?
|
|
2408
|
+
const from = part.table ? _chunkHFYDNNDBcjs.CONT_PARTS.get(part.table) : void 0;
|
|
2407
2409
|
if (!from || !part.table) {
|
|
2408
2410
|
unwrapContinuedTable(blocks, j, pageHeights, true);
|
|
2409
2411
|
continue;
|
|
@@ -2419,12 +2421,12 @@ function mergeContinuedCells(blocks, pageHeights) {
|
|
|
2419
2421
|
if (cell.blocks || add.blocks) cell.blocks = [...cellBlocks(cell, prev.pageNumber), ...cellBlocks(add, part.pageNumber)];
|
|
2420
2422
|
else if (part.pageNumber) markContinuedText(cell, add, part.pageNumber);
|
|
2421
2423
|
cell.text = [cell.text, add.text].filter((s) => s.trim()).join("\n");
|
|
2422
|
-
if (
|
|
2423
|
-
|
|
2424
|
-
const lines =
|
|
2425
|
-
if (_optionalChain([lines, 'optionalAccess', _227 => _227.length]))
|
|
2426
|
-
if (part.pageNumber && part.bbox)
|
|
2427
|
-
if (cell.text.trim() || _optionalChain([cell, 'access', _228 => _228.blocks, 'optionalAccess', _229 => _229.length]) ||
|
|
2424
|
+
if (_chunkHFYDNNDBcjs.IMAGE_CELLS.has(add)) _chunkHFYDNNDBcjs.IMAGE_CELLS.add(cell);
|
|
2425
|
+
_chunkHFYDNNDBcjs.joinCellEdges.call(void 0, cell, add);
|
|
2426
|
+
const lines = _chunkHFYDNNDBcjs.CELL_LINES.get(add);
|
|
2427
|
+
if (_optionalChain([lines, 'optionalAccess', _227 => _227.length])) _chunkHFYDNNDBcjs.CELL_LINES.set(cell, [..._nullishCoalesce(_chunkHFYDNNDBcjs.CELL_LINES.get(cell), () => ( [])), ...lines]);
|
|
2428
|
+
if (part.pageNumber && part.bbox) _chunkHFYDNNDBcjs.TABLE_TAIL.set(prev.table, _nullishCoalesce(_chunkHFYDNNDBcjs.TABLE_TAIL.get(part.table), () => ( { page: part.pageNumber, y: part.bbox.y, height: part.bbox.height })));
|
|
2429
|
+
if (cell.text.trim() || _optionalChain([cell, 'access', _228 => _228.blocks, 'optionalAccess', _229 => _229.length]) || _chunkHFYDNNDBcjs.IMAGE_CELLS.has(cell)) _chunkHFYDNNDBcjs.EMPTY_PARTS.delete(prev.table);
|
|
2428
2430
|
blocks.splice(j, 1);
|
|
2429
2431
|
if (cell.blocks && at > 0) {
|
|
2430
2432
|
const nextAt = cell.blocks[at];
|
|
@@ -2436,11 +2438,11 @@ function mergeContinuedCells(blocks, pageHeights) {
|
|
|
2436
2438
|
}
|
|
2437
2439
|
function unwrapContinuedTable(blocks, at, pageHeights, splitOnly = false) {
|
|
2438
2440
|
const prev = blocks[at - 1], frame = blocks[at];
|
|
2439
|
-
if (!_optionalChain([prev, 'optionalAccess', _230 => _230.table]) || !_optionalChain([frame, 'optionalAccess', _231 => _231.table]) || frame.table.rows !== 1 || frame.table.cols !== 1 || !
|
|
2441
|
+
if (!_optionalChain([prev, 'optionalAccess', _230 => _230.table]) || !_optionalChain([frame, 'optionalAccess', _231 => _231.table]) || frame.table.rows !== 1 || frame.table.cols !== 1 || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(frame.table)) return;
|
|
2440
2442
|
const inner = _optionalChain([frame, 'access', _232 => _232.table, 'access', _233 => _233.cells, 'access', _234 => _234[0], 'optionalAccess', _235 => _235[0], 'optionalAccess', _236 => _236.blocks]);
|
|
2441
2443
|
const next = _optionalChain([inner, 'optionalAccess', _237 => _237[0]]);
|
|
2442
|
-
if (!inner || !_optionalChain([next, 'optionalAccess', _238 => _238.table]) || !prev.bbox || !next.bbox || !prev.pageNumber || next.pageNumber !== prev.pageNumber + 1 || !
|
|
2443
|
-
const px =
|
|
2444
|
+
if (!inner || !_optionalChain([next, 'optionalAccess', _238 => _238.table]) || !prev.bbox || !next.bbox || !prev.pageNumber || next.pageNumber !== prev.pageNumber + 1 || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(prev.table) || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(next.table) || prev.table.cols !== next.table.cols) return;
|
|
2445
|
+
const px = _chunkHFYDNNDBcjs.TABLE_COLXS.get(prev.table), nx = _chunkHFYDNNDBcjs.TABLE_COLXS.get(next.table);
|
|
2444
2446
|
if (!px || !nx || px.length !== nx.length || px.some((x, i) => Math.abs(x - nx[i]) > COL_MATCH_TOL)) return;
|
|
2445
2447
|
const ph = _optionalChain([pageHeights, 'optionalAccess', _239 => _239.get, 'call', _240 => _240(prev.pageNumber)]), nh = _optionalChain([pageHeights, 'optionalAccess', _241 => _241.get, 'call', _242 => _242(next.pageNumber)]);
|
|
2446
2448
|
if (!ph || !nh || prev.bbox.y > ph * CONTINUED_TABLE_PAGE_BAND || next.bbox.y + next.bbox.height < nh * (1 - CONTINUED_TABLE_PAGE_BAND)) return;
|
|
@@ -2450,15 +2452,15 @@ function unwrapContinuedTable(blocks, at, pageHeights, splitOnly = false) {
|
|
|
2450
2452
|
function fillNestedContinuation(blocks, at) {
|
|
2451
2453
|
const prev = blocks[at - 1], next = blocks[at];
|
|
2452
2454
|
const t = _optionalChain([prev, 'optionalAccess', _245 => _245.table]), u = _optionalChain([next, 'optionalAccess', _246 => _246.table]);
|
|
2453
|
-
if (!t || !u || u.rows !== 1 || u.cols !== 1 || !
|
|
2454
|
-
const xs =
|
|
2455
|
+
if (!t || !u || u.rows !== 1 || u.cols !== 1 || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(t) || !_chunkHFYDNNDBcjs.CLIP_TABLES.has(u) || next.pageNumber !== (_nullishCoalesce(prev.pageNumber, () => ( 0))) + 1) return;
|
|
2456
|
+
const xs = _chunkHFYDNNDBcjs.TABLE_COLXS.get(u);
|
|
2455
2457
|
const cell = xs ? lastRowCell(t, xs[0], xs[xs.length - 1]) : void 0;
|
|
2456
2458
|
const add = _optionalChain([u, 'access', _247 => _247.cells, 'access', _248 => _248[0], 'optionalAccess', _249 => _249[0]]);
|
|
2457
|
-
if (!cell || !add || cell.text.trim() || _optionalChain([cell, 'access', _250 => _250.blocks, 'optionalAccess', _251 => _251.length]) ||
|
|
2459
|
+
if (!cell || !add || cell.text.trim() || _optionalChain([cell, 'access', _250 => _250.blocks, 'optionalAccess', _251 => _251.length]) || _chunkHFYDNNDBcjs.IMAGE_CELLS.has(cell)) return;
|
|
2458
2460
|
cell.text = add.text;
|
|
2459
2461
|
if (add.blocks) cell.blocks = add.blocks;
|
|
2460
|
-
if (
|
|
2461
|
-
|
|
2462
|
+
if (_chunkHFYDNNDBcjs.IMAGE_CELLS.has(add)) _chunkHFYDNNDBcjs.IMAGE_CELLS.add(cell);
|
|
2463
|
+
_chunkHFYDNNDBcjs.joinCellEdges.call(void 0, cell, add);
|
|
2462
2464
|
blocks.splice(at, 1);
|
|
2463
2465
|
}
|
|
2464
2466
|
|
|
@@ -3058,12 +3060,12 @@ function restoreUnmappedGlyphs(items, fnArray, argsArray, fontObj) {
|
|
|
3058
3060
|
}
|
|
3059
3061
|
}
|
|
3060
3062
|
for (const q of queues.values()) for (let k = 0; k < q.length; k++) {
|
|
3061
|
-
const pair = k + 1 < q.length ?
|
|
3063
|
+
const pair = k + 1 < q.length ? _chunkFE7463HFcjs.pairedNumber.call(void 0, q[k], q[k + 1]) : void 0;
|
|
3062
3064
|
if (pair !== void 0) {
|
|
3063
3065
|
q[k] = pair;
|
|
3064
3066
|
q[k + 1] = "";
|
|
3065
3067
|
k++;
|
|
3066
|
-
} else q[k] =
|
|
3068
|
+
} else q[k] = _chunkFE7463HFcjs.mapPuaText.call(void 0, q[k]);
|
|
3067
3069
|
}
|
|
3068
3070
|
const byFont = /* @__PURE__ */ new Map();
|
|
3069
3071
|
for (const it of items) {
|
|
@@ -3153,15 +3155,15 @@ function selectionContextPages(selected, pageCount) {
|
|
|
3153
3155
|
function marginContextBlocks(raw, page, view) {
|
|
3154
3156
|
const [x1, y1, x2, y2] = view;
|
|
3155
3157
|
const width = x2 - x1, height = y2 - y1;
|
|
3156
|
-
const items =
|
|
3158
|
+
const items = _chunkHFYDNNDBcjs.filterHiddenText.call(void 0, _chunkHFYDNNDBcjs.normalizeItems.call(void 0, raw), width, height, x1, y1).visible;
|
|
3157
3159
|
for (const item of items) {
|
|
3158
3160
|
item.x -= x1;
|
|
3159
3161
|
item.y -= y1;
|
|
3160
3162
|
}
|
|
3161
|
-
return
|
|
3162
|
-
const bbox =
|
|
3163
|
+
return _chunkHFYDNNDBcjs.groupByY.call(void 0, items).flatMap((line) => {
|
|
3164
|
+
const bbox = _chunkHFYDNNDBcjs.computeBBox.call(void 0, line, page);
|
|
3163
3165
|
if (bbox.y + bbox.height < height * 0.88 && bbox.y > height * 0.12) return [];
|
|
3164
|
-
return [{ type: "paragraph", text:
|
|
3166
|
+
return [{ type: "paragraph", text: _chunkHFYDNNDBcjs.mergeLineSimple.call(void 0, line), pageNumber: page, bbox, style: _chunkHFYDNNDBcjs.dominantStyle.call(void 0, line) }];
|
|
3165
3167
|
});
|
|
3166
3168
|
}
|
|
3167
3169
|
|
|
@@ -3197,7 +3199,7 @@ var WINANSI_REVERSE = {
|
|
|
3197
3199
|
};
|
|
3198
3200
|
function symbolFontTable(fontName) {
|
|
3199
3201
|
if (!fontName) return void 0;
|
|
3200
|
-
if (/wingdings(?![\s-]*[23])/i.test(fontName)) return
|
|
3202
|
+
if (/wingdings(?![\s-]*[23])/i.test(fontName)) return _chunkFE7463HFcjs.WINGDINGS;
|
|
3201
3203
|
return void 0;
|
|
3202
3204
|
}
|
|
3203
3205
|
function remapSymbolText(text, table) {
|
|
@@ -3430,7 +3432,7 @@ function wrapEquationRuns(items, faceName) {
|
|
|
3430
3432
|
for (const i of members) drop.add(i);
|
|
3431
3433
|
const toks = cur.map((it) => {
|
|
3432
3434
|
const bar2 = isBarItem(it);
|
|
3433
|
-
const text = bar2 ? "" : plain2.has(items.indexOf(it)) ?
|
|
3435
|
+
const text = bar2 ? "" : plain2.has(items.indexOf(it)) ? _chunkFE7463HFcjs.toTex.call(void 0, it.text) : FUNC_RE.test(it.text.trim()) ? it.text.trim() : [...it.text].map(decodeEq).join("");
|
|
3434
3436
|
return { text, x: it.x, y: it.y, w: it.w, size: sizeOf(it), bar: bar2 };
|
|
3435
3437
|
});
|
|
3436
3438
|
const tex = layout(toks).replace(/\}\\text\{/g, "");
|
|
@@ -4270,7 +4272,7 @@ function mergeEnclosedDigits(items) {
|
|
|
4270
4272
|
if (!/^\d\d?$/.test(digits)) continue;
|
|
4271
4273
|
const mid = (inside2[0].x + inside2[inside2.length - 1].x + inside2[inside2.length - 1].w) / 2;
|
|
4272
4274
|
if (Math.abs(mid - (s.x + s.w / 2)) > s.fontSize * 0.15) continue;
|
|
4273
|
-
s.text =
|
|
4275
|
+
s.text = _chunkFE7463HFcjs.enclosedNumber.call(void 0, Number(digits));
|
|
4274
4276
|
for (const d of inside2) drop.add(d);
|
|
4275
4277
|
}
|
|
4276
4278
|
if (!drop.size) return;
|
|
@@ -4467,7 +4469,7 @@ function demoteNonHeadingRoles(blocks, pageHeights, faceNames) {
|
|
|
4467
4469
|
if (block.type !== "heading" || !block.text) continue;
|
|
4468
4470
|
const text = block.text.replace(/<[^>]+>/g, "").trim();
|
|
4469
4471
|
const fsz = _nullishCoalesce(_optionalChain([block, 'access', _333 => _333.style, 'optionalAccess', _334 => _334.fontSize]), () => ( 0));
|
|
4470
|
-
const tocEntry = i > 0 &&
|
|
4472
|
+
const tocEntry = i > 0 && _chunkHFYDNNDBcjs.TOC_BLOCKS.has(blocks[i - 1]) && _chunkHFYDNNDBcjs.TOC_BLOCKS.has(blocks[i + 1]);
|
|
4471
4473
|
const page = _nullishCoalesce(byPage.get(_nullishCoalesce(block.pageNumber, () => ( 0))), () => ( []));
|
|
4472
4474
|
const proseStyle = _optionalChain([block, 'access', _335 => _335.style, 'optionalAccess', _336 => _336.fontName]) && bodyStyle.get(_nullishCoalesce(block.pageNumber, () => ( 0))) === `${block.style.fontName}:${block.style.fontSize}` && text.length > 60;
|
|
4473
4475
|
const next = blocks[i + 1];
|
|
@@ -4565,7 +4567,7 @@ function splitSingleCellTables(blocks) {
|
|
|
4565
4567
|
const out = [];
|
|
4566
4568
|
for (const b of blocks) {
|
|
4567
4569
|
const t = b.type === "table" ? b.table : void 0;
|
|
4568
|
-
const title = t &&
|
|
4570
|
+
const title = t && _chunkHFYDNNDBcjs.FRAME_TITLE_BLOCKS.get(t);
|
|
4569
4571
|
if (title) {
|
|
4570
4572
|
out.push({ ...title, text: `${t.cells[0][0].text.trim()} ${t.cells[0][2].text.trim()}` });
|
|
4571
4573
|
continue;
|
|
@@ -4601,7 +4603,7 @@ function joinLatinCellWraps(blocks) {
|
|
|
4601
4603
|
const lines = cell.text.split("\n");
|
|
4602
4604
|
const out = [lines[0]];
|
|
4603
4605
|
for (const line of lines.slice(1)) {
|
|
4604
|
-
if (
|
|
4606
|
+
if (_chunkHFYDNNDBcjs.latinSoftWrap.call(void 0, out[out.length - 1], line)) out[out.length - 1] = out[out.length - 1].trimEnd() + " " + line.trim();
|
|
4605
4607
|
else out.push(line);
|
|
4606
4608
|
}
|
|
4607
4609
|
cell.text = out.join("\n");
|
|
@@ -4621,10 +4623,10 @@ function cleanPdfText(text, opts) {
|
|
|
4621
4623
|
).replace(/^(?!\| ---).*$/gm, (line) => {
|
|
4622
4624
|
if (/^\s*\${1,2}.+\${1,2}\s*$/.test(line)) return line;
|
|
4623
4625
|
if (line.startsWith("|")) {
|
|
4624
|
-
return line.replace(/(?:\\.|[^|\\])+/g, (cell) => cell.split("<br>").map((seg) => seg.replace(/\S(?:.*\S)?/, (t) =>
|
|
4626
|
+
return line.replace(/(?:\\.|[^|\\])+/g, (cell) => cell.split("<br>").map((seg) => seg.replace(/\S(?:.*\S)?/, (t) => _chunkHFYDNNDBcjs.collapseEvenSpacing.call(void 0, t, false))).join("<br>"));
|
|
4625
4627
|
}
|
|
4626
4628
|
const mark = _nullishCoalesce(_optionalChain([/^(?:#{1,6}|-) /, 'access', _416 => _416.exec, 'call', _417 => _417(line), 'optionalAccess', _418 => _418[0]]), () => ( ""));
|
|
4627
|
-
return mark +
|
|
4629
|
+
return mark + _chunkHFYDNNDBcjs.collapseEvenSpacing.call(void 0, line.slice(mark.length), false);
|
|
4628
4630
|
}).replace(/\\~\\~/g, "~~").replace(/~~~~/g, "").replace(/<u>\s*<\/u>/g, "").replace(/<(sup|sub)>\s*<\/\1>/g, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
4629
4631
|
}
|
|
4630
4632
|
function startsWithMarker(line) {
|
|
@@ -4656,7 +4658,7 @@ function mergeKoreanLines(text) {
|
|
|
4656
4658
|
continue;
|
|
4657
4659
|
}
|
|
4658
4660
|
if (/[가-힣·,\-]$/.test(prev) && /^[가-힣(]/.test(curr) && !startsWithMarker(curr) && !isStandaloneHeader(prev) && !startsWithMarker(prev)) {
|
|
4659
|
-
result[result.length - 1] = prev +
|
|
4661
|
+
result[result.length - 1] = prev + _chunkHFYDNNDBcjs.wrapJoiner.call(void 0, prev, curr) + curr;
|
|
4660
4662
|
} else {
|
|
4661
4663
|
result.push(curr);
|
|
4662
4664
|
}
|
|
@@ -4672,7 +4674,7 @@ function applyLinkAnnotations(items, annots) {
|
|
|
4672
4674
|
const wrapped = /* @__PURE__ */ new Set();
|
|
4673
4675
|
for (const a of annots) {
|
|
4674
4676
|
if (a.subtype !== "Link" || !a.url || !a.rect || a.rect.length < 4) continue;
|
|
4675
|
-
const url =
|
|
4677
|
+
const url = _chunkTOUR2SPIcjs.sanitizeHref.call(void 0, a.url);
|
|
4676
4678
|
if (!url) continue;
|
|
4677
4679
|
const x1 = Math.min(a.rect[0], a.rect[2]), x2 = Math.max(a.rect[0], a.rect[2]);
|
|
4678
4680
|
const y1 = Math.min(a.rect[1], a.rect[3]), y2 = Math.max(a.rect[1], a.rect[3]);
|
|
@@ -4724,7 +4726,7 @@ function mergeLinkRuns(markdown) {
|
|
|
4724
4726
|
|
|
4725
4727
|
// src/pdf/formula-ocr.ts
|
|
4726
4728
|
async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
|
|
4727
|
-
const formulaMod = await Promise.resolve().then(() => _interopRequireWildcard(require("./formula-
|
|
4729
|
+
const formulaMod = await Promise.resolve().then(() => _interopRequireWildcard(require("./formula-CXRJQ5FS.cjs")));
|
|
4728
4730
|
const { FormulaPipeline, ensureFormulaModels } = formulaMod;
|
|
4729
4731
|
await ensureFormulaModels((p) => {
|
|
4730
4732
|
if (p.phase === "download" && p.total) {
|
|
@@ -4915,13 +4917,13 @@ async function loadPdfWithTimeout(buffer, data) {
|
|
|
4915
4917
|
try {
|
|
4916
4918
|
return await Promise.race([
|
|
4917
4919
|
loadingTask.promise.catch((e) => {
|
|
4918
|
-
if (e instanceof Error && e.name === "PasswordException") throw new (0,
|
|
4920
|
+
if (e instanceof Error && e.name === "PasswordException") throw new (0, _chunkTOUR2SPIcjs.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)");
|
|
4919
4921
|
throw e;
|
|
4920
4922
|
}),
|
|
4921
4923
|
new Promise((_, reject) => {
|
|
4922
4924
|
timer = setTimeout(() => {
|
|
4923
4925
|
loadingTask.destroy();
|
|
4924
|
-
reject(new (0,
|
|
4926
|
+
reject(new (0, _chunkTOUR2SPIcjs.KordocError)("PDF \uB85C\uB529 \uD0C0\uC784\uC544\uC6C3 (30\uCD08 \uCD08\uACFC)"));
|
|
4925
4927
|
}, PDF_LOAD_TIMEOUT_MS);
|
|
4926
4928
|
})
|
|
4927
4929
|
]);
|
|
@@ -4932,8 +4934,8 @@ async function loadPdfWithTimeout(buffer, data) {
|
|
|
4932
4934
|
async function parsePdfDocument(buffer, options) {
|
|
4933
4935
|
const formulaBuffer = _optionalChain([options, 'optionalAccess', _419 => _419.formulaOcr]) ? buffer : null;
|
|
4934
4936
|
const ocrOptionError = _chunkMMK32GPDcjs.validateOcrOptions.call(void 0, options);
|
|
4935
|
-
if (ocrOptionError) throw new (0,
|
|
4936
|
-
const autoOcr = _optionalChain([options, 'optionalAccess', _420 => _420.ocr]) === void 0 && await
|
|
4937
|
+
if (ocrOptionError) throw new (0, _chunkTOUR2SPIcjs.KordocError)(ocrOptionError);
|
|
4938
|
+
const autoOcr = _optionalChain([options, 'optionalAccess', _420 => _420.ocr]) === void 0 && await _chunkHFYDNNDBcjs.ocrModelsCached.call(void 0, _chunkHFYDNNDBcjs.resolveOcrModels.call(void 0, options)) && (_optionalChain([options, 'optionalAccess', _421 => _421.ocrRec]) !== "auto" || await _chunkHFYDNNDBcjs.ocrModelsCached.call(void 0, _chunkHFYDNNDBcjs.handwritingFallbackModels.call(void 0, _chunkHFYDNNDBcjs.resolveOcrModels.call(void 0, options))));
|
|
4937
4939
|
const ocrBuffer = _optionalChain([options, 'optionalAccess', _422 => _422.ocr]) || autoOcr ? buffer : null;
|
|
4938
4940
|
const pdfjsData = new Uint8Array(buffer.slice(0));
|
|
4939
4941
|
const blanked = blankLargeImageStreams(pdfjsData);
|
|
@@ -4945,7 +4947,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
4945
4947
|
let pristine;
|
|
4946
4948
|
try {
|
|
4947
4949
|
const pageCount = doc.numPages;
|
|
4948
|
-
if (pageCount === 0) throw new (0,
|
|
4950
|
+
if (pageCount === 0) throw new (0, _chunkTOUR2SPIcjs.KordocError)("PDF\uC5D0 \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
4949
4951
|
const metadata = { pageCount, pageMode: "layout" };
|
|
4950
4952
|
await extractPdfMetadata(doc, metadata);
|
|
4951
4953
|
const blocks = [];
|
|
@@ -4968,11 +4970,11 @@ async function parsePdfDocument(buffer, options) {
|
|
|
4968
4970
|
const uncoveredImageRegions = /* @__PURE__ */ new Map();
|
|
4969
4971
|
const largeImageRegions = /* @__PURE__ */ new Set();
|
|
4970
4972
|
const wantWebp = _optionalChain([options, 'optionalAccess', _427 => _427.imageFormat]) === "webp" && options.images !== false;
|
|
4971
|
-
const encodeWebp = wantWebp ? await
|
|
4972
|
-
if (wantWebp && !encodeWebp) warnings.push(
|
|
4973
|
+
const encodeWebp = wantWebp ? await _chunkTV7B6DJQcjs.loadWebpEncoder.call(void 0, ) : null;
|
|
4974
|
+
if (wantWebp && !encodeWebp) warnings.push(_chunkTV7B6DJQcjs.WEBP_UNAVAILABLE);
|
|
4973
4975
|
const imageState = createPdfImageState(pdfium ? { decoder: pdfium, sizes: blanked.sizes, pristine: () => pristine ??= loadPdfWithTimeout(buffer) } : void 0, _nullishCoalesce(encodeWebp, () => ( void 0)), _optionalChain([options, 'optionalAccess', _428 => _428.imagePlacement]) === "flow", !!_optionalChain([options, 'optionalAccess', _429 => _429.dropBlankImages]) && _optionalChain([options, 'optionalAccess', _430 => _430.images]) !== false);
|
|
4974
|
-
const readQr = _optionalChain([options, 'optionalAccess', _431 => _431.qrCodes]) ? await
|
|
4975
|
-
if (_optionalChain([options, 'optionalAccess', _432 => _432.qrCodes]) && !readQr) warnings.push(
|
|
4976
|
+
const readQr = _optionalChain([options, 'optionalAccess', _431 => _431.qrCodes]) ? await _chunk4TDUZ6UNcjs.loadQrReader.call(void 0, ) : null;
|
|
4977
|
+
if (_optionalChain([options, 'optionalAccess', _432 => _432.qrCodes]) && !readQr) warnings.push(_chunk4TDUZ6UNcjs.QR_UNAVAILABLE);
|
|
4976
4978
|
const imageBulletShapes = /* @__PURE__ */ new Map();
|
|
4977
4979
|
const imageArrowDirections = /* @__PURE__ */ new Map();
|
|
4978
4980
|
const extractedImages = [];
|
|
@@ -4980,7 +4982,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
4980
4982
|
const carry = {};
|
|
4981
4983
|
const preciseGaps = await isHancomPdf(doc);
|
|
4982
4984
|
const vectorPageOps = /* @__PURE__ */ new Map();
|
|
4983
|
-
const wrapLexicon = new (0,
|
|
4985
|
+
const wrapLexicon = new (0, _chunkHFYDNNDBcjs.WrapLexicon)();
|
|
4984
4986
|
const noteMarks = /* @__PURE__ */ new Map();
|
|
4985
4987
|
const headerContext = [];
|
|
4986
4988
|
if (pageFilter && _optionalChain([options, 'optionalAccess', _433 => _433.removeHeaderFooter]) !== false && pageFilter.size < effectivePageCount) {
|
|
@@ -5031,12 +5033,12 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5031
5033
|
markSyntheticSpaces(rawItems, rawOps.fnArray, rawOps.argsArray);
|
|
5032
5034
|
restoreSoftHyphens();
|
|
5033
5035
|
rawItems.push(...spaceMappedDots(rawOps.fnArray, rawOps.argsArray, (n) => fontObj(n)));
|
|
5034
|
-
const items =
|
|
5036
|
+
const items = _chunkHFYDNNDBcjs.normalizeItems.call(void 0, occluded.size ? rawItems.filter((it) => !occluded.has(it)) : rawItems);
|
|
5035
5037
|
if (!preciseGaps) for (const it of items) {
|
|
5036
5038
|
delete it.fx;
|
|
5037
5039
|
delete it.fw;
|
|
5038
5040
|
}
|
|
5039
|
-
const filtered =
|
|
5041
|
+
const filtered = _chunkHFYDNNDBcjs.filterHiddenText.call(void 0, items, pageW, pageH, viewX1, viewY1);
|
|
5040
5042
|
const joined = joinVerticalColumns(filtered.visible);
|
|
5041
5043
|
const visible = dropTabLeaderDots(joined);
|
|
5042
5044
|
const hiddenCount = filtered.hiddenCount + occluded.size;
|
|
@@ -5063,7 +5065,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5063
5065
|
} : rawOps;
|
|
5064
5066
|
remapSymbolFontItems(visible, (loadedName) => _optionalChain([fontObj, 'call', _440 => _440(loadedName), 'optionalAccess', _441 => _441.name]));
|
|
5065
5067
|
remapControlGlyphs(visible, differencesOf);
|
|
5066
|
-
await
|
|
5068
|
+
await _chunkHFYDNNDBcjs.restoreImageBullets.call(void 0, visible, page, opList.fnArray, opList.argsArray, imageBulletShapes);
|
|
5067
5069
|
const faces = /* @__PURE__ */ new Map();
|
|
5068
5070
|
for (const it of visible) {
|
|
5069
5071
|
if (!it.fontName) continue;
|
|
@@ -5076,12 +5078,12 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5076
5078
|
it.fontName = face;
|
|
5077
5079
|
if (!faceNames.has(face)) faceNames.set(face, (_nullishCoalesce(_optionalChain([fontObj, 'call', _443 => _443(face), 'optionalAccess', _444 => _444.name]), () => ( ""))).replace(/^[A-Z]{6}\+/, ""));
|
|
5078
5080
|
}
|
|
5079
|
-
for (const it of visible) if (it.text.includes("$")) it.text =
|
|
5080
|
-
for (const it of visible) if (it.text.includes("<")) it.text =
|
|
5081
|
+
for (const it of visible) if (it.text.includes("$")) it.text = _chunkFE7463HFcjs.escapeLiteralDollar.call(void 0, it.text);
|
|
5082
|
+
for (const it of visible) if (it.text.includes("<")) it.text = _chunkFE7463HFcjs.escapeLiteralTags.call(void 0, it.text);
|
|
5081
5083
|
wrapEquationRuns(visible, (face) => faceNames.get(face));
|
|
5082
5084
|
const pageArea = pageW * pageH;
|
|
5083
5085
|
if (pageArea > 0) {
|
|
5084
|
-
const imageRegions =
|
|
5086
|
+
const imageRegions = _chunkHFYDNNDBcjs.extractImageRegions.call(void 0, opList.fnArray, opList.argsArray);
|
|
5085
5087
|
let uncovered = 0;
|
|
5086
5088
|
for (const r of imageRegions) {
|
|
5087
5089
|
const area = (r.x2 - r.x1) * (r.y2 - r.y1);
|
|
@@ -5108,11 +5110,11 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5108
5110
|
if (uncovered > 0) skippedImagePages.set(i, uncovered);
|
|
5109
5111
|
}
|
|
5110
5112
|
const marks = superscriptNoteMarks(visible);
|
|
5111
|
-
if (marks.length) noteMarks.set(i, { marks, seps: footnoteSeparators(
|
|
5113
|
+
if (marks.length) noteMarks.set(i, { marks, seps: footnoteSeparators(_chunkHFYDNNDBcjs.extractLines.call(void 0, opList.fnArray, opList.argsArray).horizontals, pageW, pageH) });
|
|
5112
5114
|
const stamp = marginStamp(visible);
|
|
5113
5115
|
const flow = stamp.length ? visible.filter((it) => !stamp.includes(it)) : visible;
|
|
5114
|
-
const rightArrows = _optionalChain([options, 'optionalAccess', _445 => _445.tables]) !== false ? await
|
|
5115
|
-
const pageBlocks = orderTwoUpPage(
|
|
5116
|
+
const rightArrows = _optionalChain([options, 'optionalAccess', _445 => _445.tables]) !== false ? await _chunkHFYDNNDBcjs.detectRightArrowRegions.call(void 0, page, opList.fnArray, opList.argsArray, imageArrowDirections) : [];
|
|
5117
|
+
const pageBlocks = orderTwoUpPage(_chunkHFYDNNDBcjs.extractPageBlocksWithLines.call(void 0, flow, i, opList, pageW, pageH, void 0, _optionalChain([options, 'optionalAccess', _446 => _446.tables]) !== false, carry, wrapLexicon, rightArrows), pageW, pageH);
|
|
5116
5118
|
if (stamp.length) pageBlocks.unshift({ type: "paragraph", text: [...stamp].sort((a, b) => a.y - b.y).map((it) => it.text).join(" "), pageNumber: i });
|
|
5117
5119
|
for (const b of pageBlocks) blocks.push(b);
|
|
5118
5120
|
try {
|
|
@@ -5138,11 +5140,11 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5138
5140
|
if (_optionalChain([options, 'optionalAccess', _448 => _448.ocr]) && quality.ocrReason === "vector_text" && page.rotate % 360 === 0 && page.view[0] === 0 && page.view[1] === 0) {
|
|
5139
5141
|
vectorPageOps.set(i, ocrVectorOps(opList, vector.paths));
|
|
5140
5142
|
}
|
|
5141
|
-
if (totalTextBytes > MAX_TOTAL_TEXT) throw new (0,
|
|
5143
|
+
if (totalTextBytes > MAX_TOTAL_TEXT) throw new (0, _chunkTOUR2SPIcjs.KordocError)("\uD14D\uC2A4\uD2B8 \uCD94\uCD9C \uD06C\uAE30 \uCD08\uACFC");
|
|
5142
5144
|
parsedPages++;
|
|
5143
5145
|
_optionalChain([options, 'optionalAccess', _449 => _449.onProgress, 'optionalCall', _450 => _450(parsedPages, totalTarget)]);
|
|
5144
5146
|
} catch (pageErr) {
|
|
5145
|
-
if (pageErr instanceof
|
|
5147
|
+
if (pageErr instanceof _chunkTOUR2SPIcjs.KordocError) throw pageErr;
|
|
5146
5148
|
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" });
|
|
5147
5149
|
} finally {
|
|
5148
5150
|
_optionalChain([loadedPage, 'optionalAccess', _451 => _451.cleanup, 'call', _452 => _452()]);
|
|
@@ -5173,12 +5175,12 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5173
5175
|
}
|
|
5174
5176
|
if (targets.size > 0) {
|
|
5175
5177
|
try {
|
|
5176
|
-
const { runPdfOcr } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pdf-ocr-
|
|
5178
|
+
const { runPdfOcr } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pdf-ocr-TBGICSC2.cjs")));
|
|
5177
5179
|
const mode = typeof _optionalChain([options, 'optionalAccess', _457 => _457.ocr]) === "function" ? options.ocr : "builtin";
|
|
5178
5180
|
const regionPages = new Map([...ocrRegions].filter(([p]) => _optionalChain([options, 'optionalAccess', _458 => _458.ocr]) !== "force" && !isImageBased && !_optionalChain([pageQuality, 'access', _459 => _459.find, 'call', _460 => _460((q) => q.page === p), 'optionalAccess', _461 => _461.needsOcr])));
|
|
5179
|
-
const { builtinOcrConfig } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pdf-ocr-
|
|
5181
|
+
const { builtinOcrConfig } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pdf-ocr-TBGICSC2.cjs")));
|
|
5180
5182
|
const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, _optionalChain([options, 'optionalAccess', _462 => _462.onProgress]), _optionalChain([options, 'optionalAccess', _463 => _463.tables]) !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut);
|
|
5181
|
-
for (const obs of ocrPageBlocks.values())
|
|
5183
|
+
for (const obs of ocrPageBlocks.values()) _chunkFE7463HFcjs.stripScriptTags.call(void 0, { blocks: obs });
|
|
5182
5184
|
if (ocrPageBlocks.size > 0) {
|
|
5183
5185
|
const replacePages = /* @__PURE__ */ new Set();
|
|
5184
5186
|
for (const [p, obs] of ocrPageBlocks) {
|
|
@@ -5189,7 +5191,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5189
5191
|
continue;
|
|
5190
5192
|
}
|
|
5191
5193
|
const regions = ocrRegions.get(p);
|
|
5192
|
-
if (!regions ||
|
|
5194
|
+
if (!regions || _chunkHFYDNNDBcjs.mergeOcrImageRegions.call(void 0, blocks, p, regions, obs) === 0) continue;
|
|
5193
5195
|
ocrDone.add(p);
|
|
5194
5196
|
if (_optionalChain([pageImageBlocks, 'access', _468 => _468.get, 'call', _469 => _469(p), 'optionalAccess', _470 => _470.length]) === 1) pageImageBlocks.delete(p);
|
|
5195
5197
|
}
|
|
@@ -5242,17 +5244,17 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5242
5244
|
}
|
|
5243
5245
|
}
|
|
5244
5246
|
if (_optionalChain([options, 'optionalAccess', _471 => _471.removeHeaderFooter]) !== false && (parsedPageCount >= 3 || headerContext.length)) {
|
|
5245
|
-
const removed =
|
|
5246
|
-
const running =
|
|
5247
|
+
const removed = _chunkHFYDNNDBcjs.removeHeaderFooterBlocks.call(void 0, blocks, pageHeights, warnings, noteMarks, false, headerContext);
|
|
5248
|
+
const running = _chunkHFYDNNDBcjs.runningLinePatterns.call(void 0, removed.map((ri) => blocks[ri]), pageHeights);
|
|
5247
5249
|
for (let ri = removed.length - 1; ri >= 0; ri--) {
|
|
5248
5250
|
blocks.splice(removed[ri], 1);
|
|
5249
5251
|
}
|
|
5250
|
-
const stripped =
|
|
5252
|
+
const stripped = _chunkHFYDNNDBcjs.stripAbsorbedRunningLines.call(void 0, blocks, pageHeights, running);
|
|
5251
5253
|
if (stripped !== blocks) {
|
|
5252
5254
|
blocks.length = 0;
|
|
5253
5255
|
blocks.push(...stripped);
|
|
5254
5256
|
}
|
|
5255
|
-
const kept =
|
|
5257
|
+
const kept = _chunkHFYDNNDBcjs.removeSideTabs.call(void 0, blocks, pageWidths);
|
|
5256
5258
|
if (kept !== blocks) {
|
|
5257
5259
|
blocks.length = 0;
|
|
5258
5260
|
blocks.push(...kept);
|
|
@@ -5261,12 +5263,12 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5261
5263
|
mergeContinuedCells(blocks, pageHeights);
|
|
5262
5264
|
mergeCrossPageTables(blocks, pageHeights, wrapLexicon);
|
|
5263
5265
|
if (_optionalChain([options, 'optionalAccess', _472 => _472.removeHeaderFooter]) !== false && parsedPageCount >= 3) {
|
|
5264
|
-
const boxes =
|
|
5266
|
+
const boxes = _chunkHFYDNNDBcjs.removeHeaderFooterBlocks.call(void 0, blocks, pageHeights, warnings, noteMarks, true);
|
|
5265
5267
|
for (let ri = boxes.length - 1; ri >= 0; ri--) blocks.splice(boxes[ri], 1);
|
|
5266
5268
|
}
|
|
5267
5269
|
splitContactTables(blocks);
|
|
5268
|
-
if (!_optionalChain([options, 'optionalAccess', _473 => _473.keepTrailingEmptyCols]))
|
|
5269
|
-
|
|
5270
|
+
if (!_optionalChain([options, 'optionalAccess', _473 => _473.keepTrailingEmptyCols])) _chunkHFYDNNDBcjs.trimTrailingEmptyTableCols.call(void 0, blocks);
|
|
5271
|
+
_chunkHFYDNNDBcjs.joinPageBreakWraps.call(void 0, blocks, wrapLexicon);
|
|
5270
5272
|
await flushPdfImages(imageState, warnings, pageImageBlocks);
|
|
5271
5273
|
injectPageImageBlocks(blocks, pageImageBlocks);
|
|
5272
5274
|
if (_optionalChain([options, 'optionalAccess', _474 => _474.formulaOcr]) && formulaBuffer) {
|
|
@@ -5279,21 +5281,21 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5279
5281
|
});
|
|
5280
5282
|
}
|
|
5281
5283
|
}
|
|
5282
|
-
const medianFontSize =
|
|
5284
|
+
const medianFontSize = _chunkHFYDNNDBcjs.computeMedianFontSizeFromFreq.call(void 0, fontSizeFreq);
|
|
5283
5285
|
if (medianFontSize > 0) {
|
|
5284
|
-
|
|
5285
|
-
}
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5286
|
+
_chunkHFYDNNDBcjs.detectHeadings.call(void 0, blocks, medianFontSize);
|
|
5287
|
+
}
|
|
5288
|
+
_chunkHFYDNNDBcjs.detectDocumentStyleHeadings.call(void 0, blocks);
|
|
5289
|
+
_chunkHFYDNNDBcjs.detectTypographyHeadings.call(void 0, blocks);
|
|
5290
|
+
_chunkHFYDNNDBcjs.detectSiblingStyleHeadings.call(void 0, blocks);
|
|
5291
|
+
_chunkHFYDNNDBcjs.detectRepeatedPageLabels.call(void 0, blocks);
|
|
5292
|
+
_chunkHFYDNNDBcjs.detectPageLeadHeadings.call(void 0, blocks);
|
|
5293
|
+
_chunkHFYDNNDBcjs.mergeStackedHeadingLines.call(void 0, blocks, medianFontSize);
|
|
5294
|
+
_chunkHFYDNNDBcjs.refineDocumentStyleHeadings.call(void 0, blocks);
|
|
5295
|
+
_chunkHFYDNNDBcjs.detectMarkerHeadings.call(void 0, blocks);
|
|
5294
5296
|
demoteNonHeadingRoles(blocks, pageHeights, faceNames);
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
+
_chunkHFYDNNDBcjs.detectTableCaptions.call(void 0, blocks);
|
|
5298
|
+
_chunkHFYDNNDBcjs.detectKoreanListBlocks.call(void 0, blocks);
|
|
5297
5299
|
sanitizeBlockControlChars(blocks);
|
|
5298
5300
|
if (_optionalChain([options, 'optionalAccess', _475 => _475.imagePlacement]) === "flow") moveImagesInFlow(blocks);
|
|
5299
5301
|
let outBlocks = splitSingleCellTables(blocks);
|
|
@@ -5315,19 +5317,19 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5315
5317
|
const shown = /* @__PURE__ */ new Map();
|
|
5316
5318
|
const markContent = (bs) => {
|
|
5317
5319
|
for (const b of _nullishCoalesce(bs, () => ( []))) if (b.table) for (const row of b.table.cells) for (const c of row) {
|
|
5318
|
-
if (
|
|
5319
|
-
const lines =
|
|
5320
|
-
if (lines)
|
|
5320
|
+
if (_chunkHFYDNNDBcjs.IMAGE_CELLS.has(c)) _chunkFE7463HFcjs.CONTENT_CELLS.add(c);
|
|
5321
|
+
const lines = _chunkHFYDNNDBcjs.CELL_LINES.get(c);
|
|
5322
|
+
if (lines) _chunkFE7463HFcjs.CELL_BASELINES.set(c, lines.map((l) => l.y));
|
|
5321
5323
|
markContent(c.blocks);
|
|
5322
5324
|
}
|
|
5323
5325
|
};
|
|
5324
5326
|
const visual = (bs) => bs.flatMap((b) => {
|
|
5325
5327
|
if (b.type !== "table") return [b];
|
|
5326
|
-
if (!hancom && b.table &&
|
|
5328
|
+
if (!hancom && b.table && _chunkHFYDNNDBcjs.CLIP_TABLES.has(b.table)) return [b];
|
|
5327
5329
|
let v = shown.get(b);
|
|
5328
5330
|
if (!v) {
|
|
5329
5331
|
markContent([b]);
|
|
5330
|
-
shown.set(b, v =
|
|
5332
|
+
shown.set(b, v = _chunkFE7463HFcjs.unframeLayoutTables.call(void 0, [b], !!_optionalChain([options, 'optionalAccess', _479 => _479.keepTrailingEmptyCols])));
|
|
5331
5333
|
}
|
|
5332
5334
|
return v;
|
|
5333
5335
|
});
|
|
@@ -5336,13 +5338,13 @@ async function parsePdfDocument(buffer, options) {
|
|
|
5336
5338
|
blocks.length = 0;
|
|
5337
5339
|
for (const b of kept) blocks.push(b);
|
|
5338
5340
|
}
|
|
5339
|
-
const finishMarkdown = (bs) => mergeLinkRuns(cleanPdfText(
|
|
5340
|
-
if (_optionalChain([options, 'optionalAccess', _481 => _481.tableFormat]) === "gfm")
|
|
5341
|
+
const finishMarkdown = (bs) => mergeLinkRuns(cleanPdfText(_chunkFE7463HFcjs.blocksToMarkdown.call(void 0, bs, { tableFormat: _optionalChain([options, 'optionalAccess', _480 => _480.tableFormat]) }), { keepLoneNumbers: true }));
|
|
5342
|
+
if (_optionalChain([options, 'optionalAccess', _481 => _481.tableFormat]) === "gfm") _chunkFE7463HFcjs.assignTableIds.call(void 0, blocks);
|
|
5341
5343
|
let markdown = finishMarkdown(outBlocks);
|
|
5342
5344
|
const outline = collectPdfOutline(outBlocks);
|
|
5343
5345
|
return {
|
|
5344
5346
|
markdown,
|
|
5345
|
-
pages:
|
|
5347
|
+
pages: _chunk4TDUZ6UNcjs.blocksToPages.call(void 0, splitPageTables(_chunkHFYDNNDBcjs.splitPageBreakWraps.call(void 0, outBlocks)), finishMarkdown),
|
|
5346
5348
|
blocks,
|
|
5347
5349
|
metadata,
|
|
5348
5350
|
outline: outline.length > 0 ? outline : void 0,
|
|
@@ -5425,5 +5427,5 @@ function marginStamp(items) {
|
|
|
5425
5427
|
|
|
5426
5428
|
|
|
5427
5429
|
|
|
5428
|
-
exports.PDFJS_DOCUMENT_OPTIONS = PDFJS_DOCUMENT_OPTIONS; exports.cleanPdfText = cleanPdfText; exports.detectKoreanListBlocks =
|
|
5429
|
-
//# sourceMappingURL=parser-
|
|
5430
|
+
exports.PDFJS_DOCUMENT_OPTIONS = PDFJS_DOCUMENT_OPTIONS; exports.cleanPdfText = cleanPdfText; exports.detectKoreanListBlocks = _chunkHFYDNNDBcjs.detectKoreanListBlocks; exports.detectTableCaptions = _chunkHFYDNNDBcjs.detectTableCaptions; exports.extractPdfMetadataOnly = extractPdfMetadataOnly; exports.mergeCrossPageTables = mergeCrossPageTables; exports.ocrImageRegions = ocrImageRegions; exports.parsePdfDocument = parsePdfDocument; exports.removeHeaderFooterBlocks = _chunkHFYDNNDBcjs.removeHeaderFooterBlocks;
|
|
5431
|
+
//# sourceMappingURL=parser-YJYGGUJP.cjs.map
|