@filens/converter-client 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,2752 @@
1
+ var lt = Object.defineProperty;
2
+ var Ft = (e, t, r) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var y = (e, t, r) => Ft(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { gunzipSync as gt } from "fflate";
5
+ function p(e) {
6
+ if (e != null && e.aborted) throw K();
7
+ }
8
+ function K() {
9
+ return Object.assign(new Error("The conversion was aborted."), { name: "AbortError" });
10
+ }
11
+ function f(e, t) {
12
+ return t ? new Promise((r, o) => {
13
+ const a = () => o(K());
14
+ e.then(
15
+ (s) => {
16
+ t.removeEventListener("abort", a), r(s);
17
+ },
18
+ (s) => {
19
+ t.removeEventListener("abort", a), o(s);
20
+ }
21
+ ), t.aborted ? a() : t.addEventListener("abort", a, { once: !0 });
22
+ }) : e;
23
+ }
24
+ function D(e) {
25
+ let t;
26
+ return () => {
27
+ if (!t) {
28
+ const r = Promise.resolve().then(e);
29
+ t = r, r.catch(() => {
30
+ t === r && (t = void 0);
31
+ });
32
+ }
33
+ return t;
34
+ };
35
+ }
36
+ function X(e) {
37
+ return /^(?:https?:|blob:|\/|\.{1,2}\/)/i.test(e);
38
+ }
39
+ function Q(e) {
40
+ return e.trimStart().toLowerCase().startsWith("data:");
41
+ }
42
+ function Z(e) {
43
+ const t = atob(e), r = new Uint8Array(t.length);
44
+ for (let o = 0; o < r.length; o++) r[o] = t.charCodeAt(o);
45
+ return r;
46
+ }
47
+ function q(e) {
48
+ var m;
49
+ const t = e.trimStart(), r = t.indexOf(",");
50
+ if (r < 0) throw new Error("Conversion data URL is missing its payload separator.");
51
+ const o = t.slice(0, r), a = t.slice(r + 1), s = (m = o.match(/^data:([^;,]+)/i)) == null ? void 0 : m[1];
52
+ if (/;base64$/i.test(o)) return { bytes: Z(a), contentType: s };
53
+ const n = new TextEncoder().encode(a);
54
+ let c = 0;
55
+ for (let i = 0; i < n.length; i++) {
56
+ if (n[i] === 37) {
57
+ const d = $(n[i + 1]), l = $(n[i + 2]);
58
+ if (d >= 0 && l >= 0) {
59
+ n[c++] = d << 4 | l, i += 2;
60
+ continue;
61
+ }
62
+ }
63
+ n[c++] = n[i];
64
+ }
65
+ return { bytes: n.subarray(0, c), contentType: s };
66
+ }
67
+ function $(e) {
68
+ if (e >= 48 && e <= 57) return e - 48;
69
+ const t = e | 32;
70
+ return t >= 97 && t <= 102 ? t - 87 : -1;
71
+ }
72
+ async function tt(e, t = globalThis.fetch, r, o = 1 / 0) {
73
+ var s;
74
+ const a = (n) => {
75
+ if (n > o) throw new Error("Conversion source exceeds the preview byte limit.");
76
+ };
77
+ if (xt(e)) {
78
+ a(e.size);
79
+ const n = new Uint8Array(await f(e.arrayBuffer(), r));
80
+ return a(n.length), n;
81
+ }
82
+ if (e instanceof ArrayBuffer)
83
+ return a(e.byteLength), new Uint8Array(e);
84
+ if (ArrayBuffer.isView(e))
85
+ return a(e.byteLength), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
86
+ if (typeof e == "string") {
87
+ if (Q(e)) {
88
+ a(Math.max(0, e.length - e.indexOf(",") - 1) / 3);
89
+ const c = q(e).bytes;
90
+ return a(c.length), c;
91
+ }
92
+ if (X(e)) {
93
+ if (!t) throw new Error("A fetch implementation is required to load a conversion source URL.");
94
+ const c = await f(t(e, { signal: r }), r);
95
+ if (p(r), !c.ok)
96
+ throw new Error(`Failed to fetch conversion source: ${c.status} ${c.statusText}`.trim());
97
+ try {
98
+ if (a(Number(c.headers.get("content-length"))), !Number.isFinite(o) || !c.body) {
99
+ const i = new Uint8Array(await f(c.arrayBuffer(), r));
100
+ return a(i.length), i;
101
+ }
102
+ const m = c.body.getReader();
103
+ try {
104
+ const i = [];
105
+ let d = 0;
106
+ for (; ; ) {
107
+ const { value: g, done: A } = await f(m.read(), r);
108
+ if (A) break;
109
+ d += g.length, a(d), i.push(g);
110
+ }
111
+ const l = new Uint8Array(d);
112
+ let h = 0;
113
+ for (const g of i)
114
+ l.set(g, h), h += g.length;
115
+ return l;
116
+ } finally {
117
+ await m.cancel().catch(() => {
118
+ }), m.releaseLock();
119
+ }
120
+ } catch (m) {
121
+ throw await ((s = c.body) == null ? void 0 : s.cancel().catch(() => {
122
+ })), m;
123
+ }
124
+ }
125
+ a(e.length);
126
+ const n = new TextEncoder().encode(e);
127
+ return a(n.length), n;
128
+ }
129
+ throw new Error("Unsupported conversion source type.");
130
+ }
131
+ function xt(e) {
132
+ return typeof e == "object" && e !== null && "arrayBuffer" in e && typeof e.arrayBuffer == "function";
133
+ }
134
+ async function ft(e) {
135
+ var r;
136
+ if (((r = e.headers.get("content-type")) == null ? void 0 : r.split(";", 1)[0]) !== "application/wasm+gzip") return e;
137
+ if (typeof DecompressionStream < "u" && e.body)
138
+ return new Response(e.body.pipeThrough(new DecompressionStream("gzip")), {
139
+ headers: { "content-type": "application/wasm" }
140
+ });
141
+ const t = gt(new Uint8Array(await e.arrayBuffer()));
142
+ return new Response(t, { headers: { "content-type": "application/wasm" } });
143
+ }
144
+ function T(e) {
145
+ const t = D(() => rt(e.wasm, e.fetch));
146
+ return async (r) => {
147
+ const o = r.signal;
148
+ p(o);
149
+ const a = new at({
150
+ args: r.args,
151
+ files: r.files,
152
+ captureStdio: r.captureStdio
153
+ }), s = await f(t(), o);
154
+ p(o);
155
+ const n = await f(WebAssembly.instantiate(s, {
156
+ wasi_snapshot_preview1: a.imports
157
+ }), o);
158
+ p(o), a.setInstance(n);
159
+ let c = 0;
160
+ try {
161
+ n.exports._start();
162
+ } catch (m) {
163
+ if (m instanceof et)
164
+ c = m.code;
165
+ else
166
+ throw m;
167
+ }
168
+ return {
169
+ exitCode: c,
170
+ ...r.captureStdio ? { stdout: a.readStdio(1), stderr: a.readStdio(2) } : {},
171
+ files: Object.fromEntries((r.readFiles ?? []).flatMap((m) => {
172
+ const i = a.readFileIfPresent(m);
173
+ return i ? [[m, i]] : [];
174
+ }))
175
+ };
176
+ };
177
+ }
178
+ async function rt(e, t = globalThis.fetch) {
179
+ const r = typeof e == "function" ? await e() : await e;
180
+ if (r instanceof WebAssembly.Module)
181
+ return r;
182
+ if (typeof r == "string" || ht(r)) {
183
+ if (!t)
184
+ throw new Error("A fetch implementation is required to load converter WASM from a URL.");
185
+ return P(await t(String(r)));
186
+ }
187
+ return typeof Response < "u" && r instanceof Response ? P(r) : WebAssembly.compile(r);
188
+ }
189
+ function ht(e) {
190
+ return typeof URL < "u" && e instanceof URL;
191
+ }
192
+ async function P(e) {
193
+ var r;
194
+ if (!e.ok)
195
+ throw new Error(`Failed to fetch converter WASM: ${e.status} ${e.statusText}`.trim());
196
+ const t = await ft(e);
197
+ return typeof WebAssembly.compileStreaming == "function" && ((r = t.headers.get("content-type")) == null ? void 0 : r.split(";", 1)[0]) === "application/wasm" ? WebAssembly.compileStreaming(t) : WebAssembly.compile(await t.arrayBuffer());
198
+ }
199
+ class et extends Error {
200
+ constructor(t) {
201
+ super(`WASI exited with code ${t}`), this.code = t;
202
+ }
203
+ }
204
+ const u = 0, x = 8, wt = 20, z = 28, S = 31, C = 44, G = 54, I = 55, ot = 2, O = 3, W = 4, H = 1, yt = 2, bt = 4, vt = 8, V = 1;
205
+ class at {
206
+ constructor(t) {
207
+ y(this, "imports", {
208
+ args_get: (t, r) => this.argsGet(t, r),
209
+ args_sizes_get: (t, r) => this.argsSizesGet(t, r),
210
+ clock_time_get: (t, r, o) => this.clockTimeGet(o),
211
+ environ_get: (t, r) => u,
212
+ environ_sizes_get: (t, r) => this.environSizesGet(t, r),
213
+ fd_close: (t) => this.fdClose(t),
214
+ fd_fdstat_get: (t, r) => this.fdFdstatGet(t, r),
215
+ fd_fdstat_set_flags: (t, r) => u,
216
+ fd_filestat_get: (t, r) => this.fdFilestatGet(t, r),
217
+ fd_pread: (t, r, o, a, s) => this.fdRead(t, r, o, s, Number(a), !1),
218
+ fd_prestat_dir_name: (t, r, o) => this.fdPrestatDirName(t, r, o),
219
+ fd_prestat_get: (t, r) => this.fdPrestatGet(t, r),
220
+ fd_read: (t, r, o, a) => this.fdRead(t, r, o, a),
221
+ fd_seek: (t, r, o, a) => this.fdSeek(t, r, o, a),
222
+ fd_tell: (t, r) => this.fdTell(t, r),
223
+ fd_write: (t, r, o, a) => this.fdWrite(t, r, o, a),
224
+ path_create_directory: (t, r, o) => this.pathCreateDirectory(t, r, o),
225
+ path_filestat_get: (t, r, o, a, s) => this.pathFilestatGet(t, o, a, s),
226
+ path_open: (t, r, o, a, s, n, c, m, i) => this.pathOpen(t, o, a, s, m, i),
227
+ path_remove_directory: (t, r, o) => this.pathRemoveDirectory(t, r, o),
228
+ path_unlink_file: (t, r, o) => this.pathUnlinkFile(t, r, o),
229
+ poll_oneoff: (t, r, o, a) => this.pollOneoff(a),
230
+ proc_exit: (t) => {
231
+ throw new et(t);
232
+ },
233
+ random_get: (t, r) => this.randomGet(t, r),
234
+ sched_yield: () => u
235
+ });
236
+ y(this, "instance");
237
+ y(this, "captureStdio");
238
+ y(this, "stdio", { 1: [], 2: [] });
239
+ y(this, "args");
240
+ y(this, "files", /* @__PURE__ */ new Map());
241
+ y(this, "dirs", /* @__PURE__ */ new Set(["/", "/work"]));
242
+ y(this, "fds", /* @__PURE__ */ new Map([
243
+ [0, { kind: "stdio", fd: 0, position: 0 }],
244
+ [1, { kind: "stdio", fd: 1, position: 0 }],
245
+ [2, { kind: "stdio", fd: 2, position: 0 }],
246
+ [3, { kind: "dir", path: "/work", position: 0 }]
247
+ ]));
248
+ y(this, "nextFd", 4);
249
+ this.args = t.args, this.captureStdio = t.captureStdio ?? !1;
250
+ for (const [r, o] of Object.entries(t.files))
251
+ this.writeInitialFile(r, o);
252
+ }
253
+ setInstance(t) {
254
+ this.instance = t;
255
+ }
256
+ readStdio(t) {
257
+ return new TextDecoder().decode(new Uint8Array(this.stdio[t]));
258
+ }
259
+ readFile(t) {
260
+ const r = this.files.get(j(t));
261
+ if (!r)
262
+ throw new Error(`WASM file was not written: ${t}`);
263
+ const o = new Uint8Array(r.byteLength);
264
+ return o.set(r), o;
265
+ }
266
+ readFileIfPresent(t) {
267
+ return this.files.has(j(t)) ? this.readFile(t) : void 0;
268
+ }
269
+ get memory() {
270
+ var r;
271
+ const t = (r = this.instance) == null ? void 0 : r.exports.memory;
272
+ if (!(t instanceof WebAssembly.Memory))
273
+ throw new Error("WASM instance did not export memory.");
274
+ return t;
275
+ }
276
+ get bytes() {
277
+ return new Uint8Array(this.memory.buffer);
278
+ }
279
+ get view() {
280
+ return new DataView(this.memory.buffer);
281
+ }
282
+ argsSizesGet(t, r) {
283
+ return this.view.setUint32(t, this.args.length, !0), this.view.setUint32(r, kt(this.args), !0), u;
284
+ }
285
+ argsGet(t, r) {
286
+ return this.writeStringList(this.args, t, r);
287
+ }
288
+ environSizesGet(t, r) {
289
+ return this.view.setUint32(t, 0, !0), this.view.setUint32(r, 0, !0), u;
290
+ }
291
+ clockTimeGet(t) {
292
+ return this.view.setBigUint64(t, BigInt(Date.now()) * 1000000n, !0), u;
293
+ }
294
+ fdClose(t) {
295
+ return t <= 3 || this.fds.delete(t) ? u : x;
296
+ }
297
+ fdFdstatGet(t, r) {
298
+ const o = this.fds.get(t);
299
+ return o ? (this.bytes.fill(0, r, r + 24), this.bytes[r] = jt(o), this.view.setBigUint64(r + 8, 0xffffffffffffffffn, !0), this.view.setBigUint64(r + 16, 0xffffffffffffffffn, !0), u) : x;
300
+ }
301
+ fdFilestatGet(t, r) {
302
+ var a;
303
+ const o = this.fds.get(t);
304
+ return o ? o.kind === "file" ? (this.writeFilestat(r, W, ((a = this.files.get(o.path)) == null ? void 0 : a.byteLength) ?? 0), u) : o.kind === "dir" ? (this.writeFilestat(r, O, 0), u) : (this.writeFilestat(r, ot, 0), u) : x;
305
+ }
306
+ fdPrestatGet(t, r) {
307
+ const o = this.fds.get(t);
308
+ return !o || o.kind !== "dir" || o.path !== "/work" ? x : (this.bytes.fill(0, r, r + 8), this.view.setUint32(r + 4, o.path.length, !0), u);
309
+ }
310
+ fdPrestatDirName(t, r, o) {
311
+ const a = this.fds.get(t);
312
+ if (!a || a.kind !== "dir")
313
+ return x;
314
+ const s = new TextEncoder().encode(a.path);
315
+ return this.bytes.set(s.subarray(0, o), r), u;
316
+ }
317
+ fdRead(t, r, o, a, s, n = !0) {
318
+ const c = this.fds.get(t);
319
+ if (!c)
320
+ return x;
321
+ if (c.kind !== "file")
322
+ return this.view.setUint32(a, 0, !0), c.kind === "dir" ? S : u;
323
+ const m = this.files.get(c.path) ?? new Uint8Array();
324
+ let i = s ?? c.position, d = 0;
325
+ for (const [l, h] of this.iovs(r, o)) {
326
+ const g = m.subarray(i, i + h);
327
+ if (this.bytes.set(g, l), i += g.byteLength, d += g.byteLength, g.byteLength < h)
328
+ break;
329
+ }
330
+ return n && s === void 0 && (c.position = i), this.view.setUint32(a, d, !0), u;
331
+ }
332
+ fdSeek(t, r, o, a) {
333
+ var m;
334
+ const s = this.fds.get(t);
335
+ if (!s || s.kind !== "file")
336
+ return (s == null ? void 0 : s.kind) === "dir" ? S : x;
337
+ if (o !== 0 && o !== 1 && o !== 2) return z;
338
+ const c = (o === 0 ? 0 : o === 1 ? s.position : o === 2 ? ((m = this.files.get(s.path)) == null ? void 0 : m.byteLength) ?? 0 : -1) + Number(r);
339
+ return !Number.isSafeInteger(c) || c < 0 ? z : (s.position = c, this.view.setBigUint64(a, BigInt(c), !0), u);
340
+ }
341
+ fdTell(t, r) {
342
+ const o = this.fds.get(t);
343
+ return !o || o.kind !== "file" ? (o == null ? void 0 : o.kind) === "dir" ? S : x : (this.view.setBigUint64(r, BigInt(o.position), !0), u);
344
+ }
345
+ fdWrite(t, r, o, a) {
346
+ const s = this.fds.get(t);
347
+ if (!s)
348
+ return x;
349
+ let n = 0;
350
+ if (s.kind === "stdio") {
351
+ for (const [c, m] of this.iovs(r, o)) {
352
+ const i = this.captureStdio ? this.stdio[s.fd] : void 0;
353
+ if (i) {
354
+ const d = c + Math.min(m, Math.max(0, 1048576 - i.length)), l = this.bytes;
355
+ for (let h = c; h < d; h++) i.push(l[h]);
356
+ }
357
+ n += m;
358
+ }
359
+ return this.view.setUint32(a, n, !0), u;
360
+ }
361
+ if (s.kind !== "file")
362
+ return S;
363
+ for (const [c, m] of this.iovs(r, o)) {
364
+ const i = this.bytes.subarray(c, c + m);
365
+ this.writeFileChunk(s, i), n += m;
366
+ }
367
+ return this.view.setUint32(a, n, !0), u;
368
+ }
369
+ pathCreateDirectory(t, r, o) {
370
+ const a = this.readPath(t, r, o);
371
+ return a ? (this.ensureParentDir(a), this.files.has(a) ? G : (this.dirs.add(a), u)) : x;
372
+ }
373
+ pathFilestatGet(t, r, o, a) {
374
+ var n;
375
+ const s = this.readPath(t, r, o);
376
+ return s ? this.files.has(s) ? (this.writeFilestat(a, W, ((n = this.files.get(s)) == null ? void 0 : n.byteLength) ?? 0), u) : this.dirs.has(s) ? (this.writeFilestat(a, O, 0), u) : C : x;
377
+ }
378
+ pathOpen(t, r, o, a, s, n) {
379
+ var i;
380
+ const c = this.readPath(t, r, o);
381
+ if (!c)
382
+ return x;
383
+ if (a & H && a & bt && (this.files.has(c) || this.dirs.has(c)))
384
+ return wt;
385
+ if (!!(a & yt))
386
+ return this.dirs.has(c) ? this.openDescriptor({ kind: "dir", path: c, position: 0 }, n) : this.files.has(c) ? G : C;
387
+ if (this.files.has(c))
388
+ a & vt && this.files.set(c, new Uint8Array());
389
+ else {
390
+ if (!(a & H))
391
+ return this.dirs.has(c) ? S : C;
392
+ this.ensureParentDir(c), this.files.set(c, new Uint8Array());
393
+ }
394
+ return this.openDescriptor(
395
+ {
396
+ kind: "file",
397
+ path: c,
398
+ position: s & V ? ((i = this.files.get(c)) == null ? void 0 : i.byteLength) ?? 0 : 0,
399
+ append: !!(s & V)
400
+ },
401
+ n
402
+ );
403
+ }
404
+ pathRemoveDirectory(t, r, o) {
405
+ const a = this.readPath(t, r, o);
406
+ if (!a)
407
+ return x;
408
+ if (a === "/" || a === "/work")
409
+ return I;
410
+ for (const s of this.dirs)
411
+ if (s !== a && N(s) === a)
412
+ return I;
413
+ for (const s of this.files.keys())
414
+ if (N(s) === a)
415
+ return I;
416
+ return this.dirs.delete(a) ? u : C;
417
+ }
418
+ pathUnlinkFile(t, r, o) {
419
+ const a = this.readPath(t, r, o);
420
+ return a ? this.files.delete(a) ? u : C : x;
421
+ }
422
+ pollOneoff(t) {
423
+ return this.view.setUint32(t, 0, !0), u;
424
+ }
425
+ randomGet(t, r) {
426
+ const o = this.bytes.subarray(t, t + r), a = globalThis.crypto;
427
+ if (a != null && a.getRandomValues)
428
+ a.getRandomValues(o);
429
+ else
430
+ for (let s = 0; s < o.length; s += 1)
431
+ o[s] = Math.floor(Math.random() * 256);
432
+ return u;
433
+ }
434
+ writeStringList(t, r, o) {
435
+ let a = o;
436
+ for (let s = 0; s < t.length; s += 1) {
437
+ const n = new TextEncoder().encode(t[s]);
438
+ this.view.setUint32(r + s * 4, a, !0), this.bytes.set(n, a), this.bytes[a + n.byteLength] = 0, a += n.byteLength + 1;
439
+ }
440
+ return u;
441
+ }
442
+ iovs(t, r) {
443
+ const o = [];
444
+ for (let a = 0; a < r; a += 1) {
445
+ const s = t + a * 8;
446
+ o.push([this.view.getUint32(s, !0), this.view.getUint32(s + 4, !0)]);
447
+ }
448
+ return o;
449
+ }
450
+ readPath(t, r, o) {
451
+ const a = this.fds.get(t);
452
+ if (!a || a.kind !== "dir")
453
+ return null;
454
+ const s = new TextDecoder().decode(this.bytes.subarray(r, r + o));
455
+ return _t(a.path, s);
456
+ }
457
+ openDescriptor(t, r) {
458
+ const o = this.nextFd++;
459
+ return this.fds.set(o, t), this.view.setUint32(r, o, !0), u;
460
+ }
461
+ writeFilestat(t, r, o) {
462
+ this.bytes.fill(0, t, t + 64), this.bytes[t + 16] = r, this.view.setBigUint64(t + 24, 1n, !0), this.view.setBigUint64(t + 32, BigInt(o), !0);
463
+ }
464
+ writeInitialFile(t, r) {
465
+ const o = j(t);
466
+ this.ensureParentDir(o);
467
+ const a = new Uint8Array(r.byteLength);
468
+ a.set(r), this.files.set(o, a);
469
+ }
470
+ ensureParentDir(t) {
471
+ const r = N(t);
472
+ r === t || this.dirs.has(r) || (this.ensureParentDir(r), this.dirs.add(r));
473
+ }
474
+ writeFileChunk(t, r) {
475
+ if (!r.byteLength) return;
476
+ const o = this.files.get(t.path) ?? new Uint8Array(), a = t.append ? o.byteLength : t.position, s = Math.max(o.byteLength, a + r.byteLength);
477
+ let n;
478
+ if (s <= o.buffer.byteLength)
479
+ n = new Uint8Array(o.buffer, 0, s);
480
+ else {
481
+ const c = new Uint8Array(Math.max(s, o.buffer.byteLength * 2));
482
+ c.set(o), n = c.subarray(0, s);
483
+ }
484
+ n.set(r, a), this.files.set(t.path, n), t.position = a + r.byteLength;
485
+ }
486
+ }
487
+ function kt(e) {
488
+ return e.reduce((t, r) => t + new TextEncoder().encode(r).byteLength + 1, 0);
489
+ }
490
+ function jt(e) {
491
+ switch (e.kind) {
492
+ case "dir":
493
+ return O;
494
+ case "file":
495
+ return W;
496
+ default:
497
+ return ot;
498
+ }
499
+ }
500
+ function _t(e, t) {
501
+ return t.startsWith("/") ? j(t) : j(`${e}/${t}`);
502
+ }
503
+ function j(e) {
504
+ const t = [];
505
+ for (const r of e.replace(/\\/g, "/").split("/"))
506
+ if (!(!r || r === ".")) {
507
+ if (r === "..") {
508
+ t.pop();
509
+ continue;
510
+ }
511
+ t.push(r);
512
+ }
513
+ return `/${t.join("/")}`;
514
+ }
515
+ function N(e) {
516
+ const t = j(e);
517
+ if (t === "/")
518
+ return "/";
519
+ const r = t.lastIndexOf("/");
520
+ return r <= 0 ? "/" : t.slice(0, r);
521
+ }
522
+ const st = [
523
+ {
524
+ sourceFormat: "psd",
525
+ targetFormat: "png"
526
+ },
527
+ {
528
+ sourceFormat: "psb",
529
+ targetFormat: "png"
530
+ },
531
+ {
532
+ sourceFormat: "ai",
533
+ targetFormat: "pdf"
534
+ },
535
+ {
536
+ sourceFormat: "eps",
537
+ targetFormat: "pdf"
538
+ },
539
+ {
540
+ sourceFormat: "ps",
541
+ targetFormat: "pdf"
542
+ },
543
+ {
544
+ sourceFormat: "docx",
545
+ targetFormat: "docx"
546
+ },
547
+ {
548
+ sourceFormat: "xlsx",
549
+ targetFormat: "xlsx"
550
+ },
551
+ {
552
+ sourceFormat: "pptx",
553
+ targetFormat: "pptx"
554
+ },
555
+ {
556
+ sourceFormat: "ppt",
557
+ targetFormat: "pptx"
558
+ },
559
+ {
560
+ sourceFormat: "pps",
561
+ targetFormat: "pptx"
562
+ },
563
+ {
564
+ sourceFormat: "pot",
565
+ targetFormat: "pptx"
566
+ },
567
+ {
568
+ sourceFormat: "pptm",
569
+ targetFormat: "pptx"
570
+ },
571
+ {
572
+ sourceFormat: "ppsx",
573
+ targetFormat: "pptx"
574
+ },
575
+ {
576
+ sourceFormat: "ppsm",
577
+ targetFormat: "pptx"
578
+ },
579
+ {
580
+ sourceFormat: "potx",
581
+ targetFormat: "pptx"
582
+ },
583
+ {
584
+ sourceFormat: "potm",
585
+ targetFormat: "pptx"
586
+ },
587
+ {
588
+ sourceFormat: "dps",
589
+ targetFormat: "pptx"
590
+ },
591
+ {
592
+ sourceFormat: "dpt",
593
+ targetFormat: "pptx"
594
+ },
595
+ {
596
+ sourceFormat: "odp",
597
+ targetFormat: "pptx"
598
+ },
599
+ {
600
+ sourceFormat: "otp",
601
+ targetFormat: "pptx"
602
+ },
603
+ {
604
+ sourceFormat: "fodp",
605
+ targetFormat: "pptx"
606
+ },
607
+ {
608
+ sourceFormat: "sxi",
609
+ targetFormat: "pptx"
610
+ },
611
+ {
612
+ sourceFormat: "sti",
613
+ targetFormat: "pptx"
614
+ },
615
+ {
616
+ sourceFormat: "odg",
617
+ targetFormat: "pptx"
618
+ },
619
+ {
620
+ sourceFormat: "otg",
621
+ targetFormat: "pptx"
622
+ },
623
+ {
624
+ sourceFormat: "fodg",
625
+ targetFormat: "pptx"
626
+ },
627
+ {
628
+ sourceFormat: "sxd",
629
+ targetFormat: "pptx"
630
+ },
631
+ {
632
+ sourceFormat: "std",
633
+ targetFormat: "pptx"
634
+ },
635
+ {
636
+ sourceFormat: "doc",
637
+ targetFormat: "docx"
638
+ },
639
+ {
640
+ sourceFormat: "docm",
641
+ targetFormat: "docx"
642
+ },
643
+ {
644
+ sourceFormat: "dot",
645
+ targetFormat: "docx"
646
+ },
647
+ {
648
+ sourceFormat: "dotx",
649
+ targetFormat: "docx"
650
+ },
651
+ {
652
+ sourceFormat: "dotm",
653
+ targetFormat: "docx"
654
+ },
655
+ {
656
+ sourceFormat: "wps",
657
+ targetFormat: "docx"
658
+ },
659
+ {
660
+ sourceFormat: "wpt",
661
+ targetFormat: "docx"
662
+ },
663
+ {
664
+ sourceFormat: "rtf",
665
+ targetFormat: "docx"
666
+ },
667
+ {
668
+ sourceFormat: "odt",
669
+ targetFormat: "docx"
670
+ },
671
+ {
672
+ sourceFormat: "ott",
673
+ targetFormat: "docx"
674
+ },
675
+ {
676
+ sourceFormat: "fodt",
677
+ targetFormat: "docx"
678
+ },
679
+ {
680
+ sourceFormat: "sxw",
681
+ targetFormat: "docx"
682
+ },
683
+ {
684
+ sourceFormat: "stw",
685
+ targetFormat: "docx"
686
+ },
687
+ {
688
+ sourceFormat: "txt",
689
+ targetFormat: "docx"
690
+ },
691
+ {
692
+ sourceFormat: "text",
693
+ targetFormat: "docx"
694
+ },
695
+ {
696
+ sourceFormat: "md",
697
+ targetFormat: "docx"
698
+ },
699
+ {
700
+ sourceFormat: "markdown",
701
+ targetFormat: "docx"
702
+ },
703
+ {
704
+ sourceFormat: "mkd",
705
+ targetFormat: "docx"
706
+ },
707
+ {
708
+ sourceFormat: "mkdn",
709
+ targetFormat: "docx"
710
+ },
711
+ {
712
+ sourceFormat: "mdown",
713
+ targetFormat: "docx"
714
+ },
715
+ {
716
+ sourceFormat: "html",
717
+ targetFormat: "docx"
718
+ },
719
+ {
720
+ sourceFormat: "htm",
721
+ targetFormat: "docx"
722
+ },
723
+ {
724
+ sourceFormat: "shtml",
725
+ targetFormat: "docx"
726
+ },
727
+ {
728
+ sourceFormat: "xhtml",
729
+ targetFormat: "docx"
730
+ },
731
+ {
732
+ sourceFormat: "xht",
733
+ targetFormat: "docx"
734
+ },
735
+ {
736
+ sourceFormat: "xhtm",
737
+ targetFormat: "docx"
738
+ },
739
+ {
740
+ sourceFormat: "epub",
741
+ targetFormat: "docx"
742
+ },
743
+ {
744
+ sourceFormat: "fb2",
745
+ targetFormat: "docx"
746
+ },
747
+ {
748
+ sourceFormat: "xml",
749
+ targetFormat: "docx"
750
+ },
751
+ {
752
+ sourceFormat: "rss",
753
+ targetFormat: "docx"
754
+ },
755
+ {
756
+ sourceFormat: "atom",
757
+ targetFormat: "docx"
758
+ },
759
+ {
760
+ sourceFormat: "kml",
761
+ targetFormat: "docx"
762
+ },
763
+ {
764
+ sourceFormat: "gpx",
765
+ targetFormat: "docx"
766
+ },
767
+ {
768
+ sourceFormat: "ttml",
769
+ targetFormat: "docx"
770
+ },
771
+ {
772
+ sourceFormat: "dfxp",
773
+ targetFormat: "docx"
774
+ },
775
+ {
776
+ sourceFormat: "xsd",
777
+ targetFormat: "docx"
778
+ },
779
+ {
780
+ sourceFormat: "xsl",
781
+ targetFormat: "docx"
782
+ },
783
+ {
784
+ sourceFormat: "xslt",
785
+ targetFormat: "docx"
786
+ },
787
+ {
788
+ sourceFormat: "wsdl",
789
+ targetFormat: "docx"
790
+ },
791
+ {
792
+ sourceFormat: "plist",
793
+ targetFormat: "docx"
794
+ },
795
+ {
796
+ sourceFormat: "pom",
797
+ targetFormat: "docx"
798
+ },
799
+ {
800
+ sourceFormat: "yaml",
801
+ targetFormat: "docx"
802
+ },
803
+ {
804
+ sourceFormat: "yml",
805
+ targetFormat: "docx"
806
+ },
807
+ {
808
+ sourceFormat: "toml",
809
+ targetFormat: "docx"
810
+ },
811
+ {
812
+ sourceFormat: "ini",
813
+ targetFormat: "docx"
814
+ },
815
+ {
816
+ sourceFormat: "log",
817
+ targetFormat: "docx"
818
+ },
819
+ {
820
+ sourceFormat: "rst",
821
+ targetFormat: "docx"
822
+ },
823
+ {
824
+ sourceFormat: "rest",
825
+ targetFormat: "docx"
826
+ },
827
+ {
828
+ sourceFormat: "adoc",
829
+ targetFormat: "docx"
830
+ },
831
+ {
832
+ sourceFormat: "asciidoc",
833
+ targetFormat: "docx"
834
+ },
835
+ {
836
+ sourceFormat: "asc",
837
+ targetFormat: "docx"
838
+ },
839
+ {
840
+ sourceFormat: "tex",
841
+ targetFormat: "docx"
842
+ },
843
+ {
844
+ sourceFormat: "latex",
845
+ targetFormat: "docx"
846
+ },
847
+ {
848
+ sourceFormat: "ltx",
849
+ targetFormat: "docx"
850
+ },
851
+ {
852
+ sourceFormat: "sty",
853
+ targetFormat: "docx"
854
+ },
855
+ {
856
+ sourceFormat: "cls",
857
+ targetFormat: "docx"
858
+ },
859
+ {
860
+ sourceFormat: "properties",
861
+ targetFormat: "docx"
862
+ },
863
+ {
864
+ sourceFormat: "env",
865
+ targetFormat: "docx"
866
+ },
867
+ {
868
+ sourceFormat: "conf",
869
+ targetFormat: "docx"
870
+ },
871
+ {
872
+ sourceFormat: "config",
873
+ targetFormat: "docx"
874
+ },
875
+ {
876
+ sourceFormat: "cfg",
877
+ targetFormat: "docx"
878
+ },
879
+ {
880
+ sourceFormat: "cnf",
881
+ targetFormat: "docx"
882
+ },
883
+ {
884
+ sourceFormat: "sql",
885
+ targetFormat: "docx"
886
+ },
887
+ {
888
+ sourceFormat: "js",
889
+ targetFormat: "docx"
890
+ },
891
+ {
892
+ sourceFormat: "jsx",
893
+ targetFormat: "docx"
894
+ },
895
+ {
896
+ sourceFormat: "mjs",
897
+ targetFormat: "docx"
898
+ },
899
+ {
900
+ sourceFormat: "cjs",
901
+ targetFormat: "docx"
902
+ },
903
+ {
904
+ sourceFormat: "ts",
905
+ targetFormat: "docx"
906
+ },
907
+ {
908
+ sourceFormat: "tsx",
909
+ targetFormat: "docx"
910
+ },
911
+ {
912
+ sourceFormat: "mts",
913
+ targetFormat: "docx"
914
+ },
915
+ {
916
+ sourceFormat: "cts",
917
+ targetFormat: "docx"
918
+ },
919
+ {
920
+ sourceFormat: "vue",
921
+ targetFormat: "docx"
922
+ },
923
+ {
924
+ sourceFormat: "css",
925
+ targetFormat: "docx"
926
+ },
927
+ {
928
+ sourceFormat: "scss",
929
+ targetFormat: "docx"
930
+ },
931
+ {
932
+ sourceFormat: "sass",
933
+ targetFormat: "docx"
934
+ },
935
+ {
936
+ sourceFormat: "less",
937
+ targetFormat: "docx"
938
+ },
939
+ {
940
+ sourceFormat: "c",
941
+ targetFormat: "docx"
942
+ },
943
+ {
944
+ sourceFormat: "cpp",
945
+ targetFormat: "docx"
946
+ },
947
+ {
948
+ sourceFormat: "cc",
949
+ targetFormat: "docx"
950
+ },
951
+ {
952
+ sourceFormat: "cxx",
953
+ targetFormat: "docx"
954
+ },
955
+ {
956
+ sourceFormat: "h",
957
+ targetFormat: "docx"
958
+ },
959
+ {
960
+ sourceFormat: "hpp",
961
+ targetFormat: "docx"
962
+ },
963
+ {
964
+ sourceFormat: "hh",
965
+ targetFormat: "docx"
966
+ },
967
+ {
968
+ sourceFormat: "hxx",
969
+ targetFormat: "docx"
970
+ },
971
+ {
972
+ sourceFormat: "cs",
973
+ targetFormat: "docx"
974
+ },
975
+ {
976
+ sourceFormat: "go",
977
+ targetFormat: "docx"
978
+ },
979
+ {
980
+ sourceFormat: "java",
981
+ targetFormat: "docx"
982
+ },
983
+ {
984
+ sourceFormat: "kt",
985
+ targetFormat: "docx"
986
+ },
987
+ {
988
+ sourceFormat: "kts",
989
+ targetFormat: "docx"
990
+ },
991
+ {
992
+ sourceFormat: "lua",
993
+ targetFormat: "docx"
994
+ },
995
+ {
996
+ sourceFormat: "php",
997
+ targetFormat: "docx"
998
+ },
999
+ {
1000
+ sourceFormat: "py",
1001
+ targetFormat: "docx"
1002
+ },
1003
+ {
1004
+ sourceFormat: "rb",
1005
+ targetFormat: "docx"
1006
+ },
1007
+ {
1008
+ sourceFormat: "rs",
1009
+ targetFormat: "docx"
1010
+ },
1011
+ {
1012
+ sourceFormat: "sh",
1013
+ targetFormat: "docx"
1014
+ },
1015
+ {
1016
+ sourceFormat: "bash",
1017
+ targetFormat: "docx"
1018
+ },
1019
+ {
1020
+ sourceFormat: "bat",
1021
+ targetFormat: "docx"
1022
+ },
1023
+ {
1024
+ sourceFormat: "cmd",
1025
+ targetFormat: "docx"
1026
+ },
1027
+ {
1028
+ sourceFormat: "ps1",
1029
+ targetFormat: "docx"
1030
+ },
1031
+ {
1032
+ sourceFormat: "swift",
1033
+ targetFormat: "docx"
1034
+ },
1035
+ {
1036
+ sourceFormat: "jsonc",
1037
+ targetFormat: "docx"
1038
+ },
1039
+ {
1040
+ sourceFormat: "json5",
1041
+ targetFormat: "docx"
1042
+ },
1043
+ {
1044
+ sourceFormat: "ipynb",
1045
+ targetFormat: "docx"
1046
+ },
1047
+ {
1048
+ sourceFormat: "gql",
1049
+ targetFormat: "docx"
1050
+ },
1051
+ {
1052
+ sourceFormat: "graphql",
1053
+ targetFormat: "docx"
1054
+ },
1055
+ {
1056
+ sourceFormat: "proto",
1057
+ targetFormat: "docx"
1058
+ },
1059
+ {
1060
+ sourceFormat: "diff",
1061
+ targetFormat: "docx"
1062
+ },
1063
+ {
1064
+ sourceFormat: "patch",
1065
+ targetFormat: "docx"
1066
+ },
1067
+ {
1068
+ sourceFormat: "gitignore",
1069
+ targetFormat: "docx"
1070
+ },
1071
+ {
1072
+ sourceFormat: "dockerignore",
1073
+ targetFormat: "docx"
1074
+ },
1075
+ {
1076
+ sourceFormat: "editorconfig",
1077
+ targetFormat: "docx"
1078
+ },
1079
+ {
1080
+ sourceFormat: "r",
1081
+ targetFormat: "docx"
1082
+ },
1083
+ {
1084
+ sourceFormat: "dart",
1085
+ targetFormat: "docx"
1086
+ },
1087
+ {
1088
+ sourceFormat: "scala",
1089
+ targetFormat: "docx"
1090
+ },
1091
+ {
1092
+ sourceFormat: "groovy",
1093
+ targetFormat: "docx"
1094
+ },
1095
+ {
1096
+ sourceFormat: "gradle",
1097
+ targetFormat: "docx"
1098
+ },
1099
+ {
1100
+ sourceFormat: "pl",
1101
+ targetFormat: "docx"
1102
+ },
1103
+ {
1104
+ sourceFormat: "ex",
1105
+ targetFormat: "docx"
1106
+ },
1107
+ {
1108
+ sourceFormat: "erl",
1109
+ targetFormat: "docx"
1110
+ },
1111
+ {
1112
+ sourceFormat: "fs",
1113
+ targetFormat: "docx"
1114
+ },
1115
+ {
1116
+ sourceFormat: "fsi",
1117
+ targetFormat: "docx"
1118
+ },
1119
+ {
1120
+ sourceFormat: "fsx",
1121
+ targetFormat: "docx"
1122
+ },
1123
+ {
1124
+ sourceFormat: "vb",
1125
+ targetFormat: "docx"
1126
+ },
1127
+ {
1128
+ sourceFormat: "clj",
1129
+ targetFormat: "docx"
1130
+ },
1131
+ {
1132
+ sourceFormat: "hs",
1133
+ targetFormat: "docx"
1134
+ },
1135
+ {
1136
+ sourceFormat: "jl",
1137
+ targetFormat: "docx"
1138
+ },
1139
+ {
1140
+ sourceFormat: "zig",
1141
+ targetFormat: "docx"
1142
+ },
1143
+ {
1144
+ sourceFormat: "m",
1145
+ targetFormat: "docx"
1146
+ },
1147
+ {
1148
+ sourceFormat: "matlab",
1149
+ targetFormat: "docx"
1150
+ },
1151
+ {
1152
+ sourceFormat: "svelte",
1153
+ targetFormat: "docx"
1154
+ },
1155
+ {
1156
+ sourceFormat: "astro",
1157
+ targetFormat: "docx"
1158
+ },
1159
+ {
1160
+ sourceFormat: "mdx",
1161
+ targetFormat: "docx"
1162
+ },
1163
+ {
1164
+ sourceFormat: "tf",
1165
+ targetFormat: "docx"
1166
+ },
1167
+ {
1168
+ sourceFormat: "tfvars",
1169
+ targetFormat: "docx"
1170
+ },
1171
+ {
1172
+ sourceFormat: "hcl",
1173
+ targetFormat: "docx"
1174
+ },
1175
+ {
1176
+ sourceFormat: "rego",
1177
+ targetFormat: "docx"
1178
+ },
1179
+ {
1180
+ sourceFormat: "bicep",
1181
+ targetFormat: "docx"
1182
+ },
1183
+ {
1184
+ sourceFormat: "prisma",
1185
+ targetFormat: "docx"
1186
+ },
1187
+ {
1188
+ sourceFormat: "dockerfile",
1189
+ targetFormat: "docx"
1190
+ },
1191
+ {
1192
+ sourceFormat: "cmake",
1193
+ targetFormat: "docx"
1194
+ },
1195
+ {
1196
+ sourceFormat: "make",
1197
+ targetFormat: "docx"
1198
+ },
1199
+ {
1200
+ sourceFormat: "mk",
1201
+ targetFormat: "docx"
1202
+ },
1203
+ {
1204
+ sourceFormat: "zsh",
1205
+ targetFormat: "docx"
1206
+ },
1207
+ {
1208
+ sourceFormat: "fish",
1209
+ targetFormat: "docx"
1210
+ },
1211
+ {
1212
+ sourceFormat: "csproj",
1213
+ targetFormat: "docx"
1214
+ },
1215
+ {
1216
+ sourceFormat: "vbproj",
1217
+ targetFormat: "docx"
1218
+ },
1219
+ {
1220
+ sourceFormat: "fsproj",
1221
+ targetFormat: "docx"
1222
+ },
1223
+ {
1224
+ sourceFormat: "props",
1225
+ targetFormat: "docx"
1226
+ },
1227
+ {
1228
+ sourceFormat: "targets",
1229
+ targetFormat: "docx"
1230
+ },
1231
+ {
1232
+ sourceFormat: "sln",
1233
+ targetFormat: "docx"
1234
+ },
1235
+ {
1236
+ sourceFormat: "cshtml",
1237
+ targetFormat: "docx"
1238
+ },
1239
+ {
1240
+ sourceFormat: "razor",
1241
+ targetFormat: "docx"
1242
+ },
1243
+ {
1244
+ sourceFormat: "mustache",
1245
+ targetFormat: "docx"
1246
+ },
1247
+ {
1248
+ sourceFormat: "hbs",
1249
+ targetFormat: "docx"
1250
+ },
1251
+ {
1252
+ sourceFormat: "liquid",
1253
+ targetFormat: "docx"
1254
+ },
1255
+ {
1256
+ sourceFormat: "jinja",
1257
+ targetFormat: "docx"
1258
+ },
1259
+ {
1260
+ sourceFormat: "twig",
1261
+ targetFormat: "docx"
1262
+ },
1263
+ {
1264
+ sourceFormat: "ejs",
1265
+ targetFormat: "docx"
1266
+ },
1267
+ {
1268
+ sourceFormat: "erb",
1269
+ targetFormat: "docx"
1270
+ },
1271
+ {
1272
+ sourceFormat: "haml",
1273
+ targetFormat: "docx"
1274
+ },
1275
+ {
1276
+ sourceFormat: "slim",
1277
+ targetFormat: "docx"
1278
+ },
1279
+ {
1280
+ sourceFormat: "mermaid",
1281
+ targetFormat: "docx"
1282
+ },
1283
+ {
1284
+ sourceFormat: "mmd",
1285
+ targetFormat: "docx"
1286
+ },
1287
+ {
1288
+ sourceFormat: "puml",
1289
+ targetFormat: "docx"
1290
+ },
1291
+ {
1292
+ sourceFormat: "avsc",
1293
+ targetFormat: "docx"
1294
+ },
1295
+ {
1296
+ sourceFormat: "sol",
1297
+ targetFormat: "docx"
1298
+ },
1299
+ {
1300
+ sourceFormat: "move",
1301
+ targetFormat: "docx"
1302
+ },
1303
+ {
1304
+ sourceFormat: "nim",
1305
+ targetFormat: "docx"
1306
+ },
1307
+ {
1308
+ sourceFormat: "cr",
1309
+ targetFormat: "docx"
1310
+ },
1311
+ {
1312
+ sourceFormat: "ml",
1313
+ targetFormat: "docx"
1314
+ },
1315
+ {
1316
+ sourceFormat: "mli",
1317
+ targetFormat: "docx"
1318
+ },
1319
+ {
1320
+ sourceFormat: "elm",
1321
+ targetFormat: "docx"
1322
+ },
1323
+ {
1324
+ sourceFormat: "rkt",
1325
+ targetFormat: "docx"
1326
+ },
1327
+ {
1328
+ sourceFormat: "lisp",
1329
+ targetFormat: "docx"
1330
+ },
1331
+ {
1332
+ sourceFormat: "scm",
1333
+ targetFormat: "docx"
1334
+ },
1335
+ {
1336
+ sourceFormat: "asm",
1337
+ targetFormat: "docx"
1338
+ },
1339
+ {
1340
+ sourceFormat: "s",
1341
+ targetFormat: "docx"
1342
+ },
1343
+ {
1344
+ sourceFormat: "cu",
1345
+ targetFormat: "docx"
1346
+ },
1347
+ {
1348
+ sourceFormat: "cuh",
1349
+ targetFormat: "docx"
1350
+ },
1351
+ {
1352
+ sourceFormat: "d",
1353
+ targetFormat: "docx"
1354
+ },
1355
+ {
1356
+ sourceFormat: "pas",
1357
+ targetFormat: "docx"
1358
+ },
1359
+ {
1360
+ sourceFormat: "adb",
1361
+ targetFormat: "docx"
1362
+ },
1363
+ {
1364
+ sourceFormat: "ads",
1365
+ targetFormat: "docx"
1366
+ },
1367
+ {
1368
+ sourceFormat: "cob",
1369
+ targetFormat: "docx"
1370
+ },
1371
+ {
1372
+ sourceFormat: "cbl",
1373
+ targetFormat: "docx"
1374
+ },
1375
+ {
1376
+ sourceFormat: "f90",
1377
+ targetFormat: "docx"
1378
+ },
1379
+ {
1380
+ sourceFormat: "f95",
1381
+ targetFormat: "docx"
1382
+ },
1383
+ {
1384
+ sourceFormat: "vhd",
1385
+ targetFormat: "docx"
1386
+ },
1387
+ {
1388
+ sourceFormat: "vhdl",
1389
+ targetFormat: "docx"
1390
+ },
1391
+ {
1392
+ sourceFormat: "sv",
1393
+ targetFormat: "docx"
1394
+ },
1395
+ {
1396
+ sourceFormat: "svh",
1397
+ targetFormat: "docx"
1398
+ },
1399
+ {
1400
+ sourceFormat: "ino",
1401
+ targetFormat: "docx"
1402
+ },
1403
+ {
1404
+ sourceFormat: "glsl",
1405
+ targetFormat: "docx"
1406
+ },
1407
+ {
1408
+ sourceFormat: "vert",
1409
+ targetFormat: "docx"
1410
+ },
1411
+ {
1412
+ sourceFormat: "frag",
1413
+ targetFormat: "docx"
1414
+ },
1415
+ {
1416
+ sourceFormat: "wgsl",
1417
+ targetFormat: "docx"
1418
+ },
1419
+ {
1420
+ sourceFormat: "hlsl",
1421
+ targetFormat: "docx"
1422
+ },
1423
+ {
1424
+ sourceFormat: "rmd",
1425
+ targetFormat: "docx"
1426
+ },
1427
+ {
1428
+ sourceFormat: "qmd",
1429
+ targetFormat: "docx"
1430
+ },
1431
+ {
1432
+ sourceFormat: "bib",
1433
+ targetFormat: "docx"
1434
+ },
1435
+ {
1436
+ sourceFormat: "nix",
1437
+ targetFormat: "docx"
1438
+ },
1439
+ {
1440
+ sourceFormat: "cue",
1441
+ targetFormat: "docx"
1442
+ },
1443
+ {
1444
+ sourceFormat: "dhall",
1445
+ targetFormat: "docx"
1446
+ },
1447
+ {
1448
+ sourceFormat: "org",
1449
+ targetFormat: "docx"
1450
+ },
1451
+ {
1452
+ sourceFormat: "wiki",
1453
+ targetFormat: "docx"
1454
+ },
1455
+ {
1456
+ sourceFormat: "mediawiki",
1457
+ targetFormat: "docx"
1458
+ },
1459
+ {
1460
+ sourceFormat: "textile",
1461
+ targetFormat: "docx"
1462
+ },
1463
+ {
1464
+ sourceFormat: "pod",
1465
+ targetFormat: "docx"
1466
+ },
1467
+ {
1468
+ sourceFormat: "man",
1469
+ targetFormat: "docx"
1470
+ },
1471
+ {
1472
+ sourceFormat: "roff",
1473
+ targetFormat: "docx"
1474
+ },
1475
+ {
1476
+ sourceFormat: "nfo",
1477
+ targetFormat: "docx"
1478
+ },
1479
+ {
1480
+ sourceFormat: "srt",
1481
+ targetFormat: "docx"
1482
+ },
1483
+ {
1484
+ sourceFormat: "vtt",
1485
+ targetFormat: "docx"
1486
+ },
1487
+ {
1488
+ sourceFormat: "sbv",
1489
+ targetFormat: "docx"
1490
+ },
1491
+ {
1492
+ sourceFormat: "ass",
1493
+ targetFormat: "docx"
1494
+ },
1495
+ {
1496
+ sourceFormat: "ssa",
1497
+ targetFormat: "docx"
1498
+ },
1499
+ {
1500
+ sourceFormat: "ics",
1501
+ targetFormat: "docx"
1502
+ },
1503
+ {
1504
+ sourceFormat: "vcf",
1505
+ targetFormat: "docx"
1506
+ },
1507
+ {
1508
+ sourceFormat: "eml",
1509
+ targetFormat: "docx"
1510
+ },
1511
+ {
1512
+ sourceFormat: "mbox",
1513
+ targetFormat: "docx"
1514
+ },
1515
+ {
1516
+ sourceFormat: "msg",
1517
+ targetFormat: "docx"
1518
+ },
1519
+ {
1520
+ sourceFormat: "oft",
1521
+ targetFormat: "docx"
1522
+ },
1523
+ {
1524
+ sourceFormat: "mht",
1525
+ targetFormat: "docx"
1526
+ },
1527
+ {
1528
+ sourceFormat: "mhtml",
1529
+ targetFormat: "docx"
1530
+ },
1531
+ {
1532
+ sourceFormat: "npmrc",
1533
+ targetFormat: "docx"
1534
+ },
1535
+ {
1536
+ sourceFormat: "yarnrc",
1537
+ targetFormat: "docx"
1538
+ },
1539
+ {
1540
+ sourceFormat: "gitattributes",
1541
+ targetFormat: "docx"
1542
+ },
1543
+ {
1544
+ sourceFormat: "gitmodules",
1545
+ targetFormat: "docx"
1546
+ },
1547
+ {
1548
+ sourceFormat: "xls",
1549
+ targetFormat: "xlsx"
1550
+ },
1551
+ {
1552
+ sourceFormat: "xlsm",
1553
+ targetFormat: "xlsx"
1554
+ },
1555
+ {
1556
+ sourceFormat: "xlt",
1557
+ targetFormat: "xlsx"
1558
+ },
1559
+ {
1560
+ sourceFormat: "xltx",
1561
+ targetFormat: "xlsx"
1562
+ },
1563
+ {
1564
+ sourceFormat: "xltm",
1565
+ targetFormat: "xlsx"
1566
+ },
1567
+ {
1568
+ sourceFormat: "et",
1569
+ targetFormat: "xlsx"
1570
+ },
1571
+ {
1572
+ sourceFormat: "ett",
1573
+ targetFormat: "xlsx"
1574
+ },
1575
+ {
1576
+ sourceFormat: "ods",
1577
+ targetFormat: "xlsx"
1578
+ },
1579
+ {
1580
+ sourceFormat: "ots",
1581
+ targetFormat: "xlsx"
1582
+ },
1583
+ {
1584
+ sourceFormat: "fods",
1585
+ targetFormat: "xlsx"
1586
+ },
1587
+ {
1588
+ sourceFormat: "sxc",
1589
+ targetFormat: "xlsx"
1590
+ },
1591
+ {
1592
+ sourceFormat: "stc",
1593
+ targetFormat: "xlsx"
1594
+ },
1595
+ {
1596
+ sourceFormat: "dbf",
1597
+ targetFormat: "xlsx"
1598
+ },
1599
+ {
1600
+ sourceFormat: "slk",
1601
+ targetFormat: "xlsx"
1602
+ },
1603
+ {
1604
+ sourceFormat: "dif",
1605
+ targetFormat: "xlsx"
1606
+ },
1607
+ {
1608
+ sourceFormat: "csv",
1609
+ targetFormat: "xlsx"
1610
+ },
1611
+ {
1612
+ sourceFormat: "tsv",
1613
+ targetFormat: "xlsx"
1614
+ },
1615
+ {
1616
+ sourceFormat: "tab",
1617
+ targetFormat: "xlsx"
1618
+ },
1619
+ {
1620
+ sourceFormat: "psv",
1621
+ targetFormat: "xlsx"
1622
+ },
1623
+ {
1624
+ sourceFormat: "json",
1625
+ targetFormat: "xlsx"
1626
+ },
1627
+ {
1628
+ sourceFormat: "jsonl",
1629
+ targetFormat: "xlsx"
1630
+ },
1631
+ {
1632
+ sourceFormat: "ndjson",
1633
+ targetFormat: "xlsx"
1634
+ },
1635
+ {
1636
+ sourceFormat: "jsonlines",
1637
+ targetFormat: "xlsx"
1638
+ },
1639
+ {
1640
+ sourceFormat: "ldjson",
1641
+ targetFormat: "xlsx"
1642
+ },
1643
+ {
1644
+ sourceFormat: "dng",
1645
+ targetFormat: "jpg"
1646
+ },
1647
+ {
1648
+ sourceFormat: "cr2",
1649
+ targetFormat: "jpg"
1650
+ },
1651
+ {
1652
+ sourceFormat: "cr3",
1653
+ targetFormat: "jpg"
1654
+ },
1655
+ {
1656
+ sourceFormat: "nef",
1657
+ targetFormat: "jpg"
1658
+ },
1659
+ {
1660
+ sourceFormat: "nrw",
1661
+ targetFormat: "jpg"
1662
+ },
1663
+ {
1664
+ sourceFormat: "arw",
1665
+ targetFormat: "jpg"
1666
+ },
1667
+ {
1668
+ sourceFormat: "sr2",
1669
+ targetFormat: "jpg"
1670
+ },
1671
+ {
1672
+ sourceFormat: "srf",
1673
+ targetFormat: "jpg"
1674
+ },
1675
+ {
1676
+ sourceFormat: "orf",
1677
+ targetFormat: "jpg"
1678
+ },
1679
+ {
1680
+ sourceFormat: "rw2",
1681
+ targetFormat: "jpg"
1682
+ },
1683
+ {
1684
+ sourceFormat: "rwl",
1685
+ targetFormat: "jpg"
1686
+ },
1687
+ {
1688
+ sourceFormat: "raf",
1689
+ targetFormat: "jpg"
1690
+ },
1691
+ {
1692
+ sourceFormat: "kdc",
1693
+ targetFormat: "jpg"
1694
+ },
1695
+ {
1696
+ sourceFormat: "x3f",
1697
+ targetFormat: "jpg"
1698
+ },
1699
+ {
1700
+ sourceFormat: "pef",
1701
+ targetFormat: "jpg"
1702
+ },
1703
+ {
1704
+ sourceFormat: "srw",
1705
+ targetFormat: "jpg"
1706
+ },
1707
+ {
1708
+ sourceFormat: "erf",
1709
+ targetFormat: "jpg"
1710
+ },
1711
+ {
1712
+ sourceFormat: "mef",
1713
+ targetFormat: "jpg"
1714
+ },
1715
+ {
1716
+ sourceFormat: "mos",
1717
+ targetFormat: "jpg"
1718
+ },
1719
+ {
1720
+ sourceFormat: "mrw",
1721
+ targetFormat: "jpg"
1722
+ },
1723
+ {
1724
+ sourceFormat: "3fr",
1725
+ targetFormat: "jpg"
1726
+ },
1727
+ {
1728
+ sourceFormat: "iiq",
1729
+ targetFormat: "jpg"
1730
+ },
1731
+ {
1732
+ sourceFormat: "icns",
1733
+ targetFormat: "png"
1734
+ },
1735
+ {
1736
+ sourceFormat: "apk",
1737
+ targetFormat: "png"
1738
+ },
1739
+ {
1740
+ sourceFormat: "ipa",
1741
+ targetFormat: "png"
1742
+ },
1743
+ {
1744
+ sourceFormat: "exe",
1745
+ targetFormat: "png"
1746
+ },
1747
+ {
1748
+ sourceFormat: "dll",
1749
+ targetFormat: "png"
1750
+ },
1751
+ {
1752
+ sourceFormat: "mui",
1753
+ targetFormat: "png"
1754
+ },
1755
+ {
1756
+ sourceFormat: "mun",
1757
+ targetFormat: "png"
1758
+ },
1759
+ {
1760
+ sourceFormat: "ico",
1761
+ targetFormat: "png"
1762
+ },
1763
+ {
1764
+ sourceFormat: "ppm",
1765
+ targetFormat: "png"
1766
+ }
1767
+ ], Et = [
1768
+ {
1769
+ sourceFormat: "dng",
1770
+ targetFormat: "jpg"
1771
+ },
1772
+ {
1773
+ sourceFormat: "cr2",
1774
+ targetFormat: "jpg"
1775
+ },
1776
+ {
1777
+ sourceFormat: "cr3",
1778
+ targetFormat: "jpg"
1779
+ },
1780
+ {
1781
+ sourceFormat: "nef",
1782
+ targetFormat: "jpg"
1783
+ },
1784
+ {
1785
+ sourceFormat: "nrw",
1786
+ targetFormat: "jpg"
1787
+ },
1788
+ {
1789
+ sourceFormat: "arw",
1790
+ targetFormat: "jpg"
1791
+ },
1792
+ {
1793
+ sourceFormat: "sr2",
1794
+ targetFormat: "jpg"
1795
+ },
1796
+ {
1797
+ sourceFormat: "srf",
1798
+ targetFormat: "jpg"
1799
+ },
1800
+ {
1801
+ sourceFormat: "orf",
1802
+ targetFormat: "jpg"
1803
+ },
1804
+ {
1805
+ sourceFormat: "rw2",
1806
+ targetFormat: "jpg"
1807
+ },
1808
+ {
1809
+ sourceFormat: "rwl",
1810
+ targetFormat: "jpg"
1811
+ },
1812
+ {
1813
+ sourceFormat: "raf",
1814
+ targetFormat: "jpg"
1815
+ },
1816
+ {
1817
+ sourceFormat: "kdc",
1818
+ targetFormat: "jpg"
1819
+ },
1820
+ {
1821
+ sourceFormat: "x3f",
1822
+ targetFormat: "jpg"
1823
+ },
1824
+ {
1825
+ sourceFormat: "pef",
1826
+ targetFormat: "jpg"
1827
+ },
1828
+ {
1829
+ sourceFormat: "srw",
1830
+ targetFormat: "jpg"
1831
+ },
1832
+ {
1833
+ sourceFormat: "erf",
1834
+ targetFormat: "jpg"
1835
+ },
1836
+ {
1837
+ sourceFormat: "mef",
1838
+ targetFormat: "jpg"
1839
+ },
1840
+ {
1841
+ sourceFormat: "mos",
1842
+ targetFormat: "jpg"
1843
+ },
1844
+ {
1845
+ sourceFormat: "mrw",
1846
+ targetFormat: "jpg"
1847
+ },
1848
+ {
1849
+ sourceFormat: "3fr",
1850
+ targetFormat: "jpg"
1851
+ },
1852
+ {
1853
+ sourceFormat: "iiq",
1854
+ targetFormat: "jpg"
1855
+ },
1856
+ {
1857
+ sourceFormat: "icns",
1858
+ targetFormat: "png"
1859
+ }
1860
+ ], St = new Set(
1861
+ st.map((e) => k(e.sourceFormat))
1862
+ ), Ct = new Set(
1863
+ st.map(
1864
+ (e) => `${k(e.sourceFormat)}->${k(e.targetFormat)}`
1865
+ )
1866
+ ), At = new Set(
1867
+ Et.map(
1868
+ (e) => `${k(e.sourceFormat)}->${k(e.targetFormat)}`
1869
+ )
1870
+ );
1871
+ class L extends Error {
1872
+ constructor(t) {
1873
+ super(t.errorMessage || t.errorCode || "WASM conversion failed."), this.result = t, this.name = "WasmConversionError";
1874
+ }
1875
+ }
1876
+ function Kt(e) {
1877
+ const t = T(e), r = e.officeWasm ? T({ wasm: e.officeWasm, fetch: e.fetch }) : void 0, o = e.postscriptWasm ? T({ wasm: e.postscriptWasm, fetch: e.fetch }) : void 0, a = e.imageWasm ? D(() => rt(e.imageWasm, e.fetch)) : void 0, s = e.imageWasm ? T({ wasm: a, fetch: e.fetch }) : void 0, n = a ? Tt(a) : void 0;
1878
+ return {
1879
+ async convert(c, m) {
1880
+ p(m.signal);
1881
+ const i = k(c.sourceFormat), d = k(c.targetFormat), l = Ut(i, d), h = `/work/input.${i}`, g = `/work/output.${d}`, A = "/work/options.json", _ = "/work/result.json", R = await tt(c.source, e.fetch, m.signal);
1882
+ p(m.signal);
1883
+ const ut = JSON.stringify({
1884
+ ...c.password ? { password: c.password } : {},
1885
+ ...c.locale ? { locale: c.locale } : {}
1886
+ }), B = !!(s && At.has(l));
1887
+ if (B && d === "jpg" && n) {
1888
+ const v = await n(R, m.signal);
1889
+ if (p(m.signal), v) return v;
1890
+ }
1891
+ const dt = !!(o && d === "pdf" && ["eps", "ps", "ai"].includes(i)) ? o : B ? s : t, M = (v, pt) => v({
1892
+ args: [
1893
+ B ? "converter-image" : "converter-core",
1894
+ "--input",
1895
+ h,
1896
+ "--output",
1897
+ g,
1898
+ "--source",
1899
+ i,
1900
+ "--target",
1901
+ d,
1902
+ "--options",
1903
+ A,
1904
+ "--result",
1905
+ _
1906
+ ],
1907
+ files: {
1908
+ [h]: pt,
1909
+ [A]: new TextEncoder().encode(ut)
1910
+ },
1911
+ readFiles: [_, g],
1912
+ signal: m.signal
1913
+ });
1914
+ let E = await M(dt, R), b = U(E.files[_]);
1915
+ if (!b.ok && b.errorCode === "engine_unavailable" && b.requiredModule === "office" && r) {
1916
+ const v = await M(r, R);
1917
+ Y(U(v.files[_]), v.exitCode), E = await M(t, v.files[g]), b = U(E.files[_]);
1918
+ }
1919
+ return p(m.signal), Y(b, E.exitCode), {
1920
+ source: E.files[g],
1921
+ format: k(b.targetFormat || d),
1922
+ contentType: b.contentType,
1923
+ warnings: b.warnings
1924
+ };
1925
+ }
1926
+ };
1927
+ }
1928
+ function Y(e, t) {
1929
+ if (!e.ok) throw new L(e);
1930
+ if (t !== 0)
1931
+ throw new L({
1932
+ ...e,
1933
+ ok: !1,
1934
+ errorCode: e.errorCode || "conversion_failed",
1935
+ errorMessage: e.errorMessage || `converter WASM exited with code ${t}`
1936
+ });
1937
+ }
1938
+ function Tt(e) {
1939
+ const t = D(async () => {
1940
+ const r = await e(), o = new Set(WebAssembly.Module.exports(r).map((n) => n.name));
1941
+ if (!["filens_image_alloc", "filens_image_free", "filens_image_preview", "memory"].every((n) => o.has(n))) return null;
1942
+ const a = new at({ args: ["converter-image"], files: {} }), s = await WebAssembly.instantiate(r, { wasi_snapshot_preview1: a.imports });
1943
+ return a.setInstance(s), s.exports;
1944
+ });
1945
+ return async (r, o) => {
1946
+ const a = await f(t(), o);
1947
+ if (p(o), !a || r.length === 0) return null;
1948
+ let s = 0, n = 0, c = 0;
1949
+ try {
1950
+ if (s = a.filens_image_alloc(r.length) >>> 0, !s) throw new Error("Image core could not allocate its input buffer.");
1951
+ new Uint8Array(a.memory.buffer).set(r, s);
1952
+ const m = a.filens_image_preview(s, r.length);
1953
+ if (n = Number(m & 0xffffffffn), c = Number(m >> 32n), !n || c < 4 || n + c > a.memory.buffer.byteLength) throw new Error("Image core returned an invalid preview buffer.");
1954
+ const i = new Uint8Array(a.memory.buffer, n, c), d = new DataView(i.buffer, i.byteOffset, 4).getUint32(0, !0);
1955
+ if (d > i.length - 4) throw new Error("Image core returned invalid preview metadata.");
1956
+ const l = U(i.subarray(4, 4 + d));
1957
+ if (!l.ok) throw new L(l);
1958
+ return { source: i.slice(4 + d), format: "jpg", contentType: l.contentType, warnings: l.warnings };
1959
+ } finally {
1960
+ n && c && a.filens_image_free(n, c), s && a.filens_image_free(s, r.length);
1961
+ }
1962
+ };
1963
+ }
1964
+ function Ut(e, t) {
1965
+ const r = `${e}->${t}`;
1966
+ if (Ct.has(r))
1967
+ return r;
1968
+ const o = St.has(e) ? `unsupported conversion pair: ${e} -> ${t}` : `unsupported source format: ${e}`;
1969
+ throw new L({
1970
+ ok: !1,
1971
+ sourceFormat: e,
1972
+ targetFormat: t,
1973
+ warnings: [],
1974
+ errorCode: "unsupported_format",
1975
+ errorMessage: o,
1976
+ metrics: {}
1977
+ });
1978
+ }
1979
+ function U(e) {
1980
+ const t = new TextDecoder().decode(e), r = JSON.parse(t);
1981
+ return {
1982
+ ...r,
1983
+ warnings: Array.isArray(r.warnings) ? r.warnings.map(String) : []
1984
+ };
1985
+ }
1986
+ function k(e) {
1987
+ return e.trim().replace(/^\./, "").toLowerCase();
1988
+ }
1989
+ const J = 64 * 1024 * 1024;
1990
+ function Xt() {
1991
+ return {
1992
+ async convert(e, t) {
1993
+ const r = e.sourceFormat.replace(/^\./, "").toLowerCase(), o = e.targetFormat.replace(/^\./, "").toLowerCase();
1994
+ if (!(["heic", "heif"].includes(r) && o === "png"))
1995
+ throw new Error(`Unsupported media conversion: ${r} -> ${o}.`);
1996
+ if (p(t.signal), (e.source instanceof Blob ? e.source.size : typeof e.source == "string" ? 0 : e.source.byteLength) > J)
1997
+ throw new Error("HEIF input exceeds the 64 MiB preview limit.");
1998
+ const a = ArrayBuffer.isView(e.source) ? e.source.slice() : e.source instanceof ArrayBuffer ? e.source.slice(0) : e.source, s = await tt(a, globalThis.fetch, t.signal, J);
1999
+ p(t.signal);
2000
+ const n = await f(import("./media-runtime-Chg4A2un.js"), t.signal);
2001
+ return p(t.signal), n.convertMedia(s, r, t.signal);
2002
+ }
2003
+ };
2004
+ }
2005
+ class ct extends Error {
2006
+ constructor(t, r, o) {
2007
+ const a = `Conversion failed: ${t} ${r}`.trim(), s = (o == null ? void 0 : o.errorMessage) || (o == null ? void 0 : o.errorCode);
2008
+ super(s ? `${a}: ${s}` : a), this.status = t, this.statusText = r, this.result = o, this.name = "HttpConversionError";
2009
+ }
2010
+ }
2011
+ function Qt(e) {
2012
+ const t = e.fetch ?? globalThis.fetch;
2013
+ if (!t)
2014
+ throw new Error("A fetch implementation is required for HTTP conversion.");
2015
+ return {
2016
+ async convert(r, o) {
2017
+ const a = o.signal;
2018
+ p(a);
2019
+ const s = new FormData();
2020
+ s.set("sourceFormat", r.sourceFormat), s.set("targetFormat", r.targetFormat), r.name && s.set("name", r.name), r.password && s.set("password", r.password), r.locale && s.set("locale", r.locale), s.set("file", await Mt(r.source, r, t, a), Dt(r)), p(a);
2021
+ const n = typeof e.headers == "function" ? e.headers(r) : e.headers;
2022
+ p(a);
2023
+ const c = await f(t(e.endpoint, {
2024
+ method: "POST",
2025
+ body: s,
2026
+ signal: a,
2027
+ credentials: e.credentials,
2028
+ headers: n
2029
+ }), a);
2030
+ if (p(a), !c.ok)
2031
+ throw await f(Lt(c, r), a);
2032
+ if ((e.responseType ?? "json") === "blob")
2033
+ return f(Nt(c, r.targetFormat), a);
2034
+ const m = await f(c.json(), a);
2035
+ return p(a), It(m, r, c);
2036
+ }
2037
+ };
2038
+ }
2039
+ async function Lt(e, t) {
2040
+ return new ct(e.status, e.statusText, await Rt(e, t));
2041
+ }
2042
+ function Zt(e) {
2043
+ return {
2044
+ async convert(t) {
2045
+ const r = e.find(
2046
+ (o) => F(o.sourceFormat) === F(t.sourceFormat) && F(o.targetFormat) === F(t.targetFormat)
2047
+ );
2048
+ if (!r)
2049
+ throw new Error(`No mock conversion registered for ${t.sourceFormat} -> ${t.targetFormat}.`);
2050
+ return {
2051
+ source: typeof r.source == "function" ? await r.source(t) : r.source,
2052
+ format: r.targetFormat,
2053
+ contentType: r.contentType,
2054
+ warnings: r.warnings,
2055
+ cacheKey: r.cacheKey
2056
+ };
2057
+ }
2058
+ };
2059
+ }
2060
+ async function Rt(e, t) {
2061
+ var a;
2062
+ const r = ((a = e.headers.get("content-type")) == null ? void 0 : a.toLowerCase()) ?? "";
2063
+ if (r.includes("application/json") || r.includes("+json"))
2064
+ try {
2065
+ return nt(await e.json(), t);
2066
+ } catch {
2067
+ return;
2068
+ }
2069
+ const o = Bt(e.headers, t);
2070
+ return o.errorCode || o.errorMessage ? o : void 0;
2071
+ }
2072
+ function nt(e, t) {
2073
+ if (!e || typeof e != "object")
2074
+ return;
2075
+ const r = e;
2076
+ return {
2077
+ ok: typeof r.ok == "boolean" ? r.ok : void 0,
2078
+ format: typeof r.format == "string" ? F(r.format) : void 0,
2079
+ sourceFormat: typeof r.sourceFormat == "string" ? F(r.sourceFormat) : F(t.sourceFormat),
2080
+ targetFormat: typeof r.targetFormat == "string" ? F(r.targetFormat) : F(t.targetFormat),
2081
+ backend: typeof r.backend == "string" ? r.backend : void 0,
2082
+ fidelity: typeof r.fidelity == "string" ? r.fidelity : void 0,
2083
+ contentType: typeof r.contentType == "string" ? r.contentType : void 0,
2084
+ warnings: Array.isArray(r.warnings) ? r.warnings.map(String) : [],
2085
+ errorCode: typeof r.errorCode == "string" ? r.errorCode : void 0,
2086
+ errorMessage: typeof r.errorMessage == "string" ? r.errorMessage : void 0,
2087
+ metrics: r.metrics && typeof r.metrics == "object" ? r.metrics : void 0
2088
+ };
2089
+ }
2090
+ function Bt(e, t) {
2091
+ return {
2092
+ ok: w(e, "x-preview-ok") === "true" ? !0 : w(e, "x-preview-ok") === "false" ? !1 : void 0,
2093
+ format: w(e, "x-preview-format") ?? void 0,
2094
+ sourceFormat: w(e, "x-preview-source-format") ?? F(t.sourceFormat),
2095
+ targetFormat: w(e, "x-preview-target-format") ?? F(t.targetFormat),
2096
+ backend: w(e, "x-preview-backend") ?? void 0,
2097
+ fidelity: w(e, "x-preview-fidelity") ?? void 0,
2098
+ warnings: it(e) ?? [],
2099
+ errorCode: w(e, "x-preview-error-code") ?? void 0,
2100
+ errorMessage: w(e, "x-preview-error-message") ?? void 0
2101
+ };
2102
+ }
2103
+ async function Mt(e, t, r, o) {
2104
+ const a = zt(t.name, t.sourceFormat);
2105
+ if (e instanceof Blob)
2106
+ return e.type || a === "application/octet-stream" ? e : new Blob([e], {
2107
+ type: a
2108
+ });
2109
+ if (typeof e == "string") {
2110
+ if (Q(e))
2111
+ return Wt(e, a);
2112
+ if (X(e)) {
2113
+ const s = await f(r(e, { signal: o }), o);
2114
+ if (p(o), !s.ok) throw new Error(`Failed to fetch conversion source: ${s.status} ${s.statusText}`.trim());
2115
+ const n = await f(s.blob(), o);
2116
+ return p(o), n.type ? n : new Blob([n], { type: a });
2117
+ }
2118
+ return new Blob([e], {
2119
+ type: a === "application/octet-stream" ? "text/plain" : a
2120
+ });
2121
+ }
2122
+ if (ArrayBuffer.isView(e)) {
2123
+ const s = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
2124
+ if (s.buffer instanceof ArrayBuffer) return new Blob([s], { type: a });
2125
+ const n = new Uint8Array(s.byteLength);
2126
+ return n.set(s), new Blob([n.buffer], {
2127
+ type: a
2128
+ });
2129
+ }
2130
+ return new Blob([e], {
2131
+ type: a
2132
+ });
2133
+ }
2134
+ function It(e, t, r) {
2135
+ if (!e || typeof e != "object")
2136
+ throw new Error("Conversion response must be a JSON object.");
2137
+ const o = e;
2138
+ if (o.ok === !1 || typeof o.errorCode == "string" || typeof o.errorMessage == "string")
2139
+ throw new ct(r.status, r.statusText, nt(o, t));
2140
+ const a = Ot(o), s = String(o.format ?? o.targetFormat ?? t.targetFormat);
2141
+ return {
2142
+ source: a,
2143
+ format: s,
2144
+ contentType: typeof o.contentType == "string" ? o.contentType : void 0,
2145
+ warnings: Array.isArray(o.warnings) ? o.warnings.map(String) : void 0,
2146
+ cacheKey: typeof o.cacheKey == "string" ? o.cacheKey : void 0
2147
+ };
2148
+ }
2149
+ async function Nt(e, t) {
2150
+ return {
2151
+ source: await e.blob(),
2152
+ format: w(e.headers, "x-preview-format") ?? t,
2153
+ contentType: e.headers.get("content-type") ?? void 0,
2154
+ warnings: it(e.headers),
2155
+ cacheKey: w(e.headers, "x-preview-cache-key")
2156
+ };
2157
+ }
2158
+ function Ot(e) {
2159
+ if (typeof e.url == "string")
2160
+ return e.url;
2161
+ if (typeof e.dataUrl == "string")
2162
+ return e.dataUrl;
2163
+ if (typeof e.base64 == "string")
2164
+ return Z(e.base64);
2165
+ if (typeof e.text == "string")
2166
+ return new TextEncoder().encode(e.text);
2167
+ throw new Error("Conversion JSON response must include url, dataUrl, base64, or text.");
2168
+ }
2169
+ function Wt(e, t = "application/octet-stream") {
2170
+ const { bytes: r, contentType: o } = q(e);
2171
+ return new Blob([r], {
2172
+ type: o ?? t
2173
+ });
2174
+ }
2175
+ function it(e) {
2176
+ const t = w(e, "x-preview-warnings");
2177
+ if (t)
2178
+ try {
2179
+ const r = JSON.parse(t);
2180
+ return Array.isArray(r) ? r.map(String) : [String(r)];
2181
+ } catch {
2182
+ return t.split("|").map((r) => r.trim()).filter(Boolean);
2183
+ }
2184
+ }
2185
+ function w(e, t) {
2186
+ return e.get(t) ?? e.get(t.toLowerCase()) ?? void 0;
2187
+ }
2188
+ function Dt(e) {
2189
+ const t = F(e.sourceFormat), r = F(e.targetFormat), o = t || r || "bin", a = $t(e.name) || `input.${o}`;
2190
+ return mt(a) ? a : `${a}.${o}`;
2191
+ }
2192
+ function $t(e) {
2193
+ var o, a;
2194
+ const r = ((a = (((o = String(e ?? "").split(/[?#]/, 1)[0]) == null ? void 0 : o.trim()) ?? "").split(/[\\/]/).pop()) == null ? void 0 : a.trim()) ?? "";
2195
+ return Pt(r);
2196
+ }
2197
+ function Pt(e) {
2198
+ const t = e.replace(/[^\w.+-]+/g, "_").replace(/^_+|_+$/g, "");
2199
+ return !t || t === "." || t === ".." ? "" : t;
2200
+ }
2201
+ function zt(e, t) {
2202
+ const r = mt(e);
2203
+ switch (F(r || t || "")) {
2204
+ case "dng":
2205
+ case "cr2":
2206
+ case "cr3":
2207
+ case "nef":
2208
+ case "nrw":
2209
+ case "arw":
2210
+ case "sr2":
2211
+ case "srf":
2212
+ case "orf":
2213
+ case "rw2":
2214
+ case "rwl":
2215
+ case "raf":
2216
+ case "kdc":
2217
+ case "x3f":
2218
+ case "pef":
2219
+ case "srw":
2220
+ case "erf":
2221
+ case "mef":
2222
+ case "mos":
2223
+ case "mrw":
2224
+ case "3fr":
2225
+ case "iiq":
2226
+ return "application/octet-stream";
2227
+ case "apk":
2228
+ return "application/vnd.android.package-archive";
2229
+ case "ipa":
2230
+ return "application/x-ios-app";
2231
+ case "exe":
2232
+ case "dll":
2233
+ case "mui":
2234
+ case "mun":
2235
+ return "application/vnd.microsoft.portable-executable";
2236
+ case "ico":
2237
+ return "image/x-icon";
2238
+ case "icns":
2239
+ return "application/x-icns";
2240
+ case "psd":
2241
+ case "psb":
2242
+ return "image/vnd.adobe.photoshop";
2243
+ case "ai":
2244
+ return "application/illustrator";
2245
+ case "eps":
2246
+ case "ps":
2247
+ return "application/postscript";
2248
+ case "ppm":
2249
+ return "image/x-portable-pixmap";
2250
+ case "doc":
2251
+ case "dot":
2252
+ return "application/msword";
2253
+ case "docm":
2254
+ return "application/vnd.ms-word.document.macroenabled.12";
2255
+ case "docx":
2256
+ return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
2257
+ case "xlsx":
2258
+ return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
2259
+ case "pptx":
2260
+ return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
2261
+ case "dotm":
2262
+ return "application/vnd.ms-word.template.macroenabled.12";
2263
+ case "dotx":
2264
+ return "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
2265
+ case "odt":
2266
+ return "application/vnd.oasis.opendocument.text";
2267
+ case "ott":
2268
+ return "application/vnd.oasis.opendocument.text-template";
2269
+ case "fodt":
2270
+ return "application/vnd.oasis.opendocument.text-flat-xml";
2271
+ case "sxw":
2272
+ return "application/vnd.sun.xml.writer";
2273
+ case "stw":
2274
+ return "application/vnd.sun.xml.writer.template";
2275
+ case "rtf":
2276
+ return "application/rtf";
2277
+ case "wps":
2278
+ return "application/vnd.ms-works";
2279
+ case "wpt":
2280
+ return "application/wps-office.wpt";
2281
+ case "xls":
2282
+ case "xlt":
2283
+ case "et":
2284
+ return "application/vnd.ms-excel";
2285
+ case "xlsm":
2286
+ return "application/vnd.ms-excel.sheet.macroenabled.12";
2287
+ case "xltm":
2288
+ return "application/vnd.ms-excel.template.macroenabled.12";
2289
+ case "ett":
2290
+ return "application/wps-office.ett";
2291
+ case "xltx":
2292
+ return "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
2293
+ case "ods":
2294
+ return "application/vnd.oasis.opendocument.spreadsheet";
2295
+ case "ots":
2296
+ return "application/vnd.oasis.opendocument.spreadsheet-template";
2297
+ case "fods":
2298
+ return "application/vnd.oasis.opendocument.spreadsheet-flat-xml";
2299
+ case "sxc":
2300
+ return "application/vnd.sun.xml.calc";
2301
+ case "stc":
2302
+ return "application/vnd.sun.xml.calc.template";
2303
+ case "dbf":
2304
+ return "application/x-dbf";
2305
+ case "slk":
2306
+ return "text/spreadsheet";
2307
+ case "dif":
2308
+ return "application/x-dif";
2309
+ case "txt":
2310
+ case "text":
2311
+ case "log":
2312
+ return "text/plain";
2313
+ case "md":
2314
+ case "markdown":
2315
+ case "mkd":
2316
+ case "mkdn":
2317
+ case "mdown":
2318
+ return "text/markdown";
2319
+ case "html":
2320
+ case "htm":
2321
+ case "shtml":
2322
+ return "text/html";
2323
+ case "xhtml":
2324
+ case "xht":
2325
+ case "xhtm":
2326
+ return "application/xhtml+xml";
2327
+ case "epub":
2328
+ return "application/epub+zip";
2329
+ case "fb2":
2330
+ return "application/x-fictionbook+xml";
2331
+ case "xml":
2332
+ return "application/xml";
2333
+ case "rss":
2334
+ return "application/rss+xml";
2335
+ case "atom":
2336
+ return "application/atom+xml";
2337
+ case "kml":
2338
+ return "application/vnd.google-earth.kml+xml";
2339
+ case "gpx":
2340
+ return "application/gpx+xml";
2341
+ case "ttml":
2342
+ case "dfxp":
2343
+ return "application/ttml+xml";
2344
+ case "xsd":
2345
+ return "application/xsd+xml";
2346
+ case "xsl":
2347
+ case "xslt":
2348
+ return "application/xslt+xml";
2349
+ case "wsdl":
2350
+ return "application/wsdl+xml";
2351
+ case "plist":
2352
+ return "application/x-plist";
2353
+ case "pom":
2354
+ return "application/xml";
2355
+ case "yaml":
2356
+ case "yml":
2357
+ return "application/yaml";
2358
+ case "toml":
2359
+ return "application/toml";
2360
+ case "ini":
2361
+ return "text/x-ini";
2362
+ case "rst":
2363
+ case "rest":
2364
+ return "text/x-rst";
2365
+ case "adoc":
2366
+ case "asciidoc":
2367
+ case "asc":
2368
+ return "text/asciidoc";
2369
+ case "tex":
2370
+ case "latex":
2371
+ case "ltx":
2372
+ case "sty":
2373
+ case "cls":
2374
+ return "application/x-tex";
2375
+ case "properties":
2376
+ return "text/x-java-properties";
2377
+ case "env":
2378
+ return "application/x-env";
2379
+ case "conf":
2380
+ case "config":
2381
+ case "cfg":
2382
+ case "cnf":
2383
+ return "text/x-config";
2384
+ case "sql":
2385
+ return "application/sql";
2386
+ case "js":
2387
+ case "jsx":
2388
+ case "mjs":
2389
+ case "cjs":
2390
+ return "text/javascript";
2391
+ case "ts":
2392
+ case "tsx":
2393
+ case "mts":
2394
+ case "cts":
2395
+ return "text/typescript";
2396
+ case "vue":
2397
+ return "text/x-vue";
2398
+ case "css":
2399
+ return "text/css";
2400
+ case "scss":
2401
+ case "sass":
2402
+ return "text/x-scss";
2403
+ case "less":
2404
+ return "text/x-less";
2405
+ case "c":
2406
+ case "h":
2407
+ return "text/x-csrc";
2408
+ case "cpp":
2409
+ case "cc":
2410
+ case "cxx":
2411
+ case "hpp":
2412
+ case "hh":
2413
+ case "hxx":
2414
+ return "text/x-c++src";
2415
+ case "cs":
2416
+ return "text/x-csharp";
2417
+ case "go":
2418
+ return "text/x-go";
2419
+ case "java":
2420
+ return "text/x-java-source";
2421
+ case "kt":
2422
+ case "kts":
2423
+ return "text/x-kotlin";
2424
+ case "lua":
2425
+ return "text/x-lua";
2426
+ case "php":
2427
+ return "text/x-php";
2428
+ case "py":
2429
+ return "text/x-python";
2430
+ case "rb":
2431
+ return "text/x-ruby";
2432
+ case "rs":
2433
+ return "text/rust";
2434
+ case "sh":
2435
+ case "bash":
2436
+ return "application/x-sh";
2437
+ case "bat":
2438
+ case "cmd":
2439
+ return "application/x-msdos-program";
2440
+ case "ps1":
2441
+ return "text/x-powershell";
2442
+ case "swift":
2443
+ return "text/x-swift";
2444
+ case "jsonc":
2445
+ return "application/jsonc";
2446
+ case "json5":
2447
+ return "application/json5";
2448
+ case "ipynb":
2449
+ return "application/x-ipynb+json";
2450
+ case "gql":
2451
+ case "graphql":
2452
+ return "application/graphql";
2453
+ case "proto":
2454
+ return "application/x-protobuf";
2455
+ case "diff":
2456
+ return "text/x-diff";
2457
+ case "patch":
2458
+ return "text/x-patch";
2459
+ case "gitignore":
2460
+ return "text/x-gitignore";
2461
+ case "dockerignore":
2462
+ return "text/x-dockerignore";
2463
+ case "editorconfig":
2464
+ return "text/x-editorconfig";
2465
+ case "r":
2466
+ return "text/x-r";
2467
+ case "dart":
2468
+ return "text/x-dart";
2469
+ case "scala":
2470
+ return "text/x-scala";
2471
+ case "groovy":
2472
+ case "gradle":
2473
+ return "text/x-groovy";
2474
+ case "pl":
2475
+ return "text/x-perl";
2476
+ case "ex":
2477
+ return "text/x-elixir";
2478
+ case "erl":
2479
+ return "text/x-erlang";
2480
+ case "fs":
2481
+ case "fsi":
2482
+ case "fsx":
2483
+ return "text/x-fsharp";
2484
+ case "vb":
2485
+ return "text/x-vb";
2486
+ case "clj":
2487
+ return "text/x-clojure";
2488
+ case "hs":
2489
+ return "text/x-haskell";
2490
+ case "jl":
2491
+ return "text/x-julia";
2492
+ case "zig":
2493
+ return "text/x-zig";
2494
+ case "m":
2495
+ case "matlab":
2496
+ return "text/x-matlab";
2497
+ case "svelte":
2498
+ return "text/x-svelte";
2499
+ case "astro":
2500
+ return "text/x-astro";
2501
+ case "mdx":
2502
+ return "text/mdx";
2503
+ case "tf":
2504
+ case "tfvars":
2505
+ case "hcl":
2506
+ return "text/x-hcl";
2507
+ case "rego":
2508
+ return "text/x-rego";
2509
+ case "bicep":
2510
+ return "text/x-bicep";
2511
+ case "prisma":
2512
+ return "text/x-prisma";
2513
+ case "dockerfile":
2514
+ return "text/x-dockerfile";
2515
+ case "cmake":
2516
+ return "text/x-cmake";
2517
+ case "make":
2518
+ case "mk":
2519
+ return "text/x-makefile";
2520
+ case "zsh":
2521
+ case "fish":
2522
+ return "text/x-shellscript";
2523
+ case "csproj":
2524
+ case "vbproj":
2525
+ case "fsproj":
2526
+ case "props":
2527
+ case "targets":
2528
+ return "application/x-msbuild";
2529
+ case "sln":
2530
+ return "text/x-ms-sln";
2531
+ case "cshtml":
2532
+ case "razor":
2533
+ return "text/x-cshtml";
2534
+ case "mustache":
2535
+ case "hbs":
2536
+ return "text/x-handlebars-template";
2537
+ case "liquid":
2538
+ return "text/x-liquid";
2539
+ case "jinja":
2540
+ return "text/x-jinja";
2541
+ case "twig":
2542
+ return "text/x-twig";
2543
+ case "ejs":
2544
+ return "text/x-ejs";
2545
+ case "erb":
2546
+ return "text/x-erb";
2547
+ case "haml":
2548
+ return "text/x-haml";
2549
+ case "slim":
2550
+ return "text/x-slim";
2551
+ case "mermaid":
2552
+ case "mmd":
2553
+ return "text/vnd.mermaid";
2554
+ case "puml":
2555
+ return "text/x-plantuml";
2556
+ case "avsc":
2557
+ return "application/vnd.apache.avro+json";
2558
+ case "sol":
2559
+ return "text/x-solidity";
2560
+ case "move":
2561
+ return "text/x-move";
2562
+ case "nim":
2563
+ return "text/x-nim";
2564
+ case "cr":
2565
+ return "text/x-crystal";
2566
+ case "ml":
2567
+ case "mli":
2568
+ return "text/x-ocaml";
2569
+ case "elm":
2570
+ return "text/x-elm";
2571
+ case "rkt":
2572
+ return "text/x-racket";
2573
+ case "lisp":
2574
+ return "text/x-lisp";
2575
+ case "scm":
2576
+ return "text/x-scheme";
2577
+ case "asm":
2578
+ case "s":
2579
+ return "text/x-asm";
2580
+ case "cu":
2581
+ case "cuh":
2582
+ return "text/x-cuda";
2583
+ case "d":
2584
+ return "text/x-d";
2585
+ case "pas":
2586
+ return "text/x-pascal";
2587
+ case "adb":
2588
+ case "ads":
2589
+ return "text/x-ada";
2590
+ case "cob":
2591
+ case "cbl":
2592
+ return "text/x-cobol";
2593
+ case "f90":
2594
+ case "f95":
2595
+ return "text/x-fortran";
2596
+ case "vhd":
2597
+ case "vhdl":
2598
+ return "text/x-vhdl";
2599
+ case "sv":
2600
+ case "svh":
2601
+ return "text/x-systemverilog";
2602
+ case "ino":
2603
+ return "text/x-arduino";
2604
+ case "glsl":
2605
+ case "vert":
2606
+ case "frag":
2607
+ return "text/x-glsl";
2608
+ case "wgsl":
2609
+ return "text/wgsl";
2610
+ case "hlsl":
2611
+ return "text/x-hlsl";
2612
+ case "rmd":
2613
+ return "text/x-r-markdown";
2614
+ case "qmd":
2615
+ return "text/x-quarto";
2616
+ case "bib":
2617
+ return "application/x-bibtex";
2618
+ case "nix":
2619
+ return "text/x-nix";
2620
+ case "cue":
2621
+ return "text/x-cue";
2622
+ case "dhall":
2623
+ return "text/x-dhall";
2624
+ case "org":
2625
+ return "text/org";
2626
+ case "wiki":
2627
+ case "mediawiki":
2628
+ return "text/x-wiki";
2629
+ case "textile":
2630
+ return "text/x-textile";
2631
+ case "pod":
2632
+ return "text/x-pod";
2633
+ case "man":
2634
+ case "roff":
2635
+ return "text/troff";
2636
+ case "nfo":
2637
+ return "text/x-nfo";
2638
+ case "srt":
2639
+ return "application/x-subrip";
2640
+ case "vtt":
2641
+ return "text/vtt";
2642
+ case "sbv":
2643
+ return "text/x-sbv";
2644
+ case "ass":
2645
+ return "text/x-ass";
2646
+ case "ssa":
2647
+ return "text/x-ssa";
2648
+ case "ics":
2649
+ return "text/calendar";
2650
+ case "vcf":
2651
+ return "text/vcard";
2652
+ case "eml":
2653
+ return "message/rfc822";
2654
+ case "mbox":
2655
+ return "application/mbox";
2656
+ case "msg":
2657
+ return "application/vnd.ms-outlook";
2658
+ case "oft":
2659
+ return "application/vnd.ms-outlook";
2660
+ case "mht":
2661
+ case "mhtml":
2662
+ return "multipart/related";
2663
+ case "npmrc":
2664
+ return "text/x-npmrc";
2665
+ case "yarnrc":
2666
+ return "text/x-yarnrc";
2667
+ case "gitattributes":
2668
+ return "text/x-gitattributes";
2669
+ case "gitmodules":
2670
+ return "text/x-gitmodules";
2671
+ case "csv":
2672
+ return "text/csv";
2673
+ case "tsv":
2674
+ case "tab":
2675
+ return "text/tab-separated-values";
2676
+ case "psv":
2677
+ return "text/x-pipe-separated-values";
2678
+ case "json":
2679
+ return "application/json";
2680
+ case "jsonl":
2681
+ case "ndjson":
2682
+ case "jsonlines":
2683
+ case "ldjson":
2684
+ return "application/x-ndjson";
2685
+ case "ppt":
2686
+ case "pps":
2687
+ case "pot":
2688
+ case "dps":
2689
+ return "application/vnd.ms-powerpoint";
2690
+ case "dpt":
2691
+ return "application/wps-office.dpt";
2692
+ case "ppsx":
2693
+ return "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
2694
+ case "pptm":
2695
+ return "application/vnd.ms-powerpoint.presentation.macroenabled.12";
2696
+ case "ppsm":
2697
+ return "application/vnd.ms-powerpoint.slideshow.macroenabled.12";
2698
+ case "potx":
2699
+ return "application/vnd.openxmlformats-officedocument.presentationml.template";
2700
+ case "potm":
2701
+ return "application/vnd.ms-powerpoint.template.macroenabled.12";
2702
+ case "odp":
2703
+ return "application/vnd.oasis.opendocument.presentation";
2704
+ case "otp":
2705
+ return "application/vnd.oasis.opendocument.presentation-template";
2706
+ case "fodp":
2707
+ return "application/vnd.oasis.opendocument.presentation-flat-xml";
2708
+ case "sxi":
2709
+ return "application/vnd.sun.xml.impress";
2710
+ case "sti":
2711
+ return "application/vnd.sun.xml.impress.template";
2712
+ case "odg":
2713
+ return "application/vnd.oasis.opendocument.graphics";
2714
+ case "otg":
2715
+ return "application/vnd.oasis.opendocument.graphics-template";
2716
+ case "fodg":
2717
+ return "application/vnd.oasis.opendocument.graphics-flat-xml";
2718
+ case "sxd":
2719
+ return "application/vnd.sun.xml.draw";
2720
+ case "std":
2721
+ return "application/vnd.sun.xml.draw.template";
2722
+ case "png":
2723
+ return "image/png";
2724
+ default:
2725
+ return "application/octet-stream";
2726
+ }
2727
+ }
2728
+ function mt(e) {
2729
+ var s;
2730
+ const r = (((s = String(e ?? "").split(/[?#]/, 1)[0]) == null ? void 0 : s.trim()) ?? "").split(/[\\/]/).pop() ?? "", o = Gt(r);
2731
+ if (o)
2732
+ return o;
2733
+ const a = r.lastIndexOf(".");
2734
+ return a < 0 || a === r.length - 1 ? "" : a === 0 && r.indexOf(".", 1) < 0 ? F(r.slice(1)) : F(r.slice(a + 1));
2735
+ }
2736
+ function Gt(e) {
2737
+ const t = e.trim().toLowerCase();
2738
+ return t ? t === "dockerfile" || t.startsWith("dockerfile.") ? "dockerfile" : t === "makefile" || t === "gnumakefile" || t === "bsdmakefile" ? "make" : t === "cmakelists.txt" ? "cmake" : "" : "";
2739
+ }
2740
+ function F(e) {
2741
+ return e.trim().replace(/^\./, "").toLowerCase();
2742
+ }
2743
+ export {
2744
+ ct as H,
2745
+ L as W,
2746
+ Xt as a,
2747
+ Zt as b,
2748
+ Qt as c,
2749
+ Kt as d,
2750
+ T as e,
2751
+ p as t
2752
+ };