@pixerate/editor 0.21.0 → 0.22.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.
Files changed (70) hide show
  1. package/README.md +20 -11
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.d.cts +2 -2
  4. package/dist/agent/index.d.ts +2 -2
  5. package/dist/agent/index.js +2 -2
  6. package/dist/canvas/index.cjs +1269 -13
  7. package/dist/canvas/index.cjs.map +1 -1
  8. package/dist/canvas/index.d.cts +432 -6
  9. package/dist/canvas/index.d.ts +432 -6
  10. package/dist/canvas/index.js +1264 -8
  11. package/dist/canvas/index.js.map +1 -1
  12. package/dist/{chunk-U6NDQFOK.cjs → chunk-6M3BCTBD.cjs} +427 -138
  13. package/dist/chunk-6M3BCTBD.cjs.map +1 -0
  14. package/dist/{chunk-TVRC4KVT.cjs → chunk-AA4ZEVCC.cjs} +845 -90
  15. package/dist/chunk-AA4ZEVCC.cjs.map +1 -0
  16. package/dist/{chunk-LA7PEGU3.cjs → chunk-CL37JGFW.cjs} +4 -4
  17. package/dist/{chunk-LA7PEGU3.cjs.map → chunk-CL37JGFW.cjs.map} +1 -1
  18. package/dist/{chunk-A7DKIA72.js → chunk-DENSCKFC.js} +642 -69
  19. package/dist/chunk-DENSCKFC.js.map +1 -0
  20. package/dist/{chunk-4QPLEUL2.cjs → chunk-GVSMRPHB.cjs} +1046 -54
  21. package/dist/chunk-GVSMRPHB.cjs.map +1 -0
  22. package/dist/{chunk-KYRZDWM4.js → chunk-JJDLPEWL.js} +2 -2
  23. package/dist/{chunk-3TYMNULT.js → chunk-MJZBNWG7.js} +807 -52
  24. package/dist/chunk-MJZBNWG7.js.map +1 -0
  25. package/dist/{chunk-CYFJCKC4.js → chunk-QGHGJ56O.js} +997 -5
  26. package/dist/chunk-QGHGJ56O.js.map +1 -0
  27. package/dist/{chunk-GVW4P7BG.js → chunk-RU52I7QO.js} +305 -16
  28. package/dist/chunk-RU52I7QO.js.map +1 -0
  29. package/dist/{chunk-JYRIOFEN.cjs → chunk-SAZRENEZ.cjs} +647 -74
  30. package/dist/chunk-SAZRENEZ.cjs.map +1 -0
  31. package/dist/{controller-OUdxPY-X.d.ts → controller-B7GIybc4.d.cts} +139 -7
  32. package/dist/{controller-OUdxPY-X.d.cts → controller-B7GIybc4.d.ts} +139 -7
  33. package/dist/extensions/index.cjs +14 -4
  34. package/dist/extensions/index.cjs.map +1 -1
  35. package/dist/extensions/index.d.cts +3 -3
  36. package/dist/extensions/index.d.ts +3 -3
  37. package/dist/extensions/index.js +13 -3
  38. package/dist/{index-k3mFbPx_.d.cts → index-CCr_z9kF.d.cts} +3 -3
  39. package/dist/{index-Ng1pG7JE.d.ts → index-Ck6ajwXh.d.ts} +3 -3
  40. package/dist/index.cjs +250 -16
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +294 -8
  43. package/dist/index.d.ts +294 -8
  44. package/dist/index.js +241 -7
  45. package/dist/index.js.map +1 -1
  46. package/dist/{registry-iAHbqkYt.d.cts → registry-GJI4gToU.d.cts} +15 -4
  47. package/dist/{registry-iAHbqkYt.d.ts → registry-GJI4gToU.d.ts} +15 -4
  48. package/dist/serializers/index.cjs +3 -3
  49. package/dist/serializers/index.d.cts +1 -1
  50. package/dist/serializers/index.d.ts +1 -1
  51. package/dist/serializers/index.js +2 -2
  52. package/dist/spreadsheet/index.cjs +7 -3
  53. package/dist/spreadsheet/index.cjs.map +1 -1
  54. package/dist/spreadsheet/index.d.cts +33 -4
  55. package/dist/spreadsheet/index.d.ts +33 -4
  56. package/dist/spreadsheet/index.js +6 -2
  57. package/dist/{track-changes-G8JcWB8b.d.cts → track-changes-BSF58RK0.d.cts} +92 -9
  58. package/dist/{track-changes-G8JcWB8b.d.ts → track-changes-BSF58RK0.d.ts} +92 -9
  59. package/dist/{types-DMe0vFB1.d.cts → types-CJ4U-HHI.d.cts} +1 -1
  60. package/dist/{types-DMe0vFB1.d.ts → types-CJ4U-HHI.d.ts} +1 -1
  61. package/package.json +1 -1
  62. package/dist/chunk-3TYMNULT.js.map +0 -1
  63. package/dist/chunk-4QPLEUL2.cjs.map +0 -1
  64. package/dist/chunk-A7DKIA72.js.map +0 -1
  65. package/dist/chunk-CYFJCKC4.js.map +0 -1
  66. package/dist/chunk-GVW4P7BG.js.map +0 -1
  67. package/dist/chunk-JYRIOFEN.cjs.map +0 -1
  68. package/dist/chunk-TVRC4KVT.cjs.map +0 -1
  69. package/dist/chunk-U6NDQFOK.cjs.map +0 -1
  70. /package/dist/{chunk-KYRZDWM4.js.map → chunk-JJDLPEWL.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3;
2
2
 
3
3
 
4
4
 
@@ -13,7 +13,7 @@ var _chunkAXV2ZW34cjs = require('./chunk-AXV2ZW34.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunkLA7PEGU3cjs = require('./chunk-LA7PEGU3.cjs');
16
+ var _chunkCL37JGFWcjs = require('./chunk-CL37JGFW.cjs');
17
17
 
18
18
 
19
19
 
@@ -21,7 +21,8 @@ var _chunkLA7PEGU3cjs = require('./chunk-LA7PEGU3.cjs');
21
21
 
22
22
 
23
23
 
24
- var _chunkTVRC4KVTcjs = require('./chunk-TVRC4KVT.cjs');
24
+
25
+ var _chunkAA4ZEVCCcjs = require('./chunk-AA4ZEVCC.cjs');
25
26
 
26
27
  // src/extensions/gradient-text.ts
27
28
  var _core = require('@tiptap/core');
@@ -1862,7 +1863,7 @@ var Comments = _core.Mark.create({
1862
1863
  },
1863
1864
  addStorage() {
1864
1865
  return {
1865
- store: _nullishCoalesce(this.options.store, () => ( new (0, _chunkTVRC4KVTcjs.CommentStore)())),
1866
+ store: _nullishCoalesce(this.options.store, () => ( new (0, _chunkAA4ZEVCCcjs.CommentStore)())),
1866
1867
  // tiptap-markdown: comments are not part of the exported markdown.
1867
1868
  markdown: { serialize: { open: "", close: "" }, parse: {} }
1868
1869
  };
@@ -1889,7 +1890,7 @@ var Comments = _core.Mark.create({
1889
1890
  const { from, to, empty } = state.selection;
1890
1891
  if (empty) return false;
1891
1892
  if (dispatch) {
1892
- const id = _nullishCoalesce(options.id, () => ( _chunkTVRC4KVTcjs.createReviewId.call(void 0, "comment")));
1893
+ const id = _nullishCoalesce(options.id, () => ( _chunkAA4ZEVCCcjs.createReviewId.call(void 0, "comment")));
1893
1894
  tr.addMark(from, to, this.type.create({ commentId: id }));
1894
1895
  tr.setMeta(commentsPluginKey, "refresh");
1895
1896
  store().createThread({
@@ -2192,11 +2193,15 @@ var ImportAdapterRegistry = (_class = class {constructor() { _class.prototype.__
2192
2193
  { fileName }
2193
2194
  );
2194
2195
  }
2195
- const context = createImportContext(input, { fileName, mimeType, target: adapter.target });
2196
+ const context = createImportContext(input, { fileName, mimeType, target: adapter.target, registry: this });
2196
2197
  try {
2197
2198
  const result = await adapter.import(input, context);
2198
2199
  return { adapterId: adapter.id, target: adapter.target, fileName, mimeType, result };
2199
2200
  } catch (error) {
2201
+ if (error instanceof ImportError) {
2202
+ if (error.fileName !== void 0 || fileName === void 0) throw error;
2203
+ throw new ImportError(error.code, error.message, { fileName, cause: error.cause });
2204
+ }
2200
2205
  throw new ImportError(
2201
2206
  "adapter_failed",
2202
2207
  `Import adapter "${adapter.id}" failed: ${error instanceof Error ? error.message : String(error)}`,
@@ -2206,6 +2211,980 @@ var ImportAdapterRegistry = (_class = class {constructor() { _class.prototype.__
2206
2211
  }
2207
2212
  }, _class);
2208
2213
 
2214
+ // src/import/zip.ts
2215
+ var ZipError = class extends Error {
2216
+
2217
+
2218
+ constructor(code, message, details = {}) {
2219
+ super(message, details.cause !== void 0 ? { cause: details.cause } : void 0);
2220
+ this.name = "ZipError";
2221
+ this.code = code;
2222
+ this.entryName = details.entryName;
2223
+ }
2224
+ };
2225
+ var DEFAULT_ZIP_MAX_ENTRIES = 1e4;
2226
+ var DEFAULT_ZIP_MAX_TOTAL_SIZE = 256 * 1024 * 1024;
2227
+ var SIG_EOCD = 101010256;
2228
+ var SIG_ZIP64_EOCD = 101075792;
2229
+ var SIG_ZIP64_LOCATOR = 117853008;
2230
+ var SIG_CENTRAL = 33639248;
2231
+ var SIG_LOCAL = 67324752;
2232
+ var EOCD_SIZE = 22;
2233
+ var MAX_COMMENT = 65535;
2234
+ var crcTable = null;
2235
+ function zipCrc32(data) {
2236
+ if (!crcTable) {
2237
+ crcTable = new Uint32Array(256);
2238
+ for (let n = 0; n < 256; n++) {
2239
+ let c = n;
2240
+ for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
2241
+ crcTable[n] = c >>> 0;
2242
+ }
2243
+ }
2244
+ let crc = 4294967295;
2245
+ for (let i = 0; i < data.length; i++) crc = crcTable[(crc ^ data[i]) & 255] ^ crc >>> 8;
2246
+ return (crc ^ 4294967295) >>> 0;
2247
+ }
2248
+ function toBytes(data) {
2249
+ if (ArrayBuffer.isView(data)) return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
2250
+ return new Uint8Array(data);
2251
+ }
2252
+ function isUnsafeZipPath(name) {
2253
+ if (!name || name.includes("\0")) return true;
2254
+ const normalized = name.replace(/\\/g, "/");
2255
+ if (normalized.startsWith("/") || /^[a-zA-Z]:/.test(normalized)) return true;
2256
+ return normalized.split("/").some((segment) => segment === "..");
2257
+ }
2258
+ var utf8 = new TextDecoder("utf-8");
2259
+ var CP437_HIGH = "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
2260
+ function decodeName(bytes, isUtf8) {
2261
+ if (isUtf8 || bytes.every((b) => b < 128)) return utf8.decode(bytes);
2262
+ let out = "";
2263
+ for (const b of bytes) out += b < 128 ? String.fromCharCode(b) : CP437_HIGH[b - 128];
2264
+ return out;
2265
+ }
2266
+ var ZipArchive = (_class2 = class {
2267
+ constructor(bytes, entries, maxTotalSize) {;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);
2268
+ this.bytes = bytes;
2269
+ this.maxTotalSize = maxTotalSize;
2270
+ this.entries = entries;
2271
+ entries.forEach((entry) => {
2272
+ if (!this.byName.has(entry.name)) this.byName.set(entry.name, entry);
2273
+ });
2274
+ }
2275
+
2276
+
2277
+ /** Entries in central-directory order. */
2278
+
2279
+ __init2() {this.byName = /* @__PURE__ */ new Map()}
2280
+ __init3() {this.extracted = 0}
2281
+ /** Looks up an entry by exact name (a leading `/` is ignored). */
2282
+ get(name) {
2283
+ return this.byName.get(name.replace(/^\/+/, ""));
2284
+ }
2285
+ has(name) {
2286
+ return !!this.get(name);
2287
+ }
2288
+ /** Uncompressed bytes extracted so far (counted against `maxTotalSize`). */
2289
+ get extractedSize() {
2290
+ return this.extracted;
2291
+ }
2292
+ /** Extracts an entry's data, verifying its size and CRC-32. */
2293
+ async read(entryOrName) {
2294
+ const entry = typeof entryOrName === "string" ? this.get(entryOrName) : entryOrName;
2295
+ if (!entry) {
2296
+ throw new ZipError("entry_not_found", `ZIP entry "${String(entryOrName)}" not found.`, {
2297
+ entryName: String(entryOrName)
2298
+ });
2299
+ }
2300
+ const name = entry.name;
2301
+ if (entry.encrypted) {
2302
+ throw new ZipError("encrypted", `ZIP entry "${name}" is encrypted; encrypted archives are not supported.`, {
2303
+ entryName: name
2304
+ });
2305
+ }
2306
+ if (entry.isDirectory) return new Uint8Array(0);
2307
+ const remaining = this.maxTotalSize - this.extracted;
2308
+ if (entry.size > remaining) {
2309
+ throw new ZipError(
2310
+ "too_large",
2311
+ `Extracting "${name}" (${entry.size} bytes) would exceed the ${this.maxTotalSize}-byte limit.`,
2312
+ { entryName: name }
2313
+ );
2314
+ }
2315
+ const { bytes } = this;
2316
+ const offset = entry.localHeaderOffset;
2317
+ if (offset + 30 > bytes.length || readU32(bytes, offset) !== SIG_LOCAL) {
2318
+ throw new ZipError("corrupt_entry", `ZIP entry "${name}" has no valid local header.`, { entryName: name });
2319
+ }
2320
+ const dataStart = offset + 30 + readU16(bytes, offset + 26) + readU16(bytes, offset + 28);
2321
+ const dataEnd = dataStart + entry.compressedSize;
2322
+ if (dataEnd > bytes.length) {
2323
+ throw new ZipError("corrupt_entry", `ZIP entry "${name}" is truncated.`, { entryName: name });
2324
+ }
2325
+ const raw = bytes.subarray(dataStart, dataEnd);
2326
+ let data;
2327
+ if (entry.method === 0) {
2328
+ if (entry.compressedSize !== entry.size) {
2329
+ throw new ZipError("corrupt_entry", `Stored ZIP entry "${name}" has inconsistent sizes.`, { entryName: name });
2330
+ }
2331
+ data = raw.slice();
2332
+ } else if (entry.method === 8) {
2333
+ data = await inflateRaw(raw, entry.size, name);
2334
+ } else {
2335
+ throw new ZipError(
2336
+ "unsupported_feature",
2337
+ `ZIP entry "${name}" uses unsupported compression method ${entry.method}; only stored and deflate are supported.`,
2338
+ { entryName: name }
2339
+ );
2340
+ }
2341
+ if (data.length !== entry.size) {
2342
+ throw new ZipError("corrupt_entry", `ZIP entry "${name}" size does not match the directory.`, { entryName: name });
2343
+ }
2344
+ this.extracted += data.length;
2345
+ if (zipCrc32(data) !== entry.crc32) {
2346
+ throw new ZipError("corrupt_entry", `ZIP entry "${name}" failed its CRC-32 check.`, { entryName: name });
2347
+ }
2348
+ return data;
2349
+ }
2350
+ /** Extracts an entry and decodes it as UTF-8 (a leading BOM is removed). */
2351
+ async readText(entryOrName) {
2352
+ const text = utf8.decode(await this.read(entryOrName));
2353
+ return text.charCodeAt(0) === 65279 ? text.slice(1) : text;
2354
+ }
2355
+ }, _class2);
2356
+ function readU16(bytes, offset) {
2357
+ return bytes[offset] | bytes[offset + 1] << 8;
2358
+ }
2359
+ function readU32(bytes, offset) {
2360
+ return (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24) >>> 0;
2361
+ }
2362
+ function readU64(bytes, offset) {
2363
+ const value = readU32(bytes, offset) + readU32(bytes, offset + 4) * 4294967296;
2364
+ if (!Number.isSafeInteger(value)) {
2365
+ throw new ZipError("unsupported_feature", "ZIP64 value exceeds the supported range.");
2366
+ }
2367
+ return value;
2368
+ }
2369
+ async function inflateRaw(raw, limit, entryName) {
2370
+ const Stream = globalThis.DecompressionStream;
2371
+ if (typeof Stream !== "function") {
2372
+ throw new ZipError(
2373
+ "unsupported_environment",
2374
+ "Inflating ZIP entries needs DecompressionStream (modern browsers, Node 18+).",
2375
+ { entryName }
2376
+ );
2377
+ }
2378
+ const stream = new Stream("deflate-raw");
2379
+ const writer = stream.writable.getWriter();
2380
+ const reader = stream.readable.getReader();
2381
+ const CHUNK = 64 * 1024;
2382
+ const feeding = (async () => {
2383
+ for (let i = 0; i < raw.length; i += CHUNK) await writer.write(raw.subarray(i, i + CHUNK));
2384
+ await writer.close();
2385
+ })();
2386
+ feeding.catch(() => {
2387
+ });
2388
+ const chunks = [];
2389
+ let total = 0;
2390
+ try {
2391
+ for (; ; ) {
2392
+ const { done, value } = await reader.read();
2393
+ if (done) break;
2394
+ total += value.length;
2395
+ if (total > limit) {
2396
+ throw new ZipError(
2397
+ "corrupt_entry",
2398
+ `ZIP entry "${entryName}" inflates beyond its declared size of ${limit} bytes.`,
2399
+ { entryName }
2400
+ );
2401
+ }
2402
+ chunks.push(value);
2403
+ }
2404
+ } catch (error) {
2405
+ reader.cancel().catch(() => {
2406
+ });
2407
+ writer.abort().catch(() => {
2408
+ });
2409
+ if (error instanceof ZipError) throw error;
2410
+ throw new ZipError("corrupt_entry", `ZIP entry "${entryName}" has an invalid deflate stream.`, {
2411
+ entryName,
2412
+ cause: error
2413
+ });
2414
+ }
2415
+ await feeding.catch(() => {
2416
+ });
2417
+ const out = new Uint8Array(total);
2418
+ let pos = 0;
2419
+ for (const chunk of chunks) {
2420
+ out.set(chunk, pos);
2421
+ pos += chunk.length;
2422
+ }
2423
+ return out;
2424
+ }
2425
+ function findEndOfCentralDirectory(bytes) {
2426
+ const min = Math.max(0, bytes.length - EOCD_SIZE - MAX_COMMENT);
2427
+ for (let i = bytes.length - EOCD_SIZE; i >= min; i--) {
2428
+ if (readU32(bytes, i) === SIG_EOCD && i + EOCD_SIZE + readU16(bytes, i + 20) <= bytes.length) return i;
2429
+ }
2430
+ return -1;
2431
+ }
2432
+ async function readZip(data, options = {}) {
2433
+ const bytes = toBytes(data);
2434
+ const maxEntries = _nullishCoalesce(options.maxEntries, () => ( DEFAULT_ZIP_MAX_ENTRIES));
2435
+ const maxTotalSize = _nullishCoalesce(options.maxTotalSize, () => ( DEFAULT_ZIP_MAX_TOTAL_SIZE));
2436
+ const eocd = findEndOfCentralDirectory(bytes);
2437
+ if (eocd < 0) throw new ZipError("invalid_archive", "Not a ZIP archive (no end of central directory record).");
2438
+ let diskNumber = readU16(bytes, eocd + 4);
2439
+ let cdDisk = readU16(bytes, eocd + 6);
2440
+ let count = readU16(bytes, eocd + 10);
2441
+ let cdSize = readU32(bytes, eocd + 12);
2442
+ let cdOffset = readU32(bytes, eocd + 16);
2443
+ if (count === 65535 || cdSize === 4294967295 || cdOffset === 4294967295) {
2444
+ const locator = eocd - 20;
2445
+ if (locator < 0 || readU32(bytes, locator) !== SIG_ZIP64_LOCATOR) {
2446
+ throw new ZipError("invalid_archive", "ZIP64 archive is missing its end of central directory locator.");
2447
+ }
2448
+ const record = readU64(bytes, locator + 8);
2449
+ if (record + 56 > bytes.length || readU32(bytes, record) !== SIG_ZIP64_EOCD) {
2450
+ throw new ZipError("invalid_archive", "ZIP64 end of central directory record not found.");
2451
+ }
2452
+ diskNumber = readU32(bytes, record + 16);
2453
+ cdDisk = readU32(bytes, record + 20);
2454
+ count = readU64(bytes, record + 32);
2455
+ cdSize = readU64(bytes, record + 40);
2456
+ cdOffset = readU64(bytes, record + 48);
2457
+ }
2458
+ if (diskNumber !== 0 || cdDisk !== 0) {
2459
+ throw new ZipError("unsupported_feature", "Multi-disk (spanned) ZIP archives are not supported.");
2460
+ }
2461
+ if (count > maxEntries) {
2462
+ throw new ZipError("too_many_entries", `ZIP archive has ${count} entries; the limit is ${maxEntries}.`);
2463
+ }
2464
+ if (cdOffset + cdSize > bytes.length) {
2465
+ throw new ZipError("invalid_archive", "ZIP central directory lies outside the file.");
2466
+ }
2467
+ const entries = [];
2468
+ let p = cdOffset;
2469
+ for (let i = 0; i < count; i++) {
2470
+ if (p + 46 > bytes.length || readU32(bytes, p) !== SIG_CENTRAL) {
2471
+ throw new ZipError("invalid_archive", "ZIP central directory is corrupt.");
2472
+ }
2473
+ const flags = readU16(bytes, p + 8);
2474
+ const method = readU16(bytes, p + 10);
2475
+ const crc32 = readU32(bytes, p + 16);
2476
+ let compressedSize = readU32(bytes, p + 20);
2477
+ let size = readU32(bytes, p + 24);
2478
+ const nameLength = readU16(bytes, p + 28);
2479
+ const extraLength = readU16(bytes, p + 30);
2480
+ const commentLength = readU16(bytes, p + 32);
2481
+ let localHeaderOffset = readU32(bytes, p + 42);
2482
+ const nameStart = p + 46;
2483
+ const extraStart = nameStart + nameLength;
2484
+ const next = extraStart + extraLength + commentLength;
2485
+ if (next > bytes.length) throw new ZipError("invalid_archive", "ZIP central directory is truncated.");
2486
+ for (let e = extraStart; e + 4 <= extraStart + extraLength; ) {
2487
+ const id = readU16(bytes, e);
2488
+ const len = readU16(bytes, e + 2);
2489
+ if (id === 1) {
2490
+ let f = e + 4;
2491
+ const end = f + len;
2492
+ if (size === 4294967295 && f + 8 <= end) {
2493
+ size = readU64(bytes, f);
2494
+ f += 8;
2495
+ }
2496
+ if (compressedSize === 4294967295 && f + 8 <= end) {
2497
+ compressedSize = readU64(bytes, f);
2498
+ f += 8;
2499
+ }
2500
+ if (localHeaderOffset === 4294967295 && f + 8 <= end) localHeaderOffset = readU64(bytes, f);
2501
+ }
2502
+ e += 4 + len;
2503
+ }
2504
+ const rawName = decodeName(bytes.subarray(nameStart, extraStart), (flags & 2048) !== 0);
2505
+ const name = rawName.replace(/\\/g, "/");
2506
+ p = next;
2507
+ if (isUnsafeZipPath(rawName)) {
2508
+ if (options.unsafePaths === "skip") continue;
2509
+ throw new ZipError("unsafe_path", `ZIP entry name "${rawName}" is absolute or escapes the archive root.`, {
2510
+ entryName: rawName
2511
+ });
2512
+ }
2513
+ entries.push({
2514
+ name,
2515
+ isDirectory: name.endsWith("/"),
2516
+ encrypted: (flags & 1) !== 0,
2517
+ method,
2518
+ compressedSize,
2519
+ size,
2520
+ crc32,
2521
+ localHeaderOffset
2522
+ });
2523
+ }
2524
+ return new ZipArchive(bytes, entries, maxTotalSize);
2525
+ }
2526
+
2527
+ // src/import/docx.ts
2528
+ var DOCX_MIME_TYPES = [
2529
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2530
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
2531
+ "application/vnd.ms-word.document.macroenabled.12"
2532
+ ];
2533
+ var DEFAULT_DOCX_MAX_IMAGE_SIZE = 10 * 1024 * 1024;
2534
+ var W_NAMESPACES = /* @__PURE__ */ new Set([
2535
+ "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
2536
+ "http://purl.oclc.org/ooxml/wordprocessingml/main"
2537
+ ]);
2538
+ var IMAGE_MIME_TYPES = {
2539
+ png: "image/png",
2540
+ jpg: "image/jpeg",
2541
+ jpeg: "image/jpeg",
2542
+ jpe: "image/jpeg",
2543
+ gif: "image/gif",
2544
+ webp: "image/webp"
2545
+ };
2546
+ function isW(node, localName) {
2547
+ if (!node || node.nodeType !== 1) return false;
2548
+ const el = node;
2549
+ if (localName !== void 0 && el.localName !== localName) return false;
2550
+ return W_NAMESPACES.has(_nullishCoalesce(el.namespaceURI, () => ( ""))) || el.prefix === "w";
2551
+ }
2552
+ function childElements(el) {
2553
+ const out = [];
2554
+ for (let node = el.firstChild; node; node = node.nextSibling) {
2555
+ if (node.nodeType === 1) out.push(node);
2556
+ }
2557
+ return out;
2558
+ }
2559
+ function wChild(el, localName) {
2560
+ if (!el) return void 0;
2561
+ return childElements(el).find((child) => isW(child, localName));
2562
+ }
2563
+ function attr(el, localName) {
2564
+ if (!el) return void 0;
2565
+ for (const a of Array.from(el.attributes)) {
2566
+ if (a.localName === localName) return a.value;
2567
+ }
2568
+ return void 0;
2569
+ }
2570
+ function descendants(el, localName) {
2571
+ return Array.from(el.getElementsByTagName("*")).filter((node) => node.localName === localName);
2572
+ }
2573
+ function toggle(el) {
2574
+ if (!el) return void 0;
2575
+ const value = _optionalChain([attr, 'call', _68 => _68(el, "val"), 'optionalAccess', _69 => _69.toLowerCase, 'call', _70 => _70()]);
2576
+ return value === void 0 || !["0", "false", "off", "none"].includes(value);
2577
+ }
2578
+ function parseXml(Parser, xml, partName) {
2579
+ const doc = new Parser().parseFromString(xml, "application/xml");
2580
+ if (!doc.documentElement || doc.getElementsByTagName("parsererror").length > 0) {
2581
+ throw new ImportError("invalid_file", `DOCX part "${partName}" is not well-formed XML.`);
2582
+ }
2583
+ return doc;
2584
+ }
2585
+ function dirname(path) {
2586
+ const index = path.lastIndexOf("/");
2587
+ return index === -1 ? "" : path.slice(0, index + 1);
2588
+ }
2589
+ function resolvePartPath(baseDir, target) {
2590
+ const raw = target.startsWith("/") ? target.slice(1) : baseDir + target;
2591
+ const out = [];
2592
+ for (const segment of raw.split("/")) {
2593
+ if (segment === "" || segment === ".") continue;
2594
+ if (segment === "..") out.pop();
2595
+ else out.push(segment);
2596
+ }
2597
+ return out.join("/");
2598
+ }
2599
+ function relsPathFor(partPath) {
2600
+ return `${dirname(partPath)}_rels/${partPath.slice(dirname(partPath).length)}.rels`;
2601
+ }
2602
+ async function readXmlPart(zip, Parser, path) {
2603
+ const entry = _nullishCoalesce(zip.get(path), () => ( zip.entries.find((e) => e.name.toLowerCase() === path.toLowerCase())));
2604
+ if (!entry) return null;
2605
+ return parseXml(Parser, await zip.readText(entry), path);
2606
+ }
2607
+ async function readRelationships(zip, Parser, partPath) {
2608
+ const rels = /* @__PURE__ */ new Map();
2609
+ const doc = await readXmlPart(zip, Parser, relsPathFor(partPath));
2610
+ if (!doc) return rels;
2611
+ const baseDir = dirname(partPath);
2612
+ descendants(doc, "Relationship").forEach((rel) => {
2613
+ const id = attr(rel, "Id");
2614
+ const target = _nullishCoalesce(attr(rel, "Target"), () => ( ""));
2615
+ if (!id) return;
2616
+ const external = _optionalChain([attr, 'call', _71 => _71(rel, "TargetMode"), 'optionalAccess', _72 => _72.toLowerCase, 'call', _73 => _73()]) === "external";
2617
+ rels.set(id, {
2618
+ type: _nullishCoalesce(attr(rel, "Type"), () => ( "")),
2619
+ target: external ? target : resolvePartPath(baseDir, target),
2620
+ external
2621
+ });
2622
+ });
2623
+ return rels;
2624
+ }
2625
+ function toBase64(bytes) {
2626
+ let binary = "";
2627
+ const CHUNK = 32768;
2628
+ for (let i = 0; i < bytes.length; i += CHUNK) {
2629
+ binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i, i + CHUNK)));
2630
+ }
2631
+ return btoa(binary);
2632
+ }
2633
+ async function loadImages(zip, root, rels, options) {
2634
+ const images = /* @__PURE__ */ new Map();
2635
+ if (options.images === false) return images;
2636
+ const maxSize = _nullishCoalesce(options.maxImageSize, () => ( DEFAULT_DOCX_MAX_IMAGE_SIZE));
2637
+ const ids = /* @__PURE__ */ new Set();
2638
+ descendants(root, "blip").forEach((blip) => {
2639
+ const id = attr(blip, "embed");
2640
+ if (id) ids.add(id);
2641
+ });
2642
+ descendants(root, "imagedata").forEach((data) => {
2643
+ const id = attr(data, "id");
2644
+ if (id) ids.add(id);
2645
+ });
2646
+ for (const id of ids) {
2647
+ const rel = rels.get(id);
2648
+ if (!rel || rel.external) continue;
2649
+ const mime = IMAGE_MIME_TYPES[_nullishCoalesce(_optionalChain([rel, 'access', _74 => _74.target, 'access', _75 => _75.split, 'call', _76 => _76("."), 'access', _77 => _77.pop, 'call', _78 => _78(), 'optionalAccess', _79 => _79.toLowerCase, 'call', _80 => _80()]), () => ( ""))];
2650
+ const entry = zip.get(rel.target);
2651
+ if (!mime || !entry || entry.size > maxSize) continue;
2652
+ images.set(id, `data:${mime};base64,${toBase64(await zip.read(entry))}`);
2653
+ }
2654
+ return images;
2655
+ }
2656
+ function readFormat(rPr) {
2657
+ const format = {};
2658
+ if (!rPr) return format;
2659
+ const set = (key, value) => {
2660
+ if (value !== void 0) format[key] = value;
2661
+ };
2662
+ set("b", toggle(wChild(rPr, "b")));
2663
+ set("i", toggle(wChild(rPr, "i")));
2664
+ set("u", toggle(wChild(rPr, "u")));
2665
+ const strike = toggle(wChild(rPr, "strike"));
2666
+ const dstrike = toggle(wChild(rPr, "dstrike"));
2667
+ if (strike !== void 0 || dstrike !== void 0) format.s = !!(strike || dstrike);
2668
+ const vertAlign = attr(wChild(rPr, "vertAlign"), "val");
2669
+ if (vertAlign) {
2670
+ format.sup = vertAlign === "superscript";
2671
+ format.sub = vertAlign === "subscript";
2672
+ }
2673
+ return format;
2674
+ }
2675
+ function readNumPr(pPr) {
2676
+ const numPr = wChild(pPr, "numPr");
2677
+ if (!numPr) return void 0;
2678
+ const numId = attr(wChild(numPr, "numId"), "val");
2679
+ if (numId === void 0) return void 0;
2680
+ return { numId, ilvl: Number(_nullishCoalesce(attr(wChild(numPr, "ilvl"), "val"), () => ( 0))) || 0 };
2681
+ }
2682
+ function readStyles(doc) {
2683
+ const styles = /* @__PURE__ */ new Map();
2684
+ if (!doc) return styles;
2685
+ descendants(doc, "style").forEach((style) => {
2686
+ const id = attr(style, "styleId");
2687
+ if (!id) return;
2688
+ const pPr = wChild(style, "pPr");
2689
+ const outline = attr(wChild(pPr, "outlineLvl"), "val");
2690
+ styles.set(id, {
2691
+ name: _nullishCoalesce(attr(wChild(style, "name"), "val"), () => ( id)),
2692
+ basedOn: attr(wChild(style, "basedOn"), "val"),
2693
+ outlineLevel: outline !== void 0 ? Number(outline) : void 0,
2694
+ numPr: readNumPr(pPr),
2695
+ format: readFormat(wChild(style, "rPr"))
2696
+ });
2697
+ });
2698
+ return styles;
2699
+ }
2700
+ function styleChain(styles, id) {
2701
+ const chain = [];
2702
+ const seen = /* @__PURE__ */ new Set();
2703
+ while (id && !seen.has(id)) {
2704
+ seen.add(id);
2705
+ const style = styles.get(id);
2706
+ if (!style) break;
2707
+ chain.push(style);
2708
+ id = style.basedOn;
2709
+ }
2710
+ return chain;
2711
+ }
2712
+ function styleHeadingLevel(styles, id) {
2713
+ if (id && /^heading([1-6])$/i.test(id)) return Number(id.slice(-1));
2714
+ for (const style of styleChain(styles, id)) {
2715
+ const byName = /^heading\s*([1-6])$/i.exec(style.name);
2716
+ if (byName) return Number(byName[1]);
2717
+ if (/^title$/i.test(style.name)) return 1;
2718
+ if (style.outlineLevel !== void 0) {
2719
+ return style.outlineLevel >= 0 && style.outlineLevel <= 5 ? style.outlineLevel + 1 : void 0;
2720
+ }
2721
+ }
2722
+ if (id && /^title$/i.test(id)) return 1;
2723
+ return void 0;
2724
+ }
2725
+ function readNumbering(doc) {
2726
+ const numbering = { abstracts: /* @__PURE__ */ new Map(), nums: /* @__PURE__ */ new Map() };
2727
+ if (!doc) return numbering;
2728
+ descendants(doc, "abstractNum").forEach((abstract) => {
2729
+ const id = attr(abstract, "abstractNumId");
2730
+ if (id === void 0) return;
2731
+ const levels = /* @__PURE__ */ new Map();
2732
+ childElements(abstract).filter((el) => isW(el, "lvl")).forEach((lvl) => {
2733
+ const format = _nullishCoalesce(attr(wChild(lvl, "numFmt"), "val"), () => ( "bullet"));
2734
+ levels.set(Number(_nullishCoalesce(attr(lvl, "ilvl"), () => ( 0))), {
2735
+ ordered: format !== "bullet" && format !== "none",
2736
+ start: Number(_nullishCoalesce(attr(wChild(lvl, "start"), "val"), () => ( 1))) || 1
2737
+ });
2738
+ });
2739
+ numbering.abstracts.set(id, levels);
2740
+ });
2741
+ descendants(doc, "num").forEach((num) => {
2742
+ const id = attr(num, "numId");
2743
+ const abstractId = attr(wChild(num, "abstractNumId"), "val");
2744
+ if (id === void 0 || abstractId === void 0) return;
2745
+ const starts = /* @__PURE__ */ new Map();
2746
+ childElements(num).filter((el) => isW(el, "lvlOverride")).forEach((override) => {
2747
+ const start2 = attr(wChild(override, "startOverride"), "val");
2748
+ if (start2 !== void 0) starts.set(Number(_nullishCoalesce(attr(override, "ilvl"), () => ( 0))), Number(start2));
2749
+ });
2750
+ numbering.nums.set(id, { abstractId, starts });
2751
+ });
2752
+ return numbering;
2753
+ }
2754
+ var formatKey = (f) => `${f.b ? 1 : 0}${f.i ? 1 : 0}${f.u ? 1 : 0}${f.s ? 1 : 0}${f.sup ? 1 : 0}${f.sub ? 1 : 0}|${_nullishCoalesce(f.href, () => ( ""))}`;
2755
+ function wrapFormat(inner, f) {
2756
+ let html = inner;
2757
+ if (f.sup) html = `<sup>${html}</sup>`;
2758
+ else if (f.sub) html = `<sub>${html}</sub>`;
2759
+ if (f.s) html = `<s>${html}</s>`;
2760
+ if (f.u) html = `<u>${html}</u>`;
2761
+ if (f.i) html = `<em>${html}</em>`;
2762
+ if (f.b) html = `<strong>${html}</strong>`;
2763
+ if (f.href) html = `<a href="${_chunkAA4ZEVCCcjs.escapeHtml.call(void 0, f.href)}">${html}</a>`;
2764
+ return html;
2765
+ }
2766
+ function renderSegments(segments) {
2767
+ let html = "";
2768
+ let i = 0;
2769
+ while (i < segments.length) {
2770
+ const key = formatKey(segments[i].format);
2771
+ let inner = "";
2772
+ let j = i;
2773
+ for (; j < segments.length && formatKey(segments[j].format) === key; j++) {
2774
+ const seg = segments[j];
2775
+ if (seg.kind === "text") inner += _chunkAA4ZEVCCcjs.escapeHtml.call(void 0, seg.text);
2776
+ else if (seg.kind === "br") inner += "<br>";
2777
+ else if (seg.kind === "img") inner += `<img src="${_chunkAA4ZEVCCcjs.escapeHtml.call(void 0, seg.src)}" alt="${_chunkAA4ZEVCCcjs.escapeHtml.call(void 0, seg.alt)}">`;
2778
+ else inner += `<sup>${seg.n}</sup>`;
2779
+ }
2780
+ html += wrapFormat(inner, segments[i].format);
2781
+ i = j;
2782
+ }
2783
+ return html;
2784
+ }
2785
+ function parseHyperlinkInstruction(instr) {
2786
+ const match = /^\s*HYPERLINK\b(.*)$/i.exec(instr);
2787
+ if (!match) return void 0;
2788
+ const rest = match[1];
2789
+ const anchor = _optionalChain([/\\l\s+"([^"]*)"/, 'access', _81 => _81.exec, 'call', _82 => _82(rest), 'optionalAccess', _83 => _83[1]]);
2790
+ const target = /^\s*(?:"([^"]*)"|([^\s\\]+))/.exec(rest);
2791
+ const url = _nullishCoalesce(_optionalChain([target, 'optionalAccess', _84 => _84[1]]), () => ( _optionalChain([target, 'optionalAccess', _85 => _85[2]])));
2792
+ if (url) return anchor ? `${url}#${anchor}` : url;
2793
+ return anchor ? `#${anchor}` : void 0;
2794
+ }
2795
+ var ParagraphRenderer = (_class3 = class {
2796
+ constructor(ctx, part) {;_class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this);
2797
+ this.ctx = ctx;
2798
+ this.part = part;
2799
+ }
2800
+
2801
+
2802
+ __init4() {this.segments = []}
2803
+ /** Open complex fields (`w:fldChar`), innermost last. */
2804
+ __init5() {this.fields = []}
2805
+ render(p) {
2806
+ this.walk(p, {});
2807
+ return renderSegments(this.segments);
2808
+ }
2809
+ fieldHref() {
2810
+ for (let i = this.fields.length - 1; i >= 0; i--) {
2811
+ if (this.fields[i].separated && this.fields[i].href) return this.fields[i].href;
2812
+ }
2813
+ return void 0;
2814
+ }
2815
+ inFieldInstruction() {
2816
+ return this.fields.some((field) => !field.separated);
2817
+ }
2818
+ walk(el, base) {
2819
+ const accepted = this.ctx.tracked === "accepted";
2820
+ for (const child of childElements(el)) {
2821
+ if (!isW(child)) {
2822
+ continue;
2823
+ }
2824
+ switch (child.localName) {
2825
+ case "r":
2826
+ this.run(child, base);
2827
+ break;
2828
+ case "hyperlink": {
2829
+ const relId = attr(child, "id");
2830
+ const rel = relId ? this.part.rels.get(relId) : void 0;
2831
+ const anchor = attr(child, "anchor");
2832
+ const href = rel ? rel.target + (anchor ? `#${anchor}` : "") : anchor ? `#${anchor}` : void 0;
2833
+ this.walk(child, href ? { ...base, href } : base);
2834
+ break;
2835
+ }
2836
+ case "fldSimple": {
2837
+ const href = parseHyperlinkInstruction(_nullishCoalesce(attr(child, "instr"), () => ( "")));
2838
+ this.walk(child, href ? { ...base, href } : base);
2839
+ break;
2840
+ }
2841
+ case "ins":
2842
+ case "moveTo":
2843
+ if (accepted) this.walk(child, base);
2844
+ break;
2845
+ case "del":
2846
+ case "moveFrom":
2847
+ if (!accepted) this.walk(child, base);
2848
+ break;
2849
+ case "sdt":
2850
+ this.walk(_nullishCoalesce(wChild(child, "sdtContent"), () => ( child)), base);
2851
+ break;
2852
+ case "smartTag":
2853
+ case "customXml":
2854
+ case "dir":
2855
+ case "bdo":
2856
+ case "sdtContent":
2857
+ this.walk(child, base);
2858
+ break;
2859
+ default:
2860
+ break;
2861
+ }
2862
+ }
2863
+ }
2864
+ run(r, base) {
2865
+ const rPr = wChild(r, "rPr");
2866
+ const styleFormat = _nullishCoalesce(_optionalChain([this, 'access', _86 => _86.ctx, 'access', _87 => _87.styles, 'access', _88 => _88.get, 'call', _89 => _89(_nullishCoalesce(attr(wChild(rPr, "rStyle"), "val"), () => ( ""))), 'optionalAccess', _90 => _90.format]), () => ( {}));
2867
+ const own = readFormat(rPr);
2868
+ const format = { ...base, ...styleFormat, ...own };
2869
+ for (const child of childElements(r)) {
2870
+ this.runChild(child, format);
2871
+ }
2872
+ }
2873
+ runChild(child, format) {
2874
+ const push = (segment) => {
2875
+ if (this.inFieldInstruction()) return;
2876
+ const href = _nullishCoalesce(format.href, () => ( this.fieldHref()));
2877
+ this.segments.push(href && !format.href ? { ...segment, format: { ...format, href } } : segment);
2878
+ };
2879
+ if (child.localName === "AlternateContent") {
2880
+ const branch = childElements(child).find(
2881
+ (b) => descendants(b, "blip").length || descendants(b, "imagedata").length
2882
+ );
2883
+ if (branch) this.image(branch, format, push);
2884
+ return;
2885
+ }
2886
+ if (!isW(child)) return;
2887
+ switch (child.localName) {
2888
+ case "t":
2889
+ push({ kind: "text", text: _nullishCoalesce(child.textContent, () => ( "")), format });
2890
+ break;
2891
+ case "delText":
2892
+ if (this.ctx.tracked === "original") push({ kind: "text", text: _nullishCoalesce(child.textContent, () => ( "")), format });
2893
+ break;
2894
+ case "tab":
2895
+ case "ptab":
2896
+ push({ kind: "text", text: " ", format });
2897
+ break;
2898
+ case "br": {
2899
+ const type = attr(child, "type");
2900
+ if (type !== "page" && type !== "column") push({ kind: "br", format });
2901
+ break;
2902
+ }
2903
+ case "cr":
2904
+ push({ kind: "br", format });
2905
+ break;
2906
+ case "noBreakHyphen":
2907
+ push({ kind: "text", text: "\u2011", format });
2908
+ break;
2909
+ case "drawing":
2910
+ case "pict":
2911
+ case "object":
2912
+ this.image(child, format, push);
2913
+ break;
2914
+ case "footnoteReference":
2915
+ case "endnoteReference": {
2916
+ const kind = child.localName === "footnoteReference" ? "footnote" : "endnote";
2917
+ const key = `${kind}:${attr(child, "id")}`;
2918
+ if (!this.ctx.notes.has(key)) break;
2919
+ let index = this.ctx.noteOrder.indexOf(key);
2920
+ if (index === -1) index = this.ctx.noteOrder.push(key) - 1;
2921
+ push({ kind: "note", n: index + 1, format: { ...format, sup: false, sub: false } });
2922
+ break;
2923
+ }
2924
+ case "fldChar": {
2925
+ const type = attr(child, "fldCharType");
2926
+ if (type === "begin") this.fields.push({ instr: "", separated: false });
2927
+ else if (type === "separate") {
2928
+ const field = this.fields[this.fields.length - 1];
2929
+ if (field) {
2930
+ field.separated = true;
2931
+ field.href = parseHyperlinkInstruction(field.instr);
2932
+ }
2933
+ } else if (type === "end") this.fields.pop();
2934
+ break;
2935
+ }
2936
+ case "instrText": {
2937
+ const field = this.fields[this.fields.length - 1];
2938
+ if (field && !field.separated) field.instr += _nullishCoalesce(child.textContent, () => ( ""));
2939
+ break;
2940
+ }
2941
+ default:
2942
+ break;
2943
+ }
2944
+ }
2945
+ image(container, format, push) {
2946
+ const blip = descendants(container, "blip")[0];
2947
+ const imageData = descendants(container, "imagedata")[0];
2948
+ const id = blip ? attr(blip, "embed") : attr(imageData, "id");
2949
+ const src = id ? this.part.images.get(id) : void 0;
2950
+ if (!src) return;
2951
+ const docPr = descendants(container, "docPr")[0];
2952
+ const alt = attr(docPr, "descr") || attr(docPr, "title") || attr(imageData, "title") || "";
2953
+ push({ kind: "img", src, alt, format });
2954
+ }
2955
+ }, _class3);
2956
+ function flattenBlocks(container, ctx, out = []) {
2957
+ const accepted = ctx.tracked === "accepted";
2958
+ for (const child of childElements(container)) {
2959
+ if (!isW(child)) continue;
2960
+ switch (child.localName) {
2961
+ case "p":
2962
+ case "tbl":
2963
+ out.push(child);
2964
+ break;
2965
+ case "sdt":
2966
+ flattenBlocks(_nullishCoalesce(wChild(child, "sdtContent"), () => ( child)), ctx, out);
2967
+ break;
2968
+ case "sdtContent":
2969
+ case "customXml":
2970
+ flattenBlocks(child, ctx, out);
2971
+ break;
2972
+ case "ins":
2973
+ case "moveTo":
2974
+ if (accepted) flattenBlocks(child, ctx, out);
2975
+ break;
2976
+ case "del":
2977
+ case "moveFrom":
2978
+ if (!accepted) flattenBlocks(child, ctx, out);
2979
+ break;
2980
+ default:
2981
+ break;
2982
+ }
2983
+ }
2984
+ return out;
2985
+ }
2986
+ function paragraphInfo(p, ctx) {
2987
+ const pPr = wChild(p, "pPr");
2988
+ const styleId = attr(wChild(pPr, "pStyle"), "val");
2989
+ const outline = attr(wChild(pPr, "outlineLvl"), "val");
2990
+ let heading;
2991
+ if (outline !== void 0) {
2992
+ const level = Number(outline);
2993
+ heading = level >= 0 && level <= 5 ? level + 1 : void 0;
2994
+ } else {
2995
+ heading = styleHeadingLevel(ctx.styles, styleId);
2996
+ }
2997
+ let numPr = readNumPr(pPr);
2998
+ if (!numPr) numPr = _optionalChain([styleChain, 'call', _91 => _91(ctx.styles, styleId), 'access', _92 => _92.find, 'call', _93 => _93((style) => style.numPr), 'optionalAccess', _94 => _94.numPr]);
2999
+ let list;
3000
+ if (numPr && numPr.numId !== "0" && heading === void 0) {
3001
+ const num = ctx.numbering.nums.get(numPr.numId);
3002
+ const def = num ? _optionalChain([ctx, 'access', _95 => _95.numbering, 'access', _96 => _96.abstracts, 'access', _97 => _97.get, 'call', _98 => _98(num.abstractId), 'optionalAccess', _99 => _99.get, 'call', _100 => _100(numPr.ilvl)]) : void 0;
3003
+ list = {
3004
+ level: Math.max(0, Math.min(numPr.ilvl, 8)),
3005
+ ordered: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _101 => _101.ordered]), () => ( false)),
3006
+ start: _nullishCoalesce(_nullishCoalesce(_optionalChain([num, 'optionalAccess', _102 => _102.starts, 'access', _103 => _103.get, 'call', _104 => _104(numPr.ilvl)]), () => ( _optionalChain([def, 'optionalAccess', _105 => _105.start]))), () => ( 1))
3007
+ };
3008
+ }
3009
+ return { heading, list };
3010
+ }
3011
+ function renderBlocks(container, ctx, part) {
3012
+ let html = "";
3013
+ const stack = [];
3014
+ const closeList = () => {
3015
+ const top = stack.pop();
3016
+ html += `</li></${top.tag}>`;
3017
+ };
3018
+ const closeAll = () => {
3019
+ while (stack.length) closeList();
3020
+ };
3021
+ for (const block of flattenBlocks(container, ctx)) {
3022
+ if (block.localName === "tbl") {
3023
+ closeAll();
3024
+ html += renderTable(block, ctx, part);
3025
+ continue;
3026
+ }
3027
+ const { heading, list } = paragraphInfo(block, ctx);
3028
+ const inner = new ParagraphRenderer(ctx, part).render(block);
3029
+ const blockHtml = heading ? `<h${heading}>${inner}</h${heading}>` : `<p>${inner}</p>`;
3030
+ if (!list) {
3031
+ closeAll();
3032
+ html += blockHtml;
3033
+ continue;
3034
+ }
3035
+ const tag = list.ordered ? "ol" : "ul";
3036
+ while (stack.length && stack[stack.length - 1].level > list.level) closeList();
3037
+ const top = stack[stack.length - 1];
3038
+ if (top && top.level === list.level && top.tag === tag) {
3039
+ html += "</li><li>";
3040
+ } else {
3041
+ if (top && top.level === list.level) closeList();
3042
+ const start2 = tag === "ol" && list.start !== 1 ? ` start="${list.start}"` : "";
3043
+ html += `<${tag}${start2}><li>`;
3044
+ stack.push({ level: list.level, tag });
3045
+ }
3046
+ html += blockHtml;
3047
+ }
3048
+ closeAll();
3049
+ return html;
3050
+ }
3051
+ function renderTable(tbl, ctx, part) {
3052
+ const rows = [];
3053
+ const collectRows = (container) => {
3054
+ for (const child of childElements(container)) {
3055
+ if (isW(child, "tr")) {
3056
+ const header = !!toggle(wChild(wChild(child, "trPr"), "tblHeader"));
3057
+ const cells = [];
3058
+ let col = 0;
3059
+ const collectCells = (row) => {
3060
+ for (const cellEl of childElements(row)) {
3061
+ if (isW(cellEl, "tc")) {
3062
+ const tcPr = wChild(cellEl, "tcPr");
3063
+ const span = Math.max(1, Number(_nullishCoalesce(attr(wChild(tcPr, "gridSpan"), "val"), () => ( 1))) || 1);
3064
+ const vMerge = wChild(tcPr, "vMerge");
3065
+ const merge = vMerge ? attr(vMerge, "val") === "restart" ? "restart" : "continue" : void 0;
3066
+ cells.push({ el: cellEl, col, span, merge, header });
3067
+ col += span;
3068
+ } else if (isW(cellEl, "sdt")) {
3069
+ collectCells(_nullishCoalesce(wChild(cellEl, "sdtContent"), () => ( cellEl)));
3070
+ }
3071
+ }
3072
+ };
3073
+ collectCells(child);
3074
+ rows.push(cells);
3075
+ } else if (isW(child, "sdt")) {
3076
+ collectRows(_nullishCoalesce(wChild(child, "sdtContent"), () => ( child)));
3077
+ }
3078
+ }
3079
+ };
3080
+ collectRows(tbl);
3081
+ let html = "<table><tbody>";
3082
+ rows.forEach((cells, rowIndex) => {
3083
+ html += "<tr>";
3084
+ for (const cell of cells) {
3085
+ if (cell.merge === "continue") continue;
3086
+ let rowspan = 1;
3087
+ if (cell.merge === "restart") {
3088
+ for (let r = rowIndex + 1; r < rows.length; r++) {
3089
+ const below = rows[r].find((c) => c.col === cell.col);
3090
+ if (_optionalChain([below, 'optionalAccess', _106 => _106.merge]) !== "continue") break;
3091
+ rowspan++;
3092
+ }
3093
+ }
3094
+ const tag = cell.header ? "th" : "td";
3095
+ const attrs = `${cell.span > 1 ? ` colspan="${cell.span}"` : ""}${rowspan > 1 ? ` rowspan="${rowspan}"` : ""}`;
3096
+ html += `<${tag}${attrs}>${renderBlocks(cell.el, ctx, part) || "<p></p>"}</${tag}>`;
3097
+ }
3098
+ html += "</tr>";
3099
+ });
3100
+ return `${html}</tbody></table>`;
3101
+ }
3102
+ function getDomParser(options) {
3103
+ const Parser = _nullishCoalesce(_nullishCoalesce(options.DOMParser, () => ( globalThis.DOMParser)), () => ( _optionalChain([globalThis, 'access', _107 => _107.window, 'optionalAccess', _108 => _108.DOMParser])));
3104
+ if (typeof Parser !== "function") {
3105
+ throw new ImportError(
3106
+ "unsupported_environment",
3107
+ "DOCX import needs a DOMParser. In Node, pass one with createDocxImportAdapter({ DOMParser }) (e.g. from jsdom)."
3108
+ );
3109
+ }
3110
+ return Parser;
3111
+ }
3112
+ async function docxToDocumentImport(data, options = {}) {
3113
+ const Parser = getDomParser(options);
3114
+ let zip;
3115
+ try {
3116
+ zip = await readZip(data, { maxTotalSize: 100 * 1024 * 1024, maxEntries: 5e3, ...options.zip });
3117
+ } catch (error) {
3118
+ if (_optionalChain([error, 'optionalAccess', _109 => _109.code]) === "invalid_archive") {
3119
+ throw new ImportError("invalid_file", "Not a DOCX file (the file is not a ZIP package).", { cause: error });
3120
+ }
3121
+ throw error;
3122
+ }
3123
+ let mainPath = "word/document.xml";
3124
+ const packageRels = await readXmlPart(zip, Parser, "_rels/.rels");
3125
+ if (packageRels) {
3126
+ const office = descendants(packageRels, "Relationship").find(
3127
+ (rel) => /\/officeDocument$/.test(_nullishCoalesce(attr(rel, "Type"), () => ( "")))
3128
+ );
3129
+ const target = attr(office, "Target");
3130
+ if (target) mainPath = resolvePartPath("", target);
3131
+ }
3132
+ const documentXml = await readXmlPart(zip, Parser, mainPath);
3133
+ const body = documentXml ? descendants(documentXml, "body").find((el) => isW(el)) : void 0;
3134
+ if (!documentXml || !body) {
3135
+ throw new ImportError("invalid_file", "Not a Word document (no main document part with a body).");
3136
+ }
3137
+ const rels = await readRelationships(zip, Parser, mainPath);
3138
+ const partByType = (suffix) => _optionalChain([Array, 'access', _110 => _110.from, 'call', _111 => _111(rels.values()), 'access', _112 => _112.find, 'call', _113 => _113((rel) => !rel.external && rel.type.endsWith(`/${suffix}`)), 'optionalAccess', _114 => _114.target]);
3139
+ const baseDir = dirname(mainPath);
3140
+ const stylesPath = _nullishCoalesce(partByType("styles"), () => ( `${baseDir}styles.xml`));
3141
+ const numberingPath = _nullishCoalesce(partByType("numbering"), () => ( `${baseDir}numbering.xml`));
3142
+ const ctx = {
3143
+ styles: readStyles(await readXmlPart(zip, Parser, stylesPath)),
3144
+ numbering: readNumbering(await readXmlPart(zip, Parser, numberingPath)),
3145
+ notes: /* @__PURE__ */ new Map(),
3146
+ noteOrder: [],
3147
+ tracked: _nullishCoalesce(options.trackedChanges, () => ( "accepted"))
3148
+ };
3149
+ for (const kind of ["footnote", "endnote"]) {
3150
+ const path = _nullishCoalesce(partByType(`${kind}s`), () => ( `${baseDir}${kind}s.xml`));
3151
+ const notesXml = await readXmlPart(zip, Parser, path);
3152
+ if (!notesXml) continue;
3153
+ const noteRels = await readRelationships(zip, Parser, path);
3154
+ const part2 = { rels: noteRels, images: await loadImages(zip, notesXml, noteRels, options) };
3155
+ descendants(notesXml, kind).filter((note) => isW(note)).forEach((note) => {
3156
+ const type = attr(note, "type");
3157
+ if (type && type !== "normal") return;
3158
+ ctx.notes.set(`${kind}:${attr(note, "id")}`, { element: note, part: part2 });
3159
+ });
3160
+ }
3161
+ const part = { rels, images: await loadImages(zip, documentXml, rels, options) };
3162
+ let html = renderBlocks(body, ctx, part);
3163
+ if (ctx.noteOrder.length) {
3164
+ let notesHtml = "";
3165
+ for (let i = 0; i < ctx.noteOrder.length; i++) {
3166
+ const note = ctx.notes.get(ctx.noteOrder[i]);
3167
+ notesHtml += `<li>${renderBlocks(note.element, ctx, note.part) || "<p></p>"}</li>`;
3168
+ }
3169
+ html += `<hr><ol>${notesHtml}</ol>`;
3170
+ }
3171
+ const sanitized = _chunkCL37JGFWcjs.sanitizeImportedHtml.call(void 0, html);
3172
+ return { html: sanitized, text: _chunkAA4ZEVCCcjs.htmlToPlainText.call(void 0, sanitized) };
3173
+ }
3174
+ function createDocxImportAdapter(options = {}) {
3175
+ return {
3176
+ id: _nullishCoalesce(options.id, () => ( "docx")),
3177
+ label: "Word document",
3178
+ mimeTypes: DOCX_MIME_TYPES,
3179
+ extensions: [".docx", ".docm", ".dotx"],
3180
+ target: "document",
3181
+ async import(_input, context) {
3182
+ return docxToDocumentImport(await context.readArrayBuffer(), options);
3183
+ }
3184
+ };
3185
+ }
3186
+ var docxImportAdapter = createDocxImportAdapter();
3187
+
2209
3188
  // src/import/adapters.ts
2210
3189
  var markdownImportAdapter = {
2211
3190
  id: "markdown",
@@ -2215,7 +3194,7 @@ var markdownImportAdapter = {
2215
3194
  target: "document",
2216
3195
  async import(_input, context) {
2217
3196
  const text = await context.readText();
2218
- return { html: _chunkTVRC4KVTcjs.markdownToTipTapHtml.call(void 0, text), text };
3197
+ return { html: _chunkAA4ZEVCCcjs.markdownToTipTapHtml.call(void 0, text), text };
2219
3198
  }
2220
3199
  };
2221
3200
  var htmlImportAdapter = {
@@ -2225,8 +3204,8 @@ var htmlImportAdapter = {
2225
3204
  extensions: [".html", ".htm", ".xhtml"],
2226
3205
  target: "document",
2227
3206
  async import(_input, context) {
2228
- const html = _chunkLA7PEGU3cjs.sanitizeImportedHtml.call(void 0, await context.readText());
2229
- return { html, text: _chunkTVRC4KVTcjs.htmlToPlainText.call(void 0, html) };
3207
+ const html = _chunkCL37JGFWcjs.sanitizeImportedHtml.call(void 0, await context.readText());
3208
+ return { html, text: _chunkAA4ZEVCCcjs.htmlToPlainText.call(void 0, html) };
2230
3209
  }
2231
3210
  };
2232
3211
  var plainTextImportAdapter = {
@@ -2237,7 +3216,7 @@ var plainTextImportAdapter = {
2237
3216
  target: "document",
2238
3217
  async import(_input, context) {
2239
3218
  const text = (await context.readText()).replace(/\r\n?/g, "\n");
2240
- return { html: _chunkLA7PEGU3cjs.plainTextToParagraphHtml.call(void 0, text), text };
3219
+ return { html: _chunkCL37JGFWcjs.plainTextToParagraphHtml.call(void 0, text), text };
2241
3220
  }
2242
3221
  };
2243
3222
  var rtfImportAdapter = {
@@ -2247,15 +3226,16 @@ var rtfImportAdapter = {
2247
3226
  extensions: [".rtf"],
2248
3227
  target: "document",
2249
3228
  async import(_input, context) {
2250
- const text = _chunkLA7PEGU3cjs.rtfToPlainText.call(void 0, await context.readText());
2251
- return { html: _chunkLA7PEGU3cjs.plainTextToParagraphHtml.call(void 0, text), text };
3229
+ const text = _chunkCL37JGFWcjs.rtfToPlainText.call(void 0, await context.readText());
3230
+ return { html: _chunkCL37JGFWcjs.plainTextToParagraphHtml.call(void 0, text), text };
2252
3231
  }
2253
3232
  };
2254
3233
  var BUILT_IN_IMPORT_ADAPTERS = [
2255
3234
  markdownImportAdapter,
2256
3235
  htmlImportAdapter,
2257
3236
  plainTextImportAdapter,
2258
- rtfImportAdapter
3237
+ rtfImportAdapter,
3238
+ docxImportAdapter
2259
3239
  ];
2260
3240
  function createImportAdapterRegistry(options = {}) {
2261
3241
  const registry = new ImportAdapterRegistry();
@@ -2286,7 +3266,7 @@ function getImportAccept(target) {
2286
3266
 
2287
3267
  var toView = (target) => "state" in target && "dispatch" in target ? target : target.view;
2288
3268
  function htmlToSlice(html, schema) {
2289
- const Parser = _nullishCoalesce(globalThis.DOMParser, () => ( _optionalChain([globalThis, 'access', _68 => _68.window, 'optionalAccess', _69 => _69.DOMParser])));
3269
+ const Parser = _nullishCoalesce(globalThis.DOMParser, () => ( _optionalChain([globalThis, 'access', _115 => _115.window, 'optionalAccess', _116 => _116.DOMParser])));
2290
3270
  if (!Parser) return null;
2291
3271
  const body = new Parser().parseFromString(`<body>${html}</body>`, "text/html").body;
2292
3272
  return new (0, _model.Slice)(_model.DOMParser.fromSchema(schema).parse(body).content, 0, 0);
@@ -2301,7 +3281,7 @@ function insertImportedDocument(target, content, options = {}) {
2301
3281
  if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
2302
3282
  from = to = _state.Selection.near(state.doc.resolve(from)).from;
2303
3283
  }
2304
- const tr = htmlSlice ? state.tr.replaceRange(from, to, htmlSlice) : state.tr.replace(from, to, _chunkTVRC4KVTcjs.plainTextToSlice.call(void 0, content.text, state.schema));
3284
+ const tr = htmlSlice ? state.tr.replaceRange(from, to, htmlSlice) : state.tr.replace(from, to, _chunkAA4ZEVCCcjs.plainTextToSlice.call(void 0, content.text, state.schema));
2305
3285
  const end = tr.mapping.map(to, 1);
2306
3286
  view.dispatch(tr.scrollIntoView().setMeta("uiEvent", "drop"));
2307
3287
  return end;
@@ -2317,7 +3297,7 @@ async function importFilesIntoEditor(target, files, options = {}) {
2317
3297
  if (view.isDestroyed) break;
2318
3298
  at = insertImportedDocument(view, outcome.result, { at, asPlainText: options.asPlainText });
2319
3299
  outcomes.push(outcome);
2320
- _optionalChain([options, 'access', _70 => _70.onImport, 'optionalCall', _71 => _71(outcome, file)]);
3300
+ _optionalChain([options, 'access', _117 => _117.onImport, 'optionalCall', _118 => _118(outcome, file)]);
2321
3301
  } catch (error) {
2322
3302
  const err = error instanceof Error ? error : new Error(String(error));
2323
3303
  if (options.onError) options.onError(err, file);
@@ -2336,7 +3316,7 @@ function getImportableFiles(files, registry) {
2336
3316
  }
2337
3317
  function dropPosition(view, event) {
2338
3318
  try {
2339
- return _optionalChain([view, 'access', _72 => _72.posAtCoords, 'call', _73 => _73({ left: event.clientX, top: event.clientY }), 'optionalAccess', _74 => _74.pos]);
3319
+ return _optionalChain([view, 'access', _119 => _119.posAtCoords, 'call', _120 => _120({ left: event.clientX, top: event.clientY }), 'optionalAccess', _121 => _121.pos]);
2340
3320
  } catch (e2) {
2341
3321
  return void 0;
2342
3322
  }
@@ -2371,7 +3351,7 @@ var FileImport = _core.Extension.create({
2371
3351
  props: {
2372
3352
  handleDrop(view, event, _slice, moved) {
2373
3353
  if (!options.enableDrop || moved) return false;
2374
- const files = getImportableFiles(_optionalChain([event, 'access', _75 => _75.dataTransfer, 'optionalAccess', _76 => _76.files]), registry());
3354
+ const files = getImportableFiles(_optionalChain([event, 'access', _122 => _122.dataTransfer, 'optionalAccess', _123 => _123.files]), registry());
2375
3355
  if (!files) return false;
2376
3356
  event.preventDefault();
2377
3357
  run(view, files, dropPosition(view, event));
@@ -2379,7 +3359,7 @@ var FileImport = _core.Extension.create({
2379
3359
  },
2380
3360
  handlePaste(view, event) {
2381
3361
  if (!options.enablePaste) return false;
2382
- const files = getImportableFiles(_optionalChain([event, 'access', _77 => _77.clipboardData, 'optionalAccess', _78 => _78.files]), registry());
3362
+ const files = getImportableFiles(_optionalChain([event, 'access', _124 => _124.clipboardData, 'optionalAccess', _125 => _125.files]), registry());
2383
3363
  if (!files) return false;
2384
3364
  event.preventDefault();
2385
3365
  run(view, files);
@@ -2398,15 +3378,15 @@ var richClipboardPluginKey = new (0, _state.PluginKey)("richClipboard");
2398
3378
  function writeRichClipboard(view, event, options = {}) {
2399
3379
  const { state } = view;
2400
3380
  if (state.selection.empty) return false;
2401
- const data = _chunkLA7PEGU3cjs.getClipboardData.call(void 0, event);
3381
+ const data = _chunkCL37JGFWcjs.getClipboardData.call(void 0, event);
2402
3382
  if (!data || typeof data.setData !== "function") return false;
2403
3383
  const slice = state.selection.content();
2404
3384
  const { dom, text } = view.serializeForClipboard(slice);
2405
3385
  event.preventDefault();
2406
- _optionalChain([data, 'access', _79 => _79.clearData, 'optionalCall', _80 => _80()]);
3386
+ _optionalChain([data, 'access', _126 => _126.clearData, 'optionalCall', _127 => _127()]);
2407
3387
  data.setData("text/html", dom.innerHTML);
2408
3388
  data.setData("text/plain", text);
2409
- data.setData(_nullishCoalesce(options.mimeType, () => ( _chunkLA7PEGU3cjs.PIXERATE_DOCUMENT_MIME)), _chunkLA7PEGU3cjs.serializeRichClipboardPayload.call(void 0, slice, state.schema));
3389
+ data.setData(_nullishCoalesce(options.mimeType, () => ( _chunkCL37JGFWcjs.PIXERATE_DOCUMENT_MIME)), _chunkCL37JGFWcjs.serializeRichClipboardPayload.call(void 0, slice, state.schema));
2410
3390
  if (options.cut && view.editable) {
2411
3391
  view.dispatch(state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
2412
3392
  }
@@ -2416,7 +3396,7 @@ var RichClipboard = _core.Extension.create({
2416
3396
  name: "richClipboard",
2417
3397
  addOptions() {
2418
3398
  return {
2419
- mimeType: _chunkLA7PEGU3cjs.PIXERATE_DOCUMENT_MIME,
3399
+ mimeType: _chunkCL37JGFWcjs.PIXERATE_DOCUMENT_MIME,
2420
3400
  plainTextMode: false
2421
3401
  };
2422
3402
  },
@@ -2424,7 +3404,7 @@ var RichClipboard = _core.Extension.create({
2424
3404
  return { plainTextMode: !!this.options.plainTextMode };
2425
3405
  },
2426
3406
  addProseMirrorPlugins() {
2427
- const mimeType = _nullishCoalesce(this.options.mimeType, () => ( _chunkLA7PEGU3cjs.PIXERATE_DOCUMENT_MIME));
3407
+ const mimeType = _nullishCoalesce(this.options.mimeType, () => ( _chunkCL37JGFWcjs.PIXERATE_DOCUMENT_MIME));
2428
3408
  const storage = this.storage;
2429
3409
  return [
2430
3410
  new (0, _state.Plugin)({
@@ -2436,7 +3416,7 @@ var RichClipboard = _core.Extension.create({
2436
3416
  },
2437
3417
  handlePaste(view, event) {
2438
3418
  if (storage.plainTextMode) return false;
2439
- const slice = _chunkLA7PEGU3cjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
3419
+ const slice = _chunkCL37JGFWcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
2440
3420
  if (!slice) return false;
2441
3421
  event.preventDefault();
2442
3422
  view.dispatch(
@@ -2631,7 +3611,7 @@ var Autocorrect = _core.Extension.create({
2631
3611
  addCommands() {
2632
3612
  return {
2633
3613
  undoAutocorrect: () => ({ state, tr, dispatch }) => {
2634
- const last = _optionalChain([autocorrectPluginKey, 'access', _81 => _81.getState, 'call', _82 => _82(state), 'optionalAccess', _83 => _83.last]);
3614
+ const last = _optionalChain([autocorrectPluginKey, 'access', _128 => _128.getState, 'call', _129 => _129(state), 'optionalAccess', _130 => _130.last]);
2635
3615
  if (!last) return false;
2636
3616
  if (state.doc.textBetween(last.from, last.to) !== last.replacement) return false;
2637
3617
  if (dispatch) {
@@ -2681,7 +3661,7 @@ var Autocorrect = _core.Extension.create({
2681
3661
  }
2682
3662
  const insertTyped = () => {
2683
3663
  const tr2 = state.tr.insertText(text, from, to);
2684
- if (_optionalChain([pluginState, 'optionalAccess', _84 => _84.closePending])) _history.closeHistory.call(void 0, tr2);
3664
+ if (_optionalChain([pluginState, 'optionalAccess', _131 => _131.closePending])) _history.closeHistory.call(void 0, tr2);
2685
3665
  view.dispatch(tr2);
2686
3666
  };
2687
3667
  if (isIgnored(state, from, to)) return false;
@@ -2689,7 +3669,7 @@ var Autocorrect = _core.Extension.create({
2689
3669
  if (extension.options.ignorePromptTokens && isInsidePromptToken(textBefore)) {
2690
3670
  return false;
2691
3671
  }
2692
- const currentWord = _nullishCoalesce(_optionalChain([/\S*$/, 'access', _85 => _85.exec, 'call', _86 => _86(textBefore), 'optionalAccess', _87 => _87[0]]), () => ( ""));
3672
+ const currentWord = _nullishCoalesce(_optionalChain([/\S*$/, 'access', _132 => _132.exec, 'call', _133 => _133(textBefore), 'optionalAccess', _134 => _134[0]]), () => ( ""));
2693
3673
  if (/:\/\/|^www\./i.test(currentWord)) return false;
2694
3674
  const exceptions = extension.storage.exceptions;
2695
3675
  const found = findAutocorrection(textBefore, extension.options.rules, {
@@ -2697,7 +3677,7 @@ var Autocorrect = _core.Extension.create({
2697
3677
  isException: (value) => exceptions.has(value.toLowerCase())
2698
3678
  });
2699
3679
  if (!found) {
2700
- if (!_optionalChain([pluginState, 'optionalAccess', _88 => _88.closePending])) return false;
3680
+ if (!_optionalChain([pluginState, 'optionalAccess', _135 => _135.closePending])) return false;
2701
3681
  insertTyped();
2702
3682
  return true;
2703
3683
  }
@@ -2734,7 +3714,7 @@ var Autocorrect = _core.Extension.create({
2734
3714
  _history.closeHistory.call(void 0, tr);
2735
3715
  tr.setMeta(autocorrectPluginKey, { correction });
2736
3716
  view.dispatch(tr);
2737
- _optionalChain([extension, 'access', _89 => _89.options, 'access', _90 => _90.onCorrection, 'optionalCall', _91 => _91(correction)]);
3717
+ _optionalChain([extension, 'access', _136 => _136.options, 'access', _137 => _137.onCorrection, 'optionalCall', _138 => _138(correction)]);
2738
3718
  return true;
2739
3719
  };
2740
3720
  return [
@@ -2744,8 +3724,8 @@ var Autocorrect = _core.Extension.create({
2744
3724
  init: () => ({ last: null, closePending: false }),
2745
3725
  apply: (tr, prev) => {
2746
3726
  const meta = tr.getMeta(autocorrectPluginKey);
2747
- if (_optionalChain([meta, 'optionalAccess', _92 => _92.correction])) return { last: meta.correction, closePending: true };
2748
- if (_optionalChain([meta, 'optionalAccess', _93 => _93.undo])) return { last: null, closePending: true };
3727
+ if (_optionalChain([meta, 'optionalAccess', _139 => _139.correction])) return { last: meta.correction, closePending: true };
3728
+ if (_optionalChain([meta, 'optionalAccess', _140 => _140.undo])) return { last: null, closePending: true };
2749
3729
  if (!tr.docChanged) return prev;
2750
3730
  if (!prev.last && !prev.closePending) return prev;
2751
3731
  return { last: null, closePending: false };
@@ -2826,7 +3806,7 @@ function arraysEqual(a, b, eq) {
2826
3806
  }
2827
3807
  function scrollDomAtPos(view, pos, behavior = "smooth") {
2828
3808
  try {
2829
- const dom = _optionalChain([view, 'optionalAccess', _94 => _94.nodeDOM, 'optionalCall', _95 => _95(pos)]);
3809
+ const dom = _optionalChain([view, 'optionalAccess', _141 => _141.nodeDOM, 'optionalCall', _142 => _142(pos)]);
2830
3810
  if (dom && typeof dom.scrollIntoView === "function") {
2831
3811
  dom.scrollIntoView({ block: "start", behavior });
2832
3812
  }
@@ -2841,7 +3821,7 @@ function syncInitialContent(editor, sync) {
2841
3821
  errorOnInvalidContent: false
2842
3822
  });
2843
3823
  const tr = sync(_state.EditorState.create({ doc }));
2844
- if (_optionalChain([tr, 'optionalAccess', _96 => _96.docChanged])) editor.options.content = tr.doc;
3824
+ if (_optionalChain([tr, 'optionalAccess', _143 => _143.docChanged])) editor.options.content = tr.doc;
2845
3825
  } catch (e4) {
2846
3826
  }
2847
3827
  }
@@ -2922,7 +3902,7 @@ function createOutlineStore(editor) {
2922
3902
  const compute = () => {
2923
3903
  if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
2924
3904
  const headings = getOutline(editor);
2925
- const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _97 => _97(editor, headings), 'optionalAccess', _98 => _98.id]), () => ( null));
3905
+ const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _144 => _144(editor, headings), 'optionalAccess', _145 => _145.id]), () => ( null));
2926
3906
  const sameStructure = arraysEqual(snapshot.headings, headings, sameHeading);
2927
3907
  if (sameStructure && snapshot.activeId === activeId) return snapshot;
2928
3908
  return {
@@ -2947,16 +3927,16 @@ function createOutlineStore(editor) {
2947
3927
  subscribe(listener) {
2948
3928
  if (!listeners.size) {
2949
3929
  snapshot = compute();
2950
- _optionalChain([editor, 'optionalAccess', _99 => _99.on, 'call', _100 => _100("transaction", onTransaction)]);
3930
+ _optionalChain([editor, 'optionalAccess', _146 => _146.on, 'call', _147 => _147("transaction", onTransaction)]);
2951
3931
  }
2952
3932
  listeners.add(listener);
2953
3933
  return () => {
2954
3934
  listeners.delete(listener);
2955
- if (!listeners.size) _optionalChain([editor, 'optionalAccess', _101 => _101.off, 'call', _102 => _102("transaction", onTransaction)]);
3935
+ if (!listeners.size) _optionalChain([editor, 'optionalAccess', _148 => _148.off, 'call', _149 => _149("transaction", onTransaction)]);
2956
3936
  };
2957
3937
  },
2958
3938
  destroy() {
2959
- _optionalChain([editor, 'optionalAccess', _103 => _103.off, 'call', _104 => _104("transaction", onTransaction)]);
3939
+ _optionalChain([editor, 'optionalAccess', _150 => _150.off, 'call', _151 => _151("transaction", onTransaction)]);
2960
3940
  listeners.clear();
2961
3941
  }
2962
3942
  };
@@ -3031,7 +4011,7 @@ var Outline = _core.Extension.create({
3031
4011
  if (options.focus !== false) {
3032
4012
  tr.setSelection(_state.TextSelection.create(tr.doc, heading.pos + 1));
3033
4013
  tr.scrollIntoView();
3034
- _optionalChain([view, 'optionalAccess', _105 => _105.focus, 'optionalCall', _106 => _106()]);
4014
+ _optionalChain([view, 'optionalAccess', _152 => _152.focus, 'optionalCall', _153 => _153()]);
3035
4015
  }
3036
4016
  scrollDomAtPos(view, heading.pos, options.behavior);
3037
4017
  }
@@ -3063,7 +4043,7 @@ var Outline = _core.Extension.create({
3063
4043
  const next = computeOutline(newState.doc, types);
3064
4044
  if (arraysEqual(prev, next, sameHeading)) return prev;
3065
4045
  storage.headings = next;
3066
- _optionalChain([onUpdate, 'call', _107 => _107(), 'optionalCall', _108 => _108(next)]);
4046
+ _optionalChain([onUpdate, 'call', _154 => _154(), 'optionalCall', _155 => _155(next)]);
3067
4047
  return next;
3068
4048
  }
3069
4049
  }
@@ -3382,7 +4362,7 @@ var TableOfContents = _core.Node.create({
3382
4362
  handleDOMEvents: {
3383
4363
  click: (view, event) => {
3384
4364
  const target = event.target;
3385
- const link = _optionalChain([target, 'optionalAccess', _109 => _109.closest, 'optionalCall', _110 => _110(
4365
+ const link = _optionalChain([target, 'optionalAccess', _156 => _156.closest, 'optionalCall', _157 => _157(
3386
4366
  'nav[data-type="table-of-contents"] a[data-heading-id]'
3387
4367
  )]);
3388
4368
  if (!link) return false;
@@ -3455,7 +4435,7 @@ function getFootnotes(doc) {
3455
4435
  number: index + 1,
3456
4436
  text: footnote ? footnoteText(footnote.node) : "",
3457
4437
  referencePos: ref.pos,
3458
- footnotePos: _nullishCoalesce(_optionalChain([footnote, 'optionalAccess', _111 => _111.pos]), () => ( null))
4438
+ footnotePos: _nullishCoalesce(_optionalChain([footnote, 'optionalAccess', _158 => _158.pos]), () => ( null))
3459
4439
  };
3460
4440
  });
3461
4441
  }
@@ -3497,7 +4477,7 @@ function syncFootnotes(tr, options = {}) {
3497
4477
  });
3498
4478
  const desiredItems = desiredRefs.map(({ id, number, copyOf }) => {
3499
4479
  const source = _nullishCoalesce(existing.get(id), () => ( (copyOf ? existing.get(copyOf) : void 0)));
3500
- const content = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _112 => _112.content]), () => ( paragraphsFromText(schema, _nullishCoalesce(_optionalChain([options, 'access', _113 => _113.contents, 'optionalAccess', _114 => _114[id]]), () => ( "")))));
4480
+ const content = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _159 => _159.content]), () => ( paragraphsFromText(schema, _nullishCoalesce(_optionalChain([options, 'access', _160 => _160.contents, 'optionalAccess', _161 => _161[id]]), () => ( "")))));
3501
4481
  if (source && source.attrs.id === id && source.attrs.number === number) {
3502
4482
  return source;
3503
4483
  }
@@ -3700,7 +4680,7 @@ var FootnoteReference = _core.Node.create({
3700
4680
  handleClickOn: (_view, _pos, node, _nodePos, event) => {
3701
4681
  if (node.type.name !== REFERENCE || !node.attrs.id) return false;
3702
4682
  const target = event.target;
3703
- if (!_optionalChain([target, 'optionalAccess', _115 => _115.closest, 'optionalCall', _116 => _116("a")])) return false;
4683
+ if (!_optionalChain([target, 'optionalAccess', _162 => _162.closest, 'optionalCall', _163 => _163("a")])) return false;
3704
4684
  event.preventDefault();
3705
4685
  return editor.commands.goToFootnote(node.attrs.id);
3706
4686
  }
@@ -3898,7 +4878,7 @@ var Bookmark = _core.Mark.create({
3898
4878
  }
3899
4879
  if (!dispatch) return true;
3900
4880
  const sameName = getBookmarks(state.doc).find((b) => b.name === name);
3901
- const bookmarkId = _nullishCoalesce(_nullishCoalesce(id, () => ( _optionalChain([sameName, 'optionalAccess', _117 => _117.id]))), () => ( this.options.generateId()));
4881
+ const bookmarkId = _nullishCoalesce(_nullishCoalesce(id, () => ( _optionalChain([sameName, 'optionalAccess', _164 => _164.id]))), () => ( this.options.generateId()));
3902
4882
  if (sameName) {
3903
4883
  forEachBookmarkRange(
3904
4884
  tr.doc,
@@ -4140,7 +5120,7 @@ var CrossReference = _core.Node.create({
4140
5120
  // src/extensions/document-structure/command-items.ts
4141
5121
  var start = (editor, args) => {
4142
5122
  const chain = editor.chain().focus();
4143
- return _optionalChain([args, 'optionalAccess', _118 => _118.range]) ? chain.deleteRange(args.range) : chain;
5123
+ return _optionalChain([args, 'optionalAccess', _165 => _165.range]) ? chain.deleteRange(args.range) : chain;
4144
5124
  };
4145
5125
  var documentStructureCommandItems = [
4146
5126
  {
@@ -4157,7 +5137,7 @@ var documentStructureCommandItems = [
4157
5137
  description: "Insert a numbered footnote",
4158
5138
  keywords: ["footnote", "note", "fn", "citation"],
4159
5139
  extension: "footnoteReference",
4160
- run: (editor, args) => start(editor, args).insertFootnote({ content: _optionalChain([args, 'optionalAccess', _119 => _119.content]) }).run()
5140
+ run: (editor, args) => start(editor, args).insertFootnote({ content: _optionalChain([args, 'optionalAccess', _166 => _166.content]) }).run()
4161
5141
  },
4162
5142
  {
4163
5143
  id: "bookmark",
@@ -4166,7 +5146,7 @@ var documentStructureCommandItems = [
4166
5146
  keywords: ["bookmark", "anchor", "name"],
4167
5147
  extension: "bookmark",
4168
5148
  requires: "name",
4169
- run: (editor, args) => !!_optionalChain([args, 'optionalAccess', _120 => _120.name]) && start(editor, args).setBookmark({ name: args.name }).run()
5149
+ run: (editor, args) => !!_optionalChain([args, 'optionalAccess', _167 => _167.name]) && start(editor, args).setBookmark({ name: args.name }).run()
4170
5150
  },
4171
5151
  {
4172
5152
  id: "cross-reference",
@@ -4175,7 +5155,7 @@ var documentStructureCommandItems = [
4175
5155
  keywords: ["cross", "reference", "xref", "link", "ref"],
4176
5156
  extension: "crossReference",
4177
5157
  requires: "target",
4178
- run: (editor, args) => !!_optionalChain([args, 'optionalAccess', _121 => _121.targetType]) && !!args.targetId && start(editor, args).insertCrossReference({ targetType: args.targetType, targetId: args.targetId }).run()
5158
+ run: (editor, args) => !!_optionalChain([args, 'optionalAccess', _168 => _168.targetType]) && !!args.targetId && start(editor, args).insertCrossReference({ targetType: args.targetType, targetId: args.targetId }).run()
4179
5159
  }
4180
5160
  ];
4181
5161
  function getDocumentStructureCommandItems(editor, query = "") {
@@ -4190,7 +5170,7 @@ function getDocumentStructureCommandItems(editor, query = "") {
4190
5170
  }
4191
5171
 
4192
5172
  // src/extensions/rich-text-preset.ts
4193
- var resolveExt3 = (mod, name) => _optionalChain([mod, 'optionalAccess', _122 => _122[name]]) || _optionalChain([mod, 'optionalAccess', _123 => _123.default, 'optionalAccess', _124 => _124[name]]) || _optionalChain([mod, 'optionalAccess', _125 => _125.default, 'optionalAccess', _126 => _126.default]) || _optionalChain([mod, 'optionalAccess', _127 => _127.default]) || mod;
5173
+ var resolveExt3 = (mod, name) => _optionalChain([mod, 'optionalAccess', _169 => _169[name]]) || _optionalChain([mod, 'optionalAccess', _170 => _170.default, 'optionalAccess', _171 => _171[name]]) || _optionalChain([mod, 'optionalAccess', _172 => _172.default, 'optionalAccess', _173 => _173.default]) || _optionalChain([mod, 'optionalAccess', _174 => _174.default]) || mod;
4194
5174
  var StarterKit = resolveExt3(_StarterKit, "StarterKit");
4195
5175
  var Color = resolveExt3(_Color, "Color");
4196
5176
  var Highlight = resolveExt3(_Highlight, "Highlight");
@@ -4271,7 +5251,7 @@ function createRichTextPreset(options = {}) {
4271
5251
  find: /^\s*(\[([ |x])?\])\s$/i,
4272
5252
  type: this.type,
4273
5253
  getAttributes: (match) => ({
4274
- checked: _optionalChain([match, 'access', _128 => _128[2], 'optionalAccess', _129 => _129.toLowerCase, 'call', _130 => _130()]) === "x"
5254
+ checked: _optionalChain([match, 'access', _175 => _175[2], 'optionalAccess', _176 => _176.toLowerCase, 'call', _177 => _177()]) === "x"
4275
5255
  })
4276
5256
  })
4277
5257
  ];
@@ -4345,7 +5325,7 @@ function createRichTextPreset(options = {}) {
4345
5325
  }
4346
5326
  if (options.trackChanges) {
4347
5327
  extensions2.push(
4348
- typeof options.trackChanges === "object" ? _chunkTVRC4KVTcjs.TrackChanges.configure(options.trackChanges) : _chunkTVRC4KVTcjs.TrackChanges
5328
+ typeof options.trackChanges === "object" ? _chunkAA4ZEVCCcjs.TrackChanges.configure(options.trackChanges) : _chunkAA4ZEVCCcjs.TrackChanges
4349
5329
  );
4350
5330
  }
4351
5331
  if (options.fileImport) {
@@ -4476,5 +5456,17 @@ function createRichTextPreset(options = {}) {
4476
5456
 
4477
5457
 
4478
5458
 
4479
- exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; exports.LoadingNode = LoadingNode; exports.SMILIE_REPLACEMENTS = SMILIE_REPLACEMENTS; exports.smilieAutocorrectRules = smilieAutocorrectRules; exports.SmilieReplacer = SmilieReplacer; exports.findHexColors = findHexColors; exports.ColorHighlighter = ColorHighlighter; exports.FontSize = FontSize; exports.Mention = Mention; exports.createMentionExtension = createMentionExtension; exports.Markdown = Markdown2; exports.imagePastePluginKey = imagePastePluginKey; exports.insertImageNode = insertImageNode; exports.updateImageSrc = updateImageSrc; exports.removeImageNode = removeImageNode; exports.handleImageInsertion = handleImageInsertion; exports.Image = Image2; exports.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; exports.ImportError = ImportError; exports.createImportContext = createImportContext; exports.ImportAdapterRegistry = ImportAdapterRegistry; exports.markdownImportAdapter = markdownImportAdapter; exports.htmlImportAdapter = htmlImportAdapter; exports.plainTextImportAdapter = plainTextImportAdapter; exports.rtfImportAdapter = rtfImportAdapter; exports.BUILT_IN_IMPORT_ADAPTERS = BUILT_IN_IMPORT_ADAPTERS; exports.createImportAdapterRegistry = createImportAdapterRegistry; exports.defaultImportRegistry = defaultImportRegistry; exports.registerImportAdapter = registerImportAdapter; exports.unregisterImportAdapter = unregisterImportAdapter; exports.findImportAdapter = findImportAdapter; exports.importFile = importFile; exports.getImportAccept = getImportAccept; exports.htmlToSlice = htmlToSlice; exports.insertImportedDocument = insertImportedDocument; exports.importFilesIntoEditor = importFilesIntoEditor; exports.fileImportPluginKey = fileImportPluginKey; exports.FileImport = FileImport; exports.richClipboardPluginKey = richClipboardPluginKey; exports.writeRichClipboard = writeRichClipboard; exports.RichClipboard = RichClipboard; exports.smartQuoteRules = smartQuoteRules; exports.symbolRules = symbolRules; exports.fractionRules = fractionRules; exports.capitalizeSentenceRules = capitalizeSentenceRules; exports.twoInitialCapitalsRules = twoInitialCapitalsRules; exports.defaultAutocorrectRules = defaultAutocorrectRules; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.autocorrectPluginKey = autocorrectPluginKey; exports.findAutocorrection = findAutocorrection; exports.isInsidePromptToken = isInsidePromptToken; exports.Autocorrect = Autocorrect; exports.outlinePluginKey = outlinePluginKey; exports.computeOutline = computeOutline; exports.buildOutlineTree = buildOutlineTree; exports.getOutline = getOutline; exports.getActiveHeading = getActiveHeading; exports.createOutlineStore = createOutlineStore; exports.navigateToHeading = navigateToHeading; exports.Outline = Outline; exports.tableOfContentsMarkdownIt = tableOfContentsMarkdownIt; exports.footnotesMarkdownIt = footnotesMarkdownIt; exports.tableOfContentsPluginKey = tableOfContentsPluginKey; exports.getTableOfContentsEntries = getTableOfContentsEntries; exports.TableOfContents = TableOfContents; exports.footnotesPluginKey = footnotesPluginKey; exports.getFootnotes = getFootnotes; exports.syncFootnotes = syncFootnotes; exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.getBookmarks = getBookmarks; exports.Bookmark = Bookmark; exports.crossReferencePluginKey = crossReferencePluginKey; exports.getCrossReferenceTargets = getCrossReferenceTargets; exports.CrossReference = CrossReference; exports.documentStructureCommandItems = documentStructureCommandItems; exports.getDocumentStructureCommandItems = getDocumentStructureCommandItems; exports.createRichTextPreset = createRichTextPreset;
4480
- //# sourceMappingURL=chunk-4QPLEUL2.cjs.map
5459
+
5460
+
5461
+
5462
+
5463
+
5464
+
5465
+
5466
+
5467
+
5468
+
5469
+
5470
+
5471
+ exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; exports.LoadingNode = LoadingNode; exports.SMILIE_REPLACEMENTS = SMILIE_REPLACEMENTS; exports.smilieAutocorrectRules = smilieAutocorrectRules; exports.SmilieReplacer = SmilieReplacer; exports.findHexColors = findHexColors; exports.ColorHighlighter = ColorHighlighter; exports.FontSize = FontSize; exports.Mention = Mention; exports.createMentionExtension = createMentionExtension; exports.Markdown = Markdown2; exports.imagePastePluginKey = imagePastePluginKey; exports.insertImageNode = insertImageNode; exports.updateImageSrc = updateImageSrc; exports.removeImageNode = removeImageNode; exports.handleImageInsertion = handleImageInsertion; exports.Image = Image2; exports.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; exports.ImportError = ImportError; exports.createImportContext = createImportContext; exports.ImportAdapterRegistry = ImportAdapterRegistry; exports.ZipError = ZipError; exports.DEFAULT_ZIP_MAX_ENTRIES = DEFAULT_ZIP_MAX_ENTRIES; exports.DEFAULT_ZIP_MAX_TOTAL_SIZE = DEFAULT_ZIP_MAX_TOTAL_SIZE; exports.zipCrc32 = zipCrc32; exports.isUnsafeZipPath = isUnsafeZipPath; exports.ZipArchive = ZipArchive; exports.readZip = readZip; exports.DOCX_MIME_TYPES = DOCX_MIME_TYPES; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.docxToDocumentImport = docxToDocumentImport; exports.createDocxImportAdapter = createDocxImportAdapter; exports.docxImportAdapter = docxImportAdapter; exports.markdownImportAdapter = markdownImportAdapter; exports.htmlImportAdapter = htmlImportAdapter; exports.plainTextImportAdapter = plainTextImportAdapter; exports.rtfImportAdapter = rtfImportAdapter; exports.BUILT_IN_IMPORT_ADAPTERS = BUILT_IN_IMPORT_ADAPTERS; exports.createImportAdapterRegistry = createImportAdapterRegistry; exports.defaultImportRegistry = defaultImportRegistry; exports.registerImportAdapter = registerImportAdapter; exports.unregisterImportAdapter = unregisterImportAdapter; exports.findImportAdapter = findImportAdapter; exports.importFile = importFile; exports.getImportAccept = getImportAccept; exports.htmlToSlice = htmlToSlice; exports.insertImportedDocument = insertImportedDocument; exports.importFilesIntoEditor = importFilesIntoEditor; exports.fileImportPluginKey = fileImportPluginKey; exports.FileImport = FileImport; exports.richClipboardPluginKey = richClipboardPluginKey; exports.writeRichClipboard = writeRichClipboard; exports.RichClipboard = RichClipboard; exports.smartQuoteRules = smartQuoteRules; exports.symbolRules = symbolRules; exports.fractionRules = fractionRules; exports.capitalizeSentenceRules = capitalizeSentenceRules; exports.twoInitialCapitalsRules = twoInitialCapitalsRules; exports.defaultAutocorrectRules = defaultAutocorrectRules; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.autocorrectPluginKey = autocorrectPluginKey; exports.findAutocorrection = findAutocorrection; exports.isInsidePromptToken = isInsidePromptToken; exports.Autocorrect = Autocorrect; exports.outlinePluginKey = outlinePluginKey; exports.computeOutline = computeOutline; exports.buildOutlineTree = buildOutlineTree; exports.getOutline = getOutline; exports.getActiveHeading = getActiveHeading; exports.createOutlineStore = createOutlineStore; exports.navigateToHeading = navigateToHeading; exports.Outline = Outline; exports.tableOfContentsMarkdownIt = tableOfContentsMarkdownIt; exports.footnotesMarkdownIt = footnotesMarkdownIt; exports.tableOfContentsPluginKey = tableOfContentsPluginKey; exports.getTableOfContentsEntries = getTableOfContentsEntries; exports.TableOfContents = TableOfContents; exports.footnotesPluginKey = footnotesPluginKey; exports.getFootnotes = getFootnotes; exports.syncFootnotes = syncFootnotes; exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.getBookmarks = getBookmarks; exports.Bookmark = Bookmark; exports.crossReferencePluginKey = crossReferencePluginKey; exports.getCrossReferenceTargets = getCrossReferenceTargets; exports.CrossReference = CrossReference; exports.documentStructureCommandItems = documentStructureCommandItems; exports.getDocumentStructureCommandItems = getDocumentStructureCommandItems; exports.createRichTextPreset = createRichTextPreset;
5472
+ //# sourceMappingURL=chunk-GVSMRPHB.cjs.map