kordoc 4.24.47 → 4.24.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/NOTICE +21 -0
  2. package/README.md +4 -4
  3. package/dist/{-PWMZE4CC.js → -22V6D2US.js} +42 -42
  4. package/dist/{chunk-RQ4XTX4J.cjs → chunk-2UWWWM4Q.cjs} +98 -98
  5. package/dist/{chunk-RQ4XTX4J.cjs.map → chunk-2UWWWM4Q.cjs.map} +1 -1
  6. package/dist/{chunk-3CWVQNFL.cjs → chunk-367WLMPO.cjs} +59 -67
  7. package/dist/chunk-367WLMPO.cjs.map +1 -0
  8. package/dist/{chunk-Z5TDZDWU.js → chunk-4HJKBRZJ.js} +153 -50
  9. package/dist/chunk-4HJKBRZJ.js.map +1 -0
  10. package/dist/{chunk-GRQXAWNW.js → chunk-4MWUBTAE.js} +2 -2
  11. package/dist/{chunk-TN5ZK2WN.js → chunk-67GSFYG7.js} +2 -2
  12. package/dist/{chunk-TGLXN6VH.js → chunk-6BFWLS7E.js} +3 -3
  13. package/dist/{chunk-X7RBVVDC.cjs → chunk-6NZ32OTX.cjs} +9 -3
  14. package/dist/chunk-6NZ32OTX.cjs.map +1 -0
  15. package/dist/{chunk-Q3UCWUEV.js → chunk-7KKL3PRK.js} +5 -13
  16. package/dist/chunk-7KKL3PRK.js.map +1 -0
  17. package/dist/{chunk-T5J4GW6B.js → chunk-AUAJVQQK.js} +2 -2
  18. package/dist/{chunk-KIVWAZKL.js → chunk-AXW2FMVR.js} +2 -2
  19. package/dist/{chunk-LEUAWTMU.js → chunk-CCQMSIZQ.js} +19 -19
  20. package/dist/{chunk-PM46GSMV.js → chunk-DA5AXURC.js} +194 -6
  21. package/dist/chunk-DA5AXURC.js.map +1 -0
  22. package/dist/{chunk-SUIH5LY7.js → chunk-DAAJO62F.js} +2 -2
  23. package/dist/{chunk-4MNRUPS5.js → chunk-EUJX7HTR.js} +53 -10
  24. package/dist/chunk-EUJX7HTR.js.map +1 -0
  25. package/dist/{chunk-56FEGA44.js → chunk-EYSXMDA7.js} +17 -17
  26. package/dist/{chunk-VKVDMH7X.js → chunk-FU6ZDWCI.js} +8 -2
  27. package/dist/chunk-FU6ZDWCI.js.map +1 -0
  28. package/dist/{chunk-KSE5HSU3.js → chunk-HETGOJ6V.js} +8 -5
  29. package/dist/chunk-HETGOJ6V.js.map +1 -0
  30. package/dist/{chunk-HFQFCAEJ.js → chunk-HW7WVYBF.js} +2 -2
  31. package/dist/{chunk-O2652KK3.cjs → chunk-IRAZCKQ6.cjs} +3 -3
  32. package/dist/{chunk-O2652KK3.cjs.map → chunk-IRAZCKQ6.cjs.map} +1 -1
  33. package/dist/{chunk-AB7MYMPZ.js → chunk-KB4ORA7M.js} +2 -2
  34. package/dist/{chunk-57BKTVR5.js → chunk-KXHUHGMC.js} +2 -2
  35. package/dist/{chunk-YLYSJSEP.js → chunk-L3JP55ZY.js} +2 -2
  36. package/dist/{chunk-2CBIY2OH.js → chunk-LCRSRVFJ.js} +2 -2
  37. package/dist/{chunk-2CBIY2OH.js.map → chunk-LCRSRVFJ.js.map} +1 -1
  38. package/dist/{chunk-IPXFIH5E.js → chunk-LFFARZYZ.js} +8 -5
  39. package/dist/chunk-LFFARZYZ.js.map +1 -0
  40. package/dist/{chunk-BO2IJGNZ.js → chunk-LOSCIAHY.js} +2 -2
  41. package/dist/{chunk-SQ5Q4Q3R.js → chunk-M5RQ2PNP.js} +6 -14
  42. package/dist/chunk-M5RQ2PNP.js.map +1 -0
  43. package/dist/{chunk-MOWJOFIH.js → chunk-MIJTZKWF.js} +2 -2
  44. package/dist/chunk-MLBX6KQM.js +153 -0
  45. package/dist/chunk-MLBX6KQM.js.map +1 -0
  46. package/dist/{chunk-HMD35PMD.js → chunk-OAETOHH3.js} +3 -3
  47. package/dist/{chunk-IWC6PTMT.js → chunk-PMGJQWSW.js} +2 -2
  48. package/dist/{chunk-LMHE4HDR.cjs → chunk-PVV6OY4M.cjs} +286 -98
  49. package/dist/chunk-PVV6OY4M.cjs.map +1 -0
  50. package/dist/{chunk-BKK2SMVM.cjs → chunk-PW7MQZI4.cjs} +2 -2
  51. package/dist/{chunk-BKK2SMVM.cjs.map → chunk-PW7MQZI4.cjs.map} +1 -1
  52. package/dist/{chunk-NYIJU4Q6.js → chunk-Q7FDPJUS.js} +10 -10
  53. package/dist/{chunk-FI7ULBC6.js → chunk-R2RLNUNK.js} +6 -6
  54. package/dist/{chunk-AO3YFJVW.js → chunk-RQLEGKEV.js} +2 -2
  55. package/dist/{chunk-OAKJNKAS.js → chunk-S54DZB2Z.js} +193 -5
  56. package/dist/chunk-S54DZB2Z.js.map +1 -0
  57. package/dist/{chunk-A67OXFXM.js → chunk-TAHS42ED.js} +54 -11
  58. package/dist/chunk-TAHS42ED.js.map +1 -0
  59. package/dist/{chunk-WAFJUSUF.cjs → chunk-TQOAPKLU.cjs} +11 -8
  60. package/dist/chunk-TQOAPKLU.cjs.map +1 -0
  61. package/dist/{chunk-UFY6XX4U.cjs → chunk-UBY2PLKR.cjs} +75 -32
  62. package/dist/chunk-UBY2PLKR.cjs.map +1 -0
  63. package/dist/{chunk-U556XJW6.js → chunk-UJELMNOU.js} +8 -2
  64. package/dist/chunk-UJELMNOU.js.map +1 -0
  65. package/dist/{chunk-FOTG4MMD.js → chunk-UU54HN5I.js} +6 -6
  66. package/dist/{chunk-BP5GDQBT.js → chunk-VMOUAWGD.js} +7 -7
  67. package/dist/{chunk-2VXVBB5Q.js → chunk-WLFZOBZR.js} +3 -3
  68. package/dist/chunk-Y4MFHEK4.cjs +156 -0
  69. package/dist/chunk-Y4MFHEK4.cjs.map +1 -0
  70. package/dist/{chunk-VL43TUO6.js → chunk-Y6QW3FJQ.js} +2 -2
  71. package/dist/chunk-ZF24SO45.js +154 -0
  72. package/dist/chunk-ZF24SO45.js.map +1 -0
  73. package/dist/chunks-Q7242OJE.js +11 -0
  74. package/dist/cli.js +74 -53
  75. package/dist/cli.js.map +1 -1
  76. package/dist/{formula-W5MTLANP.js → formula-BYEDWWZU.js} +4 -4
  77. package/dist/{formula-2BQBGPM2.js → formula-FQLMMBDP.js} +3 -3
  78. package/dist/{formula-V6CNOC4G.cjs → formula-QJEOIVKR.cjs} +9 -9
  79. package/dist/{formula-V6CNOC4G.cjs.map → formula-QJEOIVKR.cjs.map} +1 -1
  80. package/dist/generator-FTM6GOGB.cjs +11 -0
  81. package/dist/{generator-U2BRFTJ4.cjs.map → generator-FTM6GOGB.cjs.map} +1 -1
  82. package/dist/generator-Q3L7RNUY.js +17 -0
  83. package/dist/generator-SU73HZHR.js +10 -0
  84. package/dist/{image-ocr-COBRSG6O.js → image-ocr-7Y3FCGRR.js} +12 -10
  85. package/dist/image-ocr-7Y3FCGRR.js.map +1 -0
  86. package/dist/{image-ocr-2WSZULNO.js → image-ocr-VIGZE4YL.js} +9 -7
  87. package/dist/image-ocr-VIGZE4YL.js.map +1 -0
  88. package/dist/{image-ocr-MVOSHIY5.cjs → image-ocr-WRILL3WO.cjs} +29 -27
  89. package/dist/image-ocr-WRILL3WO.cjs.map +1 -0
  90. package/dist/index.cjs +1645 -1542
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.d.cts +18 -5
  93. package/dist/index.d.ts +18 -5
  94. package/dist/index.js +231 -128
  95. package/dist/index.js.map +1 -1
  96. package/dist/mcp.js +42 -43
  97. package/dist/mcp.js.map +1 -1
  98. package/dist/memo-T5ZQEXEA.js +17 -0
  99. package/dist/{model-bundle-LFLRW2SI.js → model-bundle-UJRQPYUU.js} +5 -5
  100. package/dist/{models-UGOWUUAL.js → models-64YLAWTI.js} +5 -5
  101. package/dist/{parse-worker-v2-LCCTZWPT.js → parse-worker-v2-QWQZKFQO.js} +26 -24
  102. package/dist/parse-worker-v2-QWQZKFQO.js.map +1 -0
  103. package/dist/{parser-JAL2OOOL.js → parser-JPWANPLM.js} +428 -42
  104. package/dist/parser-JPWANPLM.js.map +1 -0
  105. package/dist/{parser-RE52HQXO.cjs → parser-RB6CBNAM.cjs} +720 -334
  106. package/dist/parser-RB6CBNAM.cjs.map +1 -0
  107. package/dist/{parser-J56FGU6P.js → parser-XFU3VRWM.js} +431 -45
  108. package/dist/parser-XFU3VRWM.js.map +1 -0
  109. package/dist/pdf-ocr-NOJHEH4M.cjs +42 -0
  110. package/dist/{pdf-ocr-5O336TCR.cjs.map → pdf-ocr-NOJHEH4M.cjs.map} +1 -1
  111. package/dist/{pdf-ocr-PQZZVFI5.js → pdf-ocr-XTZZEYKJ.js} +6 -6
  112. package/dist/{pdf-ocr-NQ3HAL77.js → pdf-ocr-ZV3KYIIE.js} +9 -9
  113. package/dist/{profile-io-K22CB2ZB.js → profile-io-FAJORRD2.js} +3 -3
  114. package/dist/{rasterize-A6B5K4QN.js → rasterize-4ZJUA2DZ.js} +3 -3
  115. package/dist/{redact-doc-TPXMML5Q.js → redact-doc-JPNROEH6.js} +30 -30
  116. package/dist/{render-ROFIMWW5.js → render-D4WBOBKI.js} +13 -13
  117. package/dist/{rewrite-fallback-WG7Z3LR3.js → rewrite-fallback-OF3QI6CX.js} +14 -14
  118. package/dist/seal-DQWEHIAM.js +16 -0
  119. package/dist/{setup-J5SHDFIE.js → setup-YC25YCQB.js} +3 -3
  120. package/dist/to-hwpx-D7OMPDUQ.js +21 -0
  121. package/dist/to-hwpx-LUA6F5RR.cjs +16 -0
  122. package/dist/{to-hwpx-RWDQB3T2.cjs.map → to-hwpx-LUA6F5RR.cjs.map} +1 -1
  123. package/dist/{to-hwpx-X7JE6YJB.js → to-hwpx-ZWN64NCQ.js} +5 -5
  124. package/dist/visual-SW7NPY6K.js +37 -0
  125. package/dist/{watch-WZBW6UE7.js → watch-ZU576VSR.js} +24 -24
  126. package/package.json +3 -2
  127. package/dist/chunk-3CWVQNFL.cjs.map +0 -1
  128. package/dist/chunk-4MNRUPS5.js.map +0 -1
  129. package/dist/chunk-A67OXFXM.js.map +0 -1
  130. package/dist/chunk-AYM7XTI2.js +0 -31
  131. package/dist/chunk-AYM7XTI2.js.map +0 -1
  132. package/dist/chunk-CQ33HCSU.js +0 -32
  133. package/dist/chunk-CQ33HCSU.js.map +0 -1
  134. package/dist/chunk-IPXFIH5E.js.map +0 -1
  135. package/dist/chunk-KSE5HSU3.js.map +0 -1
  136. package/dist/chunk-LMHE4HDR.cjs.map +0 -1
  137. package/dist/chunk-OAKJNKAS.js.map +0 -1
  138. package/dist/chunk-PM46GSMV.js.map +0 -1
  139. package/dist/chunk-Q3UCWUEV.js.map +0 -1
  140. package/dist/chunk-SQ5Q4Q3R.js.map +0 -1
  141. package/dist/chunk-U556XJW6.js.map +0 -1
  142. package/dist/chunk-UFY6XX4U.cjs.map +0 -1
  143. package/dist/chunk-VKVDMH7X.js.map +0 -1
  144. package/dist/chunk-WAFJUSUF.cjs.map +0 -1
  145. package/dist/chunk-WPLAEJU5.cjs +0 -31
  146. package/dist/chunk-WPLAEJU5.cjs.map +0 -1
  147. package/dist/chunk-X7RBVVDC.cjs.map +0 -1
  148. package/dist/chunk-Z5TDZDWU.js.map +0 -1
  149. package/dist/chunks-SHXTE5HM.js +0 -11
  150. package/dist/generator-E4VQKPRP.js +0 -10
  151. package/dist/generator-MBR4V3JQ.js +0 -17
  152. package/dist/generator-U2BRFTJ4.cjs +0 -11
  153. package/dist/hancom-7SU4XBXJ.js +0 -84
  154. package/dist/hancom-7SU4XBXJ.js.map +0 -1
  155. package/dist/hancom-MP7D7HWW.cjs +0 -85
  156. package/dist/hancom-MP7D7HWW.cjs.map +0 -1
  157. package/dist/hancom-RNJWH63M.js +0 -85
  158. package/dist/hancom-RNJWH63M.js.map +0 -1
  159. package/dist/image-ocr-2WSZULNO.js.map +0 -1
  160. package/dist/image-ocr-COBRSG6O.js.map +0 -1
  161. package/dist/image-ocr-MVOSHIY5.cjs.map +0 -1
  162. package/dist/memo-QJ5RKTBN.js +0 -17
  163. package/dist/parse-worker-v2-LCCTZWPT.js.map +0 -1
  164. package/dist/parser-J56FGU6P.js.map +0 -1
  165. package/dist/parser-JAL2OOOL.js.map +0 -1
  166. package/dist/parser-RE52HQXO.cjs.map +0 -1
  167. package/dist/pdf-ocr-5O336TCR.cjs +0 -42
  168. package/dist/seal-35U76WY2.js +0 -16
  169. package/dist/to-hwpx-RWDQB3T2.cjs +0 -16
  170. package/dist/to-hwpx-XQULU2I7.js +0 -21
  171. package/dist/visual-4HRP2VIH.js +0 -37
  172. /package/dist/{-PWMZE4CC.js.map → -22V6D2US.js.map} +0 -0
  173. /package/dist/{chunk-GRQXAWNW.js.map → chunk-4MWUBTAE.js.map} +0 -0
  174. /package/dist/{chunk-TN5ZK2WN.js.map → chunk-67GSFYG7.js.map} +0 -0
  175. /package/dist/{chunk-TGLXN6VH.js.map → chunk-6BFWLS7E.js.map} +0 -0
  176. /package/dist/{chunk-T5J4GW6B.js.map → chunk-AUAJVQQK.js.map} +0 -0
  177. /package/dist/{chunk-KIVWAZKL.js.map → chunk-AXW2FMVR.js.map} +0 -0
  178. /package/dist/{chunk-LEUAWTMU.js.map → chunk-CCQMSIZQ.js.map} +0 -0
  179. /package/dist/{chunk-SUIH5LY7.js.map → chunk-DAAJO62F.js.map} +0 -0
  180. /package/dist/{chunk-56FEGA44.js.map → chunk-EYSXMDA7.js.map} +0 -0
  181. /package/dist/{chunk-HFQFCAEJ.js.map → chunk-HW7WVYBF.js.map} +0 -0
  182. /package/dist/{chunk-AB7MYMPZ.js.map → chunk-KB4ORA7M.js.map} +0 -0
  183. /package/dist/{chunk-57BKTVR5.js.map → chunk-KXHUHGMC.js.map} +0 -0
  184. /package/dist/{chunk-YLYSJSEP.js.map → chunk-L3JP55ZY.js.map} +0 -0
  185. /package/dist/{chunk-BO2IJGNZ.js.map → chunk-LOSCIAHY.js.map} +0 -0
  186. /package/dist/{chunk-MOWJOFIH.js.map → chunk-MIJTZKWF.js.map} +0 -0
  187. /package/dist/{chunk-HMD35PMD.js.map → chunk-OAETOHH3.js.map} +0 -0
  188. /package/dist/{chunk-IWC6PTMT.js.map → chunk-PMGJQWSW.js.map} +0 -0
  189. /package/dist/{chunk-NYIJU4Q6.js.map → chunk-Q7FDPJUS.js.map} +0 -0
  190. /package/dist/{chunk-FI7ULBC6.js.map → chunk-R2RLNUNK.js.map} +0 -0
  191. /package/dist/{chunk-AO3YFJVW.js.map → chunk-RQLEGKEV.js.map} +0 -0
  192. /package/dist/{chunk-FOTG4MMD.js.map → chunk-UU54HN5I.js.map} +0 -0
  193. /package/dist/{chunk-BP5GDQBT.js.map → chunk-VMOUAWGD.js.map} +0 -0
  194. /package/dist/{chunk-2VXVBB5Q.js.map → chunk-WLFZOBZR.js.map} +0 -0
  195. /package/dist/{chunk-VL43TUO6.js.map → chunk-Y6QW3FJQ.js.map} +0 -0
  196. /package/dist/{chunks-SHXTE5HM.js.map → chunks-Q7242OJE.js.map} +0 -0
  197. /package/dist/{formula-W5MTLANP.js.map → formula-BYEDWWZU.js.map} +0 -0
  198. /package/dist/{formula-2BQBGPM2.js.map → formula-FQLMMBDP.js.map} +0 -0
  199. /package/dist/{generator-E4VQKPRP.js.map → generator-Q3L7RNUY.js.map} +0 -0
  200. /package/dist/{generator-MBR4V3JQ.js.map → generator-SU73HZHR.js.map} +0 -0
  201. /package/dist/{memo-QJ5RKTBN.js.map → memo-T5ZQEXEA.js.map} +0 -0
  202. /package/dist/{model-bundle-LFLRW2SI.js.map → model-bundle-UJRQPYUU.js.map} +0 -0
  203. /package/dist/{models-UGOWUUAL.js.map → models-64YLAWTI.js.map} +0 -0
  204. /package/dist/{pdf-ocr-NQ3HAL77.js.map → pdf-ocr-XTZZEYKJ.js.map} +0 -0
  205. /package/dist/{pdf-ocr-PQZZVFI5.js.map → pdf-ocr-ZV3KYIIE.js.map} +0 -0
  206. /package/dist/{profile-io-K22CB2ZB.js.map → profile-io-FAJORRD2.js.map} +0 -0
  207. /package/dist/{rasterize-A6B5K4QN.js.map → rasterize-4ZJUA2DZ.js.map} +0 -0
  208. /package/dist/{redact-doc-TPXMML5Q.js.map → redact-doc-JPNROEH6.js.map} +0 -0
  209. /package/dist/{render-ROFIMWW5.js.map → render-D4WBOBKI.js.map} +0 -0
  210. /package/dist/{rewrite-fallback-WG7Z3LR3.js.map → rewrite-fallback-OF3QI6CX.js.map} +0 -0
  211. /package/dist/{seal-35U76WY2.js.map → seal-DQWEHIAM.js.map} +0 -0
  212. /package/dist/{setup-J5SHDFIE.js.map → setup-YC25YCQB.js.map} +0 -0
  213. /package/dist/{to-hwpx-X7JE6YJB.js.map → to-hwpx-D7OMPDUQ.js.map} +0 -0
  214. /package/dist/{to-hwpx-XQULU2I7.js.map → to-hwpx-ZWN64NCQ.js.map} +0 -0
  215. /package/dist/{visual-4HRP2VIH.js.map → visual-SW7NPY6K.js.map} +0 -0
  216. /package/dist/{watch-WZBW6UE7.js.map → watch-ZU576VSR.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  ensureModelsIn,
4
4
  getModelStatusIn,
5
5
  getModelsDir
6
- } from "./chunk-HFQFCAEJ.js";
6
+ } from "./chunk-HW7WVYBF.js";
7
7
 
