kordoc 4.24.70 → 4.24.71

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 (176) hide show
  1. package/README.md +3 -3
  2. package/dist/{-JPBHAOIR.js → -F7GLIIGT.js} +21 -21
  3. package/dist/{chunk-KET32GPP.js → chunk-2CPEW6WC.js} +3 -3
  4. package/dist/{chunk-R6J7X4ND.js → chunk-2OF2YWIZ.js} +2 -2
  5. package/dist/{chunk-YY54476T.js → chunk-2VBRCIPI.js} +2 -2
  6. package/dist/{chunk-FPGY6TH2.js → chunk-5WWGC5SG.js} +2 -2
  7. package/dist/{chunk-N426QQP6.js → chunk-6ZA4V4QS.js} +2 -2
  8. package/dist/{chunk-XHBJCOWB.js → chunk-7KVDHXP2.js} +4 -4
  9. package/dist/{chunk-UMVD6PRZ.js → chunk-AUHQRRKM.js} +3 -3
  10. package/dist/{chunk-6UNCF3PJ.js → chunk-BHYBZSOC.js} +2 -2
  11. package/dist/{chunk-XRZERCPJ.cjs → chunk-BNP3WXTB.cjs} +3 -3
  12. package/dist/{chunk-XRZERCPJ.cjs.map → chunk-BNP3WXTB.cjs.map} +1 -1
  13. package/dist/{chunk-MU7YOHDK.js → chunk-D4UFBXMT.js} +2 -2
  14. package/dist/{chunk-JVVTJDJY.js → chunk-DSCT67WF.js} +3 -3
  15. package/dist/{chunk-MIERFAOB.js → chunk-EZNUMAAJ.js} +2 -2
  16. package/dist/{chunk-TAATW772.js → chunk-GFAWIBHG.js} +10 -10
  17. package/dist/{chunk-6PVJCEF7.js → chunk-GRCIFCGC.js} +2 -2
  18. package/dist/{chunk-EESBEBUC.cjs → chunk-H2VOH7X3.cjs} +82 -54
  19. package/dist/chunk-H2VOH7X3.cjs.map +1 -0
  20. package/dist/{chunk-QTRQ4KM3.js → chunk-HIYRMYAS.js} +2 -2
  21. package/dist/{chunk-LEITYWHM.js → chunk-IMT5TVVM.js} +2 -2
  22. package/dist/{chunk-VZ2J3654.js → chunk-KGCJNPAI.js} +5 -5
  23. package/dist/{chunk-Q4DDUA7U.js → chunk-KLUI4SAZ.js} +2 -2
  24. package/dist/{chunk-3EPX46NF.cjs → chunk-LFTO5QAP.cjs} +2 -2
  25. package/dist/{chunk-3EPX46NF.cjs.map → chunk-LFTO5QAP.cjs.map} +1 -1
  26. package/dist/{chunk-ZMPNA2W7.js → chunk-LNWURZ2Z.js} +7 -7
  27. package/dist/{chunk-N6XPJBIS.js → chunk-M27VBFO6.js} +60 -32
  28. package/dist/chunk-M27VBFO6.js.map +1 -0
  29. package/dist/{chunk-6SQF5PAM.js → chunk-MHXPW72E.js} +2 -2
  30. package/dist/{chunk-G3UCY3T7.js → chunk-NPBNJCXZ.js} +2 -2
  31. package/dist/{chunk-7CLI2Y6A.js → chunk-O7PJFEOC.js} +2 -2
  32. package/dist/{chunk-KV5YT6L4.js → chunk-OJK4FLS5.js} +3 -3
  33. package/dist/{chunk-UD7DB4U3.js → chunk-OUHMNF2A.js} +2 -2
  34. package/dist/{chunk-A5MTYCTO.cjs → chunk-OW2XKTQA.cjs} +8 -8
  35. package/dist/{chunk-A5MTYCTO.cjs.map → chunk-OW2XKTQA.cjs.map} +1 -1
  36. package/dist/{chunk-CVH5PB65.js → chunk-QK5KCWLE.js} +2 -2
  37. package/dist/{chunk-6T6VP4AQ.js → chunk-RUUUGCXS.js} +6 -6
  38. package/dist/{chunk-YG42FESS.js → chunk-RWU3Y5YK.js} +15 -15
  39. package/dist/{chunk-OTIYXYOL.cjs → chunk-SK5AOGYK.cjs} +104 -104
  40. package/dist/{chunk-OTIYXYOL.cjs.map → chunk-SK5AOGYK.cjs.map} +1 -1
  41. package/dist/{chunk-VCRBRUCO.js → chunk-SMEBVDM2.js} +5 -5
  42. package/dist/{chunk-G5YCISXC.js → chunk-T7MHZIFG.js} +61 -33
  43. package/dist/chunk-T7MHZIFG.js.map +1 -0
  44. package/dist/{chunk-WVQDRZF5.js → chunk-TYGZ6O2A.js} +11 -11
  45. package/dist/{chunk-OHSTI6C3.js → chunk-UJQRIX4L.js} +2 -2
  46. package/dist/{chunk-O2RV2FMS.js → chunk-WMA4GJHC.js} +5 -5
  47. package/dist/{chunk-7D6KEQNU.cjs → chunk-YISBYF7X.cjs} +58 -58
  48. package/dist/{chunk-7D6KEQNU.cjs.map → chunk-YISBYF7X.cjs.map} +1 -1
  49. package/dist/{chunk-JLMNWMZJ.cjs → chunk-YJ2YVG6N.cjs} +88 -88
  50. package/dist/{chunk-JLMNWMZJ.cjs.map → chunk-YJ2YVG6N.cjs.map} +1 -1
  51. package/dist/{chunk-ICK4R4HF.js → chunk-YPRIJDH6.js} +2 -2
  52. package/dist/{chunk-HUKGGV5M.js → chunk-YTDHH362.js} +2 -2
  53. package/dist/{chunk-NIFJSZR7.cjs → chunk-YTP7FPA5.cjs} +3 -3
  54. package/dist/{chunk-NIFJSZR7.cjs.map → chunk-YTP7FPA5.cjs.map} +1 -1
  55. package/dist/{chunk-RTQ2N6DG.js → chunk-ZPJZXTEG.js} +6 -6
  56. package/dist/chunks-JAD5Z5YY.js +11 -0
  57. package/dist/cli.js +45 -45
  58. package/dist/{formula-ESTBYQ67.js → formula-3PJYUQMG.js} +4 -4
  59. package/dist/{formula-BVDS6XNY.cjs → formula-RTPZD2IM.cjs} +9 -9
  60. package/dist/{formula-BVDS6XNY.cjs.map → formula-RTPZD2IM.cjs.map} +1 -1
  61. package/dist/{formula-BJU6ZM3X.js → formula-UJF4RZ6W.js} +3 -3
  62. package/dist/generator-EB2436BE.js +18 -0
  63. package/dist/generator-INMUN6KB.cjs +12 -0
  64. package/dist/{generator-JBGS3C5H.cjs.map → generator-INMUN6KB.cjs.map} +1 -1
  65. package/dist/generator-K5KMPSLC.js +11 -0
  66. package/dist/{hancom-YC2LGVBP.cjs → hancom-MVPEYI4X.cjs} +5 -5
  67. package/dist/{hancom-YC2LGVBP.cjs.map → hancom-MVPEYI4X.cjs.map} +1 -1
  68. package/dist/{hancom-TE4NLTFM.js → hancom-P3SUQXM4.js} +2 -2
  69. package/dist/{hancom-FINYE4NT.js → hancom-RYIZHWJ5.js} +2 -2
  70. package/dist/{image-ocr-TB5QRYYM.js → image-ocr-GL5YVCNU.js} +10 -10
  71. package/dist/{image-ocr-T77T2NQO.cjs → image-ocr-ZS4EMQN3.cjs} +28 -28
  72. package/dist/{image-ocr-T77T2NQO.cjs.map → image-ocr-ZS4EMQN3.cjs.map} +1 -1
  73. package/dist/{image-ocr-L256UYPI.js → image-ocr-ZXLHPQI2.js} +7 -7
  74. package/dist/index.cjs +1115 -1115
  75. package/dist/index.js +9 -9
  76. package/dist/mcp.js +36 -36
  77. package/dist/memo-JNMSGIO7.js +17 -0
  78. package/dist/{model-bundle-THGO5EUW.js → model-bundle-VCUAKBF3.js} +5 -5
  79. package/dist/{models-MKIZDK2U.js → models-UACAGYBI.js} +5 -5
  80. package/dist/{parse-worker-v2-MGNDWJDE.js → parse-worker-v2-LJB4QXGF.js} +22 -22
  81. package/dist/{parser-C6EZWRQM.js → parser-5GZUD22P.js} +12 -12
  82. package/dist/{parser-EULDI5W6.js → parser-HCZD4DUO.js} +9 -9
  83. package/dist/{parser-IC2X7P2S.cjs → parser-T4HAQ3QW.cjs} +166 -166
  84. package/dist/{parser-IC2X7P2S.cjs.map → parser-T4HAQ3QW.cjs.map} +1 -1
  85. package/dist/pdf-ocr-H4DKZSOB.cjs +43 -0
  86. package/dist/{pdf-ocr-7SNY67NL.cjs.map → pdf-ocr-H4DKZSOB.cjs.map} +1 -1
  87. package/dist/{pdf-ocr-LQ5SYFCE.js → pdf-ocr-JXVGK5MR.js} +6 -6
  88. package/dist/{pdf-ocr-4Y6VPEZC.js → pdf-ocr-YCMC2VL4.js} +9 -9
  89. package/dist/{profile-io-SDJTSIFY.js → profile-io-MVTEOXAU.js} +3 -3
  90. package/dist/{rasterize-TGFUBV6B.js → rasterize-VWT3C3RW.js} +3 -3
  91. package/dist/{redact-doc-X5WKER3O.js → redact-doc-SU3JDC6F.js} +21 -21
  92. package/dist/{render-6KIT7GYL.js → render-D5N4FKWB.js} +12 -12
  93. package/dist/{rewrite-fallback-ARYCZKU6.js → rewrite-fallback-QXTWSPGY.js} +13 -13
  94. package/dist/seal-Q3BD6CRB.js +16 -0
  95. package/dist/{setup-ZEMI2HI4.js → setup-TXNJYX6P.js} +3 -3
  96. package/dist/to-hwpx-KZTTH7EY.cjs +16 -0
  97. package/dist/{to-hwpx-MVDTG25O.cjs.map → to-hwpx-KZTTH7EY.cjs.map} +1 -1
  98. package/dist/{to-hwpx-QRVTR6VA.js → to-hwpx-YHGVFTBO.js} +4 -4
  99. package/dist/{to-hwpx-XCS6LSWE.js → to-hwpx-Z7NHUMUD.js} +7 -7
  100. package/dist/visual-LNHFYJDL.js +38 -0
  101. package/dist/{watch-LFL26YPL.js → watch-EI5QYDT2.js} +22 -22
  102. package/package.json +1 -1
  103. package/dist/chunk-EESBEBUC.cjs.map +0 -1
  104. package/dist/chunk-G5YCISXC.js.map +0 -1
  105. package/dist/chunk-N6XPJBIS.js.map +0 -1
  106. package/dist/chunks-7ABYRV7K.js +0 -11
  107. package/dist/generator-B5RBQFEP.js +0 -18
  108. package/dist/generator-JBGS3C5H.cjs +0 -12
  109. package/dist/generator-NZFUFJL4.js +0 -11
  110. package/dist/memo-VDT6J2FA.js +0 -17
  111. package/dist/pdf-ocr-7SNY67NL.cjs +0 -43
  112. package/dist/seal-4IPGOMFX.js +0 -16
  113. package/dist/to-hwpx-MVDTG25O.cjs +0 -16
  114. package/dist/visual-4D32BQGS.js +0 -38
  115. /package/dist/{-JPBHAOIR.js.map → -F7GLIIGT.js.map} +0 -0
  116. /package/dist/{chunk-KET32GPP.js.map → chunk-2CPEW6WC.js.map} +0 -0
  117. /package/dist/{chunk-R6J7X4ND.js.map → chunk-2OF2YWIZ.js.map} +0 -0
  118. /package/dist/{chunk-YY54476T.js.map → chunk-2VBRCIPI.js.map} +0 -0
  119. /package/dist/{chunk-FPGY6TH2.js.map → chunk-5WWGC5SG.js.map} +0 -0
  120. /package/dist/{chunk-N426QQP6.js.map → chunk-6ZA4V4QS.js.map} +0 -0
  121. /package/dist/{chunk-XHBJCOWB.js.map → chunk-7KVDHXP2.js.map} +0 -0
  122. /package/dist/{chunk-UMVD6PRZ.js.map → chunk-AUHQRRKM.js.map} +0 -0
  123. /package/dist/{chunk-6UNCF3PJ.js.map → chunk-BHYBZSOC.js.map} +0 -0
  124. /package/dist/{chunk-MU7YOHDK.js.map → chunk-D4UFBXMT.js.map} +0 -0
  125. /package/dist/{chunk-JVVTJDJY.js.map → chunk-DSCT67WF.js.map} +0 -0
  126. /package/dist/{chunk-MIERFAOB.js.map → chunk-EZNUMAAJ.js.map} +0 -0
  127. /package/dist/{chunk-TAATW772.js.map → chunk-GFAWIBHG.js.map} +0 -0
  128. /package/dist/{chunk-6PVJCEF7.js.map → chunk-GRCIFCGC.js.map} +0 -0
  129. /package/dist/{chunk-QTRQ4KM3.js.map → chunk-HIYRMYAS.js.map} +0 -0
  130. /package/dist/{chunk-LEITYWHM.js.map → chunk-IMT5TVVM.js.map} +0 -0
  131. /package/dist/{chunk-VZ2J3654.js.map → chunk-KGCJNPAI.js.map} +0 -0
  132. /package/dist/{chunk-Q4DDUA7U.js.map → chunk-KLUI4SAZ.js.map} +0 -0
  133. /package/dist/{chunk-ZMPNA2W7.js.map → chunk-LNWURZ2Z.js.map} +0 -0
  134. /package/dist/{chunk-6SQF5PAM.js.map → chunk-MHXPW72E.js.map} +0 -0
  135. /package/dist/{chunk-G3UCY3T7.js.map → chunk-NPBNJCXZ.js.map} +0 -0
  136. /package/dist/{chunk-7CLI2Y6A.js.map → chunk-O7PJFEOC.js.map} +0 -0
  137. /package/dist/{chunk-KV5YT6L4.js.map → chunk-OJK4FLS5.js.map} +0 -0
  138. /package/dist/{chunk-UD7DB4U3.js.map → chunk-OUHMNF2A.js.map} +0 -0
  139. /package/dist/{chunk-CVH5PB65.js.map → chunk-QK5KCWLE.js.map} +0 -0
  140. /package/dist/{chunk-6T6VP4AQ.js.map → chunk-RUUUGCXS.js.map} +0 -0
  141. /package/dist/{chunk-YG42FESS.js.map → chunk-RWU3Y5YK.js.map} +0 -0
  142. /package/dist/{chunk-VCRBRUCO.js.map → chunk-SMEBVDM2.js.map} +0 -0
  143. /package/dist/{chunk-WVQDRZF5.js.map → chunk-TYGZ6O2A.js.map} +0 -0
  144. /package/dist/{chunk-OHSTI6C3.js.map → chunk-UJQRIX4L.js.map} +0 -0
  145. /package/dist/{chunk-O2RV2FMS.js.map → chunk-WMA4GJHC.js.map} +0 -0
  146. /package/dist/{chunk-ICK4R4HF.js.map → chunk-YPRIJDH6.js.map} +0 -0
  147. /package/dist/{chunk-HUKGGV5M.js.map → chunk-YTDHH362.js.map} +0 -0
  148. /package/dist/{chunk-RTQ2N6DG.js.map → chunk-ZPJZXTEG.js.map} +0 -0
  149. /package/dist/{chunks-7ABYRV7K.js.map → chunks-JAD5Z5YY.js.map} +0 -0
  150. /package/dist/{formula-ESTBYQ67.js.map → formula-3PJYUQMG.js.map} +0 -0
  151. /package/dist/{formula-BJU6ZM3X.js.map → formula-UJF4RZ6W.js.map} +0 -0
  152. /package/dist/{generator-B5RBQFEP.js.map → generator-EB2436BE.js.map} +0 -0
  153. /package/dist/{generator-NZFUFJL4.js.map → generator-K5KMPSLC.js.map} +0 -0
  154. /package/dist/{hancom-TE4NLTFM.js.map → hancom-P3SUQXM4.js.map} +0 -0
  155. /package/dist/{hancom-FINYE4NT.js.map → hancom-RYIZHWJ5.js.map} +0 -0
  156. /package/dist/{image-ocr-TB5QRYYM.js.map → image-ocr-GL5YVCNU.js.map} +0 -0
  157. /package/dist/{image-ocr-L256UYPI.js.map → image-ocr-ZXLHPQI2.js.map} +0 -0
  158. /package/dist/{memo-VDT6J2FA.js.map → memo-JNMSGIO7.js.map} +0 -0
  159. /package/dist/{model-bundle-THGO5EUW.js.map → model-bundle-VCUAKBF3.js.map} +0 -0
  160. /package/dist/{models-MKIZDK2U.js.map → models-UACAGYBI.js.map} +0 -0
  161. /package/dist/{parse-worker-v2-MGNDWJDE.js.map → parse-worker-v2-LJB4QXGF.js.map} +0 -0
  162. /package/dist/{parser-C6EZWRQM.js.map → parser-5GZUD22P.js.map} +0 -0
  163. /package/dist/{parser-EULDI5W6.js.map → parser-HCZD4DUO.js.map} +0 -0
  164. /package/dist/{pdf-ocr-4Y6VPEZC.js.map → pdf-ocr-JXVGK5MR.js.map} +0 -0
  165. /package/dist/{pdf-ocr-LQ5SYFCE.js.map → pdf-ocr-YCMC2VL4.js.map} +0 -0
  166. /package/dist/{profile-io-SDJTSIFY.js.map → profile-io-MVTEOXAU.js.map} +0 -0
  167. /package/dist/{rasterize-TGFUBV6B.js.map → rasterize-VWT3C3RW.js.map} +0 -0
  168. /package/dist/{redact-doc-X5WKER3O.js.map → redact-doc-SU3JDC6F.js.map} +0 -0
  169. /package/dist/{render-6KIT7GYL.js.map → render-D5N4FKWB.js.map} +0 -0
  170. /package/dist/{rewrite-fallback-ARYCZKU6.js.map → rewrite-fallback-QXTWSPGY.js.map} +0 -0
  171. /package/dist/{seal-4IPGOMFX.js.map → seal-Q3BD6CRB.js.map} +0 -0
  172. /package/dist/{setup-ZEMI2HI4.js.map → setup-TXNJYX6P.js.map} +0 -0
  173. /package/dist/{to-hwpx-QRVTR6VA.js.map → to-hwpx-YHGVFTBO.js.map} +0 -0
  174. /package/dist/{to-hwpx-XCS6LSWE.js.map → to-hwpx-Z7NHUMUD.js.map} +0 -0
  175. /package/dist/{visual-4D32BQGS.js.map → visual-LNHFYJDL.js.map} +0 -0
  176. /package/dist/{watch-LFL26YPL.js.map → watch-EI5QYDT2.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
3
 
4
- var _chunkNIFJSZR7cjs = require('./chunk-NIFJSZR7.cjs');
4
+ var _chunkYTP7FPA5cjs = require('./chunk-YTP7FPA5.cjs');
5
5
 
6
6
 
7
7
 
@@ -9,11 +9,11 @@ var _chunkNIFJSZR7cjs = require('./chunk-NIFJSZR7.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkA5MTYCTOcjs = require('./chunk-A5MTYCTO.cjs');
12
+ var _chunkOW2XKTQAcjs = require('./chunk-OW2XKTQA.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunk3EPX46NFcjs = require('./chunk-3EPX46NF.cjs');
16
+ var _chunkLFTO5QAPcjs = require('./chunk-LFTO5QAP.cjs');
17
17
 
18
18
  // src/ocr/models.ts
19
19
  var _path = require('path');
@@ -65,7 +65,7 @@ var OCR_REC_DICT = {
65
65
  sizeMb: 1
66
66
  };
67
67
  function getOcrModelsDir() {
68
- return _chunkNIFJSZR7cjs.getModelsDir.call(void 0, "ppocr");
68
+ return _chunkYTP7FPA5cjs.getModelsDir.call(void 0, "ppocr");
69
69
  }
70
70
  var DEFAULT_OCR_MODELS = Object.freeze({
71
71
  det: { spec: OCR_DET_MODEL },
@@ -110,7 +110,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
110
110
  if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
111
111
  }
112
112
  if (!todo.length) return;
113
- await _chunkNIFJSZR7cjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
113
+ await _chunkYTP7FPA5cjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
114
114
  for (const spec of todo) {
115
115
  const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
116
116
  if (stamp) verifiedInProcess.set(path, stamp);
@@ -3414,16 +3414,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
3414
3414
  }
3415
3415
  function takeClipCellEdges(from, to) {
3416
3416
  const e = CLIP_CELL_EDGES.get(from);
3417
- if (e) _chunkA5MTYCTOcjs.CELL_EDGES.set(to, e);
3417
+ if (e) _chunkOW2XKTQAcjs.CELL_EDGES.set(to, e);
3418
3418
  }
3419
3419
  function hasOpenCellSeam(a, b) {
3420
- const u = _chunkA5MTYCTOcjs.CELL_EDGES.get(a), d = _chunkA5MTYCTOcjs.CELL_EDGES.get(b);
3420
+ const u = _chunkOW2XKTQAcjs.CELL_EDGES.get(a), d = _chunkOW2XKTQAcjs.CELL_EDGES.get(b);
3421
3421
  return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
3422
3422
  }
3423
3423
  function joinCellEdges(a, b) {
3424
- const u = _chunkA5MTYCTOcjs.CELL_EDGES.get(a), d = _chunkA5MTYCTOcjs.CELL_EDGES.get(b);
3424
+ const u = _chunkOW2XKTQAcjs.CELL_EDGES.get(a), d = _chunkOW2XKTQAcjs.CELL_EDGES.get(b);
3425
3425
  if (!u || !d) return;
3426
- _chunkA5MTYCTOcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
3426
+ _chunkOW2XKTQAcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
3427
3427
  }
3428
3428
 
3429
3429
  // src/pdf/cell-extract.ts
@@ -3608,7 +3608,7 @@ function tagScripts(text, lines) {
3608
3608
  const [s, e, kind] = marks[m];
3609
3609
  out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
3610
3610
  }
3611
- return _chunkA5MTYCTOcjs.tidyScriptTags.call(void 0, out);
3611
+ return _chunkOW2XKTQAcjs.tidyScriptTags.call(void 0, out);
3612
3612
  }
3613
3613
 
3614
3614
  // src/pdf/line-wrap.ts
@@ -3778,7 +3778,7 @@ function particleContinues(left, rightWord) {
3778
3778
  if (ADNOMINAL_HAN.test(right)) return h.length >= 2 && !auxBefore(h) && !/(?:는|은|한|다|어|년)$/.test(h);
3779
3779
  return VERB_FORM.test(right) && !auxBefore(h) && !((last === "\uC774" || last === "\uAC00" && h.length >= 3) && BECOME.test(right));
3780
3780
  }
3781
- var ITEM_HEAD = /^(?:[□■◆◇○●◎◦▪▫•※▶▷►❍❏❑✓✔➢➤☞]|[①-⑳]|[-–·∙ㆍ*](?=\s)|\(?\d{1,2}[.)](?!\d)|\(?[가-하][.)]|\([가-하\d]{1,2}\)|[ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ]|제\d+[조항호장절])/;
3781
+ var ITEM_HEAD = /^(?:[□■◆◇○●◎◦▪▫•※▶▷►❍❏❑✓✔➢➤☞]|[①-⑳]|[-–·∙ㆍ*#](?=\s)|\(?\d{1,2}[.)](?!\d)|\(?[가-하][.)]|\([가-하\d]{1,2}\)|[ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ]|제\d+[조항호장절])/;
3782
3782
  function startsNewItem(prevText, nextText) {
3783
3783
  const t = nextText.replace(MARKUP, "").trimStart();
3784
3784
  const prev = prevText.replace(MARKUP, "").trimEnd();
@@ -3949,11 +3949,15 @@ function bodyLineJoins(lines, lex) {
3949
3949
  const others = Number.isFinite(own) ? own : _nullishCoalesce(_optionalChain([lex, 'optionalAccess', _116 => _116.bodyPitch, 'call', _117 => _117(fs)]), () => ( Infinity));
3950
3950
  const maxPitch = Number.isFinite(others) ? Math.min(BODY_MAX_PITCH_ABS_EM * fs, Math.max(BODY_MAX_PITCH_EM * fs, others * BODY_PITCH_REL)) : BODY_MAX_PITCH_EM * fs;
3951
3951
  const wordWrap = ragged && !full(a) && nextWordNoRoom(a, b) && !MULTI_LEVEL_NUMBER.test(b.text.trimStart());
3952
- const wraps = fs > 0 && (full(a) || wordWrap) && a.right - a.left >= BODY_MIN_WIDTH_EM * fs && a.y - b.y > 0 && a.y - b.y < maxPitch && Math.abs(b.fontSize - fs) <= 0.15 * fs && !startsNewItem(a.text, b.text) && !(SENTENCE_END.test(a.text.trimEnd()) && MULTI_LEVEL_NUMBER.test(b.text.trimStart()));
3952
+ const wraps = fs > 0 && (full(a) || wordWrap) && a.right - a.left >= BODY_MIN_WIDTH_EM * fs && a.y - b.y > 0 && (a.y - b.y < maxPitch || indentedCjkFirstLine(a, b, fs)) && Math.abs(b.fontSize - fs) <= 0.15 * fs && !startsNewItem(a.text, b.text) && !(SENTENCE_END.test(a.text.trimEnd()) && MULTI_LEVEL_NUMBER.test(b.text.trimStart()));
3953
3953
  out.push(!wraps ? "\n" : wordWrap ? unspacedCjkBoundary(a.text, b.text) ? "" : " " : wrapJoiner(a.text, b.text, lex));
3954
3954
  }
3955
3955
  return out;
3956
3956
  }
3957
+ function indentedCjkFirstLine(a, b, fs) {
3958
+ const cjk = (t) => !/[가-힣]/.test(t) && /[\u3040-\u30ff\u3400-\u9fff]/.test(t);
3959
+ return cjk(a.text) && cjk(b.text) && b.left < a.left - fs && a.y - b.y < BODY_MAX_PITCH_ABS_EM * fs && b.fontSize >= 0.95 * a.fontSize && !/^(?:\d{1,2}\)?\s|[*※])/.test(b.text.trimStart());
3960
+ }
3957
3961
  var CELL_PAD_MAX = 6;
3958
3962
  function cellLineWraps(box, contentLeft, prevRight, fontSize, nextFirstCharW) {
3959
3963
  const pad = Math.min(CELL_PAD_MAX, Math.max(0, contentLeft - box.x1));
@@ -4533,6 +4537,8 @@ function isCjkLatinAutospace(prevText, nextText, gap, fontSize, hangulLine = fal
4533
4537
  const a = prevText.replace(/(?:<\/?u>|~~)+$/, "").slice(-1), b = _nullishCoalesce(nextText.replace(/^(?:<\/?u>|~~)+/, "").replace(/^\(/, "")[0], () => ( ""));
4534
4538
  const cjk = /[\u3000-\u303f\u3040-\u30ff\u3400-\u9fff\uf900-\ufaff\uff00-\uffef]/, latin = /[A-Za-z0-9]/;
4535
4539
  const cjkOrQuote = /[\u3000-\u303f\u3040-\u30ff\u3400-\u9fff\uf900-\ufaff\uff00-\uffef\u2018-\u201f]/;
4540
+ const bare = _nullishCoalesce(nextText.replace(/^(?:<\/?u>|~~)+/, "")[0], () => ( ""));
4541
+ if (bare === "(" && cjk.test(a) || a === ")" && cjk.test(b)) return true;
4536
4542
  return cjk.test(a) && latin.test(b) || latin.test(a) && cjk.test(b) || cjkOrQuote.test(a) && cjkOrQuote.test(b) && (cjk.test(a) || cjk.test(b));
4537
4543
  }
4538
4544
  function filterHiddenText(items, pageWidth, pageHeight, originX = 0, originY = 0) {
@@ -5435,11 +5441,25 @@ function detectCompactStatisticalTables(rows, pageNum) {
5435
5441
  }
5436
5442
  return found;
5437
5443
  }
5444
+ function twoColumnCells(row) {
5445
+ const items = [...row.items].sort((a, b) => a.x - b.x);
5446
+ if (items.length <= 2) return items.map((c) => ({ x: c.x, y: c.y, fontSize: c.fontSize, text: c.text }));
5447
+ const out = [];
5448
+ for (const c of items) {
5449
+ const last = out.at(-1), gap = last ? c.x - last.end : Infinity;
5450
+ if (last && gap <= c.fontSize * 1.2) {
5451
+ last.text += (gap > c.fontSize * 0.2 || c.hasSpaceBefore ? " " : "") + c.text;
5452
+ last.end = Math.max(last.end, c.x + c.w);
5453
+ } else out.push({ x: c.x, y: c.y, fontSize: c.fontSize, text: c.text, end: c.x + c.w });
5454
+ }
5455
+ if (out.length === 2 && (out[0].text.length > 20 || out.some((c) => /^\s*[::]|[::]\s*$|\s[::]\s/.test(c.text)))) return [];
5456
+ return out.map(({ end: _end, ...cell }) => cell);
5457
+ }
5438
5458
  function detectAlignedTwoColumnTables(rows, pageNum) {
5439
5459
  const found = [];
5440
5460
  let i = 0;
5441
5461
  while (i < rows.length - 2) {
5442
- const first = [...rows[i].items].sort((a, b) => a.x - b.x);
5462
+ const first = twoColumnCells(rows[i]);
5443
5463
  if (first.length !== 2 || first.some((c) => !c.text.trim() || c.text.length > 48) || first[1].x - first[0].x < 45 || first[1].x - first[0].x > 260 || /[.!?]$/.test(first[0].text)) {
5444
5464
  i++;
5445
5465
  continue;
@@ -5447,23 +5467,28 @@ function detectAlignedTwoColumnTables(rows, pageNum) {
5447
5467
  const body = [];
5448
5468
  let j = i;
5449
5469
  for (; j < rows.length; j++) {
5450
- const cells2 = [...rows[j].items].sort((a, b) => a.x - b.x);
5470
+ const cells2 = twoColumnCells(rows[j]);
5451
5471
  const previous = body.at(-1);
5452
- if (cells2.length !== 2 || cells2.some((c) => !c.text.trim() || c.text.length > 48) || Math.abs(cells2[0].x - first[0].x) > 5 || Math.abs(cells2[1].x - first[1].x) > 5 || previous && previous.y - rows[j].y > Math.max(24, first[0].fontSize * 2.8)) break;
5453
- body.push(rows[j]);
5472
+ if (previous && previous.rows.at(-1).y - rows[j].y > Math.max(24, first[0].fontSize * 2.8)) break;
5473
+ if (previous && cells2.length === 1 && Math.abs(cells2[0].x - first[1].x) <= 5 && cells2[0].text.trim()) {
5474
+ previous.rows.push(rows[j]);
5475
+ previous.right.push(cells2[0].text);
5476
+ continue;
5477
+ }
5478
+ if (cells2.length !== 2 || cells2.some((c) => !c.text.trim() || c.text.length > 48) || Math.abs(cells2[0].x - first[0].x) > 5 || Math.abs(cells2[1].x - first[1].x) > 5) break;
5479
+ body.push({ rows: [rows[j]], left: cells2[0].text, right: [cells2[1].text] });
5454
5480
  }
5455
- if (body.length < 3) {
5481
+ if (body.length < 3 || body.filter((b) => !/[\p{L}\p{N}]/u.test(b.right.join(""))).length * 2 >= body.length) {
5456
5482
  i++;
5457
5483
  continue;
5458
5484
  }
5459
5485
  const top = rows[i - 1];
5460
5486
  const title = _optionalChain([top, 'optionalAccess', _165 => _165.items, 'access', _166 => _166.length]) === 1 && Math.abs(top.items[0].x - first[0].x) <= 5 && top.items[0].text.length <= 65 && top.y - first[0].y <= Math.max(24, first[0].fontSize * 2.8) ? top : void 0;
5461
- const tableRows = title ? [title, ...body] : body;
5462
- const cells = tableRows.map((row, idx) => {
5463
- if (title && idx === 0) return [{ text: row.items[0].text, colSpan: 2, rowSpan: 1 }, { text: "", colSpan: 1, rowSpan: 1 }];
5464
- const [left, right] = [...row.items].sort((a, b) => a.x - b.x);
5465
- return [{ text: left.text, colSpan: 1, rowSpan: 1 }, { text: right.text, colSpan: 1, rowSpan: 1 }];
5466
- });
5487
+ const tableRows = [...title ? [title] : [], ...body.flatMap((b) => b.rows)];
5488
+ const cells = [
5489
+ ...title ? [[{ text: title.items[0].text, colSpan: 2, rowSpan: 1 }, { text: "", colSpan: 1, rowSpan: 1 }]] : [],
5490
+ ...body.map((b) => [{ text: b.left, colSpan: 1, rowSpan: 1 }, { text: b.right.join(" "), colSpan: 1, rowSpan: 1 }])
5491
+ ];
5467
5492
  const usedItems = new Set(tableRows.flatMap((row) => row.items));
5468
5493
  const all = [...usedItems];
5469
5494
  const minX = Math.min(...all.map((c) => c.x)), minY = Math.min(...all.map((c) => c.y));
@@ -6688,7 +6713,7 @@ function chartBandGap(group, gap, charts) {
6688
6713
  const top = Math.max(...group.map((i) => i.y + i.fontSize)), em = Math.max(...group.map((i) => i.fontSize));
6689
6714
  return charts.some((c) => x1 >= c.x1 - 2 && x2 <= c.x2 + 2 && top <= c.y1 + 2 && c.y1 - top <= 2 * em) ? gap : 0;
6690
6715
  }
6691
- function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6716
+ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0, lex) {
6692
6717
  if (items.length === 0) return [];
6693
6718
  const newRegion = wrapped === void 0;
6694
6719
  wrapped ??= inheritedWrapBands(items);
@@ -6696,7 +6721,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6696
6721
  if (items.length === 2 && depth < MAX_XYCUT_DEPTH) {
6697
6722
  const sortedY2 = [...items].sort((a, b) => b.y - a.y);
6698
6723
  if (findHorizontalCut(sortedY2, wrapped).gap >= farGap) {
6699
- if (newRegion) wrapped = wrappedLineBands(items, wrapped);
6724
+ if (newRegion) wrapped = wrappedLineBands(items, wrapped, lex);
6700
6725
  const cut = findHorizontalCut(sortedY2, wrapped);
6701
6726
  if (cut.gap >= farGap) return [...leaf([sortedY2[0]], wrapped), ...leaf([sortedY2[1]], wrapped)];
6702
6727
  }
@@ -6707,7 +6732,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6707
6732
  if (cross.size > 0 && cross.size <= items.length * CROSS_MAX_MASK_RATIO) {
6708
6733
  const rest = items.filter((i) => !cross.has(i));
6709
6734
  if (rest.length > 0) {
6710
- const groups = xyCutOrder(rest, gapThreshold, 1, void 0, columnGap);
6735
+ const groups = xyCutOrder(rest, gapThreshold, 1, void 0, columnGap, lex);
6711
6736
  return mergeCrossLayoutGroups(groups, [...cross]);
6712
6737
  }
6713
6738
  }
@@ -6716,7 +6741,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6716
6741
  const sortedY = [...items].sort((a, b) => b.y - a.y);
6717
6742
  let hCut = findHorizontalCut(sortedY, wrapped);
6718
6743
  if (newRegion && hCut.gap >= minGap) {
6719
- wrapped = wrappedLineBands(items, wrapped);
6744
+ wrapped = wrappedLineBands(items, wrapped, lex);
6720
6745
  hCut = findHorizontalCut(sortedY, wrapped);
6721
6746
  }
6722
6747
  const vMinGap = Math.max(minGap, columnGap);
@@ -6727,18 +6752,18 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6727
6752
  if (hValid && vValid) useHorizontal = (vCut.gap <= hCut.gap * 1.5 || staggeredSides(items, vCut.position)) && !gapInsideLongerColumn(items, hCut.position, hCut.gap, vCut.position);
6728
6753
  else if (hValid) useHorizontal = true;
6729
6754
  else if (vValid) useHorizontal = false;
6730
- else return _nullishCoalesce(splitEdgeSpannedColumns(items, gapThreshold, depth), () => ( leaf(items, wrapped)));
6755
+ else return _nullishCoalesce(splitEdgeSpannedColumns(items, gapThreshold, depth, lex), () => ( leaf(items, wrapped)));
6731
6756
  if (useHorizontal) {
6732
6757
  const upper = items.filter((i) => i.y > hCut.position);
6733
6758
  const lower = items.filter((i) => i.y <= hCut.position);
6734
6759
  if (upper.length > 0 && lower.length > 0 && upper.length < items.length) {
6735
- return [...xyCutOrder(upper, gapThreshold, depth + 1, wrapped, columnGap), ...xyCutOrder(lower, gapThreshold, depth + 1, wrapped, columnGap)];
6760
+ return [...xyCutOrder(upper, gapThreshold, depth + 1, wrapped, columnGap, lex), ...xyCutOrder(lower, gapThreshold, depth + 1, wrapped, columnGap, lex)];
6736
6761
  }
6737
6762
  } else {
6738
6763
  const left = items.filter((i) => i.x + i.w / 2 < vCut.position);
6739
6764
  const right = items.filter((i) => i.x + i.w / 2 >= vCut.position);
6740
6765
  if (left.length > 0 && right.length > 0 && left.length < items.length) {
6741
- return [...xyCutOrder(left, gapThreshold, depth + 1, void 0, columnGap), ...xyCutOrder(right, gapThreshold, depth + 1, void 0, columnGap)];
6766
+ return [...xyCutOrder(left, gapThreshold, depth + 1, void 0, columnGap, lex), ...xyCutOrder(right, gapThreshold, depth + 1, void 0, columnGap, lex)];
6742
6767
  }
6743
6768
  }
6744
6769
  return leaf(items, wrapped);
@@ -6884,9 +6909,12 @@ function splitsLoneRowTail(items, x) {
6884
6909
  const head = left.find((r) => Math.abs(r[0].y - tail[0].y) <= 2);
6885
6910
  if (!head) return false;
6886
6911
  const headBox = computeBBox(head, 0), fs = _nullishCoalesce(_optionalChain([dominantStyle, 'call', _195 => _195(tail), 'optionalAccess', _196 => _196.fontSize]), () => ( 10));
6887
- return tailBox.x - (headBox.x + headBox.width) <= fs * 3 && tailBox.x + tailBox.width >= box.x + box.width - fs && headBox.width >= box.width / 2;
6912
+ const gap = tailBox.x - (headBox.x + headBox.width), fills = tailBox.x + tailBox.width >= box.x + box.width - fs;
6913
+ if (gap <= fs * 3 && fills && headBox.width >= box.width / 2) return true;
6914
+ const text = [...head, ...tail].map((i) => i.text).join("");
6915
+ return !/[가-힣]/.test(text) && /[\u3040-\u30ff\u3400-\u9fff]/.test(text) && gap <= fs * 4 && fills && headBox.x <= box.x + fs;
6888
6916
  }
6889
- function wrappedLineBands(items, inherited) {
6917
+ function wrappedLineBands(items, inherited, lex) {
6890
6918
  const rows = groupByY(items);
6891
6919
  const records = tocRecordBoundaries(rows);
6892
6920
  const lines = rows.map((row) => {
@@ -6900,7 +6928,7 @@ function wrappedLineBands(items, inherited) {
6900
6928
  sources: row.map((item) => ({ item, state: { ...item } }))
6901
6929
  };
6902
6930
  });
6903
- const joins = bodyLineJoins(lines);
6931
+ const joins = bodyLineJoins(lines, lex);
6904
6932
  const fresh = lines.slice(0, -1).flatMap((line, i) => joins[i] === "\n" || records.has(i) || line.text.trim() === lines[i + 1].text.trim() ? [] : [{ top: line.y, bottom: lines[i + 1].y, sources: [...line.sources, ...lines[i + 1].sources] }]);
6905
6933
  const freshKeys = new Set(fresh.map((b) => `${b.top}:${b.bottom}`));
6906
6934
  return [...inherited.filter((b) => !freshKeys.has(`${b.top}:${b.bottom}`)), ...fresh].sort((a, b) => b.top - a.top);
@@ -6994,7 +7022,7 @@ function isProseGutter(items, x) {
6994
7022
  const [l0, l1] = span2(left), [r0, r1] = span2(right);
6995
7023
  return Math.min(l1, r1) - Math.max(l0, r0) >= Math.min(l1 - l0, r1 - r0) * 0.5;
6996
7024
  }
6997
- function splitEdgeSpannedColumns(items, gapThreshold, depth) {
7025
+ function splitEdgeSpannedColumns(items, gapThreshold, depth, lex) {
6998
7026
  let minX = Infinity, maxX = -Infinity;
6999
7027
  for (const i of items) {
7000
7028
  minX = Math.min(minX, i.x);
@@ -7012,8 +7040,8 @@ function splitEdgeSpannedColumns(items, gapThreshold, depth) {
7012
7040
  const left = rest.filter((i) => i.x + i.w / 2 < cut.position), right = rest.filter((i) => i.x + i.w / 2 >= cut.position);
7013
7041
  return [
7014
7042
  ...above.length ? [above] : [],
7015
- ...xyCutOrder(left, gapThreshold, depth + 1),
7016
- ...xyCutOrder(right, gapThreshold, depth + 1),
7043
+ ...xyCutOrder(left, gapThreshold, depth + 1, void 0, 0, lex),
7044
+ ...xyCutOrder(right, gapThreshold, depth + 1, void 0, 0, lex),
7017
7045
  ...below.length ? [below] : []
7018
7046
  ];
7019
7047
  }
@@ -7118,9 +7146,9 @@ function detectHeadings(blocks, medianFontSize) {
7118
7146
  if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
7119
7147
  const ratio = block.style.fontSize / medianFontSize;
7120
7148
  let level = 0;
7121
- if (ratio >= _chunkA5MTYCTOcjs.HEADING_RATIO_H1) level = 1;
7122
- else if (ratio >= _chunkA5MTYCTOcjs.HEADING_RATIO_H2) level = 2;
7123
- else if (ratio >= _chunkA5MTYCTOcjs.HEADING_RATIO_H3) level = 3;
7149
+ if (ratio >= _chunkOW2XKTQAcjs.HEADING_RATIO_H1) level = 1;
7150
+ else if (ratio >= _chunkOW2XKTQAcjs.HEADING_RATIO_H2) level = 2;
7151
+ else if (ratio >= _chunkOW2XKTQAcjs.HEADING_RATIO_H3) level = 3;
7124
7152
  if (level > 0) {
7125
7153
  block.type = "heading";
7126
7154
  block.level = level;
@@ -7133,7 +7161,7 @@ function isChapterNumber(block, next, medianFontSize) {
7133
7161
  const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _208 => _208.style, 'optionalAccess', _209 => _209.fontSize]), () => ( 0));
7134
7162
  const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _210 => _210.text, 'optionalAccess', _211 => _211.trim, 'call', _212 => _212()]), () => ( ""));
7135
7163
  const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _213 => _213.bbox]);
7136
- return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _214 => _214.text, 'optionalAccess', _215 => _215.trim, 'call', _216 => _216()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkA5MTYCTOcjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
7164
+ return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _214 => _214.text, 'optionalAccess', _215 => _215.trim, 'call', _216 => _216()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkOW2XKTQAcjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
7137
7165
  }
7138
7166
  function mergeStackedHeadingLines(blocks, medianFontSize) {
7139
7167
  for (let i = 0; i < blocks.length - 1; ) {
@@ -8906,16 +8934,16 @@ function isProseSpread(items) {
8906
8934
  for (let i = 1; i < sorted.length; i++) {
8907
8935
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
8908
8936
  }
8909
- const maxGap = _chunk3EPX46NFcjs.safeMax.call(void 0, gaps);
8937
+ const maxGap = _chunkLFTO5QAPcjs.safeMax.call(void 0, gaps);
8910
8938
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
8911
8939
  if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
8912
- const minGap = _chunk3EPX46NFcjs.safeMin.call(void 0, gaps);
8940
+ const minGap = _chunkLFTO5QAPcjs.safeMin.call(void 0, gaps);
8913
8941
  return minGap > 0 && maxGap - minGap <= Math.max(2, maxGap * 0.15) && (items.filter((i) => /^\P{L}*\p{Ll}/u.test(i.text)).length * 2 >= items.length || items.some((i) => /\p{L}[,.;:]["”’)]?$/u.test(i.text)));
8914
8942
  }
8915
8943
  function detectColumns(yLines) {
8916
8944
  const allItems = yLines.flat();
8917
8945
  if (allItems.length === 0) return null;
8918
- const pageWidth = _chunk3EPX46NFcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunk3EPX46NFcjs.safeMin.call(void 0, allItems.map((i) => i.x));
8946
+ const pageWidth = _chunkLFTO5QAPcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkLFTO5QAPcjs.safeMin.call(void 0, allItems.map((i) => i.x));
8919
8947
  if (pageWidth < 100) return null;
8920
8948
  let bigoLineIdx = -1;
8921
8949
  for (let i = 0; i < yLines.length; i++) {
@@ -9313,13 +9341,13 @@ function partTex(group) {
9313
9341
  const base = Math.min(...g.filter((i) => i.fontSize >= size * SCRIPT_SIZE_RATIO).map((i) => i.y));
9314
9342
  let s = "", run = "";
9315
9343
  const flush = () => {
9316
- if (run) s += _chunkA5MTYCTOcjs.toTex.call(void 0, run);
9344
+ if (run) s += _chunkOW2XKTQAcjs.toTex.call(void 0, run);
9317
9345
  run = "";
9318
9346
  };
9319
9347
  g.forEach((it, k) => {
9320
9348
  if (it.fontSize < size * SCRIPT_SIZE_RATIO && it.y - base >= size * SCRIPT_RISE_EM) {
9321
9349
  flush();
9322
- s += `^{${_chunkA5MTYCTOcjs.toTex.call(void 0, it.text)}}`;
9350
+ s += `^{${_chunkOW2XKTQAcjs.toTex.call(void 0, it.text)}}`;
9323
9351
  return;
9324
9352
  }
9325
9353
  if (k && it.x - (g[k - 1].x + g[k - 1].w) > spaceGapThreshold(it.fontSize)) run += " ";
@@ -9492,7 +9520,7 @@ function rebuildUnitLine(items, grid) {
9492
9520
  function prependUnitRow(cells, cols, line, usedItems) {
9493
9521
  const text = cleanCellText(line.map((item) => item.text).join(""));
9494
9522
  cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
9495
- for (const cell of cells[0]) _chunkA5MTYCTOcjs.CELL_EDGES.set(cell, NO_EDGES);
9523
+ for (const cell of cells[0]) _chunkOW2XKTQAcjs.CELL_EDGES.set(cell, NO_EDGES);
9496
9524
  for (const item of line) usedItems.add(item);
9497
9525
  }
9498
9526
  function attachUnitRow(items, grid, cells, cols, usedItems) {
@@ -10074,7 +10102,7 @@ function recordFrameTitle(table, source, pageNum) {
10074
10102
  const [label, spacer, title] = cells;
10075
10103
  if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
10076
10104
  if (cells.some((c) => {
10077
- const e = _chunkA5MTYCTOcjs.CELL_EDGES.get(c);
10105
+ const e = _chunkOW2XKTQAcjs.CELL_EDGES.get(c);
10078
10106
  return !e || e.t || e.b || e.l || e.r;
10079
10107
  })) return;
10080
10108
  const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _408 => _408.fontSize]), () => ( 0));
@@ -10838,13 +10866,13 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10838
10866
  groupSizes.push(1);
10839
10867
  }
10840
10868
  const allY = remaining.map((i) => i.y);
10841
- const pageH = _chunk3EPX46NFcjs.safeMax.call(void 0, allY) - _chunk3EPX46NFcjs.safeMin.call(void 0, allY);
10869
+ const pageH = _chunkLFTO5QAPcjs.safeMax.call(void 0, allY) - _chunkLFTO5QAPcjs.safeMin.call(void 0, allY);
10842
10870
  const gapThreshold = Math.max(15, pageH * 0.03);
10843
10871
  const sides = frameColumnTextBands(remaining, spanning, gx);
10844
10872
  const textBlocks = [];
10845
10873
  for (const side of sides) {
10846
10874
  if (side.length === 0) continue;
10847
- for (const group of xyCutOrder(side, gapThreshold)) {
10875
+ for (const group of xyCutOrder(side, gapThreshold, 0, void 0, 0, lex)) {
10848
10876
  if (group.length === 0) continue;
10849
10877
  const groupBlocks = extractPageBlocksFallback(group, pageNum, false, true, lex, [], chartBandGap(group, gapThreshold, charts));
10850
10878
  for (const b of groupBlocks) textBlocks.push(b);
@@ -10854,9 +10882,9 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10854
10882
  finalTextBlocks.push(...detectListBlocks(textBlocks));
10855
10883
  } else {
10856
10884
  const allY = remaining.map((i) => i.y);
10857
- const pageH = _chunk3EPX46NFcjs.safeMax.call(void 0, allY) - _chunk3EPX46NFcjs.safeMin.call(void 0, allY);
10885
+ const pageH = _chunkLFTO5QAPcjs.safeMax.call(void 0, allY) - _chunkLFTO5QAPcjs.safeMin.call(void 0, allY);
10858
10886
  const gapThreshold = Math.max(15, pageH * 0.03);
10859
- const groups = xyCutOrder(remaining, gapThreshold);
10887
+ const groups = xyCutOrder(remaining, gapThreshold, 0, void 0, 0, lex);
10860
10888
  const textBlocks = [];
10861
10889
  for (const group of groups) {
10862
10890
  if (group.length === 0) continue;
@@ -11216,9 +11244,9 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
11216
11244
  blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
11217
11245
  } else {
11218
11246
  const allY = items.map((i) => i.y);
11219
- const pageHeight = _chunk3EPX46NFcjs.safeMax.call(void 0, allY) - _chunk3EPX46NFcjs.safeMin.call(void 0, allY);
11247
+ const pageHeight = _chunkLFTO5QAPcjs.safeMax.call(void 0, allY) - _chunkLFTO5QAPcjs.safeMin.call(void 0, allY);
11220
11248
  const gapThreshold = Math.max(15, pageHeight * 0.03);
11221
- const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
11249
+ const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap, lex);
11222
11250
  for (const group of orderedGroups) {
11223
11251
  if (group.length === 0) continue;
11224
11252
  const yLines = mergeSuperscriptLines(groupByY(group));
@@ -11486,4 +11514,4 @@ function rowParagraphs(block) {
11486
11514
 
11487
11515
 
11488
11516
  exports.DEFAULT_OCR_MODELS = DEFAULT_OCR_MODELS; exports.resolveOcrModels = resolveOcrModels; exports.handwritingFallbackModels = handwritingFallbackModels; exports.ocrSelectionKey = ocrSelectionKey; exports.ocrSourcePath = ocrSourcePath; exports.ensureOcrModelsFor = ensureOcrModelsFor; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.grayCrop = grayCrop; exports.inkStats = inkStats; exports.splitRowBands = splitRowBands; exports.leadingTriangle = leadingTriangle; exports.arrowGlyph = arrowGlyph; exports.leaderRuns = leaderRuns; exports.inkBounds = inkBounds; exports.bracketFeatures = bracketFeatures; exports.slantedPair = slantedPair; exports.romanStems = romanStems; exports.circledAt = circledAt; exports.ringBoxes = ringBoxes; exports.quoteHead = quoteHead; exports.edgeTrim = edgeTrim; exports.tallInkCount = tallInkCount; exports.gapGlyphs = gapGlyphs; exports.ringBullet = ringBullet; exports.dashRatio = dashRatio; exports.leadingRing = leadingRing; exports.discAt = discAt; exports.serifOne = serifOne; exports.starRun = starRun; exports.bracketShape = bracketShape; exports.leadingBullet = leadingBullet; exports.stackedGlyphBands = stackedGlyphBands; exports.rememberOcrTextGaps = rememberOcrTextGaps; exports.copyOcrTextGaps = copyOcrTextGaps; exports.findOcrTextGaps = findOcrTextGaps; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; exports.NO_EDGES = NO_EDGES; exports.hasOpenCellSeam = hasOpenCellSeam; exports.joinCellEdges = joinCellEdges; exports.filterHiddenText = filterHiddenText; exports.collapseEvenSpacing = collapseEvenSpacing; exports.computeBBox = computeBBox; exports.dominantStyle = dominantStyle; exports.normalizeItems = normalizeItems; exports.groupByY = groupByY; exports.mergeLineSimple = mergeLineSimple; exports.WrapLexicon = WrapLexicon; exports.startsNewItem = startsNewItem; exports.wrapJoiner = wrapJoiner; exports.joinPageBreakWraps = joinPageBreakWraps; exports.splitPageBreakWraps = splitPageBreakWraps; exports.latinSoftWrap = latinSoftWrap; exports.TOC_BLOCKS = TOC_BLOCKS; exports.computeMedianFontSizeFromFreq = computeMedianFontSizeFromFreq; exports.detectHeadings = detectHeadings; exports.mergeStackedHeadingLines = mergeStackedHeadingLines; exports.detectTypographyHeadings = detectTypographyHeadings; exports.detectDocumentStyleHeadings = detectDocumentStyleHeadings; exports.detectSiblingStyleHeadings = detectSiblingStyleHeadings; exports.detectRepeatedPageLabels = detectRepeatedPageLabels; exports.detectPageLeadHeadings = detectPageLeadHeadings; exports.refineDocumentStyleHeadings = refineDocumentStyleHeadings; exports.detectMarkerHeadings = detectMarkerHeadings; exports.detectTableCaptions = detectTableCaptions; exports.detectKoreanListBlocks = detectKoreanListBlocks; exports.removeHeaderFooterBlocks = removeHeaderFooterBlocks; exports.runningLinePatterns = runningLinePatterns; exports.stripAbsorbedRunningLines = stripAbsorbedRunningLines; exports.CLIP_TABLES = CLIP_TABLES; exports.FRAME_TITLE_BLOCKS = FRAME_TITLE_BLOCKS; exports.TABLE_COLXS = TABLE_COLXS; exports.TABLE_ROWYS = TABLE_ROWYS; exports.TABLE_TAIL = TABLE_TAIL; exports.PART_COLXS = PART_COLXS; exports.EMPTY_PARTS = EMPTY_PARTS; exports.IMAGE_CELLS = IMAGE_CELLS; exports.FILLER_CELLS = FILLER_CELLS; exports.CONT_PARTS = CONT_PARTS; exports.CELL_LINES = CELL_LINES; exports.ROW_RULES = ROW_RULES; exports.trimTrailingEmptyTableCols = trimTrailingEmptyTableCols; exports.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines; exports.UNRULED_REGION_TABLES = UNRULED_REGION_TABLES; exports.mergeOcrImageRegions = mergeOcrImageRegions;
11489
- //# sourceMappingURL=chunk-EESBEBUC.cjs.map
11517
+ //# sourceMappingURL=chunk-H2VOH7X3.cjs.map