kordoc 3.3.0 → 3.4.0

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/dist/index.cjs CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
 
19
19
 
20
- var _chunkFUB2BGXVcjs = require('./chunk-FUB2BGXV.cjs');
20
+ var _chunkYYKQN7SAcjs = require('./chunk-YYKQN7SA.cjs');
21
21
 
22
22
 
23
23
  var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
@@ -828,7 +828,7 @@ function createSectionShared() {
828
828
  function createXmlParser(warnings) {
829
829
  return new (0, _xmldom.DOMParser)({
830
830
  onError(level, msg2) {
831
- if (level === "fatalError") throw new (0, _chunkFUB2BGXVcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
831
+ if (level === "fatalError") throw new (0, _chunkYYKQN7SAcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
832
832
  _optionalChain([warnings, 'optionalAccess', _3 => _3.push, 'call', _4 => _4({ code: "MALFORMED_XML", message: `XML ${level === "warn" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
833
833
  }
834
834
  });
@@ -850,10 +850,10 @@ async function extractHwpxStyles(zip, decompressed) {
850
850
  const xml = await file.async("text");
851
851
  if (decompressed) {
852
852
  decompressed.total += xml.length * 2;
853
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
853
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
854
854
  }
855
855
  const parser = createXmlParser();
856
- const doc = parser.parseFromString(_chunkFUB2BGXVcjs.stripDtd.call(void 0, xml), "text/xml");
856
+ const doc = parser.parseFromString(_chunkYYKQN7SAcjs.stripDtd.call(void 0, xml), "text/xml");
857
857
  if (!doc.documentElement) continue;
858
858
  parseCharProperties(doc, result.charProperties);
859
859
  parseStyleElements(doc, result.styles);
@@ -1075,7 +1075,7 @@ function resolveParaHeading(paraEl, ctx) {
1075
1075
  return { prefix, headingLevel };
1076
1076
  }
1077
1077
  async function parseHwpxDocument(buffer, options) {
1078
- _chunkFUB2BGXVcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
1078
+ _chunkYYKQN7SAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
1079
1079
  let zip;
1080
1080
  try {
1081
1081
  zip = await _jszip2.default.loadAsync(buffer);
@@ -1084,7 +1084,7 @@ async function parseHwpxDocument(buffer, options) {
1084
1084
  }
1085
1085
  const actualEntryCount = Object.keys(zip.files).length;
1086
1086
  if (actualEntryCount > MAX_ZIP_ENTRIES) {
1087
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1087
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1088
1088
  }
1089
1089
  const manifestFile = zip.file("META-INF/manifest.xml");
1090
1090
  if (manifestFile) {
@@ -1096,7 +1096,7 @@ async function parseHwpxDocument(buffer, options) {
1096
1096
  return comResultToParseResult(pages, pageCount, warnings2);
1097
1097
  }
1098
1098
  }
1099
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
1099
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
1100
1100
  }
1101
1101
  }
1102
1102
  const decompressed = { total: 0 };
@@ -1105,7 +1105,7 @@ async function parseHwpxDocument(buffer, options) {
1105
1105
  const styleMap = await extractHwpxStyles(zip, decompressed);
1106
1106
  const warnings = [];
1107
1107
  const sectionPaths = await resolveSectionPaths(zip);
1108
- if (sectionPaths.length === 0) throw new (0, _chunkFUB2BGXVcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1108
+ if (sectionPaths.length === 0) throw new (0, _chunkYYKQN7SAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1109
1109
  metadata.pageCount = sectionPaths.length;
1110
1110
  const pageFilter = _optionalChain([options, 'optionalAccess', _12 => _12.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sectionPaths.length) : null;
1111
1111
  const totalTarget = pageFilter ? pageFilter.size : sectionPaths.length;
@@ -1119,12 +1119,12 @@ async function parseHwpxDocument(buffer, options) {
1119
1119
  try {
1120
1120
  const xml = await file.async("text");
1121
1121
  decompressed.total += xml.length * 2;
1122
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1122
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1123
1123
  blocks.push(...parseSectionXml(xml, styleMap, warnings, si + 1, shared));
1124
1124
  parsedSections++;
1125
1125
  _optionalChain([options, 'optionalAccess', _13 => _13.onProgress, 'optionalCall', _14 => _14(parsedSections, totalTarget)]);
1126
1126
  } catch (secErr) {
1127
- if (secErr instanceof _chunkFUB2BGXVcjs.KordocError) throw secErr;
1127
+ if (secErr instanceof _chunkYYKQN7SAcjs.KordocError) throw secErr;
1128
1128
  warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
1129
1129
  }
1130
1130
  }
@@ -1132,7 +1132,7 @@ async function parseHwpxDocument(buffer, options) {
1132
1132
  const images = await extractImagesFromZip(zip, blocks, decompressed, warnings);
1133
1133
  detectHwpxHeadings(blocks, styleMap);
1134
1134
  const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
1135
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks);
1135
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks);
1136
1136
  return { markdown, blocks, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
1137
1137
  }
1138
1138
  function applyPageText(blocks, shared) {
@@ -1221,13 +1221,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings) {
1221
1221
  let found = false;
1222
1222
  const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
1223
1223
  for (const path of allCandidates) {
1224
- if (_chunkFUB2BGXVcjs.isPathTraversal.call(void 0, path)) continue;
1224
+ if (_chunkYYKQN7SAcjs.isPathTraversal.call(void 0, path)) continue;
1225
1225
  const file = zip.file(path);
1226
1226
  if (!file) continue;
1227
1227
  try {
1228
1228
  const data = await file.async("uint8array");
1229
1229
  decompressed.total += data.length;
1230
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1230
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1231
1231
  const actualPath = path;
1232
1232
  const ext = actualPath.includes(".") ? actualPath.split(".").pop() || "png" : "png";
1233
1233
  const mimeType = imageExtToMime(ext);
@@ -1240,7 +1240,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings) {
1240
1240
  found = true;
1241
1241
  break;
1242
1242
  } catch (err) {
1243
- if (err instanceof _chunkFUB2BGXVcjs.KordocError) throw err;
1243
+ if (err instanceof _chunkYYKQN7SAcjs.KordocError) throw err;
1244
1244
  }
1245
1245
  }
1246
1246
  if (!found) {
@@ -1261,7 +1261,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
1261
1261
  const xml = await file.async("text");
1262
1262
  if (decompressed) {
1263
1263
  decompressed.total += xml.length * 2;
1264
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1264
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1265
1265
  }
1266
1266
  parseDublinCoreMetadata(xml, metadata);
1267
1267
  if (metadata.title || metadata.author) return;
@@ -1271,7 +1271,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
1271
1271
  }
1272
1272
  function parseDublinCoreMetadata(xml, metadata) {
1273
1273
  const parser = createXmlParser();
1274
- const doc = parser.parseFromString(_chunkFUB2BGXVcjs.stripDtd.call(void 0, xml), "text/xml");
1274
+ const doc = parser.parseFromString(_chunkYYKQN7SAcjs.stripDtd.call(void 0, xml), "text/xml");
1275
1275
  if (!doc.documentElement) return;
1276
1276
  const getText = (tagNames) => {
1277
1277
  for (const tag of tagNames) {
@@ -1331,7 +1331,7 @@ function extractFromBrokenZip(buffer) {
1331
1331
  }
1332
1332
  const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
1333
1333
  const name = new TextDecoder().decode(nameBytes);
1334
- if (_chunkFUB2BGXVcjs.isPathTraversal.call(void 0, name)) {
1334
+ if (_chunkYYKQN7SAcjs.isPathTraversal.call(void 0, name)) {
1335
1335
  pos = fileStart + compSize;
1336
1336
  continue;
1337
1337
  }
@@ -1349,16 +1349,16 @@ function extractFromBrokenZip(buffer) {
1349
1349
  continue;
1350
1350
  }
1351
1351
  totalDecompressed += content.length * 2;
1352
- if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
1352
+ if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
1353
1353
  sectionNum++;
1354
1354
  blocks.push(...parseSectionXml(content, void 0, warnings, sectionNum, shared));
1355
1355
  } catch (e13) {
1356
1356
  continue;
1357
1357
  }
1358
1358
  }
1359
- if (blocks.length === 0) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1359
+ if (blocks.length === 0) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1360
1360
  applyPageText(blocks, shared);
1361
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks);
1361
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks);
1362
1362
  return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
1363
1363
  }
1364
1364
  async function resolveSectionPaths(zip) {
@@ -1376,7 +1376,7 @@ async function resolveSectionPaths(zip) {
1376
1376
  }
1377
1377
  function parseSectionPathsFromManifest(xml) {
1378
1378
  const parser = createXmlParser();
1379
- const doc = parser.parseFromString(_chunkFUB2BGXVcjs.stripDtd.call(void 0, xml), "text/xml");
1379
+ const doc = parser.parseFromString(_chunkYYKQN7SAcjs.stripDtd.call(void 0, xml), "text/xml");
1380
1380
  const items = doc.getElementsByTagName("opf:item");
1381
1381
  const spine = doc.getElementsByTagName("opf:itemref");
1382
1382
  const isSectionId = (id) => /^s/i.test(id) || id.toLowerCase().includes("section");
@@ -1424,9 +1424,9 @@ function detectHwpxHeadings(blocks, styleMap) {
1424
1424
  let level = 0;
1425
1425
  if (baseFontSize > 0 && _optionalChain([block, 'access', _25 => _25.style, 'optionalAccess', _26 => _26.fontSize])) {
1426
1426
  const ratio = block.style.fontSize / baseFontSize;
1427
- if (ratio >= _chunkFUB2BGXVcjs.HEADING_RATIO_H1) level = 1;
1428
- else if (ratio >= _chunkFUB2BGXVcjs.HEADING_RATIO_H2) level = 2;
1429
- else if (ratio >= _chunkFUB2BGXVcjs.HEADING_RATIO_H3) level = 3;
1427
+ if (ratio >= _chunkYYKQN7SAcjs.HEADING_RATIO_H1) level = 1;
1428
+ else if (ratio >= _chunkYYKQN7SAcjs.HEADING_RATIO_H2) level = 2;
1429
+ else if (ratio >= _chunkYYKQN7SAcjs.HEADING_RATIO_H3) level = 3;
1430
1430
  }
1431
1431
  const compactText = text.replace(/\s+/g, "");
1432
1432
  if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
@@ -1439,7 +1439,7 @@ function detectHwpxHeadings(blocks, styleMap) {
1439
1439
  }
1440
1440
  }
1441
1441
  function buildTableWithCellMeta(state) {
1442
- const table = _chunkFUB2BGXVcjs.buildTable.call(void 0, state.rows);
1442
+ const table = _chunkYYKQN7SAcjs.buildTable.call(void 0, state.rows);
1443
1443
  if (state.caption) table.caption = state.caption;
1444
1444
  const claimed = /* @__PURE__ */ new Set();
1445
1445
  for (const row of state.rows) {
@@ -1482,7 +1482,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
1482
1482
  const cell = parentTable.cell;
1483
1483
  (cell.blocks ??= []).push(block);
1484
1484
  cell.hasStructure = true;
1485
- let flat = _chunkFUB2BGXVcjs.convertTableToText.call(void 0, newTable.rows);
1485
+ let flat = _chunkYYKQN7SAcjs.convertTableToText.call(void 0, newTable.rows);
1486
1486
  if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
1487
1487
  if (flat) cell.text += (cell.text ? "\n" : "") + flat;
1488
1488
  } else {
@@ -1492,7 +1492,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
1492
1492
  }
1493
1493
  function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
1494
1494
  const parser = createXmlParser(warnings);
1495
- const doc = parser.parseFromString(_chunkFUB2BGXVcjs.stripDtd.call(void 0, xml), "text/xml");
1495
+ const doc = parser.parseFromString(_chunkYYKQN7SAcjs.stripDtd.call(void 0, xml), "text/xml");
1496
1496
  if (!doc.documentElement) return [];
1497
1497
  const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
1498
1498
  ctx.shared.track.deleteDepth = 0;
@@ -1583,8 +1583,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
1583
1583
  const cs = isNaN(rawCs) ? 1 : rawCs;
1584
1584
  const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
1585
1585
  const rs = isNaN(rawRs) ? 1 : rawRs;
1586
- tableCtx.cell.colSpan = clampSpan(cs, _chunkFUB2BGXVcjs.MAX_COLS);
1587
- tableCtx.cell.rowSpan = clampSpan(rs, _chunkFUB2BGXVcjs.MAX_ROWS);
1586
+ tableCtx.cell.colSpan = clampSpan(cs, _chunkYYKQN7SAcjs.MAX_COLS);
1587
+ tableCtx.cell.rowSpan = clampSpan(rs, _chunkYYKQN7SAcjs.MAX_ROWS);
1588
1588
  }
1589
1589
  break;
1590
1590
  case "p": {
@@ -1806,7 +1806,7 @@ function extractHyperlinkHref(fieldBegin) {
1806
1806
  let url = (ch.textContent || "").trim();
1807
1807
  if (!url) continue;
1808
1808
  url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
1809
- const safe = _chunkFUB2BGXVcjs.sanitizeHref.call(void 0, url);
1809
+ const safe = _chunkYYKQN7SAcjs.sanitizeHref.call(void 0, url);
1810
1810
  if (safe) return safe;
1811
1811
  }
1812
1812
  return void 0;
@@ -1941,7 +1941,7 @@ function extractParagraphInfo(para, styleMap, ctx) {
1941
1941
  case "hyperlink": {
1942
1942
  const url = child.getAttribute("url") || child.getAttribute("href") || "";
1943
1943
  if (url) {
1944
- const safe = _chunkFUB2BGXVcjs.sanitizeHref.call(void 0, url);
1944
+ const safe = _chunkYYKQN7SAcjs.sanitizeHref.call(void 0, url);
1945
1945
  if (safe) href = safe;
1946
1946
  }
1947
1947
  walk(child);
@@ -2131,7 +2131,7 @@ function decompressStream(data) {
2131
2131
  return _zlib.inflateRawSync.call(void 0, data, opts);
2132
2132
  }
2133
2133
  function parseFileHeader(data) {
2134
- if (data.length < 40) throw new (0, _chunkFUB2BGXVcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
2134
+ if (data.length < 40) throw new (0, _chunkYYKQN7SAcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
2135
2135
  const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
2136
2136
  return {
2137
2137
  signature: sig,
@@ -3655,7 +3655,7 @@ function parseHwp5Document(buffer, options) {
3655
3655
  lenientCfb = parseLenientCfb(buffer);
3656
3656
  warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
3657
3657
  } catch (e20) {
3658
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
3658
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
3659
3659
  }
3660
3660
  }
3661
3661
  const findStream = (path) => {
@@ -3666,11 +3666,11 @@ function parseHwp5Document(buffer, options) {
3666
3666
  return lenientCfb.findStream(path);
3667
3667
  };
3668
3668
  const headerData = findStream("/FileHeader");
3669
- if (!headerData) throw new (0, _chunkFUB2BGXVcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
3669
+ if (!headerData) throw new (0, _chunkYYKQN7SAcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
3670
3670
  const header = parseFileHeader(headerData);
3671
- if (header.signature !== "HWP Document File") throw new (0, _chunkFUB2BGXVcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
3672
- if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3673
- if (header.flags & FLAG_DRM) throw new (0, _chunkFUB2BGXVcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3671
+ if (header.signature !== "HWP Document File") throw new (0, _chunkYYKQN7SAcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
3672
+ if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3673
+ if (header.flags & FLAG_DRM) throw new (0, _chunkYYKQN7SAcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3674
3674
  const compressed = (header.flags & FLAG_COMPRESSED) !== 0;
3675
3675
  const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
3676
3676
  const metadata = {
@@ -3679,7 +3679,7 @@ function parseHwp5Document(buffer, options) {
3679
3679
  if (cfb) extractHwp5Metadata(cfb, metadata);
3680
3680
  const docInfo = cfb ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
3681
3681
  const sections = distribution ? cfb ? findViewTextSections(cfb, compressed) : findViewTextSectionsLenient(lenientCfb, compressed) : cfb ? findSections(cfb) : findSectionsLenient(lenientCfb, compressed);
3682
- if (sections.length === 0) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3682
+ if (sections.length === 0) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3683
3683
  metadata.pageCount = sections.length;
3684
3684
  const pageFilter = _optionalChain([options, 'optionalAccess', _51 => _51.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sections.length) : null;
3685
3685
  const totalTarget = pageFilter ? pageFilter.size : sections.length;
@@ -3693,25 +3693,25 @@ function parseHwp5Document(buffer, options) {
3693
3693
  const sectionData = sections[si];
3694
3694
  const data = !distribution && compressed ? decompressStream(Buffer.from(sectionData)) : Buffer.from(sectionData);
3695
3695
  totalDecompressed += data.length;
3696
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3696
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3697
3697
  const records = readRecords(data);
3698
3698
  const sectionBlocks = parseSection(records, docInfo, warnings, si + 1, doc);
3699
3699
  bodyBlocks.push(...sectionBlocks);
3700
3700
  parsedSections++;
3701
3701
  _optionalChain([options, 'optionalAccess', _52 => _52.onProgress, 'optionalCall', _53 => _53(parsedSections, totalTarget)]);
3702
3702
  } catch (secErr) {
3703
- if (secErr instanceof _chunkFUB2BGXVcjs.KordocError) throw secErr;
3703
+ if (secErr instanceof _chunkYYKQN7SAcjs.KordocError) throw secErr;
3704
3704
  warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
3705
3705
  }
3706
3706
  }
3707
3707
  const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
3708
3708
  const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings);
3709
- const flatBlocks = _chunkFUB2BGXVcjs.flattenLayoutTables.call(void 0, blocks);
3709
+ const flatBlocks = _chunkYYKQN7SAcjs.flattenLayoutTables.call(void 0, blocks);
3710
3710
  if (docInfo) {
3711
3711
  detectHwp5Headings(flatBlocks, docInfo);
3712
3712
  }
3713
3713
  const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
3714
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, flatBlocks);
3714
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, flatBlocks);
3715
3715
  return { markdown, blocks: flatBlocks, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
3716
3716
  }
3717
3717
  function parseDocInfoStream(cfb, compressed) {
@@ -3771,9 +3771,9 @@ function detectHwp5Headings(blocks, docInfo) {
3771
3771
  let level = 0;
3772
3772
  if (_optionalChain([block, 'access', _58 => _58.style, 'optionalAccess', _59 => _59.fontSize]) && baseFontSize > 0) {
3773
3773
  const ratio = block.style.fontSize / baseFontSize;
3774
- if (ratio >= _chunkFUB2BGXVcjs.HEADING_RATIO_H1) level = 1;
3775
- else if (ratio >= _chunkFUB2BGXVcjs.HEADING_RATIO_H2) level = 2;
3776
- else if (ratio >= _chunkFUB2BGXVcjs.HEADING_RATIO_H3) level = 3;
3774
+ if (ratio >= _chunkYYKQN7SAcjs.HEADING_RATIO_H1) level = 1;
3775
+ else if (ratio >= _chunkYYKQN7SAcjs.HEADING_RATIO_H2) level = 2;
3776
+ else if (ratio >= _chunkYYKQN7SAcjs.HEADING_RATIO_H3) level = 3;
3777
3777
  }
3778
3778
  if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
3779
3779
  if (level === 0) level = 2;
@@ -3858,7 +3858,7 @@ function findSectionsLenient(lcfb, compressed) {
3858
3858
  if (!raw) break;
3859
3859
  const content = compressed ? decompressStream(raw) : raw;
3860
3860
  totalDecompressed += content.length;
3861
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3861
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3862
3862
  sections.push({ idx: i, content });
3863
3863
  }
3864
3864
  if (sections.length === 0) {
@@ -3870,7 +3870,7 @@ function findSectionsLenient(lcfb, compressed) {
3870
3870
  if (raw) {
3871
3871
  const content = compressed ? decompressStream(raw) : raw;
3872
3872
  totalDecompressed += content.length;
3873
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3873
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3874
3874
  sections.push({ idx, content });
3875
3875
  }
3876
3876
  }
@@ -3887,7 +3887,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
3887
3887
  try {
3888
3888
  const content = decryptViewText(raw, compressed);
3889
3889
  totalDecompressed += content.length;
3890
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3890
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3891
3891
  sections.push({ idx: i, content });
3892
3892
  } catch (e25) {
3893
3893
  break;
@@ -3990,7 +3990,7 @@ function parseParagraph(records, start, end, ctx) {
3990
3990
  const ctrl = ctrls[r.ctrlIdx];
3991
3991
  if (!_optionalChain([ctrl, 'optionalAccess', _66 => _66.href]) || r.end <= r.start) continue;
3992
3992
  if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
3993
- const href = _chunkFUB2BGXVcjs.sanitizeHref.call(void 0, ctrl.href);
3993
+ const href = _chunkYYKQN7SAcjs.sanitizeHref.call(void 0, ctrl.href);
3994
3994
  if (!href) continue;
3995
3995
  const anchor = text.slice(r.start, r.end);
3996
3996
  if (!anchor.trim()) continue;
@@ -4223,8 +4223,8 @@ function parseTableControl(ctrl, records, ctx) {
4223
4223
  let tableIdx = -1;
4224
4224
  for (let i2 = childStart; i2 < childEnd; i2++) {
4225
4225
  if (records[i2].tagId === TAG_TABLE && records[i2].data.length >= 8) {
4226
- rows = Math.min(records[i2].data.readUInt16LE(4), _chunkFUB2BGXVcjs.MAX_ROWS);
4227
- cols = Math.min(records[i2].data.readUInt16LE(6), _chunkFUB2BGXVcjs.MAX_COLS);
4226
+ rows = Math.min(records[i2].data.readUInt16LE(4), _chunkYYKQN7SAcjs.MAX_ROWS);
4227
+ cols = Math.min(records[i2].data.readUInt16LE(6), _chunkYYKQN7SAcjs.MAX_COLS);
4228
4228
  tableIdx = i2;
4229
4229
  break;
4230
4230
  }
@@ -4273,7 +4273,7 @@ function parseTableControl(ctrl, records, ctx) {
4273
4273
  return table2;
4274
4274
  }
4275
4275
  const cellRows = arrangeCells(rows, cols, cells);
4276
- const table = _chunkFUB2BGXVcjs.buildTable.call(void 0, cellRows);
4276
+ const table = _chunkYYKQN7SAcjs.buildTable.call(void 0, cellRows);
4277
4277
  if (caption && table.rows > 0) table.caption = caption;
4278
4278
  return table.rows > 0 ? table : null;
4279
4279
  }
@@ -4290,8 +4290,8 @@ function parseCell(records, lhIdx, end, ctx) {
4290
4290
  rowAddr = rec.data.readUInt16LE(10);
4291
4291
  const cs = rec.data.readUInt16LE(12);
4292
4292
  const rs = rec.data.readUInt16LE(14);
4293
- if (cs > 0) colSpan = Math.min(cs, _chunkFUB2BGXVcjs.MAX_COLS);
4294
- if (rs > 0) rowSpan = Math.min(rs, _chunkFUB2BGXVcjs.MAX_ROWS);
4293
+ if (cs > 0) colSpan = Math.min(cs, _chunkYYKQN7SAcjs.MAX_COLS);
4294
+ if (rs > 0) rowSpan = Math.min(rs, _chunkYYKQN7SAcjs.MAX_ROWS);
4295
4295
  }
4296
4296
  const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
4297
4297
  const parts = [];
@@ -4301,7 +4301,7 @@ function parseCell(records, lhIdx, end, ctx) {
4301
4301
  parts.push(`![image](hwp5bin:${b.text})`);
4302
4302
  hasStructure = true;
4303
4303
  } else if (b.type === "table" && b.table) {
4304
- const flat = _chunkFUB2BGXVcjs.convertTableToText.call(void 0, b.table.cells);
4304
+ const flat = _chunkYYKQN7SAcjs.convertTableToText.call(void 0, b.table.cells);
4305
4305
  if (flat) parts.push(flat);
4306
4306
  hasStructure = true;
4307
4307
  } else if (b.text) {
@@ -16735,7 +16735,7 @@ function getTextContent(el) {
16735
16735
  return _nullishCoalesce(_optionalChain([el, 'access', _79 => _79.textContent, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]), () => ( ""));
16736
16736
  }
16737
16737
  function parseXml(text) {
16738
- return new (0, _xmldom.DOMParser)().parseFromString(_chunkFUB2BGXVcjs.stripDtd.call(void 0, text), "text/xml");
16738
+ return new (0, _xmldom.DOMParser)().parseFromString(_chunkYYKQN7SAcjs.stripDtd.call(void 0, text), "text/xml");
16739
16739
  }
16740
16740
  function parseSharedStrings(xml) {
16741
16741
  const doc = parseXml(xml);
@@ -16879,7 +16879,7 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex) {
16879
16879
  cellRows.push(row);
16880
16880
  }
16881
16881
  if (cellRows.length > 0) {
16882
- const table = _chunkFUB2BGXVcjs.buildTable.call(void 0, cellRows);
16882
+ const table = _chunkYYKQN7SAcjs.buildTable.call(void 0, cellRows);
16883
16883
  if (table.rows > 0) {
16884
16884
  blocks.push({ type: "table", table, pageNumber: sheetIndex + 1 });
16885
16885
  }
@@ -16887,12 +16887,12 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex) {
16887
16887
  return blocks;
16888
16888
  }
16889
16889
  async function parseXlsxDocument(buffer, options) {
16890
- _chunkFUB2BGXVcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE3);
16890
+ _chunkYYKQN7SAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE3);
16891
16891
  const zip = await _jszip2.default.loadAsync(buffer);
16892
16892
  const warnings = [];
16893
16893
  const workbookFile = zip.file("xl/workbook.xml");
16894
16894
  if (!workbookFile) {
16895
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
16895
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
16896
16896
  }
16897
16897
  let sharedStrings = [];
16898
16898
  const ssFile = zip.file("xl/sharedStrings.xml");
@@ -16901,7 +16901,7 @@ async function parseXlsxDocument(buffer, options) {
16901
16901
  }
16902
16902
  const sheets = parseWorkbook(await workbookFile.async("text"));
16903
16903
  if (sheets.length === 0) {
16904
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
16904
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
16905
16905
  }
16906
16906
  let relsMap = /* @__PURE__ */ new Map();
16907
16907
  const relsFile = zip.file("xl/_rels/workbook.xml.rels");
@@ -16973,7 +16973,7 @@ async function parseXlsxDocument(buffer, options) {
16973
16973
  } catch (e26) {
16974
16974
  }
16975
16975
  }
16976
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks);
16976
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks);
16977
16977
  return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
16978
16978
  }
16979
16979
 
@@ -17380,11 +17380,11 @@ function processGlobals(records) {
17380
17380
  let encrypted = false;
17381
17381
  const firstBof = records[0];
17382
17382
  if (!firstBof || firstBof.opcode !== OP_BOF) {
17383
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
17383
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
17384
17384
  }
17385
17385
  const bof = decodeBof(firstBof.data);
17386
17386
  if (!bof || bof.dt !== DT_GLOBALS) {
17387
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
17387
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
17388
17388
  }
17389
17389
  let i = 1;
17390
17390
  while (i < records.length) {
@@ -17499,7 +17499,7 @@ function sheetToBlocks2(sheetName, sheet, sheetIndex) {
17499
17499
  cellRows.push(row);
17500
17500
  }
17501
17501
  if (cellRows.length > 0) {
17502
- const table = _chunkFUB2BGXVcjs.buildTable.call(void 0, cellRows);
17502
+ const table = _chunkYYKQN7SAcjs.buildTable.call(void 0, cellRows);
17503
17503
  if (table.rows > 0) {
17504
17504
  blocks.push({ type: "table", table, pageNumber: sheetIndex + 1 });
17505
17505
  }
@@ -17512,21 +17512,21 @@ async function parseXlsDocument(buffer, options) {
17512
17512
  try {
17513
17513
  cfb = parseLenientCfb(buf);
17514
17514
  } catch (e) {
17515
- throw new (0, _chunkFUB2BGXVcjs.KordocError)(
17515
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)(
17516
17516
  `XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
17517
17517
  );
17518
17518
  }
17519
17519
  const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
17520
17520
  if (!wb) {
17521
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
17521
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
17522
17522
  }
17523
17523
  const records = readRecords2(wb);
17524
17524
  if (records.length === 0) {
17525
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
17525
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
17526
17526
  }
17527
17527
  const firstBof = decodeBof(records[0].data);
17528
17528
  if (firstBof && firstBof.vers !== 1536) {
17529
- throw new (0, _chunkFUB2BGXVcjs.KordocError)(
17529
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)(
17530
17530
  `XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
17531
17531
  );
17532
17532
  }
@@ -17586,7 +17586,7 @@ async function parseXlsDocument(buffer, options) {
17586
17586
  pageCount: totalSheets
17587
17587
  };
17588
17588
  return {
17589
- markdown: _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, allBlocks),
17589
+ markdown: _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, allBlocks),
17590
17590
  blocks: allBlocks,
17591
17591
  metadata,
17592
17592
  warnings: warnings.length > 0 ? warnings : void 0
@@ -18012,7 +18012,7 @@ function getAttr(el, localName2) {
18012
18012
  return null;
18013
18013
  }
18014
18014
  function parseXml2(text) {
18015
- return new (0, _xmldom.DOMParser)().parseFromString(_chunkFUB2BGXVcjs.stripDtd.call(void 0, text), "text/xml");
18015
+ return new (0, _xmldom.DOMParser)().parseFromString(_chunkYYKQN7SAcjs.stripDtd.call(void 0, text), "text/xml");
18016
18016
  }
18017
18017
  function parseStyles(xml) {
18018
18018
  const doc = parseXml2(xml);
@@ -18331,12 +18331,12 @@ async function extractImages(zip, rels, doc) {
18331
18331
  return { blocks, images };
18332
18332
  }
18333
18333
  async function parseDocxDocument(buffer, options) {
18334
- _chunkFUB2BGXVcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
18334
+ _chunkYYKQN7SAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
18335
18335
  const zip = await _jszip2.default.loadAsync(buffer);
18336
18336
  const warnings = [];
18337
18337
  const docFile = zip.file("word/document.xml");
18338
18338
  if (!docFile) {
18339
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
18339
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
18340
18340
  }
18341
18341
  let rels = /* @__PURE__ */ new Map();
18342
18342
  const relsFile = zip.file("word/_rels/document.xml.rels");
@@ -18371,7 +18371,7 @@ async function parseDocxDocument(buffer, options) {
18371
18371
  const doc = parseXml2(docXml);
18372
18372
  const body = findElements(doc, "body");
18373
18373
  if (body.length === 0) {
18374
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
18374
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
18375
18375
  }
18376
18376
  const blocks = [];
18377
18377
  const bodyEl = body[0];
@@ -18411,7 +18411,7 @@ async function parseDocxDocument(buffer, options) {
18411
18411
  }
18412
18412
  }
18413
18413
  const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
18414
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks);
18414
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks);
18415
18415
  return {
18416
18416
  markdown,
18417
18417
  blocks,
@@ -18434,7 +18434,7 @@ function parseHwpmlDocument(buffer, options) {
18434
18434
  }
18435
18435
  const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
18436
18436
  const normalized = text.replace(/&nbsp;/g, "&#160;");
18437
- const xml = _chunkFUB2BGXVcjs.stripDtd.call(void 0, normalized);
18437
+ const xml = _chunkYYKQN7SAcjs.stripDtd.call(void 0, normalized);
18438
18438
  const warnings = [];
18439
18439
  const parser = new (0, _xmldom.DOMParser)({
18440
18440
  onError: (_level, msg2) => {
@@ -18474,7 +18474,7 @@ function parseHwpmlDocument(buffer, options) {
18474
18474
  parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings);
18475
18475
  }
18476
18476
  const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
18477
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks);
18477
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks);
18478
18478
  return {
18479
18479
  markdown,
18480
18480
  blocks,
@@ -18616,7 +18616,7 @@ function parseTable2(el, blocks, paraShapeMap, sectionNum, warnings) {
18616
18616
  const cellRows = grid.map(
18617
18617
  (row) => row.map((cell) => _nullishCoalesce(cell, () => ( { text: "", colSpan: 1, rowSpan: 1 })))
18618
18618
  );
18619
- const table = _chunkFUB2BGXVcjs.buildTable.call(void 0, cellRows);
18619
+ const table = _chunkYYKQN7SAcjs.buildTable.call(void 0, cellRows);
18620
18620
  blocks.push({ type: "table", table, pageNumber: sectionNum });
18621
18621
  }
18622
18622
  function extractCellText(cellEl) {
@@ -19639,19 +19639,19 @@ function parseCentralDirectory(buf) {
19639
19639
  }
19640
19640
  }
19641
19641
  }
19642
- if (eocdOffset < 0) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19642
+ if (eocdOffset < 0) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19643
19643
  const totalEntries = view.getUint16(eocdOffset + 10, true);
19644
19644
  const cdSize = view.getUint32(eocdOffset + 12, true);
19645
19645
  const cdOffset = view.getUint32(eocdOffset + 16, true);
19646
- if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19646
+ if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19647
19647
  if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
19648
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19648
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19649
19649
  }
19650
19650
  const decoder = new TextDecoder("utf-8");
19651
19651
  const entries = [];
19652
19652
  let pos = cdOffset;
19653
19653
  for (let i = 0; i < totalEntries; i++) {
19654
- if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
19654
+ if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
19655
19655
  const flags = view.getUint16(pos + 8, true);
19656
19656
  const method = view.getUint16(pos + 10, true);
19657
19657
  const crc = view.getUint32(pos + 16, true);
@@ -19662,7 +19662,7 @@ function parseCentralDirectory(buf) {
19662
19662
  const commentLen = view.getUint16(pos + 32, true);
19663
19663
  const localOffset = view.getUint32(pos + 42, true);
19664
19664
  if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
19665
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19665
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19666
19666
  }
19667
19667
  const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
19668
19668
  const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
@@ -19691,7 +19691,7 @@ function patchZipEntries(original, replacements) {
19691
19691
  const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
19692
19692
  const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
19693
19693
  for (const name of replacements.keys()) {
19694
- if (!entries.some((e) => e.name === name)) throw new (0, _chunkFUB2BGXVcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
19694
+ if (!entries.some((e) => e.name === name)) throw new (0, _chunkYYKQN7SAcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
19695
19695
  }
19696
19696
  const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
19697
19697
  const segments = [];
@@ -19709,7 +19709,7 @@ function patchZipEntries(original, replacements) {
19709
19709
  offset += seg.length;
19710
19710
  continue;
19711
19711
  }
19712
- if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkFUB2BGXVcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
19712
+ if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkYYKQN7SAcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
19713
19713
  const nameLen = view.getUint16(e.localOffset + 26, true);
19714
19714
  const extraLen = view.getUint16(e.localOffset + 28, true);
19715
19715
  const headerLen = 30 + nameLen + extraLen;
@@ -19764,7 +19764,7 @@ async function fillHwpx(hwpxBuffer, values) {
19764
19764
  const zip = await _jszip2.default.loadAsync(hwpxBuffer);
19765
19765
  const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
19766
19766
  if (sectionPaths.length === 0) {
19767
- throw new (0, _chunkFUB2BGXVcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19767
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19768
19768
  }
19769
19769
  const normalizedValues = normalizeValues(values);
19770
19770
  const matchedLabels = /* @__PURE__ */ new Set();
@@ -20914,7 +20914,7 @@ function escapeGfm(text) {
20914
20914
  }
20915
20915
  var HWP_SHAPE_ALT_TEXT_RE = /(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?/g;
20916
20916
  function sanitizeText(text) {
20917
- let result = _chunkFUB2BGXVcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
20917
+ let result = _chunkYYKQN7SAcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
20918
20918
  if (result.length <= 30 && result.includes(" ")) {
20919
20919
  const tokens = result.split(" ");
20920
20920
  const koreanSingleCharCount = tokens.filter((t) => t.length === 1 && /[가-힯ㄱ-ㆎ]/.test(t)).length;
@@ -21501,9 +21501,9 @@ function buildOrigUnits(blocks) {
21501
21501
  if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(sanitizeText(block.text))) {
21502
21502
  const next = blocks[i + 1];
21503
21503
  if (_optionalChain([next, 'optionalAccess', _179 => _179.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
21504
- chunk = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
21504
+ chunk = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
21505
21505
  } else {
21506
- chunk = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, [block]);
21506
+ chunk = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, [block]);
21507
21507
  }
21508
21508
  if (chunk) {
21509
21509
  const subUnits = splitMarkdownUnits(chunk);
@@ -22250,14 +22250,7 @@ async function patchHwp(original, editedMarkdown, options) {
22250
22250
  const editedUnits = splitMarkdownUnits(editedMarkdown);
22251
22251
  const pairs = alignUnits(origUnits.map((u) => u.raw), editedUnits.map((u) => u.raw));
22252
22252
  const paraMap = resolveParaMappings(origBlocks, scans);
22253
- const scanTables = scans.flatMap((s) => s.tables);
22254
- const obTableOrdinals = /* @__PURE__ */ new Map();
22255
- {
22256
- let ordinal = 0;
22257
- for (let i = 0; i < origBlocks.length; i++) {
22258
- if (origBlocks[i].type === "table" && origBlocks[i].table) obTableOrdinals.set(i, ordinal++);
22259
- }
22260
- }
22253
+ const tableMap = resolveTableMappings(origBlocks, scans.flatMap((s) => s.tables));
22261
22254
  for (const [oi, ei] of pairs) {
22262
22255
  if (oi !== null && ei !== null) {
22263
22256
  const orig = origUnits[oi];
@@ -22267,8 +22260,7 @@ async function patchHwp(original, editedMarkdown, options) {
22267
22260
  origBlocks,
22268
22261
  paraMap,
22269
22262
  scans,
22270
- scanTables,
22271
- obTableOrdinals,
22263
+ tableMap,
22272
22264
  skipped
22273
22265
  });
22274
22266
  } else if (oi !== null) {
@@ -22353,6 +22345,46 @@ function resolveParaMappings(blocks, scans) {
22353
22345
  }
22354
22346
  return result;
22355
22347
  }
22348
+ function resolveTableMappings(blocks, scanTables) {
22349
+ const result = /* @__PURE__ */ new Map();
22350
+ let si = 0;
22351
+ for (let i = 0; i < blocks.length; i++) {
22352
+ const table = blocks[i].table;
22353
+ if (blocks[i].type !== "table" || !table) continue;
22354
+ const cands = [];
22355
+ for (let k = si; k < scanTables.length; k++) {
22356
+ if (scanTables[k].rows === table.rows && scanTables[k].cols === table.cols) cands.push(k);
22357
+ }
22358
+ if (cands.length === 0) continue;
22359
+ let pick = cands[0];
22360
+ if (cands.length > 1) {
22361
+ let best = tableContentScore(table, scanTables[cands[0]]);
22362
+ for (let ci = 1; ci < cands.length; ci++) {
22363
+ const sc = tableContentScore(table, scanTables[cands[ci]]);
22364
+ if (sc > best) {
22365
+ best = sc;
22366
+ pick = cands[ci];
22367
+ }
22368
+ }
22369
+ }
22370
+ result.set(i, scanTables[pick]);
22371
+ si = pick + 1;
22372
+ }
22373
+ return result;
22374
+ }
22375
+ function tableContentScore(irTable, scanTable) {
22376
+ let matched = 0;
22377
+ for (const [key, scanCell] of scanTable.cells) {
22378
+ const comma = key.indexOf(",");
22379
+ const r = Number(key.slice(0, comma)), c = Number(key.slice(comma + 1));
22380
+ const irCell = _optionalChain([irTable, 'access', _194 => _194.cells, 'access', _195 => _195[r], 'optionalAccess', _196 => _196[c]]);
22381
+ if (!irCell) continue;
22382
+ const a = normForMatch(scanCell.paras.map((p) => p.rawText).join(" "));
22383
+ const b = normForMatch(stripCellTokens(irCell.text));
22384
+ if (a && a === b) matched++;
22385
+ }
22386
+ return matched;
22387
+ }
22356
22388
  function handleModified(orig, edited, ctx) {
22357
22389
  const block = ctx.origBlocks[orig.blockIdx];
22358
22390
  const skip = (reason) => {
@@ -22365,12 +22397,10 @@ function handleModified(orig, edited, ctx) {
22365
22397
  if (orig.fragment) return skip("\uBB38\uB2E8 \uBD84\uC808(\uAC15\uC81C \uC904\uBC14\uAFC8/\uBCD1\uD569 \uC720\uB2DB) \u2014 \uBD80\uBD84 \uC218\uC815\uC740 \uBBF8\uC9C0\uC6D0 (v1)");
22366
22398
  if (block.type === "table" && block.table) {
22367
22399
  if (orig.kind !== edited.kind) return skip("\uD45C \u2194 \uBE44\uD45C \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0 (\uD45C \uAD6C\uC870 \uBCC0\uACBD)");
22368
- if (ctx.obTableOrdinals.size !== ctx.scanTables.length) return skip("\uD45C \uAC1C\uC218 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
22369
- const ordinal = ctx.obTableOrdinals.get(orig.blockIdx);
22370
- const scanTable = ordinal !== void 0 ? ctx.scanTables[ordinal] : void 0;
22371
- if (!scanTable) return skip("\uD45C \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328");
22400
+ const scanTable = ctx.tableMap.get(orig.blockIdx);
22401
+ if (!scanTable) return skip("\uD45C \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 \u2014 \uD45C \uAC1C\uC218/\uAD6C\uC870 \uBD88\uC77C\uCE58\uB85C \uC2E0\uB8B0 \uBD88\uAC00");
22372
22402
  if (orig.kind === "gfm-table") return patchGfmCells(scanTable, orig, edited, ctx, skip);
22373
- if (orig.kind === "html-table") return skip("HTML \uD45C(\uBCD1\uD569/\uC904\uBC14\uAFC8 \uC140) \uC218\uC815\uC740 HWP5 \uBBF8\uC9C0\uC6D0 (v1)");
22403
+ if (orig.kind === "html-table") return patchHtmlCells5(block.table, scanTable, orig, edited, ctx, skip);
22374
22404
  return patchTextChunk5(block.table, scanTable, orig, edited, ctx, skip);
22375
22405
  }
22376
22406
  if ((block.type === "paragraph" || block.type === "heading") && orig.kind === "text" && edited.kind === "text") {
@@ -22380,7 +22410,7 @@ function handleModified(orig, edited, ctx) {
22380
22410
  }
22381
22411
  function patchParagraph(block, orig, edited, ctx, skip) {
22382
22412
  const mapping = ctx.paraMap.get(orig.blockIdx);
22383
- if (!_optionalChain([mapping, 'optionalAccess', _194 => _194.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
22413
+ if (!_optionalChain([mapping, 'optionalAccess', _197 => _197.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
22384
22414
  if (block.text && block.text.includes("\n")) {
22385
22415
  return skip("\uBB38\uB2E8 \uB0B4 \uAC15\uC81C \uC904\uBC14\uAFC8 \uD3EC\uD568 \u2014 \uC218\uC815 \uC2DC \uC904\uBC14\uAFC8 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0 (v1)");
22386
22416
  }
@@ -22427,35 +22457,87 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
22427
22457
  ctx.skipped.push({ reason, before: summarize(origRows[r][c]), after: summarize(editedRows[r][c]) });
22428
22458
  return 0;
22429
22459
  };
22430
- const before = gfmCellToPlain(origRows[r][c]);
22431
- const after = gfmCellToPlain(editedRows[r][c]);
22432
- if (before === null || after === null) {
22433
- cellSkip("\uC11C\uC2DD/\uB9C1\uD06C/\uC774\uBBF8\uC9C0 \uD3EC\uD568 \uC140 \uC218\uC815\uC740 \uBBF8\uC9C0\uC6D0 (v1)");
22434
- continue;
22435
- }
22436
- if (after.includes("\n")) {
22437
- cellSkip("\uC140 \uB0B4 \uC904\uBC14\uAFC8 \uCD94\uAC00\uB294 \uBBF8\uC9C0\uC6D0 (v1)");
22438
- continue;
22439
- }
22440
22460
  const cell = scanTable.cells.get(`${r},${c}`);
22441
22461
  if (!cell) {
22442
22462
  cellSkip("\uBCD1\uD569 \uC601\uC5ED \uC140 \u2014 \uC575\uCEE4 \uC140\uC774 \uC544\uB2C8\uBBC0\uB85C \uBBF8\uC9C0\uC6D0");
22443
22463
  continue;
22444
22464
  }
22445
- if (cell.paras.length !== 1) {
22446
- cellSkip("\uBCF5\uC218 \uBB38\uB2E8 \uC140 \uC218\uC815\uC740 \uBBF8\uC9C0\uC6D0 (v1)");
22465
+ const beforeParts = origRows[r][c].split(/<br\s*\/?>/i);
22466
+ const afterParts = editedRows[r][c].split(/<br\s*\/?>/i);
22467
+ if (beforeParts.length !== cell.paras.length || afterParts.length !== cell.paras.length) {
22468
+ cellSkip("\uC140 \uBB38\uB2E8 \uC218 \uBCC0\uACBD \u2014 \uBBF8\uC9C0\uC6D0 (\uBB38\uB2E8 \uCD94\uAC00/\uC0AD\uC81C)");
22447
22469
  continue;
22448
22470
  }
22449
- const para = cell.paras[0];
22450
- if (normForMatch(para.rawText) !== normForMatch(before)) {
22451
- cellSkip("\uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
22452
- continue;
22471
+ for (let k = 0; k < cell.paras.length; k++) {
22472
+ const before = gfmCellToPlain(beforeParts[k]);
22473
+ const after = gfmCellToPlain(afterParts[k]);
22474
+ if (before === null || after === null) {
22475
+ cellSkip("\uC11C\uC2DD/\uB9C1\uD06C/\uC774\uBBF8\uC9C0 \uD3EC\uD568 \uC140 \uC218\uC815\uC740 \uBBF8\uC9C0\uC6D0 (v1)");
22476
+ break;
22477
+ }
22478
+ if (before === after) continue;
22479
+ if (after.includes("\n")) {
22480
+ cellSkip("\uC140 \uB0B4 \uC904\uBC14\uAFC8 \uCD94\uAC00\uB294 \uBBF8\uC9C0\uC6D0 (v1)");
22481
+ break;
22482
+ }
22483
+ const para = cell.paras[k];
22484
+ if (normForMatch(para.rawText) !== normForMatch(before)) {
22485
+ cellSkip("\uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
22486
+ break;
22487
+ }
22488
+ if (sanitizeText(after) !== after) {
22489
+ cellSkip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
22490
+ break;
22491
+ }
22492
+ applied += stageParaPatch(ctx.scans[para.sectionIndex], para, after, cellSkip);
22453
22493
  }
22454
- if (sanitizeText(after) !== after) {
22455
- cellSkip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
22494
+ }
22495
+ }
22496
+ return applied;
22497
+ }
22498
+ function extractImgTags5(inner) {
22499
+ return (inner.match(/<img\s(?:"[^"]*"|'[^']*'|[^>"'])*?>/gi) || []).join(" ");
22500
+ }
22501
+ function patchHtmlCells5(table, scanTable, orig, edited, ctx, skip) {
22502
+ if (replicateTableToHtml(table) !== orig.raw) return skip("\uD45C \uC88C\uD45C \uC7AC\uD604 \uBD88\uC77C\uCE58 \u2014 \uB9E4\uD551 \uC2E0\uB8B0 \uBD88\uAC00");
22503
+ const replica = replicateHtmlTable(table);
22504
+ const origRows = parseHtmlTable(orig.raw);
22505
+ if (!origRows || origRows.length !== replica.length || origRows.some((r, i) => r.cells.length !== replica[i].cells.length || r.cells.some((c, j) => c.inner !== replica[i].cells[j].inner))) {
22506
+ return skip("\uC140 \uACBD\uACC4 \uBAA8\uD638 (\uB9AC\uD130\uB7F4 \uD0DC\uADF8 \uC758\uC2EC) \u2014 \uB9E4\uD551 \uC2E0\uB8B0 \uBD88\uAC00");
22507
+ }
22508
+ const editedRows = parseHtmlTable(edited.raw);
22509
+ if (!editedRows) return skip("\uD3B8\uC9D1\uB41C HTML \uD45C \uD30C\uC2F1 \uC2E4\uD328");
22510
+ if (editedRows.length !== replica.length) return skip("\uD45C \uD589 \uCD94\uAC00/\uC0AD\uC81C\uB294 \uBBF8\uC9C0\uC6D0 (\uD45C \uAD6C\uC870 \uBCC0\uACBD)");
22511
+ let applied = 0;
22512
+ for (let r = 0; r < replica.length; r++) {
22513
+ if (editedRows[r].cells.length !== replica[r].cells.length) {
22514
+ skip(`\uD45C ${r + 1}\uD589 \uC140 \uC218 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0`);
22515
+ continue;
22516
+ }
22517
+ for (let c = 0; c < replica[r].cells.length; c++) {
22518
+ const oc = replica[r].cells[c];
22519
+ const ec = editedRows[r].cells[c];
22520
+ if (oc.colSpan !== ec.colSpan || oc.rowSpan !== ec.rowSpan) {
22521
+ skip("\uC140 \uBCD1\uD569(colspan/rowspan) \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
22456
22522
  continue;
22457
22523
  }
22458
- applied += stageParaPatch(ctx.scans[para.sectionIndex], para, after, cellSkip);
22524
+ if (oc.inner === ec.inner) continue;
22525
+ const origContent = htmlCellInnerToLines(oc.inner);
22526
+ const editedContent = htmlCellInnerToLines(ec.inner);
22527
+ if (origContent.hadNonText || editedContent.hadNonText) {
22528
+ if (extractImgTags5(oc.inner) !== extractImgTags5(ec.inner)) {
22529
+ skip("\uC140 \uB0B4 \uC774\uBBF8\uC9C0 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
22530
+ continue;
22531
+ }
22532
+ if (extractTopLevelTables(oc.inner).join("\n") !== extractTopLevelTables(ec.inner).join("\n")) {
22533
+ skip("\uC140 \uB0B4 \uC911\uCCA9\uD45C \uC218\uC815\uC740 HWP5 \uBBF8\uC9C0\uC6D0 (v1)");
22534
+ continue;
22535
+ }
22536
+ }
22537
+ if (origContent.lines.join("\n") !== editedContent.lines.join("\n")) {
22538
+ const newLines = editedContent.lines.map((l) => unescapeGfm(l));
22539
+ applied += applyCellEdit5(table, scanTable, oc.gridR, oc.gridC, newLines, ctx, oc.inner, ec.inner, origContent.lines.length);
22540
+ }
22459
22541
  }
22460
22542
  }
22461
22543
  return applied;
@@ -22507,7 +22589,7 @@ function applyCellEdit5(table, scanTable, gridR, gridC, newLines, ctx, before, a
22507
22589
  };
22508
22590
  const cell = scanTable.cells.get(`${gridR},${gridC}`);
22509
22591
  if (!cell) return skip("\uC140 \uC88C\uD45C \uB9E4\uD551 \uC2E4\uD328 (\uBCD1\uD569 \uC601\uC5ED\uC758 \uBE48 \uCE78\uC774\uAC70\uB098 \uC88C\uD45C \uBD88\uC77C\uCE58)");
22510
- const irCell = _optionalChain([table, 'access', _195 => _195.cells, 'access', _196 => _196[gridR], 'optionalAccess', _197 => _197[gridC]]);
22592
+ const irCell = _optionalChain([table, 'access', _198 => _198.cells, 'access', _199 => _199[gridR], 'optionalAccess', _200 => _200[gridC]]);
22511
22593
  const scanJoined = cell.paras.map((p) => p.rawText).filter((t) => normForMatch(t)).join("\n");
22512
22594
  if (irCell && normForMatch(scanJoined) !== normForMatch(stripCellTokens(irCell.text))) {
22513
22595
  if (normForMatch(irCell.text) !== "" || normForMatch(scanJoined) !== "") {
@@ -22547,15 +22629,103 @@ function gfmCellToPlain(md2) {
22547
22629
  let t = md2.trim();
22548
22630
  const bold = t.match(/^\*\*([\s\S]+)\*\*$/);
22549
22631
  if (bold) t = bold[1];
22550
- if (/[*`]|!\[|\]\(|<(?!br\s*\/?>)/i.test(t)) return null;
22632
+ if (/[*`]|!\[|\]\(/.test(t)) return null;
22633
+ if (/<(?!br\s*\/?>)[a-zA-Z/]/i.test(t)) return null;
22551
22634
  return unescapeGfm(unescapeGfmCell(t));
22552
22635
  }
22553
- var PARA_BREAK = Buffer.from([13, 0]);
22636
+ function splitParaText(data) {
22637
+ const toks = [];
22638
+ let i = 0;
22639
+ while (i + 1 < data.length) {
22640
+ const ch = data.readUInt16LE(i);
22641
+ const start = i;
22642
+ i += 2;
22643
+ if (ch >= 32) {
22644
+ let units = 1;
22645
+ if (ch >= 55296 && ch <= 56319 && i + 1 < data.length) {
22646
+ const lo = data.readUInt16LE(i);
22647
+ if (lo >= 56320 && lo <= 57343) {
22648
+ i += 2;
22649
+ units = 2;
22650
+ }
22651
+ }
22652
+ toks.push({ start, end: i, units, plain: true, visible: true });
22653
+ continue;
22654
+ }
22655
+ switch (ch) {
22656
+ case 0:
22657
+ case 24:
22658
+ case 25:
22659
+ case 30:
22660
+ case 31:
22661
+ toks.push({ start, end: i, units: 1, plain: false, visible: true });
22662
+ break;
22663
+ case 9:
22664
+ if (i + 14 <= data.length) i += 14;
22665
+ toks.push({ start, end: i, units: 1, plain: false, visible: true });
22666
+ break;
22667
+ case 13:
22668
+ toks.push({ start, end: i, units: 1, plain: false, visible: false });
22669
+ break;
22670
+ case 10:
22671
+ if (i + 16 <= data.length && data.readUInt16LE(i) === 11) {
22672
+ i += 16;
22673
+ toks.push({ start, end: i, units: 1, plain: false, visible: false });
22674
+ } else {
22675
+ if (i + 14 <= data.length) i += 14;
22676
+ toks.push({ start, end: i, units: 1, plain: false, visible: true });
22677
+ }
22678
+ break;
22679
+ default: {
22680
+ const ext = isExtendedOnlyCtrlChar(ch);
22681
+ const inl = ch >= 4 && ch <= 9 || ch >= 19 && ch <= 20;
22682
+ if ((ext || inl) && i + 14 <= data.length) i += 14;
22683
+ toks.push({ start, end: i, units: 1, plain: false, visible: false });
22684
+ break;
22685
+ }
22686
+ }
22687
+ }
22688
+ if (i !== data.length) return null;
22689
+ let firstP = -1, lastP = -1;
22690
+ for (let k = 0; k < toks.length; k++) if (toks[k].plain) {
22691
+ if (firstP < 0) firstP = k;
22692
+ lastP = k;
22693
+ }
22694
+ if (firstP < 0) return null;
22695
+ for (let k = firstP; k <= lastP; k++) if (!toks[k].plain) return null;
22696
+ for (let k = 0; k < firstP; k++) if (toks[k].visible) return null;
22697
+ for (let k = lastP + 1; k < toks.length; k++) if (toks[k].visible) return null;
22698
+ const prefixEnd = toks[firstP].start;
22699
+ const coreEnd = toks[lastP].end;
22700
+ const prefixUnits = prefixEnd / 2;
22701
+ const suffixUnits = (data.length - coreEnd) / 2;
22702
+ return {
22703
+ prefix: data.subarray(0, prefixEnd),
22704
+ prefixUnits,
22705
+ core: data.subarray(prefixEnd, coreEnd).toString("utf16le"),
22706
+ suffix: data.subarray(coreEnd),
22707
+ suffixUnits
22708
+ };
22709
+ }
22710
+ function rebuildCharShape(csData, coreStartUnit) {
22711
+ const pairs = [];
22712
+ for (let o = 0; o + 8 <= csData.length; o += 8) pairs.push([csData.readUInt32LE(o), csData.readUInt32LE(o + 4)]);
22713
+ if (pairs.length === 0) return { buf: Buffer.from(csData.subarray(0, 8)), count: 1 };
22714
+ let coreId = pairs[0][1];
22715
+ for (const [p, id] of pairs) if (p <= coreStartUnit) coreId = id;
22716
+ const kept = pairs.filter(([p]) => p < coreStartUnit);
22717
+ if (kept.length === 0 || kept[kept.length - 1][1] !== coreId) kept.push([coreStartUnit, coreId]);
22718
+ const buf = Buffer.alloc(kept.length * 8);
22719
+ kept.forEach(([p, id], k) => {
22720
+ buf.writeUInt32LE(p >>> 0, k * 8);
22721
+ buf.writeUInt32LE(id >>> 0, k * 8 + 4);
22722
+ });
22723
+ return { buf, count: kept.length };
22724
+ }
22554
22725
  function stageParaPatch(scan, para, newPlain, skip) {
22555
22726
  if (!scan.safe) return skip("\uC139\uC158 \uB808\uCF54\uB4DC \uC7AC\uC9C1\uB82C\uD654 \uBD88\uC77C\uCE58 \u2014 \uC548\uC804\uC744 \uC704\uD574 \uC774 \uC139\uC158\uC740 \uBBF8\uC9C0\uC6D0");
22556
22727
  if (para.textIdx === -1) return skip("\uBE48 \uBB38\uB2E8 \uD14D\uC2A4\uD2B8 \uCD94\uAC00\uB294 \uBBF8\uC9C0\uC6D0 (v1)");
22557
22728
  if (para.textIdx === -2) return skip("\uBCF5\uC218 PARA_TEXT \uB808\uCF54\uB4DC \uBB38\uB2E8 \u2014 \uBBF8\uC9C0\uC6D0 (v1)");
22558
- if (para.ctrlMask !== 0) return skip("\uCEE8\uD2B8\uB864 \uBB38\uC790 \uD3EC\uD568 \uBB38\uB2E8(\uD0ED/\uAC1C\uCCB4/\uD544\uB4DC/\uD2B9\uC218\uACF5\uBC31) \u2014 \uBBF8\uC9C0\uC6D0 (v1)");
22559
22729
  if (para.rangeTagCount > 0) return skip("\uBC94\uC704 \uD0DC\uADF8(\uD615\uAD11\uD39C/\uAD50\uC815\uBD80\uD638) \uBB38\uB2E8 \u2014 \uBBF8\uC9C0\uC6D0 (v1)");
22560
22730
  if (para.charShapeIdx < 0 || para.lineSegIdx < 0) return skip("\uBB38\uB2E8 \uB808\uCF54\uB4DC \uAD6C\uC131 \uBE44\uC815\uD615 \u2014 \uBBF8\uC9C0\uC6D0");
22561
22731
  if (scan.repl.has(para.headerIdx)) return skip("\uB3D9\uC77C \uBB38\uB2E8 \uC911\uBCF5 \uC218\uC815 \u2014 \uCCAB \uC218\uC815\uB9CC \uC801\uC6A9");
@@ -22564,36 +22734,25 @@ function stageParaPatch(scan, para, newPlain, skip) {
22564
22734
  const headerRec = records[para.headerIdx];
22565
22735
  const textRec = records[para.textIdx];
22566
22736
  const charShapeRec = records[para.charShapeIdx];
22567
- const lineSegRec = records[para.lineSegIdx];
22568
- if (charShapeRec.data.length < 8 || lineSegRec.data.length < 36) {
22569
- return skip("CHAR_SHAPE/LINE_SEG \uB808\uCF54\uB4DC \uBE44\uC815\uD615 \u2014 \uBBF8\uC9C0\uC6D0");
22737
+ if (charShapeRec.data.length < 8) {
22738
+ return skip("CHAR_SHAPE \uB808\uCF54\uB4DC \uBE44\uC815\uD615 \u2014 \uBBF8\uC9C0\uC6D0");
22739
+ }
22740
+ const seg = splitParaText(textRec.data);
22741
+ if (!seg) {
22742
+ return skip(para.ctrlMask !== 0 ? "\uCEE8\uD2B8\uB864 \uBB38\uC790(\uD0ED/\uD544\uB4DC/\uD2B9\uC218\uACF5\uBC31 \uB4F1 \uD14D\uC2A4\uD2B8 \uC911\uAC04) \uD3EC\uD568 \uBB38\uB2E8 \u2014 \uBBF8\uC9C0\uC6D0 (v1)" : "PARA_TEXT \uC7AC\uAD6C\uC131 \uBD88\uC77C\uCE58 \u2014 \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
22570
22743
  }
22571
- const hadBreak = textRec.data.length >= 2 && textRec.data.readUInt16LE(textRec.data.length - 2) === 13;
22572
- const expect = hadBreak ? Buffer.concat([Buffer.from(para.rawText, "utf16le"), PARA_BREAK]) : Buffer.from(para.rawText, "utf16le");
22573
- if (!expect.equals(textRec.data)) return skip("PARA_TEXT \uC7AC\uAD6C\uC131 \uBD88\uC77C\uCE58 \u2014 \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
22744
+ if (seg.core !== para.rawText) return skip("PARA_TEXT \uC7AC\uAD6C\uC131 \uBD88\uC77C\uCE58 \u2014 \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
22574
22745
  const lead = para.rawText.match(/^\s*/)[0];
22575
22746
  const trail = para.rawText.match(/\s*$/)[0];
22576
22747
  const newRaw = para.rawText.trim() === para.rawText ? newPlain : lead + newPlain + trail;
22577
- const newText = hadBreak ? Buffer.concat([Buffer.from(newRaw, "utf16le"), PARA_BREAK]) : Buffer.from(newRaw, "utf16le");
22748
+ const newText = Buffer.concat([seg.prefix, Buffer.from(newRaw, "utf16le"), seg.suffix]);
22578
22749
  scan.repl.set(para.textIdx, newText);
22579
22750
  const newHeader = Buffer.from(headerRec.data);
22580
- const nChars = newRaw.length + (hadBreak ? 1 : 0);
22751
+ const nChars = seg.prefixUnits + newRaw.length + seg.suffixUnits;
22581
22752
  newHeader.writeUInt32LE((para.nCharsRaw & 2147483648 | nChars) >>> 0, 0);
22582
- if (charShapeRec.data.length > 8) {
22583
- newHeader.writeUInt16LE(1, 12);
22584
- scan.repl.set(para.charShapeIdx, Buffer.from(charShapeRec.data.subarray(0, 8)));
22585
- }
22586
- const csData = _nullishCoalesce(scan.repl.get(para.charShapeIdx), () => ( Buffer.from(charShapeRec.data)));
22587
- if (csData.readUInt32LE(0) !== 0) {
22588
- csData.writeUInt32LE(0, 0);
22589
- scan.repl.set(para.charShapeIdx, csData);
22590
- }
22591
- if (lineSegRec.data.length > 36 || lineSegRec.data.readUInt32LE(0) !== 0) {
22592
- const seg = Buffer.from(lineSegRec.data.subarray(0, 36));
22593
- seg.writeUInt32LE(0, 0);
22594
- newHeader.writeUInt16LE(1, 16);
22595
- scan.repl.set(para.lineSegIdx, seg);
22596
- }
22753
+ const cs = rebuildCharShape(charShapeRec.data, seg.prefixUnits);
22754
+ scan.repl.set(para.charShapeIdx, cs.buf);
22755
+ newHeader.writeUInt16LE(cs.count, 12);
22597
22756
  scan.repl.set(para.headerIdx, newHeader);
22598
22757
  return 1;
22599
22758
  }
@@ -22673,7 +22832,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22673
22832
  const block = st.blocks[blockIndex];
22674
22833
  if (!block) return void 0;
22675
22834
  if (block.type === "paragraph" || block.type === "heading") {
22676
- const para = _optionalChain([st, 'access', _198 => _198.paraMap, 'access', _199 => _199.get, 'call', _200 => _200(blockIndex), 'optionalAccess', _201 => _201.para]);
22835
+ const para = _optionalChain([st, 'access', _201 => _201.paraMap, 'access', _202 => _202.get, 'call', _203 => _203(blockIndex), 'optionalAccess', _204 => _204.para]);
22677
22836
  if (!para) return void 0;
22678
22837
  return { kind: "paragraph", sectionIndex: para.sectionIndex, xmlStart: para.start };
22679
22838
  }
@@ -22698,7 +22857,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22698
22857
  if (block.text && block.text.includes("\n")) {
22699
22858
  return { capability: "locked", reason: "\uBB38\uB2E8 \uB0B4 \uAC15\uC81C \uC904\uBC14\uAFC8 \uD3EC\uD568 \u2014 \uC218\uC815 \uC2DC \uC904\uBC14\uAFC8 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0 (v1)" };
22700
22859
  }
22701
- if (!_optionalChain([st, 'access', _202 => _202.paraMap, 'access', _203 => _203.get, 'call', _204 => _204(blockIndex), 'optionalAccess', _205 => _205.para])) {
22860
+ if (!_optionalChain([st, 'access', _205 => _205.paraMap, 'access', _206 => _206.get, 'call', _207 => _207(blockIndex), 'optionalAccess', _208 => _208.para])) {
22702
22861
  return { capability: "locked", reason: "\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)" };
22703
22862
  }
22704
22863
  return { capability: "text" };
@@ -22764,7 +22923,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22764
22923
  continue;
22765
22924
  }
22766
22925
  if (block.type === "table" && block.table) {
22767
- if (!_optionalChain([edit, 'access', _206 => _206.cells, 'optionalAccess', _207 => _207.length])) {
22926
+ if (!_optionalChain([edit, 'access', _209 => _209.cells, 'optionalAccess', _210 => _210.length])) {
22768
22927
  skipped.push({ reason: "\uD45C \uBE14\uB85D\uC5D0\uB294 cells \uD3B8\uC9D1\uB9CC \uC9C0\uC6D0", before: summarize(_nullishCoalesce(block.table.caption, () => ( "(\uD45C)"))) });
22769
22928
  continue;
22770
22929
  }
@@ -22784,7 +22943,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22784
22943
  skipped.push({ reason: "\uAC19\uC740 \uC140\uC5D0 \uC911\uBCF5 \uD3B8\uC9D1 \u2014 \uBA3C\uC800 \uC801\uC6A9\uB41C \uD3B8\uC9D1 \uC720\uC9C0", after: summarize(cellEdit.text) });
22785
22944
  continue;
22786
22945
  }
22787
- const irCell = _optionalChain([block, 'access', _208 => _208.table, 'access', _209 => _209.cells, 'access', _210 => _210[cellEdit.row], 'optionalAccess', _211 => _211[cellEdit.col]]);
22946
+ const irCell = _optionalChain([block, 'access', _211 => _211.table, 'access', _212 => _212.cells, 'access', _213 => _213[cellEdit.row], 'optionalAccess', _214 => _214[cellEdit.col]]);
22788
22947
  if (!irCell) {
22789
22948
  skipped.push({ reason: `\uC140 \uC88C\uD45C \uBC94\uC704 \uBC16: ${cellEdit.row},${cellEdit.col}`, after: summarize(cellEdit.text) });
22790
22949
  continue;
@@ -22839,7 +22998,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22839
22998
  }
22840
22999
  if (replacements.size === 0) {
22841
23000
  let changes2;
22842
- if (_optionalChain([options, 'optionalAccess', _212 => _212.verify]) !== false) {
23001
+ if (_optionalChain([options, 'optionalAccess', _215 => _215.verify]) !== false) {
22843
23002
  const units = splitMarkdownUnits(st.markdown);
22844
23003
  changes2 = diffUnitLists(units, units);
22845
23004
  }
@@ -22860,7 +23019,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22860
23019
  }
22861
23020
  this.state = newState;
22862
23021
  let changes;
22863
- if (_optionalChain([options, 'optionalAccess', _213 => _213.verify]) !== false) {
23022
+ if (_optionalChain([options, 'optionalAccess', _216 => _216.verify]) !== false) {
22864
23023
  changes = diffUnitLists(splitMarkdownUnits(beforeMarkdown), splitMarkdownUnits(newState.markdown));
22865
23024
  }
22866
23025
  return { success: true, data: new Uint8Array(data), applied, skipped, changes };
@@ -22880,7 +23039,7 @@ var HwpxSession = (_class4 = class _HwpxSession {
22880
23039
  return skip("\uBB38\uB2E8 \uB0B4 \uAC15\uC81C \uC904\uBC14\uAFC8 \uD3EC\uD568 \u2014 \uC218\uC815 \uC2DC \uC904\uBC14\uAFC8 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0 (v1)");
22881
23040
  }
22882
23041
  const mapping = st.paraMap.get(blockIndex);
22883
- if (!_optionalChain([mapping, 'optionalAccess', _214 => _214.para])) {
23042
+ if (!_optionalChain([mapping, 'optionalAccess', _217 => _217.para])) {
22884
23043
  return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
22885
23044
  }
22886
23045
  let newPlain = newTextRaw.split("\n").map((l) => l.trim()).filter(Boolean).join(" ");
@@ -22900,14 +23059,14 @@ var HwpxSession = (_class4 = class _HwpxSession {
22900
23059
  if (sanitizeText(newPlain) !== newPlain) {
22901
23060
  return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
22902
23061
  }
22903
- const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([st, 'access', _215 => _215.scans, 'access', _216 => _216[mapping.para.sectionIndex], 'optionalAccess', _217 => _217.xml]));
23062
+ const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([st, 'access', _218 => _218.scans, 'access', _219 => _219[mapping.para.sectionIndex], 'optionalAccess', _220 => _220.xml]));
22904
23063
  if (splices === null) return skip("\uBB38\uB2E8\uC5D0 \uD14D\uC2A4\uD2B8 \uB178\uB4DC\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC74C");
22905
23064
  sectionSplices[mapping.para.sectionIndex].push(...splices);
22906
23065
  return 1;
22907
23066
  }
22908
23067
  }, _class4);
22909
23068
  function cellStaticCheck(table, scanTable, r, c) {
22910
- const irCell = _optionalChain([table, 'access', _218 => _218.cells, 'access', _219 => _219[r], 'optionalAccess', _220 => _220[c]]);
23069
+ const irCell = _optionalChain([table, 'access', _221 => _221.cells, 'access', _222 => _222[r], 'optionalAccess', _223 => _223[c]]);
22911
23070
  if (!irCell) return { editable: false, reason: "\uC140 \uC88C\uD45C \uBC94\uC704 \uBC16" };
22912
23071
  const cell = scanTable.cellByAnchor.get(`${r},${c}`);
22913
23072
  if (!cell) return { editable: false, reason: "\uBCD1\uD569 \uC601\uC5ED\uC758 \uBE48 \uCE78\uC774\uAC70\uB098 \uC88C\uD45C \uBD88\uC77C\uCE58" };
@@ -22991,11 +23150,11 @@ var md = new (0, _markdownit2.default)({
22991
23150
  breaks: false
22992
23151
  });
22993
23152
  function renderHtml(markdown, options) {
22994
- const preset = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _221 => _221.preset]), () => ( "default"));
22995
- const css = PRESETS[preset] + (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _222 => _222.extraCss]), () => ( "")));
23153
+ const preset = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _224 => _224.preset]), () => ( "default"));
23154
+ const css = PRESETS[preset] + (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _225 => _225.extraCss]), () => ( "")));
22996
23155
  const body = md.render(markdown);
22997
- const watermark = _optionalChain([options, 'optionalAccess', _223 => _223.watermark]) ? `<div class="watermark">${escapeHtml(options.watermark)}</div>` : "";
22998
- const watermarkCss = _optionalChain([options, 'optionalAccess', _224 => _224.watermark]) ? `
23156
+ const watermark = _optionalChain([options, 'optionalAccess', _226 => _226.watermark]) ? `<div class="watermark">${escapeHtml(options.watermark)}</div>` : "";
23157
+ const watermarkCss = _optionalChain([options, 'optionalAccess', _227 => _227.watermark]) ? `
22999
23158
  .watermark {
23000
23159
  position: fixed;
23001
23160
  top: 50%; left: 50%;
@@ -23026,13 +23185,13 @@ async function htmlToPdf(html, options) {
23026
23185
  try {
23027
23186
  puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
23028
23187
  } catch (e34) {
23029
- throw new (0, _chunkFUB2BGXVcjs.KordocError)(
23188
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)(
23030
23189
  "PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
23031
23190
  );
23032
23191
  }
23033
23192
  const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
23034
23193
  if (!executablePath) {
23035
- throw new (0, _chunkFUB2BGXVcjs.KordocError)(
23194
+ throw new (0, _chunkYYKQN7SAcjs.KordocError)(
23036
23195
  "Chromium \uC2E4\uD589 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. PUPPETEER_EXECUTABLE_PATH \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694."
23037
23196
  );
23038
23197
  }
@@ -23044,10 +23203,10 @@ async function htmlToPdf(html, options) {
23044
23203
  try {
23045
23204
  const page = await browser.newPage();
23046
23205
  await page.setContent(html, { waitUntil: "networkidle0" });
23047
- const margin = _optionalChain([options, 'optionalAccess', _225 => _225.margin]);
23206
+ const margin = _optionalChain([options, 'optionalAccess', _228 => _228.margin]);
23048
23207
  const pdf = await page.pdf({
23049
- format: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _226 => _226.pageSize]), () => ( "A4")),
23050
- landscape: _optionalChain([options, 'optionalAccess', _227 => _227.orientation]) === "landscape",
23208
+ format: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _229 => _229.pageSize]), () => ( "A4")),
23209
+ landscape: _optionalChain([options, 'optionalAccess', _230 => _230.orientation]) === "landscape",
23051
23210
  printBackground: true,
23052
23211
  margin: margin ? {
23053
23212
  top: toCss(margin.top),
@@ -23055,9 +23214,9 @@ async function htmlToPdf(html, options) {
23055
23214
  bottom: toCss(margin.bottom),
23056
23215
  left: toCss(margin.left)
23057
23216
  } : void 0,
23058
- displayHeaderFooter: !!(_optionalChain([options, 'optionalAccess', _228 => _228.header]) || _optionalChain([options, 'optionalAccess', _229 => _229.footer])),
23059
- headerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _230 => _230.header]), () => ( "<div></div>")),
23060
- footerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _231 => _231.footer]), () => ( '<div style="font-size:8pt;width:100%;text-align:center;color:#777;"><span class="pageNumber"></span>/<span class="totalPages"></span></div>'))
23217
+ displayHeaderFooter: !!(_optionalChain([options, 'optionalAccess', _231 => _231.header]) || _optionalChain([options, 'optionalAccess', _232 => _232.footer])),
23218
+ headerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _233 => _233.header]), () => ( "<div></div>")),
23219
+ footerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _234 => _234.footer]), () => ( '<div style="font-size:8pt;width:100%;text-align:center;color:#777;"><span class="pageNumber"></span>/<span class="totalPages"></span></div>'))
23061
23220
  });
23062
23221
  return Buffer.from(pdf);
23063
23222
  } finally {
@@ -23091,24 +23250,24 @@ async function markdownToPdf(markdown, options) {
23091
23250
  return htmlToPdf(html, options);
23092
23251
  }
23093
23252
  async function blocksToPdf(blocks, options) {
23094
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, blocks);
23253
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, blocks);
23095
23254
  return markdownToPdf(markdown, options);
23096
23255
  }
23097
23256
 
23098
23257
  // src/index.ts
23099
23258
  async function parse(input, options) {
23100
23259
  let buffer;
23101
- const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess', _232 => _232.filePath]) ? { ...options, filePath: input } : options;
23260
+ const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess', _235 => _235.filePath]) ? { ...options, filePath: input } : options;
23102
23261
  if (typeof input === "string") {
23103
23262
  try {
23104
23263
  const buf = await _promises.readFile.call(void 0, input);
23105
- buffer = _chunkFUB2BGXVcjs.toArrayBuffer.call(void 0, buf);
23264
+ buffer = _chunkYYKQN7SAcjs.toArrayBuffer.call(void 0, buf);
23106
23265
  } catch (err) {
23107
23266
  const msg2 = err instanceof Error && "code" in err && err.code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`;
23108
23267
  return { success: false, fileType: "unknown", error: msg2, code: "PARSE_ERROR" };
23109
23268
  }
23110
23269
  } else if (Buffer.isBuffer(input)) {
23111
- buffer = _chunkFUB2BGXVcjs.toArrayBuffer.call(void 0, input);
23270
+ buffer = _chunkYYKQN7SAcjs.toArrayBuffer.call(void 0, input);
23112
23271
  } else {
23113
23272
  buffer = input;
23114
23273
  }
@@ -23143,21 +23302,21 @@ async function parseHwp3(buffer, options) {
23143
23302
  const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
23144
23303
  return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings };
23145
23304
  } catch (err) {
23146
- return { success: false, fileType: "hwp3", error: err instanceof Error ? err.message : "HWP3 \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23305
+ return { success: false, fileType: "hwp3", error: err instanceof Error ? err.message : "HWP3 \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23147
23306
  }
23148
23307
  }
23149
23308
  async function parseHwpx(buffer, options) {
23150
23309
  try {
23151
23310
  const { markdown, blocks, metadata, outline, warnings, images } = await parseHwpxDocument(buffer, options);
23152
- return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _233 => _233.length]) ? images : void 0 };
23311
+ return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _236 => _236.length]) ? images : void 0 };
23153
23312
  } catch (err) {
23154
- return { success: false, fileType: "hwpx", error: err instanceof Error ? err.message : "HWPX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23313
+ return { success: false, fileType: "hwpx", error: err instanceof Error ? err.message : "HWPX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23155
23314
  }
23156
23315
  }
23157
23316
  async function parseHwp(buffer, options) {
23158
23317
  try {
23159
23318
  const { markdown, blocks, metadata, outline, warnings, images } = parseHwp5Document(Buffer.from(buffer), options);
23160
- if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _234 => _234.filePath])) {
23319
+ if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _237 => _237.filePath])) {
23161
23320
  try {
23162
23321
  const { pages, pageCount, warnings: comWarns } = extractTextViaCom(options.filePath);
23163
23322
  if (pages.some((p) => p && p.trim().length > 0)) {
@@ -23174,15 +23333,15 @@ async function parseHwp(buffer, options) {
23174
23333
  } catch (e35) {
23175
23334
  }
23176
23335
  }
23177
- return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _235 => _235.length]) ? images : void 0 };
23336
+ return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _238 => _238.length]) ? images : void 0 };
23178
23337
  } catch (err) {
23179
- return { success: false, fileType: "hwp", error: err instanceof Error ? err.message : "HWP \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23338
+ return { success: false, fileType: "hwp", error: err instanceof Error ? err.message : "HWP \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23180
23339
  }
23181
23340
  }
23182
23341
  async function parsePdf(buffer, options) {
23183
23342
  let parsePdfDocument;
23184
23343
  try {
23185
- const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-YWKNDGKI.cjs")));
23344
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-XDW6I25C.cjs")));
23186
23345
  parsePdfDocument = mod.parsePdfDocument;
23187
23346
  } catch (e36) {
23188
23347
  return {
@@ -23197,7 +23356,7 @@ async function parsePdf(buffer, options) {
23197
23356
  return { success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary };
23198
23357
  } catch (err) {
23199
23358
  const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
23200
- return { success: false, fileType: "pdf", error: err instanceof Error ? err.message : "PDF \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err), isImageBased };
23359
+ return { success: false, fileType: "pdf", error: err instanceof Error ? err.message : "PDF \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err), isImageBased };
23201
23360
  }
23202
23361
  }
23203
23362
  async function parseXlsx(buffer, options) {
@@ -23205,7 +23364,7 @@ async function parseXlsx(buffer, options) {
23205
23364
  const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
23206
23365
  return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings };
23207
23366
  } catch (err) {
23208
- return { success: false, fileType: "xlsx", error: err instanceof Error ? err.message : "XLSX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23367
+ return { success: false, fileType: "xlsx", error: err instanceof Error ? err.message : "XLSX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23209
23368
  }
23210
23369
  }
23211
23370
  async function parseXls(buffer, options) {
@@ -23213,15 +23372,15 @@ async function parseXls(buffer, options) {
23213
23372
  const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
23214
23373
  return { success: true, fileType: "xls", markdown, blocks, metadata, warnings };
23215
23374
  } catch (err) {
23216
- return { success: false, fileType: "xls", error: err instanceof Error ? err.message : "XLS \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23375
+ return { success: false, fileType: "xls", error: err instanceof Error ? err.message : "XLS \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23217
23376
  }
23218
23377
  }
23219
23378
  async function parseDocx(buffer, options) {
23220
23379
  try {
23221
23380
  const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
23222
- return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _236 => _236.length]) ? images : void 0 };
23381
+ return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _239 => _239.length]) ? images : void 0 };
23223
23382
  } catch (err) {
23224
- return { success: false, fileType: "docx", error: err instanceof Error ? err.message : "DOCX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23383
+ return { success: false, fileType: "docx", error: err instanceof Error ? err.message : "DOCX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23225
23384
  }
23226
23385
  }
23227
23386
  async function parseHwpml(buffer, options) {
@@ -23229,16 +23388,16 @@ async function parseHwpml(buffer, options) {
23229
23388
  const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
23230
23389
  return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings };
23231
23390
  } catch (err) {
23232
- return { success: false, fileType: "hwpml", error: err instanceof Error ? err.message : "HWPML \uD30C\uC2F1 \uC2E4\uD328", code: _chunkFUB2BGXVcjs.classifyError.call(void 0, err) };
23391
+ return { success: false, fileType: "hwpml", error: err instanceof Error ? err.message : "HWPML \uD30C\uC2F1 \uC2E4\uD328", code: _chunkYYKQN7SAcjs.classifyError.call(void 0, err) };
23233
23392
  }
23234
23393
  }
23235
23394
  async function fillForm(input, values, outputFormat = "markdown") {
23236
23395
  let buffer;
23237
23396
  if (typeof input === "string") {
23238
23397
  const buf = await _promises.readFile.call(void 0, input);
23239
- buffer = _chunkFUB2BGXVcjs.toArrayBuffer.call(void 0, buf);
23398
+ buffer = _chunkYYKQN7SAcjs.toArrayBuffer.call(void 0, buf);
23240
23399
  } else if (Buffer.isBuffer(input)) {
23241
- buffer = _chunkFUB2BGXVcjs.toArrayBuffer.call(void 0, input);
23400
+ buffer = _chunkYYKQN7SAcjs.toArrayBuffer.call(void 0, input);
23242
23401
  } else {
23243
23402
  buffer = input;
23244
23403
  }
@@ -23264,7 +23423,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
23264
23423
  throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
23265
23424
  }
23266
23425
  const fill = fillFormFields(parsed.blocks, values);
23267
- const markdown = _chunkFUB2BGXVcjs.blocksToMarkdown.call(void 0, fill.blocks);
23426
+ const markdown = _chunkYYKQN7SAcjs.blocksToMarkdown.call(void 0, fill.blocks);
23268
23427
  if (outputFormat === "hwpx") {
23269
23428
  const hwpxBuffer = await markdownToHwpx(markdown);
23270
23429
  return { output: hwpxBuffer, format: "hwpx", fill };
@@ -23312,5 +23471,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
23312
23471
 
23313
23472
 
23314
23473
 
23315
- exports.HwpxSession = HwpxSession; exports.VERSION = _chunkFUB2BGXVcjs.VERSION; exports.applySplices = applySplices; exports.blocksToMarkdown = _chunkFUB2BGXVcjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.renderHtml = renderHtml; exports.scanSectionXml = scanSectionXml;
23474
+ exports.HwpxSession = HwpxSession; exports.VERSION = _chunkYYKQN7SAcjs.VERSION; exports.applySplices = applySplices; exports.blocksToMarkdown = _chunkYYKQN7SAcjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.renderHtml = renderHtml; exports.scanSectionXml = scanSectionXml;
23316
23475
  //# sourceMappingURL=index.cjs.map