8
8
  // src/ocr/models.ts
9
9
  import { join } from "path";
@@ -175,4 +175,4 @@ export {
175
175
  parseCharacterDict,
176
176
  ocrModelPath
177
177
  };
178
- //# sourceMappingURL=chunk-T5J4GW6B.js.map
178
+ //# sourceMappingURL=chunk-AUAJVQQK.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  KordocError
4
- } from "./chunk-57BKTVR5.js";
4
+ } from "./chunk-KXHUHGMC.js";
5
5
 
6
6
  // src/shared/offline.ts
7
7
  import { realpathSync } from "fs";
@@ -49,4 +49,4 @@ export {
49
49
  getAccessRoot,
50
50
  assertWithinRoot
51
51
  };
52
- //# sourceMappingURL=chunk-KIVWAZKL.js.map
52
+ //# sourceMappingURL=chunk-AXW2FMVR.js.map
@@ -1,18 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- SPACE_EM_FIXED,
4
- charWidthEm1000,
5
- faceClassForGen,
6
- fitRatioForFewerLines,
7
- measureTextWidth,
8
- noteAttrsOf,
9
- noteAutoNumOf,
10
- noteRefMark,
11
- prepareWrap,
12
- readSectionNoteFormats,
13
- resolveParaHeading,
14
- simulateWrap
15
- } from "./chunk-MOWJOFIH.js";
16
2
  import {
17
3
  applySplices,
18
4
  buildMappedRangeSplices,
@@ -27,6 +13,20 @@ import {
27
13
  puaShownMap,
28
14
  scanSectionXml
29
15
  } from "./chunk-3AHL6YEA.js";
16
+ import {
17
+ SPACE_EM_FIXED,
18
+ charWidthEm1000,
19
+ faceClassForGen,
20
+ fitRatioForFewerLines,
21
+ measureTextWidth,
22
+ noteAttrsOf,
23
+ noteAutoNumOf,
24
+ noteRefMark,
25
+ prepareWrap,
26
+ readSectionNoteFormats,
27
+ resolveParaHeading,
28
+ simulateWrap
29
+ } from "./chunk-MIJTZKWF.js";
30
30
  import {
31
31
  MAX_DECOMPRESS_SIZE,
32
32
  MAX_XML_DEPTH,
@@ -38,7 +38,7 @@ import {
38
38
  extractTextFromNode,
39
39
  findChildByLocalName,
40
40
  readZipEntry
41
- } from "./chunk-AB7MYMPZ.js";
41
+ } from "./chunk-KB4ORA7M.js";
42
42
  import {
43
43
  CONVERT_MAP,
44
44
  MIDDLE_CONVERT_MAP,
@@ -57,7 +57,7 @@ import {
57
57
  escapeLiteralTags,
58
58
  tidyScriptTags,
59
59
  wrapScript
60
- } from "./chunk-2CBIY2OH.js";
60
+ } from "./chunk-LCRSRVFJ.js";
61
61
  import {
62
62
  MAX_COLS,
63
63
  MAX_ROWS,
@@ -74,7 +74,7 @@ import {
74
74
  noteTableHtml,
75
75
  sanitizeText,
76
76
  visibleText
77
- } from "./chunk-KSE5HSU3.js";
77
+ } from "./chunk-HETGOJ6V.js";
78
78
  import {
79
79
  circledHangul,
80
80
  circledNumber,
@@ -92,7 +92,7 @@ import {
92
92
  sanitizeHref,
93
93
  stripDtd,
94
94
  unescapeHtml
95
- } from "./chunk-57BKTVR5.js";
95
+ } from "./chunk-KXHUHGMC.js";
96
96
 
97
97
  // src/hwpx/generator.ts
98
98
  import JSZip2 from "jszip";
@@ -10921,4 +10921,4 @@ export {
10921
10921
  markdownToHwpxFromTemplate,
10922
10922
  markdownToHwpx
10923
10923
  };
10924
- //# sourceMappingURL=chunk-LEUAWTMU.js.map
10924
+ //# sourceMappingURL=chunk-CCQMSIZQ.js.map
@@ -30,7 +30,7 @@ import {
30
30
  stackedGlyphBands,
31
31
  starRun,
32
32
  tallInkCount
33
- } from "./chunk-4MNRUPS5.js";
33
+ } from "./chunk-EUJX7HTR.js";
34
34
  import {
35
35
  validateOcrOptions
36
36
  } from "./chunk-IIOBUTXH.js";
