postext 1.89.3 → 1.90.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.
- package/dist/__tests__/bundle/layoutCache.test.js +19 -0
- package/dist/__tests__/bundle/layoutCache.test.js.map +1 -1
- package/dist/__tests__/composed/reflow/pageMemo.test.js +4 -0
- package/dist/__tests__/composed/reflow/pageMemo.test.js.map +1 -1
- package/dist/__tests__/exports.test.js +1 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/pipeline/passEdit.test.d.ts +2 -0
- package/dist/__tests__/pipeline/passEdit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/passEdit.test.js +113 -0
- package/dist/__tests__/pipeline/passEdit.test.js.map +1 -0
- package/dist/__tests__/pipeline/passResume.test.d.ts +2 -0
- package/dist/__tests__/pipeline/passResume.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/passResume.test.js +136 -0
- package/dist/__tests__/pipeline/passResume.test.js.map +1 -0
- package/dist/__tests__/resumeCheck.d.ts +2 -0
- package/dist/__tests__/resumeCheck.d.ts.map +1 -0
- package/dist/__tests__/resumeCheck.js +47 -0
- package/dist/__tests__/resumeCheck.js.map +1 -0
- package/dist/__tests__/worker/docPatch.test.d.ts +2 -0
- package/dist/__tests__/worker/docPatch.test.d.ts.map +1 -0
- package/dist/__tests__/worker/docPatch.test.js +78 -0
- package/dist/__tests__/worker/docPatch.test.js.map +1 -0
- package/dist/bundle/book.js +8 -1
- package/dist/bundle/book.js.map +1 -1
- package/dist/comics/layoutPage/records.d.ts.map +1 -1
- package/dist/comics/layoutPage/records.js +3 -2
- package/dist/comics/layoutPage/records.js.map +1 -1
- package/dist/comics/transform.d.ts.map +1 -1
- package/dist/comics/transform.js +2 -1
- package/dist/comics/transform.js.map +1 -1
- package/dist/composed/labels.d.ts.map +1 -1
- package/dist/composed/labels.js +4 -2
- package/dist/composed/labels.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/marks/arabicMarks.d.ts +0 -7
- package/dist/marks/arabicMarks.d.ts.map +1 -1
- package/dist/marks/arabicMarks.js +47 -2
- package/dist/marks/arabicMarks.js.map +1 -1
- package/dist/marks/cjkMarks.d.ts.map +1 -1
- package/dist/marks/cjkMarks.js +2 -1
- package/dist/marks/cjkMarks.js.map +1 -1
- package/dist/marks/emphasisOverline.d.ts.map +1 -1
- package/dist/marks/emphasisOverline.js +2 -1
- package/dist/marks/emphasisOverline.js.map +1 -1
- package/dist/marks/highlightMarks.d.ts.map +1 -1
- package/dist/marks/highlightMarks.js +5 -0
- package/dist/marks/highlightMarks.js.map +1 -1
- package/dist/pipeline/blocks/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/blocks/buildHelpers.js +2 -1
- package/dist/pipeline/blocks/buildHelpers.js.map +1 -1
- package/dist/pipeline/blocks/mirrorFrame.d.ts.map +1 -1
- package/dist/pipeline/blocks/mirrorFrame.js +5 -1
- package/dist/pipeline/blocks/mirrorFrame.js.map +1 -1
- package/dist/pipeline/blocks/placement.d.ts.map +1 -1
- package/dist/pipeline/blocks/placement.js +2 -1
- package/dist/pipeline/blocks/placement.js.map +1 -1
- package/dist/pipeline/build/drivers.d.ts +3 -1
- package/dist/pipeline/build/drivers.d.ts.map +1 -1
- package/dist/pipeline/build/drivers.js +34 -1
- package/dist/pipeline/build/drivers.js.map +1 -1
- package/dist/pipeline/build/pageMarks.d.ts.map +1 -1
- package/dist/pipeline/build/pageMarks.js +3 -0
- package/dist/pipeline/build/pageMarks.js.map +1 -1
- package/dist/pipeline/build/pass/bands.d.ts.map +1 -1
- package/dist/pipeline/build/pass/bands.js +5 -3
- package/dist/pipeline/build/pass/bands.js.map +1 -1
- package/dist/pipeline/build/pass/breaks.d.ts.map +1 -1
- package/dist/pipeline/build/pass/breaks.js +2 -0
- package/dist/pipeline/build/pass/breaks.js.map +1 -1
- package/dist/pipeline/build/pass/callouts/calloutCommit.d.ts.map +1 -1
- package/dist/pipeline/build/pass/callouts/calloutCommit.js +2 -0
- package/dist/pipeline/build/pass/callouts/calloutCommit.js.map +1 -1
- package/dist/pipeline/build/pass/comics.d.ts.map +1 -1
- package/dist/pipeline/build/pass/comics.js +2 -0
- package/dist/pipeline/build/pass/comics.js.map +1 -1
- package/dist/pipeline/build/pass/composed/jumps.d.ts.map +1 -1
- package/dist/pipeline/build/pass/composed/jumps.js +2 -0
- package/dist/pipeline/build/pass/composed/jumps.js.map +1 -1
- package/dist/pipeline/build/pass/composed.d.ts.map +1 -1
- package/dist/pipeline/build/pass/composed.js +2 -0
- package/dist/pipeline/build/pass/composed.js.map +1 -1
- package/dist/pipeline/build/pass/floats/citationPull.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/citationPull.js +2 -0
- package/dist/pipeline/build/pass/floats/citationPull.js.map +1 -1
- package/dist/pipeline/build/pass/floats/floatBands.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/floatBands.js +2 -0
- package/dist/pipeline/build/pass/floats/floatBands.js.map +1 -1
- package/dist/pipeline/build/pass/floats/floatFlush.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/floatFlush.js +3 -5
- package/dist/pipeline/build/pass/floats/floatFlush.js.map +1 -1
- package/dist/pipeline/build/pass/floats/floatMeasure.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/floatMeasure.js +2 -0
- package/dist/pipeline/build/pass/floats/floatMeasure.js.map +1 -1
- package/dist/pipeline/build/pass/floats/floatPlace.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/floatPlace.js +2 -0
- package/dist/pipeline/build/pass/floats/floatPlace.js.map +1 -1
- package/dist/pipeline/build/pass/floats/floatQueue.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/floatQueue.js +2 -0
- package/dist/pipeline/build/pass/floats/floatQueue.js.map +1 -1
- package/dist/pipeline/build/pass/floats/floatRows.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/floatRows.js +2 -0
- package/dist/pipeline/build/pass/floats/floatRows.js.map +1 -1
- package/dist/pipeline/build/pass/floats/footStack.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/footStack.js +2 -0
- package/dist/pipeline/build/pass/floats/footStack.js.map +1 -1
- package/dist/pipeline/build/pass/floats/strips.d.ts.map +1 -1
- package/dist/pipeline/build/pass/floats/strips.js +2 -0
- package/dist/pipeline/build/pass/floats/strips.js.map +1 -1
- package/dist/pipeline/build/pass/measuringAsFound.d.ts +9 -0
- package/dist/pipeline/build/pass/measuringAsFound.d.ts.map +1 -0
- package/dist/pipeline/build/pass/measuringAsFound.js +48 -0
- package/dist/pipeline/build/pass/measuringAsFound.js.map +1 -0
- package/dist/pipeline/build/pass/notes.d.ts.map +1 -1
- package/dist/pipeline/build/pass/notes.js +13 -0
- package/dist/pipeline/build/pass/notes.js.map +1 -1
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts +1 -0
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts.map +1 -1
- package/dist/pipeline/build/pass/setup/contentSetup.js +8 -2
- package/dist/pipeline/build/pass/setup/contentSetup.js.map +1 -1
- package/dist/pipeline/build/pass/setup/pageSetup.d.ts.map +1 -1
- package/dist/pipeline/build/pass/setup/pageSetup.js +2 -0
- package/dist/pipeline/build/pass/setup/pageSetup.js.map +1 -1
- package/dist/pipeline/build/pass/setup/passFinish.d.ts.map +1 -1
- package/dist/pipeline/build/pass/setup/passFinish.js +6 -2
- package/dist/pipeline/build/pass/setup/passFinish.js.map +1 -1
- package/dist/pipeline/build/pass/shortLists.d.ts.map +1 -1
- package/dist/pipeline/build/pass/shortLists.js +2 -0
- package/dist/pipeline/build/pass/shortLists.js.map +1 -1
- package/dist/pipeline/build/pass.d.ts.map +1 -1
- package/dist/pipeline/build/pass.js +122 -92
- package/dist/pipeline/build/pass.js.map +1 -1
- package/dist/pipeline/build/passMade.d.ts +57 -0
- package/dist/pipeline/build/passMade.d.ts.map +1 -0
- package/dist/pipeline/build/passMade.js +216 -0
- package/dist/pipeline/build/passMade.js.map +1 -0
- package/dist/pipeline/build/passRejoin.d.ts +12 -0
- package/dist/pipeline/build/passRejoin.d.ts.map +1 -0
- package/dist/pipeline/build/passRejoin.js +172 -0
- package/dist/pipeline/build/passRejoin.js.map +1 -0
- package/dist/pipeline/build/passResume.d.ts +54 -0
- package/dist/pipeline/build/passResume.d.ts.map +1 -0
- package/dist/pipeline/build/passResume.js +212 -0
- package/dist/pipeline/build/passResume.js.map +1 -0
- package/dist/pipeline/build/passReuse.d.ts +117 -0
- package/dist/pipeline/build/passReuse.d.ts.map +1 -0
- package/dist/pipeline/build/passReuse.js +417 -0
- package/dist/pipeline/build/passReuse.js.map +1 -0
- package/dist/pipeline/build/passSetups.d.ts +53 -0
- package/dist/pipeline/build/passSetups.d.ts.map +1 -0
- package/dist/pipeline/build/passSetups.js +215 -0
- package/dist/pipeline/build/passSetups.js.map +1 -0
- package/dist/pipeline/build/passTape.d.ts +179 -0
- package/dist/pipeline/build/passTape.d.ts.map +1 -0
- package/dist/pipeline/build/passTape.js +534 -0
- package/dist/pipeline/build/passTape.js.map +1 -0
- package/dist/pipeline/build/passTypes.d.ts +12 -0
- package/dist/pipeline/build/passTypes.d.ts.map +1 -1
- package/dist/pipeline/build/passTypes.js.map +1 -1
- package/dist/pipeline/build/warnings.d.ts.map +1 -1
- package/dist/pipeline/build/warnings.js +2 -1
- package/dist/pipeline/build/warnings.js.map +1 -1
- package/dist/pipeline/build.d.ts +1 -0
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +1 -0
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/inputs.d.ts.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/inputs.js +2 -1
- package/dist/pipeline/callouts/calloutLayout/inputs.js.map +1 -1
- package/dist/pipeline/code/codeLines.d.ts.map +1 -1
- package/dist/pipeline/code/codeLines.js +2 -1
- package/dist/pipeline/code/codeLines.js.map +1 -1
- package/dist/pipeline/floats/textWrap.d.ts.map +1 -1
- package/dist/pipeline/floats/textWrap.js +3 -2
- package/dist/pipeline/floats/textWrap.js.map +1 -1
- package/dist/pipeline/index.d.ts +1 -1
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +1 -1
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/pages/dieCuts.d.ts.map +1 -1
- package/dist/pipeline/pages/dieCuts.js +6 -1
- package/dist/pipeline/pages/dieCuts.js.map +1 -1
- package/dist/pipeline/pages/headerFooter/layoutHeadersAndFooters.d.ts.map +1 -1
- package/dist/pipeline/pages/headerFooter/layoutHeadersAndFooters.js +4 -0
- package/dist/pipeline/pages/headerFooter/layoutHeadersAndFooters.js.map +1 -1
- package/dist/pipeline/pages/headerFooter/pass.d.ts.map +1 -1
- package/dist/pipeline/pages/headerFooter/pass.js +2 -1
- package/dist/pipeline/pages/headerFooter/pass.js.map +1 -1
- package/dist/pipeline/pages/pageRoles.d.ts.map +1 -1
- package/dist/pipeline/pages/pageRoles.js +4 -0
- package/dist/pipeline/pages/pageRoles.js.map +1 -1
- package/dist/pipeline/pages/paper.d.ts.map +1 -1
- package/dist/pipeline/pages/paper.js +4 -0
- package/dist/pipeline/pages/paper.js.map +1 -1
- package/dist/pipeline/text/dropCap.d.ts +5 -0
- package/dist/pipeline/text/dropCap.d.ts.map +1 -1
- package/dist/pipeline/text/dropCap.js +7 -0
- package/dist/pipeline/text/dropCap.js.map +1 -1
- package/dist/pipeline/text/verticalMetrics.d.ts.map +1 -1
- package/dist/pipeline/text/verticalMetrics.js +4 -0
- package/dist/pipeline/text/verticalMetrics.js.map +1 -1
- package/dist/worker/client.d.ts +5 -0
- package/dist/worker/client.d.ts.map +1 -1
- package/dist/worker/client.js +22 -2
- package/dist/worker/client.js.map +1 -1
- package/dist/worker/docPatch.d.ts +44 -0
- package/dist/worker/docPatch.d.ts.map +1 -0
- package/dist/worker/docPatch.js +72 -0
- package/dist/worker/docPatch.js.map +1 -0
- package/dist/worker/layout.worker.js +35 -3
- package/dist/worker/layout.worker.js.map +1 -1
- package/dist/worker/protocol.d.ts +27 -2
- package/dist/worker/protocol.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
// A layout that starts from the layout before (#1639): the checkpoints of
|
|
2
|
+
// each placement pass are kept from one build of a document to the next,
|
|
3
|
+
// and a pass over edited content starts from the last checkpoint taken
|
|
4
|
+
// before anything had read what the edit changed.
|
|
5
|
+
//
|
|
6
|
+
// A checkpoint of the pass before serves this pass only when the pass
|
|
7
|
+
// would have reached it in the same state. That holds when:
|
|
8
|
+
//
|
|
9
|
+
// - the two setups are equal, object by object, but for the blocks the
|
|
10
|
+
// edit changed and the places in the source after it (`pairSetups`);
|
|
11
|
+
// - the hints of the two passes are equal (they are part of the setup
|
|
12
|
+
// compared);
|
|
13
|
+
// - nothing placed before the checkpoint had read a changed block (the
|
|
14
|
+
// tape counts the highest block read, `PassTape.counting`);
|
|
15
|
+
// - fonts and the maths engine are as they were.
|
|
16
|
+
//
|
|
17
|
+
// Anything else, and the pass is placed from its first block, as without
|
|
18
|
+
// tapes. A pass that starts from a checkpoint and then writes to a page
|
|
19
|
+
// the checkpoint had closed is placed again from its first block too
|
|
20
|
+
// (`ClosedPageWrite`).
|
|
21
|
+
import { measurementGeneration } from '../../measure/canvas.js';
|
|
22
|
+
import { isMathReady } from '../../math/index.js';
|
|
23
|
+
import { ClosedPageWrite } from './passTape.js';
|
|
24
|
+
import { carryMarks, lastPlaceOf, makeMoves, markMade, moveSourcePlaces, movesWait, unfrozenCopy } from './passMade.js';
|
|
25
|
+
import { objectsOf, tapeRejoins } from './passRejoin.js';
|
|
26
|
+
import { Names, pairSetups, sameHintReads } from './passSetups.js';
|
|
27
|
+
/** A checkpoint is taken when this many pages have opened since the last. */
|
|
28
|
+
const PAGES_BETWEEN_CHECKPOINTS = 4;
|
|
29
|
+
/** The page a block is on, as blocks and pages say it. */
|
|
30
|
+
const pageOf = (value) => value.pageIndex;
|
|
31
|
+
const indexOf = (page) => page.index;
|
|
32
|
+
class Tapes {
|
|
33
|
+
previous = [];
|
|
34
|
+
current = [];
|
|
35
|
+
held;
|
|
36
|
+
stats = { passes: 0, startedAt: [], reasons: [], placedAgain: 0, pagesKept: [], rejoinedAt: [], pagesTaken: [], apartAt: [], builtAgain: false };
|
|
37
|
+
/** A build starts: its passes pair with those of the build before. */
|
|
38
|
+
begin() {
|
|
39
|
+
this.held = this.previous;
|
|
40
|
+
this.previous = this.current;
|
|
41
|
+
this.current = [];
|
|
42
|
+
this.stats = { passes: 0, startedAt: [], reasons: [], placedAgain: 0, pagesKept: [], rejoinedAt: [], pagesTaken: [], apartAt: [], builtAgain: false };
|
|
43
|
+
}
|
|
44
|
+
/** The build did not end (cancelled, failed): the build before stands. */
|
|
45
|
+
abandon() {
|
|
46
|
+
this.current = this.previous;
|
|
47
|
+
this.previous = this.held ?? [];
|
|
48
|
+
}
|
|
49
|
+
/** Forget every build: the next one starts from nothing. */
|
|
50
|
+
forget(error) {
|
|
51
|
+
this.previous = [];
|
|
52
|
+
this.current = [];
|
|
53
|
+
this.held = undefined;
|
|
54
|
+
const at = String(error.stack).split('\n').slice(0, 4).map((line) => line.trim().replace(/\(.*\/(src|dist)\//, '(')).join(' < ');
|
|
55
|
+
this.stats = { passes: 0, startedAt: [], reasons: [], placedAgain: 0, pagesKept: [], rejoinedAt: [], pagesTaken: [], apartAt: [], builtAgain: true, builtAgainAt: at };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Tapes for one document. */
|
|
59
|
+
export function createLayoutTapes() {
|
|
60
|
+
return new Tapes();
|
|
61
|
+
}
|
|
62
|
+
/** A build with `tapes` starts. */
|
|
63
|
+
export function beginLayoutTapes(tapes) {
|
|
64
|
+
tapes?.begin();
|
|
65
|
+
}
|
|
66
|
+
/** A build with `tapes` did not end. */
|
|
67
|
+
export function abandonLayoutTapes(tapes) {
|
|
68
|
+
tapes?.abandon();
|
|
69
|
+
}
|
|
70
|
+
/** A build with `tapes` wrote to a page it had kept from the build before
|
|
71
|
+
* and is done again: with the same tapes, emptied. */
|
|
72
|
+
export function forgetLayoutTapes(tapes, error) {
|
|
73
|
+
tapes.forget(error);
|
|
74
|
+
}
|
|
75
|
+
/** The place of the next pass among the passes of the build. */
|
|
76
|
+
export function nextTapePass(tapes) {
|
|
77
|
+
return tapes ? tapes.stats.passes++ : undefined;
|
|
78
|
+
}
|
|
79
|
+
/** Pass `ordinal` started from a checkpoint and could not go on: it leaves
|
|
80
|
+
* no record, and is placed again without the tapes. */
|
|
81
|
+
export function dropTapePass(tapes, ordinal) {
|
|
82
|
+
const t = tapes;
|
|
83
|
+
t.current[ordinal] = undefined;
|
|
84
|
+
t.stats.startedAt[ordinal] = 0;
|
|
85
|
+
t.stats.placedAgain++;
|
|
86
|
+
}
|
|
87
|
+
const environment = () => `${measurementGeneration()}|${isMathReady() ? 1 : 0}`;
|
|
88
|
+
/** Whether the steps after the placing make, of a page of `doc`, only
|
|
89
|
+
* what stays on the page. Line numbers in the margin, composed pages and
|
|
90
|
+
* comics also leave records and warnings with the document (numbers that
|
|
91
|
+
* overlap, a folio a page lost): such a document's pages are all made
|
|
92
|
+
* again, so that those are too. */
|
|
93
|
+
function pagesStandAlone(input, pages = input.doc.pages) {
|
|
94
|
+
if (input.numbersLines)
|
|
95
|
+
return false;
|
|
96
|
+
return !pages.some((page) => page.composed !== undefined || page.comic !== undefined);
|
|
97
|
+
}
|
|
98
|
+
/** One pass of a build with tapes: where it starts, and the checkpoints
|
|
99
|
+
* it leaves. */
|
|
100
|
+
export class PassRecording {
|
|
101
|
+
tapes;
|
|
102
|
+
ordinal;
|
|
103
|
+
tape;
|
|
104
|
+
input;
|
|
105
|
+
record;
|
|
106
|
+
from;
|
|
107
|
+
adopted = [];
|
|
108
|
+
/** Where the edit starts in the source, and by how much it moves what
|
|
109
|
+
* follows (0: nothing moves). */
|
|
110
|
+
editAt = 0;
|
|
111
|
+
editDelta = 0;
|
|
112
|
+
/** The checkpoints of the pass before that this pass may rejoin, by
|
|
113
|
+
* their block; and where it did: the pages and blocks it had then. */
|
|
114
|
+
rejoins;
|
|
115
|
+
/** The setup of this pass is that of the pass before, but for the edit. */
|
|
116
|
+
paired = false;
|
|
117
|
+
rejoined;
|
|
118
|
+
before;
|
|
119
|
+
lastPages = 0;
|
|
120
|
+
constructor(tapes, ordinal, tape, input) {
|
|
121
|
+
this.tapes = tapes;
|
|
122
|
+
this.ordinal = ordinal;
|
|
123
|
+
this.tape = tape;
|
|
124
|
+
this.input = input;
|
|
125
|
+
const t = tapes;
|
|
126
|
+
const before = t.previous[ordinal];
|
|
127
|
+
this.before = before;
|
|
128
|
+
// Comparing and naming the setup reads every block: not reads of the
|
|
129
|
+
// layout.
|
|
130
|
+
tape.countsReads = false;
|
|
131
|
+
const tracks = (value) => tape.tracks(value);
|
|
132
|
+
let names;
|
|
133
|
+
let reason = before ? '' : 'no pass before';
|
|
134
|
+
if (before) {
|
|
135
|
+
const pairing = before.environment !== environment() ? 'fonts or engines changed' : pairSetups(before, input.roots, input.body, tracks);
|
|
136
|
+
if (typeof pairing === 'string')
|
|
137
|
+
reason = pairing;
|
|
138
|
+
else {
|
|
139
|
+
// The first block the edit reaches: the first that ends at or
|
|
140
|
+
// after the first place that differs. Every block that changed
|
|
141
|
+
// must be at or after it.
|
|
142
|
+
let first = before.blocks.length;
|
|
143
|
+
if (pairing.at < Math.max(before.body.length, input.body.length)) {
|
|
144
|
+
first = before.blocks.findIndex((b) => b.sourceEnd >= pairing.at);
|
|
145
|
+
if (first < 0)
|
|
146
|
+
first = before.blocks.length;
|
|
147
|
+
}
|
|
148
|
+
if (pairing.changed.some((i) => i < first))
|
|
149
|
+
reason = 'a block before the edit changed';
|
|
150
|
+
else {
|
|
151
|
+
this.editAt = pairing.at + input.bodyOffset;
|
|
152
|
+
this.editDelta = pairing.delta;
|
|
153
|
+
const hintsSame = sameHintReads(before, input.roots.hints, pairing);
|
|
154
|
+
names = before.names;
|
|
155
|
+
names.succeed(pairing.pairs);
|
|
156
|
+
for (let i = before.checkpoints.length - 1; i >= 0; i--) {
|
|
157
|
+
const c = before.checkpoints[i];
|
|
158
|
+
if (c.image.opaque || c.readUpTo >= first || c.blockIdx > first || c.hintReads > hintsSame)
|
|
159
|
+
continue;
|
|
160
|
+
this.from = c;
|
|
161
|
+
this.adopted = before.checkpoints.slice(0, i + 1);
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
// Where this pass may rejoin the one before: at its checkpoints
|
|
165
|
+
// past every block the edit changed, when every hint that pass
|
|
166
|
+
// read is answered the same now and its pages stand alone.
|
|
167
|
+
const last = Math.max(first, ...pairing.changed);
|
|
168
|
+
// (A pass that starts from its first block, the edit being before
|
|
169
|
+
// its first checkpoint, may rejoin all the same.)
|
|
170
|
+
this.paired = true;
|
|
171
|
+
{
|
|
172
|
+
const whyNot = !before.end || !before.finished ? 'the pass before left no end'
|
|
173
|
+
: before.end.opaque ? 'the end of the pass before cannot be read by another pass'
|
|
174
|
+
: hintsSame !== before.hintReads.length ? `the hints differ from read ${hintsSame} on (${String(before.hintReads[hintsSame]?.[0])})`
|
|
175
|
+
: !pagesStandAlone(input, before.finished.made.pages) ? 'the pages do not stand alone' : '';
|
|
176
|
+
if (!whyNot)
|
|
177
|
+
this.rejoins = new Map(before.checkpoints.filter((c) => c.blockIdx > last && !c.image.opaque).map((c) => [c.blockIdx, c]));
|
|
178
|
+
t.stats.apartAt[ordinal] = whyNot || (this.rejoins.size === 0 ? 'the pass before left no checkpoint after the edit' : undefined);
|
|
179
|
+
}
|
|
180
|
+
if (!this.from) {
|
|
181
|
+
reason = before.checkpoints.length === 0 ? 'the pass before left no checkpoint'
|
|
182
|
+
: before.checkpoints.every((c) => c.hintReads > hintsSame) ? `the hints differ from read ${hintsSame} on (${String(before.hintReads[hintsSame]?.[0])})`
|
|
183
|
+
: 'no checkpoint before the edit';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
names ??= new Names();
|
|
189
|
+
tape.names = names;
|
|
190
|
+
tape.atoms(input.roots);
|
|
191
|
+
this.record = {
|
|
192
|
+
roots: input.roots, blocks: input.blocks, body: input.body, environment: environment(), tracks, names, checkpoints: [], hintReads: tape.hintReads,
|
|
193
|
+
freeze: (values) => tape.close(values),
|
|
194
|
+
};
|
|
195
|
+
t.stats.reasons[ordinal] = reason;
|
|
196
|
+
t.stats.startedAt[ordinal] = 0;
|
|
197
|
+
tape.countsReads = true;
|
|
198
|
+
}
|
|
199
|
+
/** Put the pass where it starts: at its first block (0), or at the
|
|
200
|
+
* block of the checkpoint it takes up. */
|
|
201
|
+
start() {
|
|
202
|
+
const from = this.from;
|
|
203
|
+
if (!from)
|
|
204
|
+
return 0;
|
|
205
|
+
this.tape.putBack(from.image);
|
|
206
|
+
// The pages the checkpoint holds by reference are closed: a write to
|
|
207
|
+
// one throws, and the pass is placed again from its first block.
|
|
208
|
+
this.tape.close(this.input.doc.pages.slice(0, -1));
|
|
209
|
+
this.tape.readUpTo = from.readUpTo;
|
|
210
|
+
// The reads the checkpoint stands on, then this pass's own.
|
|
211
|
+
this.tape.hintReads.splice(0, Infinity, ...this.before.hintReads.slice(0, from.hintReads));
|
|
212
|
+
this.record.checkpoints = this.adopted;
|
|
213
|
+
this.lastPages = this.input.doc.pages.length;
|
|
214
|
+
this.tapes.stats.startedAt[this.ordinal] = from.blockIdx;
|
|
215
|
+
return from.blockIdx;
|
|
216
|
+
}
|
|
217
|
+
/** The pass is about to place block `blockIdx`. True when it need not:
|
|
218
|
+
* it has rejoined the pass before it, and its tape is now as that pass
|
|
219
|
+
* left its own. */
|
|
220
|
+
atBlock(blockIdx) {
|
|
221
|
+
const candidate = this.rejoins?.get(blockIdx);
|
|
222
|
+
if (candidate && this.rejoin(candidate, blockIdx))
|
|
223
|
+
return true;
|
|
224
|
+
this.checkpoint(blockIdx);
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
/** Try to rejoin the pass before at its checkpoint `c`. */
|
|
228
|
+
rejoin(c, blockIdx) {
|
|
229
|
+
const doc = this.input.doc;
|
|
230
|
+
const old = this.before;
|
|
231
|
+
this.tape.close(doc.pages.slice(0, -1));
|
|
232
|
+
const closed = tapeRejoins(this.tape, c.image, this.editAt, this.editDelta);
|
|
233
|
+
if (typeof closed === 'string') {
|
|
234
|
+
this.tapes.stats.apartAt[this.ordinal] = `block ${blockIdx}: ${closed}`;
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
// The closed objects of the pages the edit changed: the end of the
|
|
238
|
+
// pass before must hold none that nothing here stands for.
|
|
239
|
+
const pages = doc.pages.length - 1;
|
|
240
|
+
const changed = old.finished.placed.pages.slice(0, pages).filter((page, i) => page !== doc.pages[i]);
|
|
241
|
+
const gone = objectsOf(changed);
|
|
242
|
+
for (const object of closed.keys())
|
|
243
|
+
gone.delete(object);
|
|
244
|
+
const here = { blockIdx, readUpTo: this.tape.readUpTo, hintReads: this.tape.hintReads.length, image: this.tape.record() };
|
|
245
|
+
const blocks = doc.blocks.length;
|
|
246
|
+
try {
|
|
247
|
+
this.tape.putBack(old.end, { stands: closed, gone, at: this.editAt, delta: this.editDelta });
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
if (!(error instanceof ClosedPageWrite))
|
|
251
|
+
throw error;
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
// The checkpoint the next build may rejoin at, and the hints the
|
|
255
|
+
// pass before read from here on.
|
|
256
|
+
this.record.checkpoints.push(here);
|
|
257
|
+
this.tape.hintReads.push(...old.hintReads.slice(c.hintReads));
|
|
258
|
+
this.rejoined = { pages, blocks };
|
|
259
|
+
this.tapes.stats.rejoinedAt[this.ordinal] = blockIdx;
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
checkpoint(blockIdx) {
|
|
263
|
+
const pages = this.input.doc.pages.length;
|
|
264
|
+
if (pages < this.lastPages + PAGES_BETWEEN_CHECKPOINTS)
|
|
265
|
+
return;
|
|
266
|
+
this.lastPages = pages;
|
|
267
|
+
this.tape.close(this.input.doc.pages.slice(0, -1));
|
|
268
|
+
this.record.checkpoints.push({ blockIdx, readUpTo: this.tape.readUpTo, hintReads: this.tape.hintReads.length, image: this.tape.record() });
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The pass has placed its blocks; what follows sets things on its pages
|
|
272
|
+
* (notes at the column feet, page labels, running heads, line frames).
|
|
273
|
+
* The pages the pass took from its checkpoint are the pages the pass
|
|
274
|
+
* before placed: what the build before made of them stands, frozen, and
|
|
275
|
+
* the steps that follow leave a frozen page alone. The other pages are
|
|
276
|
+
* opened (`PassTape.open`). Kept only while the document has as many
|
|
277
|
+
* pages as it had: a page's foot may print their number.
|
|
278
|
+
*/
|
|
279
|
+
done() {
|
|
280
|
+
const doc = this.input.doc;
|
|
281
|
+
// Every page is closed, the last too: the end of the pass holds them
|
|
282
|
+
// as they are, for a pass of the next build that rejoins this one.
|
|
283
|
+
this.tape.close(doc.pages);
|
|
284
|
+
this.record.end = this.tape.record();
|
|
285
|
+
const placed = { pages: [...doc.pages], blocks: [...doc.blocks] };
|
|
286
|
+
const old = this.paired ? this.before?.finished : undefined;
|
|
287
|
+
const usable = old !== undefined && old.placed.pages.length === placed.pages.length && pagesStandAlone(this.input);
|
|
288
|
+
const stands = new Map();
|
|
289
|
+
// The pages this pass takes from the one before, and the moves that
|
|
290
|
+
// pass left waiting on its own: they go on waiting when the same
|
|
291
|
+
// pages are taken again (a letter typed after another), and are made
|
|
292
|
+
// now otherwise, before anything reads those pages.
|
|
293
|
+
const takes = [];
|
|
294
|
+
if (usable && this.rejoined) {
|
|
295
|
+
for (let i = this.rejoined.pages; i < placed.pages.length; i++)
|
|
296
|
+
if (placed.pages[i] === old.placed.pages[i])
|
|
297
|
+
takes.push(old.made.pages[i]);
|
|
298
|
+
}
|
|
299
|
+
let moves = old?.moves;
|
|
300
|
+
// The same pages: taken from the same page on. A page that was taken
|
|
301
|
+
// and is now before the edit must have its moves made to be kept.
|
|
302
|
+
if (moves && (moves.list.length >= 8 || old.movesFrom !== this.rejoined?.pages || takes.some((page) => !moves.objects.includes(page) || Object.isFrozen(page)))) {
|
|
303
|
+
makeMoves(moves);
|
|
304
|
+
moves = undefined;
|
|
305
|
+
}
|
|
306
|
+
// A page is kept when it is the page the pass before placed and what
|
|
307
|
+
// was made of it names no place the edit moved: a note set at its foot
|
|
308
|
+
// may be written after the edit, wherever it is cited.
|
|
309
|
+
const stays = (i) => {
|
|
310
|
+
if (placed.pages[i] !== old.placed.pages[i])
|
|
311
|
+
return false;
|
|
312
|
+
if (this.editDelta === 0)
|
|
313
|
+
return true;
|
|
314
|
+
const last = (old.lastPlace[i] ??= lastPlaceOf(old.made.pages[i]));
|
|
315
|
+
return last < this.editAt;
|
|
316
|
+
};
|
|
317
|
+
let kept = 0;
|
|
318
|
+
const keptPages = new Set();
|
|
319
|
+
if (usable) {
|
|
320
|
+
while (kept < placed.pages.length - 1 && stays(kept)) {
|
|
321
|
+
stands.set(placed.pages[kept], old.made.pages[kept]);
|
|
322
|
+
keptPages.add(indexOf(placed.pages[kept]));
|
|
323
|
+
kept++;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// The pages after the block where the pass rejoined the one before
|
|
327
|
+
// are that pass's pages: what was made of them stands too, its places
|
|
328
|
+
// in the source moved by the edit, in place. A page an earlier build
|
|
329
|
+
// froze (it was before that build's edit) gives way to a copy first.
|
|
330
|
+
const at = this.editAt;
|
|
331
|
+
const delta = this.editDelta;
|
|
332
|
+
const moved = new Set();
|
|
333
|
+
const copies = new Map();
|
|
334
|
+
const owed = [];
|
|
335
|
+
const taken = (made) => {
|
|
336
|
+
let page = copies.get(made) ?? made;
|
|
337
|
+
if (Object.isFrozen(page)) {
|
|
338
|
+
page = unfrozenCopy(made, copies);
|
|
339
|
+
carryMarks(made, page);
|
|
340
|
+
}
|
|
341
|
+
owed.push(page);
|
|
342
|
+
markMade(page);
|
|
343
|
+
return page;
|
|
344
|
+
};
|
|
345
|
+
const takenPages = new Set();
|
|
346
|
+
if (usable && this.rejoined) {
|
|
347
|
+
for (let i = this.rejoined.pages; i < placed.pages.length; i++) {
|
|
348
|
+
if (placed.pages[i] !== old.placed.pages[i])
|
|
349
|
+
continue;
|
|
350
|
+
stands.set(placed.pages[i], taken(old.made.pages[i]));
|
|
351
|
+
takenPages.add(indexOf(placed.pages[i]));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// Their blocks, by their place in the list. A block of the pass before
|
|
355
|
+
// that no page stands for keeps its place: its copy is moved below.
|
|
356
|
+
const frozen = [];
|
|
357
|
+
const stale = [];
|
|
358
|
+
if (old) {
|
|
359
|
+
for (let j = 0; j < placed.blocks.length; j++) {
|
|
360
|
+
const block = placed.blocks[j];
|
|
361
|
+
const same = block === old.placed.blocks[j];
|
|
362
|
+
if (same && keptPages.has(pageOf(block))) {
|
|
363
|
+
stands.set(block, old.made.blocks[j]);
|
|
364
|
+
frozen.push(old.made.blocks[j]);
|
|
365
|
+
}
|
|
366
|
+
else if (same && takenPages.has(pageOf(block))) {
|
|
367
|
+
stands.set(block, taken(old.made.blocks[j]));
|
|
368
|
+
}
|
|
369
|
+
else if (this.rejoined && j >= this.rejoined.blocks && Object.isFrozen(block)) {
|
|
370
|
+
stale.push(j);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// What the finish before added to the list (the notes at the columns'
|
|
375
|
+
// feet) comes after the blocks placed, page after page: for the pages
|
|
376
|
+
// kept, before what this finish adds; for the pages taken, after it.
|
|
377
|
+
const added = old ? old.doc.blocks.slice(old.placed.blocks.length) : [];
|
|
378
|
+
const before = added.filter((b) => keptPages.has(pageOf(b)));
|
|
379
|
+
const after = added.filter((b) => takenPages.has(pageOf(b))).map(taken);
|
|
380
|
+
if (kept > 0)
|
|
381
|
+
this.before.freeze([...old.made.pages.slice(0, kept), ...frozen, ...before]);
|
|
382
|
+
this.tape.open(stands.size > 0 ? stands : undefined);
|
|
383
|
+
for (const j of stale)
|
|
384
|
+
moveSourcePlaces(doc.blocks[j], at, delta, moved);
|
|
385
|
+
for (const block of before)
|
|
386
|
+
doc.blocks.push(block);
|
|
387
|
+
if (after.length > 0)
|
|
388
|
+
this.tape.afterFinish = () => { for (const block of after)
|
|
389
|
+
doc.blocks.push(block); };
|
|
390
|
+
// The move this edit owes the pages taken waits with the others.
|
|
391
|
+
const waits = owed.length > 0 && delta !== 0
|
|
392
|
+
? { objects: owed, list: [...(moves?.list ?? []), { at, delta }] }
|
|
393
|
+
: owed.length > 0 && moves && moves.list.length > 0 ? { objects: owed, list: moves.list } : undefined;
|
|
394
|
+
// Under the guard of the checks (`__postextGuardTaken`), the pages
|
|
395
|
+
// taken are moved now and frozen: a step after the placing that is not
|
|
396
|
+
// taught to leave a made page alone then throws, as it does on a page
|
|
397
|
+
// kept before the edit, instead of setting it twice unseen.
|
|
398
|
+
if (globalThis.__postextGuardTaken && owed.length > 0) {
|
|
399
|
+
if (waits)
|
|
400
|
+
makeMoves(waits);
|
|
401
|
+
this.before.freeze(owed);
|
|
402
|
+
}
|
|
403
|
+
else if (waits)
|
|
404
|
+
movesWait(waits);
|
|
405
|
+
this.record.finished = {
|
|
406
|
+
placed, made: { pages: [...doc.pages], blocks: doc.blocks.slice(0, placed.blocks.length) }, doc,
|
|
407
|
+
lastPlace: old ? old.lastPlace.slice(0, kept) : [],
|
|
408
|
+
...(waits ? { moves: waits, movesFrom: this.rejoined.pages } : {}),
|
|
409
|
+
};
|
|
410
|
+
const t = this.tapes;
|
|
411
|
+
t.stats.pagesKept[this.ordinal] = kept;
|
|
412
|
+
t.stats.pagesTaken[this.ordinal] = takenPages.size;
|
|
413
|
+
t.current[this.ordinal] = this.record;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
export { ClosedPageWrite };
|
|
417
|
+
//# sourceMappingURL=passReuse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passReuse.js","sourceRoot":"","sources":["../../../src/pipeline/build/passReuse.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,yEAAyE;AACzE,uEAAuE;AACvE,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,sEAAsE;AACtE,eAAe;AACf,uEAAuE;AACvE,8DAA8D;AAC9D,iDAAiD;AACjD,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,uBAAuB;AAEvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAiC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAqB,MAAM,eAAe,CAAC;AAC3I,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAEnF,6EAA6E;AAC7E,MAAM,yBAAyB,GAAG,CAAC,CAAC;AA+CpC,0DAA0D;AAC1D,MAAM,MAAM,GAAG,CAAC,KAAa,EAAW,EAAE,CAAE,KAAiC,CAAC,SAAS,CAAC;AACxF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAW,EAAE,CAAE,IAA4B,CAAC,KAAK,CAAC;AA0C/E,MAAM,KAAK;IACT,QAAQ,GAA+B,EAAE,CAAC;IAC1C,OAAO,GAA+B,EAAE,CAAC;IACjC,IAAI,CAAyC;IACrD,KAAK,GAAoB,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,E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M,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG;YAC/F,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YAClD,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,QAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpE,CAAC;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,KAAc,CAAC;QAC9B,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACvC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;QACnD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type SetupNames } from './passTape.js';
|
|
2
|
+
/** What a pass leaves of its setup for the next build's comparison. */
|
|
3
|
+
export interface PassSetup {
|
|
4
|
+
roots: Record<string, unknown>;
|
|
5
|
+
/** The text the blocks were read from. */
|
|
6
|
+
body: string;
|
|
7
|
+
/** Whether an object is on the pass's tape (state, not setup). */
|
|
8
|
+
tracks: (value: object) => boolean;
|
|
9
|
+
/** The reads of the hints the pass made, in order. */
|
|
10
|
+
hintReads: [member: string, key: unknown][];
|
|
11
|
+
}
|
|
12
|
+
/** The numbers of the objects of a pass's setups, build after build. */
|
|
13
|
+
export declare class Names implements SetupNames {
|
|
14
|
+
private readonly ids;
|
|
15
|
+
private objects;
|
|
16
|
+
private next;
|
|
17
|
+
idOf(value: object): number | undefined;
|
|
18
|
+
byId(id: number): object | undefined;
|
|
19
|
+
name(value: object): number;
|
|
20
|
+
/** A new setup takes the numbers of the one before: each object of
|
|
21
|
+
* `pairs` its predecessor's. What the new setup has no pair for (what a
|
|
22
|
+
* changed block holds) is forgotten with the old setup. */
|
|
23
|
+
succeed(pairs: ReadonlyMap<object, object>): void;
|
|
24
|
+
}
|
|
25
|
+
export interface Pairing {
|
|
26
|
+
/** First place of the text that differs, and by how much its length. */
|
|
27
|
+
at: number;
|
|
28
|
+
delta: number;
|
|
29
|
+
pairs: Map<object, object>;
|
|
30
|
+
/** Content blocks that differ, by index. */
|
|
31
|
+
changed: number[];
|
|
32
|
+
tracksBefore: (value: object) => boolean;
|
|
33
|
+
tracksNow: (value: object) => boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Compare the setup of the pass before (`before`) with this pass's
|
|
37
|
+
* (`now`). Undefined with the reason when they differ in more than the
|
|
38
|
+
* blocks an edit changed; else the pairing, its `changed` the blocks that
|
|
39
|
+
* differ. The roots are objects of named members: the text and its parse
|
|
40
|
+
* are left out, a function that is a member of a root stands for itself
|
|
41
|
+
* (the helpers a setup makes from what is compared here), and the content
|
|
42
|
+
* blocks are compared one by one.
|
|
43
|
+
*/
|
|
44
|
+
export declare function pairSetups(before: PassSetup, roots: Record<string, unknown>, body: string, tracksNow: (value: object) => boolean): Pairing | string;
|
|
45
|
+
/**
|
|
46
|
+
* How many of the reads the pass before made of its hints this pass's
|
|
47
|
+
* hints answer the same way: a checkpoint taken before the first read
|
|
48
|
+
* that differs was reached under the same answers. Pairs the hint objects
|
|
49
|
+
* found equal. A hint that is no map or set (read with no note) must be
|
|
50
|
+
* equal, or none of the reads counts.
|
|
51
|
+
*/
|
|
52
|
+
export declare function sameHintReads(before: PassSetup, hints: Record<string, unknown>, p: Pairing): number;
|
|
53
|
+
//# sourceMappingURL=passSetups.d.ts.map
|
|
@@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