@open-take/runtime 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cdp-capture-DXTkPLLF.js → cdp-capture-Coui4-Wt.js} +551 -38
- package/dist/cdp-capture-Coui4-Wt.js.map +1 -0
- package/dist/cdp-capture-nGRiRSVD.js +3 -0
- package/dist/index.d.ts +183 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +182 -16
- package/dist/index.js.map +1 -1
- package/editor-dist/assets/index-C8-bVp44.js +49 -0
- package/editor-dist/assets/{index-C5jr6lU8.css → index-tUAsN_8O.css} +1 -1
- package/editor-dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/cdp-capture-DXTkPLLF.js.map +0 -1
- package/dist/cdp-capture-eKyYWSuf.js +0 -3
- package/editor-dist/assets/index-DWKvpdN6.js +0 -49
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/capture.ts","../src/cdp-capture.ts","../src/frame-diff.ts","../src/cdp.ts","../src/edit-server.ts","../src/take.ts","../src/review.ts","../src/frames.ts","../src/index.ts"],"sourcesContent":null,"mappings":";;;;;KAcY,SAAA;;;AAAZ,CAAA;;;AAIY,KAAA,UAAA,GAAU,MAAA,GAAA,OAAA,GAAA,QAAA;AAMV,KAAA,QAAA,GAAQ;EAAA,MAAA,EAAA,OAAA;EAAA,QAOP,CAAA,EAAA,MAAA;EAAU,IAqBV,CAAA,EAAA,MAAA;EAAU,IAYV,CAAA,EAAA,MAAA;EAAS,QAIX,CAAA,EAAA,MAAA;EAAS,IAEP,CAAA,EAvCA,UAuCA;CAAS,GAAA;EAKC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/capture.ts","../src/cdp-capture.ts","../src/nav.ts","../src/auth.ts","../src/frame-diff.ts","../src/cdp.ts","../src/edit-server.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AAW,OAAA,EAAA,MAAA;EAAA;;EAAoC,UAAlB,CAAA,EQsNpC,URtNoC;EAAO,WAAA,CAAA,EAAA,OAAA;;;;ECO9C,UAAA,CAAA,EAAA,CAAA,QAAe,EAAA,MAKnB,EAAA,GAAI,IAAA;;;;;;;;;;;iBO2NU,iBAAA,OACd,wBACL;;;YAA8D;;;;;APxLjE;;AACU,iBO0MY,qBAAA,CP1MZ,IAAA,EAAA;EAAU,eACX,EAAA,MAAA;EAAU,WAGP,EAAA,MAAA;EAAU,OACnB,EAAA,MAAA;EAAe;EA0FN,cAAA,CAAY,EAAA,MAAA,GAAA,IAAA;;;;IOoHpB;;;EPxGkB,QAAA,EOwG4C,kBPxG1B,EAAA;CAAA,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { captureTake, captureTakeCDP, ensureChrome, inspectPage, resolveChrome } from "./cdp-capture-
|
|
1
|
+
import { captureTake, captureTakeCDP, ensureChrome, inspectPage, resolveChrome, resolveNavigateUrl } from "./cdp-capture-Coui4-Wt.js";
|
|
2
2
|
import { appendFile, copyFile, mkdir, mkdtemp, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { homedir, tmpdir } from "node:os";
|
|
4
4
|
import { basename, dirname, extname, join, normalize, resolve } from "node:path";
|
|
5
5
|
import { FINISH, LOOKS, MOTION, ZOOM_LEVELS, finishName, formatIssues, formatIssues as formatIssues$1, lookName, math, motionName, planComposition, renderTake, resolveFfmpeg, resolveFfprobe, validateComposition, validateComposition as validateComposition$1, zoomLevelName } from "@open-take/compositor";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
|
-
import { createReadStream, statSync } from "node:fs";
|
|
7
|
+
import { createReadStream, mkdirSync, statSync } from "node:fs";
|
|
8
8
|
import { createServer } from "node:http";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
|
|
@@ -238,7 +238,7 @@ async function resolveTakePaths(input) {
|
|
|
238
238
|
}
|
|
239
239
|
p = join(p, pick);
|
|
240
240
|
}
|
|
241
|
-
const base = p.replace(/\.dossier\.md$/i, "").replace(/\.prev\.composition\.json$/i, "").replace(/\.composition\.json$/i, "").replace(/\.capture\.json$/i, "").replace(/\.capture\.mp4$/i, "").replace(/\.review\.mp4$/i, "").replace(/\.draft\.mp4$/i, "").replace(/\.ab\.mp4$/i, "").replace(/\.prev\.mp4$/i, "").replace(/\.mp4$/i, "");
|
|
241
|
+
const base = p.replace(/\.dossier\.md$/i, "").replace(/\.notes\.cursor$/i, "").replace(/\.notes\.md$/i, "").replace(/\.prev\.composition\.json$/i, "").replace(/\.composition\.json$/i, "").replace(/\.capture\.json$/i, "").replace(/\.capture\.mp4$/i, "").replace(/\.review\.mp4$/i, "").replace(/\.draft\.mp4$/i, "").replace(/\.ab\.mp4$/i, "").replace(/\.prev\.mp4$/i, "").replace(/\.mp4$/i, "");
|
|
242
242
|
return {
|
|
243
243
|
base,
|
|
244
244
|
name: basename(base),
|
|
@@ -250,7 +250,9 @@ async function resolveTakePaths(input) {
|
|
|
250
250
|
draftPath: `${base}.draft.mp4`,
|
|
251
251
|
abPath: `${base}.ab.mp4`,
|
|
252
252
|
prevPath: `${base}.prev.mp4`,
|
|
253
|
-
dossierPath: `${base}.dossier.md
|
|
253
|
+
dossierPath: `${base}.dossier.md`,
|
|
254
|
+
notesPath: `${base}.notes.md`,
|
|
255
|
+
notesCursorPath: `${base}.notes.cursor`
|
|
254
256
|
};
|
|
255
257
|
}
|
|
256
258
|
/** Friendly preflight: verbs die with a clear message instead of a raw ffmpeg
|
|
@@ -294,6 +296,7 @@ const KIND_LABEL = {
|
|
|
294
296
|
click: "click",
|
|
295
297
|
type: "type",
|
|
296
298
|
drag: "drag",
|
|
299
|
+
dropFiles: "drop",
|
|
297
300
|
scroll: "scroll",
|
|
298
301
|
hover: "hover",
|
|
299
302
|
press: "key"
|
|
@@ -418,7 +421,7 @@ async function renderReview(take, opts = {}) {
|
|
|
418
421
|
badges: buildBadges(comp)
|
|
419
422
|
}
|
|
420
423
|
};
|
|
421
|
-
await renderTake({
|
|
424
|
+
const { warnings } = await renderTake({
|
|
422
425
|
composition: decorated,
|
|
423
426
|
videoPath: take.capturePath,
|
|
424
427
|
outPath: take.reviewPath,
|
|
@@ -429,7 +432,8 @@ async function renderReview(take, opts = {}) {
|
|
|
429
432
|
});
|
|
430
433
|
return {
|
|
431
434
|
reviewPath: take.reviewPath,
|
|
432
|
-
sheet: buildBeatSheet(comp, take.name)
|
|
435
|
+
sheet: buildBeatSheet(comp, take.name),
|
|
436
|
+
warnings
|
|
433
437
|
};
|
|
434
438
|
}
|
|
435
439
|
/** Draft-quality re-render of the CURRENT composition to `<base>.draft.mp4` —
|
|
@@ -441,7 +445,7 @@ async function renderDraft(take, opts = {}) {
|
|
|
441
445
|
const comp = JSON.parse(await readFile(take.compositionPath, "utf8"));
|
|
442
446
|
const captureLog = await loadLogSibling(take.capturePath);
|
|
443
447
|
const chromePath = await ensureChrome(opts.chromePath);
|
|
444
|
-
await renderTake({
|
|
448
|
+
const { warnings } = await renderTake({
|
|
445
449
|
composition: toDraft(comp),
|
|
446
450
|
videoPath: take.capturePath,
|
|
447
451
|
outPath: take.draftPath,
|
|
@@ -450,7 +454,10 @@ async function renderDraft(take, opts = {}) {
|
|
|
450
454
|
chromePath,
|
|
451
455
|
writeCompositionSibling: false
|
|
452
456
|
});
|
|
453
|
-
return {
|
|
457
|
+
return {
|
|
458
|
+
draftPath: take.draftPath,
|
|
459
|
+
warnings
|
|
460
|
+
};
|
|
454
461
|
}
|
|
455
462
|
function parseSetFlag(set, beat) {
|
|
456
463
|
const eq = set.indexOf("=");
|
|
@@ -863,6 +870,81 @@ function revealPath(p) {
|
|
|
863
870
|
spawnOpener(getRevealCommand(abs), `at: ${abs}\n`);
|
|
864
871
|
}
|
|
865
872
|
|
|
873
|
+
//#endregion
|
|
874
|
+
//#region src/auth.ts
|
|
875
|
+
/** The canonical profile dir for a named auth profile. Names are a single
|
|
876
|
+
* path segment — anything else ("../", "/", spaces-only) would escape or
|
|
877
|
+
* collide with other open-take state under ~/.open-take. */
|
|
878
|
+
function profileDir(name) {
|
|
879
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name) || name.includes("..")) throw new Error(`invalid profile name ${JSON.stringify(name)} — use letters/digits/dots/dashes/underscores`);
|
|
880
|
+
return join(homedir(), ".open-take", "profiles", name);
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Open a headed Chrome on the persistent profile and resolve when the user is
|
|
884
|
+
* done (Enter on stdin, or the browser quits). The profile dir is returned so
|
|
885
|
+
* callers can print how to use it.
|
|
886
|
+
*/
|
|
887
|
+
async function authProfile(opts) {
|
|
888
|
+
const dir = opts.dir ?? profileDir(opts.name);
|
|
889
|
+
mkdirSync(dir, { recursive: true });
|
|
890
|
+
const chrome = await ensureChrome(opts.chromePath);
|
|
891
|
+
const proc = spawn(chrome, [
|
|
892
|
+
`--user-data-dir=${dir}`,
|
|
893
|
+
"--no-first-run",
|
|
894
|
+
"--no-default-browser-check",
|
|
895
|
+
"--password-store=basic",
|
|
896
|
+
"--use-mock-keychain",
|
|
897
|
+
"--window-size=1280,900",
|
|
898
|
+
opts.url ?? "about:blank"
|
|
899
|
+
], {
|
|
900
|
+
stdio: [
|
|
901
|
+
"ignore",
|
|
902
|
+
"ignore",
|
|
903
|
+
"ignore"
|
|
904
|
+
],
|
|
905
|
+
detached: false
|
|
906
|
+
});
|
|
907
|
+
let spawnErr;
|
|
908
|
+
await new Promise((resolveWait) => {
|
|
909
|
+
let settled = false;
|
|
910
|
+
const done = () => {
|
|
911
|
+
if (settled) return;
|
|
912
|
+
settled = true;
|
|
913
|
+
process.stdin.off("data", onEnter);
|
|
914
|
+
if (process.stdin.isTTY) process.stdin.pause();
|
|
915
|
+
resolveWait();
|
|
916
|
+
};
|
|
917
|
+
const onEnter = () => done();
|
|
918
|
+
proc.once("exit", done);
|
|
919
|
+
proc.once("error", (e) => {
|
|
920
|
+
spawnErr = e;
|
|
921
|
+
done();
|
|
922
|
+
});
|
|
923
|
+
if (process.stdin.isTTY) {
|
|
924
|
+
process.stdin.resume();
|
|
925
|
+
process.stdin.on("data", onEnter);
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
if (spawnErr) throw new Error(`auth: failed to launch Chrome: ${spawnErr.message}`);
|
|
929
|
+
if (proc.exitCode == null) {
|
|
930
|
+
proc.kill("SIGTERM");
|
|
931
|
+
await new Promise((r) => {
|
|
932
|
+
const tm = setTimeout(() => {
|
|
933
|
+
try {
|
|
934
|
+
proc.kill("SIGKILL");
|
|
935
|
+
} catch {}
|
|
936
|
+
r();
|
|
937
|
+
}, 4e3);
|
|
938
|
+
proc.once("exit", () => {
|
|
939
|
+
clearTimeout(tm);
|
|
940
|
+
r();
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
945
|
+
return { dir };
|
|
946
|
+
}
|
|
947
|
+
|
|
866
948
|
//#endregion
|
|
867
949
|
//#region src/edit-server.ts
|
|
868
950
|
const CONTENT_TYPE = {
|
|
@@ -982,7 +1064,7 @@ async function startEditServer(opts, deps = {}) {
|
|
|
982
1064
|
return run$1;
|
|
983
1065
|
};
|
|
984
1066
|
/** Persist unless someone else wrote first. `baseMtime` is the mtime the
|
|
985
|
-
* client last read. Every API write must provide it;
|
|
1067
|
+
* client last read. Every API write must provide it; "Keep mine" re-bases to
|
|
986
1068
|
* the 409's mtime and remains guarded against an even newer write.
|
|
987
1069
|
*
|
|
988
1070
|
* We check once before writing the temp file and again immediately before
|
|
@@ -1083,7 +1165,7 @@ async function startEditServer(opts, deps = {}) {
|
|
|
1083
1165
|
return;
|
|
1084
1166
|
}
|
|
1085
1167
|
const line = text.trim().replace(/\s+/g, " ").slice(0, 2e3);
|
|
1086
|
-
await appendFile(
|
|
1168
|
+
await appendFile(take.notesPath, `- ${line}\n`);
|
|
1087
1169
|
process.stdout.write(`NOTE ${JSON.stringify({
|
|
1088
1170
|
take: take.name,
|
|
1089
1171
|
text: line
|
|
@@ -1198,8 +1280,8 @@ async function startEditServer(opts, deps = {}) {
|
|
|
1198
1280
|
sendJson(res, 405, { error: "method not allowed" });
|
|
1199
1281
|
return;
|
|
1200
1282
|
}
|
|
1201
|
-
const rel = normalize(decodeURIComponent(path)).replace(/^(\.\.[/\\])+/, "");
|
|
1202
|
-
let filePath = join(dist, rel === "/" ? "index.html" : rel);
|
|
1283
|
+
const rel$1 = normalize(decodeURIComponent(path)).replace(/^(\.\.[/\\])+/, "");
|
|
1284
|
+
let filePath = join(dist, rel$1 === "/" ? "index.html" : rel$1);
|
|
1203
1285
|
if (!filePath.startsWith(dist)) {
|
|
1204
1286
|
sendJson(res, 403, { error: "forbidden" });
|
|
1205
1287
|
return;
|
|
@@ -1277,6 +1359,87 @@ function listen(server, startPort) {
|
|
|
1277
1359
|
});
|
|
1278
1360
|
}
|
|
1279
1361
|
|
|
1362
|
+
//#endregion
|
|
1363
|
+
//#region src/notes.ts
|
|
1364
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
1365
|
+
const fileSize = async (p) => (await stat(p).catch(() => null))?.size ?? 0;
|
|
1366
|
+
const readBytes = async (p) => await readFile(p).catch(() => Buffer.alloc(0));
|
|
1367
|
+
const readCursor = async (p) => {
|
|
1368
|
+
const n = Number((await readFile(p, "utf8").catch(() => "")).trim());
|
|
1369
|
+
return Number.isFinite(n) && n >= 0 ? n : 0;
|
|
1370
|
+
};
|
|
1371
|
+
/** `- opening is too slow` → `opening is too slow`; blank lines and stray text
|
|
1372
|
+
* are tolerated. Notes are free text in any language — never parsed for meaning. */
|
|
1373
|
+
const parseNotes = (buf) => buf.toString("utf8").split("\n").map((l) => l.replace(/^-\s*/, "").trim()).filter((l) => l.length > 0);
|
|
1374
|
+
/** The notes appended since the last read, and how many the log holds.
|
|
1375
|
+
* Advances the cursor unless `peek`, so a note is delivered exactly once. */
|
|
1376
|
+
async function readNotes(take, opts = {}) {
|
|
1377
|
+
const buf = await readBytes(take.notesPath);
|
|
1378
|
+
const saved = await readCursor(take.notesCursorPath);
|
|
1379
|
+
const from = opts.all || saved > buf.length ? 0 : saved;
|
|
1380
|
+
const end = buf.lastIndexOf(10) + 1;
|
|
1381
|
+
const slice = end > from ? buf.subarray(from, end) : Buffer.alloc(0);
|
|
1382
|
+
const cursor = Math.max(from, end);
|
|
1383
|
+
if (!opts.peek && cursor !== saved) await writeFile(take.notesCursorPath, `${cursor}\n`).catch(() => {});
|
|
1384
|
+
return {
|
|
1385
|
+
notes: parseNotes(slice),
|
|
1386
|
+
total: parseNotes(buf).length,
|
|
1387
|
+
cursor
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
/** Block until at least one unread note exists, then return it (and consume
|
|
1391
|
+
* it). Returns immediately when the log already has unread notes — a waiter
|
|
1392
|
+
* started after the user typed still delivers, which is what makes restarting
|
|
1393
|
+
* one between rounds lossless. */
|
|
1394
|
+
async function waitForNotes(take, opts = {}) {
|
|
1395
|
+
const timeoutMs = opts.timeoutMs ?? 30 * 6e4;
|
|
1396
|
+
const pollMs = opts.pollMs ?? 500;
|
|
1397
|
+
const settleMs = opts.settleMs ?? 800;
|
|
1398
|
+
const deadline = Date.now() + timeoutMs;
|
|
1399
|
+
let last = await readNotes(take, opts);
|
|
1400
|
+
if (last.notes.length) return {
|
|
1401
|
+
...last,
|
|
1402
|
+
timedOut: false
|
|
1403
|
+
};
|
|
1404
|
+
let seen = await fileSize(take.notesPath);
|
|
1405
|
+
while (!opts.signal?.aborted && Date.now() < deadline) {
|
|
1406
|
+
await sleep(Math.min(pollMs, Math.max(0, deadline - Date.now())));
|
|
1407
|
+
if (opts.signal?.aborted) break;
|
|
1408
|
+
if (await fileSize(take.notesPath) === seen) continue;
|
|
1409
|
+
if (settleMs > 0) await sleep(settleMs);
|
|
1410
|
+
last = await readNotes(take, {
|
|
1411
|
+
...opts,
|
|
1412
|
+
all: false
|
|
1413
|
+
});
|
|
1414
|
+
seen = await fileSize(take.notesPath);
|
|
1415
|
+
if (last.notes.length) return {
|
|
1416
|
+
...last,
|
|
1417
|
+
timedOut: false
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
return {
|
|
1421
|
+
...last,
|
|
1422
|
+
notes: [],
|
|
1423
|
+
timedOut: true
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
const rel = (p) => p.replace(`${process.cwd()}/`, "");
|
|
1427
|
+
/** The wake-up message. Written for an agent reading a finished background
|
|
1428
|
+
* command: what came in, and the one thing it must re-read before editing. */
|
|
1429
|
+
function formatNotes(take, res, opts = {}) {
|
|
1430
|
+
if (!res.notes.length) {
|
|
1431
|
+
if (opts.waited && res.timedOut) return `no notes · ${take.name} (waited out)\n`;
|
|
1432
|
+
return res.total ? `no new notes · ${take.name} (${res.total} already read in ${rel(take.notesPath)})\n` : `no notes yet · ${take.name} (${rel(take.notesPath)})\n`;
|
|
1433
|
+
}
|
|
1434
|
+
const head = `${res.notes.length} new note${res.notes.length > 1 ? "s" : ""} from the editor · ${take.name}`;
|
|
1435
|
+
return [
|
|
1436
|
+
head,
|
|
1437
|
+
...res.notes.map((n) => `- ${n}`),
|
|
1438
|
+
`(re-read ${rel(take.compositionPath)} before editing it — the editor may have changed it too)`,
|
|
1439
|
+
""
|
|
1440
|
+
].join("\n");
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1280
1443
|
//#endregion
|
|
1281
1444
|
//#region src/frames.ts
|
|
1282
1445
|
const COLS = 5;
|
|
@@ -1535,7 +1698,7 @@ async function makeTake(plan, opts) {
|
|
|
1535
1698
|
}
|
|
1536
1699
|
} : opts.planOpts;
|
|
1537
1700
|
const composition = planComposition(log, planOpts);
|
|
1538
|
-
const { mp4Path, compositionPath } = await renderTake({
|
|
1701
|
+
const { mp4Path, compositionPath, warnings } = await renderTake({
|
|
1539
1702
|
composition: opts.draft ? toDraft(composition) : composition,
|
|
1540
1703
|
videoPath: capturePath,
|
|
1541
1704
|
outPath: resolve(opts.outPath),
|
|
@@ -1551,7 +1714,10 @@ async function makeTake(plan, opts) {
|
|
|
1551
1714
|
capturePath,
|
|
1552
1715
|
captureLogPath,
|
|
1553
1716
|
composition,
|
|
1554
|
-
skipped: log.skipped ?? []
|
|
1717
|
+
skipped: log.skipped ?? [],
|
|
1718
|
+
settleWaits: log.settleWaits ?? [],
|
|
1719
|
+
...log.paintedFrac != null ? { paintedFrac: log.paintedFrac } : {},
|
|
1720
|
+
warnings
|
|
1555
1721
|
};
|
|
1556
1722
|
}
|
|
1557
1723
|
/** Refine: re-render an EDITED composition over a saved capture — no app
|
|
@@ -1593,5 +1759,5 @@ async function renderCompositionFile(opts) {
|
|
|
1593
1759
|
}
|
|
1594
1760
|
|
|
1595
1761
|
//#endregion
|
|
1596
|
-
export { SAY_IT_CARD, annotateCaptureLog, beatLabel, buildBadges, buildBeatSheet, buildFramePlan, buildFrameSheet, captureLogPathFor, captureTake, captureTakeCDP, diffFrames, ensureChrome, formatIssues, inspectPage, loadCaptureLogSibling, makeTake, openPath, renderAbReel, renderBeforeAfter, renderComposition, renderCompositionFile, renderDraft, renderFrames, renderReview, requireTakeFiles, resolveChrome, resolveTakePaths, revealPath, stagePrev, startEditServer, toDraft, validateComposition };
|
|
1762
|
+
export { SAY_IT_CARD, annotateCaptureLog, authProfile, beatLabel, buildBadges, buildBeatSheet, buildFramePlan, buildFrameSheet, captureLogPathFor, captureTake, captureTakeCDP, diffFrames, ensureChrome, formatIssues, formatNotes, inspectPage, loadCaptureLogSibling, makeTake, openPath, profileDir, readNotes, renderAbReel, renderBeforeAfter, renderComposition, renderCompositionFile, renderDraft, renderFrames, renderReview, requireTakeFiles, resolveChrome, resolveNavigateUrl, resolveTakePaths, revealPath, stagePrev, startEditServer, toDraft, validateComposition, waitForNotes };
|
|
1597
1763
|
//# sourceMappingURL=index.js.map
|