@@ -43,14 +43,14 @@ import {
43
43
  ocrSourcePath,
44
44
  parseCharacterDict,
45
45
  resolveOcrModels
46
- } from "./chunk-T5J4GW6B.js";
46
+ } from "./chunk-AUAJVQQK.js";
47
47
  import {
48
48
  disableOrtTelemetry
49
49
  } from "./chunk-6H25SXDI.js";
50
50
  import {
51
51
  KordocError,
52
52
  OPTIONAL_DEP_INSTALL_HINT
53
- } from "./chunk-57BKTVR5.js";
53
+ } from "./chunk-KXHUHGMC.js";
54
54
 
55
55
  // src/ocr/ocr-stacked-rows.ts
56
56
  var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p]?$|^[-–—·∼~]$|^\([-+−△▲▽▼]?[\d.,]+%?\)$/;
@@ -392,7 +392,8 @@ function detectRulingLines(rgba, width, height, scale) {
392
392
  for (const f of frames) {
393
393
  const innerH = hs.filter((h) => h.y1 > f.y1 + tol && h.y1 < f.y2 - tol && Math.abs(h.x1 - f.x1) <= tol && Math.abs(h.x2 - f.x2) <= tol);
394
394
  const innerV = vs.filter((v) => v.x1 > f.x1 + tol && v.x1 < f.x2 - tol && Math.abs(v.y1 - f.y1) <= tol && Math.abs(v.y2 - f.y2) <= tol);
395
- if (innerH.length < 3 || innerV.length < 1) continue;
395
+ const darkV = inkV.some((v) => v.x1 > f.x1 + tol && v.x1 < f.x2 - tol && v.y1 <= f.y1 + tol && v.y2 >= f.y2 - tol);
396
+ if (innerH.length < 3 || innerV.length < 1 && !darkV) continue;
396
397
  for (const h of innerH) if (!horizontals.some((p) => Math.abs(p.y1 - h.y1) <= tol && p.x1 <= h.x1 + tol && p.x2 >= h.x2 - tol)) horizontals.push(h);
397
398
  for (const v of innerV) if (!verticals.some((p) => Math.abs(p.x1 - v.x1) <= tol && p.y1 <= v.y1 + tol && p.y2 >= v.y2 - tol)) {
398
399
  verticals.push(v);
@@ -2327,6 +2328,187 @@ function rotateRgba(rgba, width, height, deg) {
2327
2328
  return out;
2328
2329
  }
2329
2330
 
2331
+ // src/ocr/ocr-chart-axes.ts
2332
+ var NUMBER = /^-?\d+(?:\.\d+)?%?$/;
2333
+ var value = (t) => Number(t.replace(/%$/, ""));
2334
+ function evenRun(ticks) {
2335
+ let best = [];
2336
+ for (let s = 0; s + 1 < ticks.length; s++) {
2337
+ const step = ticks[s + 1].value - ticks[s].value, gap = ticks[s + 1].pos - ticks[s].pos;
2338
+ if (step === 0 || gap <= 0) continue;
2339
+ let e = s + 1;
2340
+ while (e + 1 < ticks.length) {
2341
+ const d = ticks[e + 1].pos - ticks[e].pos, v = ticks[e + 1].value - ticks[e].value;
2342
+ if (Math.abs(d - gap) > gap * 0.35 || Math.abs(v - step) > Math.abs(step) * 0.25) break;
2343
+ e++;
2344
+ }
2345
+ if (e - s + 1 > best.length) best = ticks.slice(s, e + 1);
2346
+ }
2347
+ return best;
2348
+ }
2349
+ var number = (t) => NUMBER.test(t.replace(/-$/, "").trim()) ? value(t.replace(/-$/, "").trim()) : null;
2350
+ function valueAxes(items) {
2351
+ const nums = items.filter((it) => number(it.text) !== null);
2352
+ const out = [];
2353
+ const used = /* @__PURE__ */ new Set();
2354
+ for (const seed of nums) {
2355
+ if (used.has(seed)) continue;
2356
+ const col = nums.filter((it) => Math.abs(it.x + it.w - seed.x - seed.w) <= seed.h * 0.8).sort((a, b) => a.y - b.y);
2357
+ const run = evenRun(col.map((it) => ({ pos: it.y + it.h / 2, value: number(it.text), it })));
2358
+ if (run.length < 4 || run[1].value > run[0].value) continue;
2359
+ const ticks = run.map((r) => r.it);
2360
+ for (const it of ticks) used.add(it);
2361
+ const h = ticks.reduce((a, it) => a + it.h, 0) / ticks.length;
2362
+ out.push({ x1: Math.min(...ticks.map((it) => it.x)), x2: Math.max(...ticks.map((it) => it.x + it.w)), y1: ticks[0].y, y2: ticks[ticks.length - 1].y + ticks[ticks.length - 1].h, h });
2363
+ }
2364
+ return out;
2365
+ }
2366
+ function timeAxes(items) {
2367
+ const numeric = items.filter((it) => {
2368
+ const t = it.text.trim().split(/\s+/);
2369
+ return t.length > 0 && t.every((x) => NUMBER.test(x));
2370
+ });
2371
+ const out = [];
2372
+ const used = /* @__PURE__ */ new Set();
2373
+ for (const seed of numeric) {
2374
+ if (used.has(seed)) continue;
2375
+ const row = numeric.filter((it) => Math.abs(it.y + it.h / 2 - seed.y - seed.h / 2) <= Math.min(it.h, seed.h) * 0.6).sort((a, b) => a.x - b.x);
2376
+ const ticks = row.flatMap((it) => {
2377
+ const text = it.text.trim(), per = it.w / Math.max(1, text.length);
2378
+ return [...text.matchAll(/\S+/g)].map((m) => ({ pos: it.x + (m.index + m[0].length / 2) * per, value: value(m[0]), it }));
2379
+ });
2380
+ const run = evenRun(ticks);
2381
+ if (run.length < 4 || run[1].value < run[0].value) continue;
2382
+ const boxes = [...new Set(run.map((r) => r.it))];
2383
+ for (const it of boxes) used.add(it);
2384
+ out.push({ x1: Math.min(...boxes.map((it) => it.x)), x2: Math.max(...boxes.map((it) => it.x + it.w)), y1: Math.min(...boxes.map((it) => it.y)), y2: Math.max(...boxes.map((it) => it.y + it.h)), h: seed.h });
2385
+ }
2386
+ return out;
2387
+ }
2388
+ function chartPlotItems(items) {
2389
+ const drop = /* @__PURE__ */ new Set();
2390
+ const verticals = valueAxes(items);
2391
+ if (!verticals.length) return drop;
2392
+ const horizontals = timeAxes(items);
2393
+ for (const v of verticals) {
2394
+ const hz = horizontals.find((a) => a.y1 >= v.y2 - v.h && a.y1 <= v.y2 + 5 * v.h && a.x1 >= v.x1 - v.h && a.x1 <= v.x2 + 4 * v.h && a.x2 > v.x2 + 8 * v.h);
2395
+ if (!hz) continue;
2396
+ const x1 = v.x1 - 5 * v.h, x2 = hz.x2 + 2 * v.h, y1 = v.y1 - 1.5 * v.h, y2 = hz.y2 + 2.5 * v.h;
2397
+ items.forEach((it, i) => {
2398
+ const cx = it.x + it.w / 2, cy = it.y + it.h / 2;
2399
+ if (cx >= x1 && cx <= x2 && cy >= y1 && cy <= y2 && it.x >= x1 - v.h && it.x + it.w <= x2 + v.h) drop.add(i);
2400
+ });
2401
+ }
2402
+ return drop;
2403
+ }
2404
+
2405
+ // src/ocr/ocr-contact-columns.ts
2406
+ var CONTACT = /^([가-힣](?:\s*[가-힣]){0,4})\s+([가-힣]{2,4})\s*([^가-힣\s][^가-힣]{5,48})$/;
2407
+ var PHONE = /^\(?0\d{1,3}\)?[-\s]?\d{3,4}-\d{4}\)?$/;
2408
+ var MAIL = /^\(?[\w.+-]+@[\w-]+(?:\.[\w-]+)+\)?$/;
2409
+ function contactParts(text) {
2410
+ const m = CONTACT.exec(text.trim());
2411
+ if (!m) return null;
2412
+ const contact = m[3].includes("@") ? m[3].replace(/\s+/g, "") : m[3].trim();
2413
+ return PHONE.test(contact) || MAIL.test(contact) ? [m[1], m[2], contact] : null;
2414
+ }
2415
+ function owners2(t) {
2416
+ const own = Array.from({ length: t.rows }, () => Array(t.cols));
2417
+ for (let r = 0; r < t.rows; r++) for (let c = 0; c < t.cols; c++) {
2418
+ if (own[r][c]) continue;
2419
+ const cell = t.cells[r][c];
2420
+ for (let i = r; i < Math.min(t.rows, r + Math.max(1, cell.rowSpan ?? 1)); i++)
2421
+ for (let j = c; j < Math.min(t.cols, c + Math.max(1, cell.colSpan ?? 1)); j++) own[i][j] ??= cell;
2422
+ }
2423
+ return own;
2424
+ }
2425
+ function splitTable3(t) {
2426
+ if (t.cells.length !== t.rows || t.cells.some((row) => row.length !== t.cols)) return;
2427
+ const own = owners2(t);
2428
+ const anchor = (r, c) => own[r][c] === t.cells[r][c] ? t.cells[r][c] : null;
2429
+ const targets = [];
2430
+ for (let c = 0; c < t.cols; c++) {
2431
+ let filled = 0, hits = 0;
2432
+ for (let r = 0; r < t.rows; r++) {
2433
+ const cell = anchor(r, c);
2434
+ if (!cell || (cell.colSpan ?? 1) !== 1 || cell.blocks?.length || !cell.text.trim()) continue;
2435
+ if (contactParts(cell.text)) hits++;
2436
+ if (hits) filled++;
2437
+ }
2438
+ if (hits >= 2 && hits >= filled * 0.8) targets.push(c);
2439
+ }
2440
+ for (const c of targets.reverse()) {
2441
+ const grown = /* @__PURE__ */ new Set();
2442
+ for (let r = 0; r < t.rows; r++) {
2443
+ const cell = anchor(r, c);
2444
+ let added = [{ text: "", colSpan: 1, rowSpan: 1 }, { text: "", colSpan: 1, rowSpan: 1 }];
2445
+ if (cell && (cell.colSpan ?? 1) === 1 && !cell.blocks?.length) {
2446
+ const parts = contactParts(cell.text);
2447
+ if (parts) {
2448
+ cell.text = parts[0];
2449
+ added = [{ ...cell, text: parts[1] }, { ...cell, text: parts[2] }];
2450
+ } else cell.colSpan = 3;
2451
+ grown.add(cell);
2452
+ } else if (!grown.has(own[r][c])) {
2453
+ own[r][c].colSpan = Math.max(1, own[r][c].colSpan ?? 1) + 2;
2454
+ grown.add(own[r][c]);
2455
+ }
2456
+ t.cells[r].splice(c + 1, 0, ...added);
2457
+ }
2458
+ t.cols += 2;
2459
+ }
2460
+ }
2461
+ function splitOcrContactColumns(blocks) {
2462
+ for (const b of blocks) if (b.type === "table" && b.table) splitTable3(b.table);
2463
+ return blocks;
2464
+ }
2465
+
2466
+ // src/ocr/empty-cell-rescue.ts
2467
+ var MAX_CELLS = 60;
2468
+ var TOL = 3;
2469
+ var PAD = 16;
2470
+ async function rescueEmptyCells(engine, tuning, rgba, width, height, ruling, items) {
2471
+ const hs = ruling.horizontals, vs = ruling.verticals;
2472
+ if (hs.length < 2 || vs.length < 2) return [];
2473
+ const uniq = (vals) => {
2474
+ const out2 = [];
2475
+ for (const v of [...vals].sort((a, b) => a - b)) if (!out2.length || v - out2[out2.length - 1] > TOL) out2.push(v);
2476
+ return out2;
2477
+ };
2478
+ const ys = uniq(hs.map((h) => h.y1)), xs = uniq(vs.map((v) => v.x1));
2479
+ const hAt = (y, a, b) => hs.some((h) => Math.abs(h.y1 - y) <= TOL && Math.min(h.x1, h.x2) <= a + TOL && Math.max(h.x1, h.x2) >= b - TOL);
2480
+ const vAt = (x, a, b) => vs.some((v) => Math.abs(v.x1 - x) <= TOL && Math.min(v.y1, v.y2) <= a + TOL && Math.max(v.y1, v.y2) >= b - TOL);
2481
+ const cells = [];
2482
+ for (let j = 0; j + 1 < xs.length && cells.length < MAX_CELLS; j++) {
2483
+ for (let i = 0; i + 1 < ys.length && cells.length < MAX_CELLS; i++) {
2484
+ let k = i + 1;
2485
+ while (k + 1 < ys.length && !hAt(ys[k], xs[j], xs[j + 1])) k++;
2486
+ const [y1, y2, x1, x2] = [ys[i], ys[k], xs[j], xs[j + 1]];
2487
+ i = k - 1;
2488
+ if (y2 - y1 < 15 || x2 - x1 < 20 || (x2 - x1) * (y2 - y1) > width * height * 0.05) continue;
2489
+ if (!hAt(y1, x1, x2) || !hAt(y2, x1, x2) || !vAt(x1, y1, y2) || !vAt(x2, y1, y2)) continue;
2490
+ const bx = Math.ceil(x1 + 4), by = Math.ceil(y1 + 4), box = { x: bx, y: by, w: Math.floor(x2 - 4) - bx, h: Math.floor(y2 - 4) - by };
2491
+ if (box.w < 10 || box.h < 8) continue;
2492
+ if (items.some((it) => Math.min(it.x + it.w, box.x + box.w) > Math.max(it.x, box.x) && Math.min(it.y + it.h, box.y + box.h) > Math.max(it.y, box.y))) continue;
2493
+ let ink = 0;
2494
+ for (let y = box.y; y < box.y + box.h; y++) for (let x = box.x, p = (y * width + x) * 4; x < box.x + box.w; x++, p += 4) {
2495
+ if (rgba[p] * 77 + rgba[p + 1] * 150 + rgba[p + 2] * 29 < 128 * 256) ink++;
2496
+ }
2497
+ if (ink >= 40 && ink >= box.w * box.h * 0.01) cells.push(box);
2498
+ }
2499
+ }
2500
+ const out = [];
2501
+ for (const c of cells) {
2502
+ const w = c.w + PAD * 2, h = c.h + PAD * 2;
2503
+ const crop = new Uint8Array(w * h * 4).fill(255);
2504
+ for (let y = 0; y < c.h; y++) crop.set(rgba.subarray(((c.y + y) * width + c.x) * 4, ((c.y + y) * width + c.x + c.w) * 4), ((y + PAD) * w + PAD) * 4);
2505
+ const stats = { droppedLowConf: 0 };
2506
+ const found = await engine.recognizePage(crop, w, h, stats, { ...tuning, orientPage: false });
2507
+ for (const it of found) out.push({ ...it, x: it.x + c.x - PAD, y: it.y + c.y - PAD });
2508
+ }
2509
+ return out;
2510
+ }
2511
+
2330
2512
  // src/ocr/pdf-ocr.ts
2331
2513
  var OCR_RENDER_SCALE = 3;
2332
2514
  var MAX_OCR_PIXELS = 24e6;
@@ -2480,6 +2662,7 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
2480
2662
  cellEdgeHorizontals(ruling)
2481
2663
  );
2482
2664
  }
2665
+ if (ruling && !regions && !vectorOps && config.tuning.postprocess) items = [...items, ...await rescueEmptyCells(engine, tuning, upright, rw, rh, ruling, items)];
2483
2666
  if (stats.droppedLowConf > 0) {
2484
2667
  warnings.push({
2485
2668
  page: pageNo,
@@ -2634,6 +2817,10 @@ function groupOcrLines(items, figureRegion = false) {
2634
2817
  return lines.filter((l) => l.length > 0);
2635
2818
  }
2636
2819
  function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, detectTables = true, opList = { fnArray: [], argsArray: [] }, figureRegion = false) {
2820
+ if (!figureRegion) {
2821
+ const chart = chartPlotItems(items);
2822
+ if (chart.size) items = items.filter((_, i) => !chart.has(i));
2823
+ }
2637
2824
  const bottoms = items.map((it) => it.y + it.h);
2638
2825
  const xs = items.map((it) => ({ x: it.x, r: it.x + it.w, space: false }));
2639
2826
  const texts = items.map((it) => it.text);
@@ -2676,7 +2863,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
2676
2863
  copyOcrTextGaps(it, normalized, 1 / scale);
2677
2864
  return normalized;
2678
2865
  }).filter((it) => it.text);
2679
- const blocks = unframeOcrLayoutTables(splitOcrNameValueColumns(splitStackedOcrRows(extractPageBlocksWithLines(norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables))), pdfH);
2866
+ const blocks = unframeOcrLayoutTables(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(extractPageBlocksWithLines(norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables)))), pdfH);
2680
2867
  if (!figureRegion) markOcrHeadings(blocks);
2681
2868
  return blocks;
2682
2869
  }
@@ -2766,6 +2953,7 @@ function bgraToRgba(bgra) {
2766
2953
  }
2767
2954
 
2768
2955
  export {
2956
+ rescueEmptyCells,
2769
2957
  getOcrEngine,
2770
2958
  detectRulingLines,
2771
2959
  rulingToPdfLines,
@@ -2787,4 +2975,4 @@ export {
2787
2975
  ocrItemsToBlocks,
2788
2976
  markOcrHeadings
2789
2977
  };
2790
- //# sourceMappingURL=chunk-PM46GSMV.js.map
2978
+ //# sourceMappingURL=chunk-DA5AXURC.js.map