@graview/ship 0.1.38 → 0.1.40
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/README.md +38 -3
- package/dist/browser-adapter.d.ts +73 -16
- package/dist/browser-adapter.d.ts.map +1 -1
- package/dist/browser-adapter.js +425 -24
- package/dist/browser-adapter.js.map +1 -1
- package/dist/browser.d.ts +2 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.d.ts +3 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +125 -36
- package/dist/cli.js.map +1 -1
- package/dist/dev.d.ts +2 -0
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/indexed-entries.d.ts +54 -0
- package/dist/indexed-entries.d.ts.map +1 -0
- package/dist/indexed-entries.js +60 -0
- package/dist/indexed-entries.js.map +1 -0
- package/dist/open-store.d.ts +21 -2
- package/dist/open-store.d.ts.map +1 -1
- package/dist/open-store.js +86 -9
- package/dist/open-store.js.map +1 -1
- package/dist/photos.d.ts +4 -3
- package/dist/photos.d.ts.map +1 -1
- package/dist/photos.js +4 -3
- package/dist/photos.js.map +1 -1
- package/dist/preview-app.d.ts +38 -0
- package/dist/preview-app.d.ts.map +1 -0
- package/dist/preview-app.js +54 -0
- package/dist/preview-app.js.map +1 -0
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/serve-preview.d.ts +24 -3
- package/dist/serve-preview.d.ts.map +1 -1
- package/dist/serve-preview.js +22 -11
- package/dist/serve-preview.js.map +1 -1
- package/dist/serve.d.ts +11 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +31 -4
- package/dist/serve.js.map +1 -1
- package/dist/shots.d.ts +3 -1
- package/dist/shots.d.ts.map +1 -1
- package/dist/shots.js +16 -6
- package/dist/shots.js.map +1 -1
- package/dist/source-aliases.d.ts +57 -0
- package/dist/source-aliases.d.ts.map +1 -0
- package/dist/source-aliases.js +82 -0
- package/dist/source-aliases.js.map +1 -0
- package/dist/store-hold.d.ts +4 -0
- package/dist/store-hold.d.ts.map +1 -1
- package/dist/store-hold.js +12 -0
- package/dist/store-hold.js.map +1 -1
- package/dist/sync-seed.d.ts +21 -0
- package/dist/sync-seed.d.ts.map +1 -1
- package/dist/sync-seed.js +57 -2
- package/dist/sync-seed.js.map +1 -1
- package/package.json +2 -2
package/dist/browser-adapter.js
CHANGED
|
@@ -1,18 +1,49 @@
|
|
|
1
|
+
import { indexedEntries } from "./indexed-entries.js";
|
|
2
|
+
/** The IndexedDB database every scope is kept in, its keys the same as localStorage's were. */
|
|
3
|
+
export const BROWSER_DATABASE = "graview";
|
|
4
|
+
/**
|
|
5
|
+
* A log kept in more pieces than this is put back together into one the
|
|
6
|
+
* next time it is read: each write appends a piece rather than rewriting
|
|
7
|
+
* the whole log, and reading two thousand pieces on every open would be
|
|
8
|
+
* the cost a long-lived page paid instead.
|
|
9
|
+
*/
|
|
10
|
+
const MOST_PIECES = 32;
|
|
1
11
|
/**
|
|
2
12
|
* Persistence in the browser itself: the SAME things the file adapter
|
|
3
13
|
* writes — the snapshot, the append-only log, the stored schema version —
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
14
|
+
* kept in IndexedDB. Not the epochs (FR-27): each keeps a whole copy of
|
|
15
|
+
* the graph as its base, and a page's store is verified by the host it is
|
|
16
|
+
* served from, not in the page. It slots into `openStore` unchanged,
|
|
17
|
+
* migrations included, so a sample app that remembers is the same
|
|
18
|
+
* lifecycle as a deployment that does, minus the server.
|
|
19
|
+
*
|
|
20
|
+
* INDEXEDDB, BECAUSE A STORE OUTGROWS LOCALSTORAGE. localStorage is a few
|
|
21
|
+
* megabytes an origin, and WebKit counts each character twice: the
|
|
22
|
+
* gauntlet's 2.8 MB seed did not fit in Safari, so the store opened and
|
|
23
|
+
* kept nothing. IndexedDB holds hundreds of megabytes in every engine, and
|
|
24
|
+
* an append writes the ops it appends rather than the whole log again. It
|
|
25
|
+
* is the default rather than where a store spills when localStorage is
|
|
26
|
+
* full, so where a store is kept never depends on how big it once grew.
|
|
27
|
+
*
|
|
28
|
+
* A STORE KEPT IN LOCALSTORAGE IS CARRIED FORWARD, not lost: the first
|
|
29
|
+
* time a scope is read, what localStorage holds for it is written into
|
|
30
|
+
* IndexedDB in one transaction, and only once that transaction has
|
|
31
|
+
* committed is it removed from localStorage. When the write fails, the
|
|
32
|
+
* store stays where it was and this adapter keeps it there; when IndexedDB
|
|
33
|
+
* will not open at all (a locked-down browser), it is localStorage as
|
|
34
|
+
* before.
|
|
35
|
+
*
|
|
36
|
+
* The database opens on the first read, not when the adapter is made, and
|
|
37
|
+
* every read and write waits for the ones asked for before it.
|
|
10
38
|
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
39
|
+
* A WRITE IS KEPT WHEN `apply` RETURNS, not when IndexedDB commits it: an
|
|
40
|
+
* IndexedDB write lands a transaction later, and a person who changed
|
|
41
|
+
* something and left the page at once lost it. `openStore` writes each op
|
|
42
|
+
* to a journal in localStorage (`<prefix>:<scope>:journal`) inside the
|
|
43
|
+
* apply, synchronously; the journal holds only the ops IndexedDB has not
|
|
44
|
+
* committed yet, and the next open puts back what it holds, each op once
|
|
45
|
+
* (the snapshot is kept with `<prefix>:<scope>:through`, the seq of the
|
|
46
|
+
* last op it reflects).
|
|
16
47
|
*
|
|
17
48
|
* A write that fails (quota, a locked-down browser) THROWS, and `openStore`
|
|
18
49
|
* reports it: an app that believes it remembered and did not is the worst
|
|
@@ -20,55 +51,425 @@
|
|
|
20
51
|
*/
|
|
21
52
|
export function createBrowserAdapter(options = {}) {
|
|
22
53
|
const prefix = options.prefix ?? "graview";
|
|
23
|
-
const storage = options.storage ?? pageStorage();
|
|
24
54
|
const keysFor = (scope) => ({
|
|
25
55
|
snapshot: `${prefix}:${scope}:snapshot`,
|
|
26
56
|
log: `${prefix}:${scope}:log`,
|
|
27
57
|
meta: `${prefix}:${scope}:meta`,
|
|
58
|
+
through: `${prefix}:${scope}:through`,
|
|
59
|
+
journal: `${prefix}:${scope}:journal`,
|
|
28
60
|
});
|
|
61
|
+
const factory = options.indexedDB ?? (options.storage ? undefined : pageIndexedDB());
|
|
62
|
+
const storage = options.storage ?? (factory ? pageStorageIfAny() : pageStorage());
|
|
63
|
+
const local = storage ? localBackend(storage, keysFor) : undefined;
|
|
64
|
+
if (!factory) {
|
|
65
|
+
if (!local)
|
|
66
|
+
throw noStorage();
|
|
67
|
+
const only = { backend: local, kept: "localStorage" };
|
|
68
|
+
return adapterOver(keysFor, async () => only, undefined);
|
|
69
|
+
}
|
|
70
|
+
let chosen;
|
|
71
|
+
const entries = indexedEntries(factory, BROWSER_DATABASE);
|
|
72
|
+
const indexed = indexedBackend(entries, storage, keysFor, () => {
|
|
73
|
+
// A store localStorage holds and IndexedDB would not take stays where it is, and so does this adapter.
|
|
74
|
+
if (local)
|
|
75
|
+
chosen = Promise.resolve({ backend: local, kept: "localStorage" });
|
|
76
|
+
});
|
|
77
|
+
const choose = () => (chosen ??= entries.ready().then(() => ({ backend: indexed, kept: "indexedDB" }), (error) => {
|
|
78
|
+
if (!local)
|
|
79
|
+
throw error;
|
|
80
|
+
return { backend: local, kept: "localStorage" };
|
|
81
|
+
}));
|
|
82
|
+
return adapterOver(keysFor, choose, storage);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* One adapter over whichever backend was chosen, every call waiting for
|
|
86
|
+
* the ones asked for before it — so a `saveMeta` a page does not await
|
|
87
|
+
* still lands before the `openStore` after it reads.
|
|
88
|
+
*
|
|
89
|
+
* With `journalIn`, it also keeps the write-ahead journal there: the ops
|
|
90
|
+
* applied and not yet committed, written synchronously. An op is let go
|
|
91
|
+
* of once the log has committed it AND a snapshot that reflects it has,
|
|
92
|
+
* which the adapter knows by seq: a snapshot is kept with the seq of the
|
|
93
|
+
* newest op heard of when `save` was CALLED — `openStore` journals every
|
|
94
|
+
* op inside the apply and takes the snapshot as it calls `save`, so that
|
|
95
|
+
* is the last op the snapshot reflects, whenever its write's turn comes.
|
|
96
|
+
*/
|
|
97
|
+
function adapterOver(keysFor, choose, journalIn) {
|
|
98
|
+
let chain = Promise.resolve();
|
|
99
|
+
const queued = (run) => {
|
|
100
|
+
const next = chain.then(async () => {
|
|
101
|
+
try {
|
|
102
|
+
return await run(await choose());
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
// The carry IndexedDB refused moved this adapter to localStorage, where the store still is: ask there.
|
|
106
|
+
if (error instanceof StayInLocalStorage)
|
|
107
|
+
return run(await choose());
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
chain = next.catch(() => undefined);
|
|
112
|
+
return next;
|
|
113
|
+
};
|
|
114
|
+
const adapter = {
|
|
115
|
+
name: "browser",
|
|
116
|
+
keysFor,
|
|
117
|
+
keptIn: () => queued(async (chosen) => chosen.kept),
|
|
118
|
+
load: (scope) => queued(({ backend }) => backend.load(scope)),
|
|
119
|
+
save: (scope, snapshot) => queued(({ backend }) => backend.save(scope, snapshot, undefined)),
|
|
120
|
+
delete: (scope) => queued(({ backend }) => backend.delete(scope)),
|
|
121
|
+
loadLog: (scope) => queued(({ backend }) => backend.loadLog(scope)),
|
|
122
|
+
appendOps: (scope, ops) => queued(({ backend }) => (ops.length === 0 ? Promise.resolve() : backend.appendOps(scope, ops))),
|
|
123
|
+
loadMeta: (scope) => queued(({ backend }) => backend.loadMeta(scope)),
|
|
124
|
+
saveMeta: (scope, meta) => queued(({ backend }) => backend.saveMeta(scope, meta)),
|
|
125
|
+
};
|
|
126
|
+
return journalIn ? journaled(adapter, keysFor, queued, journalIn) : adapter;
|
|
127
|
+
}
|
|
128
|
+
/** The adapter with its write-ahead journal in `storage`: see `BrowserAdapter.journal`. */
|
|
129
|
+
function journaled(plain, keysFor, queued, storage) {
|
|
130
|
+
const scopes = new Map();
|
|
131
|
+
const stateOf = (scope) => {
|
|
132
|
+
let state = scopes.get(scope);
|
|
133
|
+
// Nothing is let go of until what the log and the snapshot hold has been read or written.
|
|
134
|
+
if (!state)
|
|
135
|
+
scopes.set(scope, (state = { journal: undefined, head: -1, logged: -Infinity, through: -Infinity }));
|
|
136
|
+
return state;
|
|
137
|
+
};
|
|
138
|
+
const newest = (ops) => ops.reduce((most, op) => Math.max(most, op.seq), -1);
|
|
139
|
+
const heard = (scope, ops) => {
|
|
140
|
+
const state = stateOf(scope);
|
|
141
|
+
state.head = Math.max(state.head, newest(ops));
|
|
142
|
+
};
|
|
143
|
+
const journalOf = (scope) => {
|
|
144
|
+
const state = stateOf(scope);
|
|
145
|
+
if (!state.journal) {
|
|
146
|
+
try {
|
|
147
|
+
const raw = storage.getItem(keysFor(scope).journal);
|
|
148
|
+
state.journal = raw === null ? [] : JSON.parse(raw);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
// Storage locked away, or a journal that does not read, holds nothing to replay.
|
|
152
|
+
state.journal = [];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return state.journal;
|
|
156
|
+
};
|
|
157
|
+
const write = (scope, ops) => {
|
|
158
|
+
const key = keysFor(scope).journal;
|
|
159
|
+
if (ops.length === 0)
|
|
160
|
+
storage.removeItem(key);
|
|
161
|
+
else
|
|
162
|
+
storage.setItem(key, JSON.stringify(ops));
|
|
163
|
+
};
|
|
164
|
+
/** Lets go of what the log and the snapshot have both committed. */
|
|
165
|
+
const prune = (scope) => {
|
|
166
|
+
const state = stateOf(scope);
|
|
167
|
+
const kept = Math.min(state.logged, state.through);
|
|
168
|
+
const journal = journalOf(scope);
|
|
169
|
+
const left = journal.filter((op) => op.seq > kept);
|
|
170
|
+
if (left.length === journal.length)
|
|
171
|
+
return;
|
|
172
|
+
state.journal = left;
|
|
173
|
+
try {
|
|
174
|
+
write(scope, left);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// Left in localStorage, it is skipped on the next open: the log and the snapshot already have it.
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const throughOf = async (backend, scope) => ((await backend.load(scope)) === null ? -1 : backend.loadThrough(scope));
|
|
181
|
+
return {
|
|
182
|
+
...plain,
|
|
183
|
+
load: (scope) => queued(async ({ backend }) => {
|
|
184
|
+
const snapshot = await backend.load(scope);
|
|
185
|
+
stateOf(scope).through = snapshot === null ? -1 : await backend.loadThrough(scope);
|
|
186
|
+
return snapshot;
|
|
187
|
+
}),
|
|
188
|
+
save: (scope, snapshot) => {
|
|
189
|
+
// Read NOW, not when the write's turn comes: the snapshot was taken now, after every op journaled so far.
|
|
190
|
+
const through = stateOf(scope).head;
|
|
191
|
+
return queued(async ({ backend }) => {
|
|
192
|
+
await backend.save(scope, snapshot, through);
|
|
193
|
+
const state = stateOf(scope);
|
|
194
|
+
state.through = Math.max(state.through, through);
|
|
195
|
+
prune(scope);
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
delete: (scope) => queued(async ({ backend }) => {
|
|
199
|
+
await backend.delete(scope);
|
|
200
|
+
scopes.set(scope, { journal: [], head: -1, logged: -1, through: -1 });
|
|
201
|
+
write(scope, []);
|
|
202
|
+
}),
|
|
203
|
+
loadLog: (scope) => queued(async ({ backend }) => {
|
|
204
|
+
const log = await backend.loadLog(scope);
|
|
205
|
+
heard(scope, log);
|
|
206
|
+
stateOf(scope).logged = newest(log);
|
|
207
|
+
return log;
|
|
208
|
+
}),
|
|
209
|
+
appendOps: (scope, ops) => {
|
|
210
|
+
heard(scope, ops);
|
|
211
|
+
return queued(async ({ backend }) => {
|
|
212
|
+
if (ops.length === 0)
|
|
213
|
+
return;
|
|
214
|
+
await backend.appendOps(scope, ops);
|
|
215
|
+
const state = stateOf(scope);
|
|
216
|
+
state.logged = Math.max(state.logged, newest(ops));
|
|
217
|
+
prune(scope);
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
journal(scope, ops) {
|
|
221
|
+
if (ops.length === 0)
|
|
222
|
+
return;
|
|
223
|
+
heard(scope, ops);
|
|
224
|
+
const journal = journalOf(scope);
|
|
225
|
+
journal.push(...ops);
|
|
226
|
+
// Throws when localStorage refuses it: `openStore` reports that, and the op is kept here to be written with the next.
|
|
227
|
+
write(scope, journal);
|
|
228
|
+
},
|
|
229
|
+
loadJournal: (scope) => queued(async ({ backend }) => {
|
|
230
|
+
const ops = [...journalOf(scope)].sort((a, b) => a.seq - b.seq);
|
|
231
|
+
heard(scope, ops);
|
|
232
|
+
return { ops, through: await throughOf(backend, scope) };
|
|
233
|
+
}),
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** The three entries per scope in localStorage, as the adapter kept them before IndexedDB. */
|
|
237
|
+
function localBackend(storage, keysFor) {
|
|
29
238
|
const read = (key) => {
|
|
30
239
|
const raw = storage.getItem(key);
|
|
31
|
-
return raw
|
|
240
|
+
return raw == null ? null : JSON.parse(raw);
|
|
32
241
|
};
|
|
33
242
|
const write = (key, value) => storage.setItem(key, JSON.stringify(value));
|
|
34
243
|
return {
|
|
35
|
-
name: "browser",
|
|
36
|
-
keysFor,
|
|
37
244
|
async load(scope) {
|
|
38
245
|
return read(keysFor(scope).snapshot);
|
|
39
246
|
},
|
|
40
|
-
async save(scope, snapshot) {
|
|
247
|
+
async save(scope, snapshot, through) {
|
|
41
248
|
write(keysFor(scope).snapshot, snapshot);
|
|
249
|
+
if (through !== undefined)
|
|
250
|
+
write(keysFor(scope).through, through);
|
|
251
|
+
},
|
|
252
|
+
async loadThrough(scope) {
|
|
253
|
+
return read(keysFor(scope).through) ?? -1;
|
|
42
254
|
},
|
|
43
255
|
async delete(scope) {
|
|
44
256
|
const keys = keysFor(scope);
|
|
45
257
|
storage.removeItem(keys.snapshot);
|
|
46
258
|
storage.removeItem(keys.log);
|
|
47
259
|
storage.removeItem(keys.meta);
|
|
260
|
+
storage.removeItem(keys.through);
|
|
48
261
|
},
|
|
49
262
|
async loadLog(scope) {
|
|
50
263
|
return read(keysFor(scope).log) ?? [];
|
|
51
264
|
},
|
|
52
265
|
async appendOps(scope, ops) {
|
|
53
|
-
if (ops.length === 0)
|
|
54
|
-
return;
|
|
55
266
|
const key = keysFor(scope).log;
|
|
56
267
|
write(key, [...(read(key) ?? []), ...ops]);
|
|
57
268
|
},
|
|
58
|
-
loadMeta(scope) {
|
|
269
|
+
async loadMeta(scope) {
|
|
59
270
|
return read(keysFor(scope).meta);
|
|
60
271
|
},
|
|
61
|
-
saveMeta(scope, meta) {
|
|
272
|
+
async saveMeta(scope, meta) {
|
|
62
273
|
write(keysFor(scope).meta, meta);
|
|
63
274
|
},
|
|
64
275
|
};
|
|
65
276
|
}
|
|
277
|
+
/** A carry IndexedDB refused: the adapter goes on in localStorage, where the store still is. */
|
|
278
|
+
class StayInLocalStorage extends Error {
|
|
279
|
+
refused;
|
|
280
|
+
constructor(refused) {
|
|
281
|
+
super("graview ship: IndexedDB would not take the store localStorage holds, so it stays in localStorage");
|
|
282
|
+
this.refused = refused;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The same three things in IndexedDB, the log in pieces. Each scope is
|
|
287
|
+
* SETTLED before its first read or write: what localStorage still holds
|
|
288
|
+
* for it is carried in, then removed from localStorage.
|
|
289
|
+
*/
|
|
290
|
+
function indexedBackend(entries, legacy, keysFor, stayInLocalStorage) {
|
|
291
|
+
const pieces = new Map();
|
|
292
|
+
const settled = new Map();
|
|
293
|
+
const piece = (scope, n) => `${keysFor(scope).log}:${n}`;
|
|
294
|
+
const count = async (scope) => {
|
|
295
|
+
const known = pieces.get(scope);
|
|
296
|
+
if (known !== undefined)
|
|
297
|
+
return known;
|
|
298
|
+
const [raw] = await entries.read([keysFor(scope).log]);
|
|
299
|
+
const n = Number(raw ?? 0) || 0;
|
|
300
|
+
pieces.set(scope, n);
|
|
301
|
+
return n;
|
|
302
|
+
};
|
|
303
|
+
const legacyItem = (key) => {
|
|
304
|
+
try {
|
|
305
|
+
return legacy?.getItem(key) ?? null;
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const forgetLegacy = (scope) => {
|
|
312
|
+
const keys = keysFor(scope);
|
|
313
|
+
try {
|
|
314
|
+
legacy?.removeItem(keys.snapshot);
|
|
315
|
+
legacy?.removeItem(keys.log);
|
|
316
|
+
legacy?.removeItem(keys.meta);
|
|
317
|
+
legacy?.removeItem(keys.through);
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
// Left behind, it is carried in again next time: the same store, not a lost one.
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
/*
|
|
324
|
+
* CARRIED FORWARD, THEN FORGOTTEN, IN THAT ORDER. A scope localStorage
|
|
325
|
+
* holds and IndexedDB does not is moved in. One BOTH hold is a build from
|
|
326
|
+
* before IndexedDB opened since the move and started again from its
|
|
327
|
+
* seed: IndexedDB's store, the one with the history, stands, and
|
|
328
|
+
* localStorage's is left where it is, untouched — nothing is replaced
|
|
329
|
+
* and nothing deleted that a person did not ask to be (`fresh` deletes
|
|
330
|
+
* both).
|
|
331
|
+
*/
|
|
332
|
+
const carry = async (scope) => {
|
|
333
|
+
const keys = keysFor(scope);
|
|
334
|
+
const snapshot = legacyItem(keys.snapshot);
|
|
335
|
+
if (snapshot === null)
|
|
336
|
+
return;
|
|
337
|
+
const [held] = await entries.read([keys.snapshot]);
|
|
338
|
+
if (held != null)
|
|
339
|
+
return;
|
|
340
|
+
const write = new Map();
|
|
341
|
+
// Pieces of a log whose snapshot is gone (a write that never finished) are not this store's.
|
|
342
|
+
for (let n = 0, had = await count(scope); n < had; n++)
|
|
343
|
+
write.set(piece(scope, n), null);
|
|
344
|
+
write.set(keys.snapshot, snapshot);
|
|
345
|
+
write.set(keys.meta, legacyItem(keys.meta));
|
|
346
|
+
write.set(keys.through, legacyItem(keys.through));
|
|
347
|
+
const log = legacyItem(keys.log);
|
|
348
|
+
const hasLog = log !== null && log !== "[]";
|
|
349
|
+
if (hasLog)
|
|
350
|
+
write.set(piece(scope, 0), log);
|
|
351
|
+
write.set(keys.log, hasLog ? "1" : null);
|
|
352
|
+
try {
|
|
353
|
+
await entries.write(write);
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
stayInLocalStorage();
|
|
357
|
+
throw new StayInLocalStorage(error);
|
|
358
|
+
}
|
|
359
|
+
pieces.set(scope, hasLog ? 1 : 0);
|
|
360
|
+
forgetLegacy(scope);
|
|
361
|
+
};
|
|
362
|
+
const settle = (scope) => {
|
|
363
|
+
let done = settled.get(scope);
|
|
364
|
+
if (!done) {
|
|
365
|
+
done = carry(scope);
|
|
366
|
+
settled.set(scope, done);
|
|
367
|
+
}
|
|
368
|
+
return done;
|
|
369
|
+
};
|
|
370
|
+
return {
|
|
371
|
+
async load(scope) {
|
|
372
|
+
await settle(scope);
|
|
373
|
+
const [raw] = await entries.read([keysFor(scope).snapshot]);
|
|
374
|
+
return raw == null ? null : JSON.parse(raw);
|
|
375
|
+
},
|
|
376
|
+
async save(scope, snapshot, through) {
|
|
377
|
+
await settle(scope);
|
|
378
|
+
// The snapshot and the seq it reflects in one transaction: a journal is never replayed onto a snapshot that has it.
|
|
379
|
+
const write = new Map([[keysFor(scope).snapshot, JSON.stringify(snapshot)]]);
|
|
380
|
+
if (through !== undefined)
|
|
381
|
+
write.set(keysFor(scope).through, String(through));
|
|
382
|
+
await entries.write(write);
|
|
383
|
+
},
|
|
384
|
+
async loadThrough(scope) {
|
|
385
|
+
await settle(scope);
|
|
386
|
+
const [raw] = await entries.read([keysFor(scope).through]);
|
|
387
|
+
const through = raw == null ? Number.NaN : Number(raw);
|
|
388
|
+
return Number.isInteger(through) ? through : -1;
|
|
389
|
+
},
|
|
390
|
+
async delete(scope) {
|
|
391
|
+
const keys = keysFor(scope);
|
|
392
|
+
const had = await count(scope);
|
|
393
|
+
const write = new Map([
|
|
394
|
+
[keys.snapshot, null],
|
|
395
|
+
[keys.log, null],
|
|
396
|
+
[keys.meta, null],
|
|
397
|
+
[keys.through, null],
|
|
398
|
+
]);
|
|
399
|
+
for (let n = 0; n < had; n++)
|
|
400
|
+
write.set(piece(scope, n), null);
|
|
401
|
+
await entries.write(write);
|
|
402
|
+
pieces.set(scope, 0);
|
|
403
|
+
// Deleted is deleted in both: nothing is left in localStorage to carry in again.
|
|
404
|
+
forgetLegacy(scope);
|
|
405
|
+
settled.set(scope, Promise.resolve());
|
|
406
|
+
},
|
|
407
|
+
async loadLog(scope) {
|
|
408
|
+
await settle(scope);
|
|
409
|
+
const n = await count(scope);
|
|
410
|
+
if (n === 0)
|
|
411
|
+
return [];
|
|
412
|
+
const raws = await entries.read(Array.from({ length: n }, (_, i) => piece(scope, i)));
|
|
413
|
+
const log = raws.flatMap((raw) => (raw === null ? [] : JSON.parse(raw)));
|
|
414
|
+
if (n > MOST_PIECES) {
|
|
415
|
+
// Put back together in one transaction: the one piece and its count, or the many as they were.
|
|
416
|
+
const write = new Map([
|
|
417
|
+
[piece(scope, 0), JSON.stringify(log)],
|
|
418
|
+
[keysFor(scope).log, "1"],
|
|
419
|
+
]);
|
|
420
|
+
for (let i = 1; i < n; i++)
|
|
421
|
+
write.set(piece(scope, i), null);
|
|
422
|
+
await entries.write(write);
|
|
423
|
+
pieces.set(scope, 1);
|
|
424
|
+
}
|
|
425
|
+
return log;
|
|
426
|
+
},
|
|
427
|
+
async appendOps(scope, ops) {
|
|
428
|
+
await settle(scope);
|
|
429
|
+
const n = await count(scope);
|
|
430
|
+
// The piece and the count in one transaction: a log never counts a piece it does not have.
|
|
431
|
+
await entries.write(new Map([
|
|
432
|
+
[piece(scope, n), JSON.stringify(ops)],
|
|
433
|
+
[keysFor(scope).log, String(n + 1)],
|
|
434
|
+
]));
|
|
435
|
+
pieces.set(scope, n + 1);
|
|
436
|
+
},
|
|
437
|
+
async loadMeta(scope) {
|
|
438
|
+
await settle(scope);
|
|
439
|
+
const [raw] = await entries.read([keysFor(scope).meta]);
|
|
440
|
+
return raw == null ? null : JSON.parse(raw);
|
|
441
|
+
},
|
|
442
|
+
async saveMeta(scope, meta) {
|
|
443
|
+
await settle(scope);
|
|
444
|
+
await entries.write(new Map([[keysFor(scope).meta, JSON.stringify(meta)]]));
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function pageIndexedDB() {
|
|
449
|
+
try {
|
|
450
|
+
return globalThis.indexedDB ?? undefined;
|
|
451
|
+
}
|
|
452
|
+
catch {
|
|
453
|
+
// A sandboxed frame may refuse even the look.
|
|
454
|
+
return undefined;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function pageStorageIfAny() {
|
|
458
|
+
try {
|
|
459
|
+
return globalThis.localStorage ?? undefined;
|
|
460
|
+
}
|
|
461
|
+
catch {
|
|
462
|
+
return undefined;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
function noStorage() {
|
|
466
|
+
return new Error("createBrowserAdapter: no localStorage here, and no IndexedDB — pass `storage` (any object with " +
|
|
467
|
+
"getItem/setItem/removeItem) when running outside a browser.");
|
|
468
|
+
}
|
|
66
469
|
function pageStorage() {
|
|
67
470
|
const found = globalThis.localStorage;
|
|
68
|
-
if (!found)
|
|
69
|
-
throw
|
|
70
|
-
"getItem/setItem/removeItem) when running outside a browser.");
|
|
71
|
-
}
|
|
471
|
+
if (!found)
|
|
472
|
+
throw noStorage();
|
|
72
473
|
return found;
|
|
73
474
|
}
|
|
74
475
|
/** Where a page keeps who its reader is: `rememberedPrincipal` reads it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-adapter.js","sourceRoot":"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K,GAAG;QAAE,OAAO,KAAK,CAAC;IACjD,OAAO,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAGI,UAAmB;IAEvB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG;QAAE,OAAO;IAClD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS,CACvB,WAAuC,UAAwD;KAC5F,QAAQ;IAEX,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* filesystem. An app bundled for the page imports from here, so a bundler
|
|
4
4
|
* never meets `node:fs` through the file adapter.
|
|
5
5
|
*/
|
|
6
|
-
export { browserStartsFresh, createBrowserAdapter, forgetFreshParam, freshHref, PRINCIPAL_KEY, rememberedPrincipal, } from "./browser-adapter.js";
|
|
6
|
+
export { BROWSER_DATABASE, browserStartsFresh, createBrowserAdapter, forgetFreshParam, freshHref, PRINCIPAL_KEY, rememberedPrincipal, } from "./browser-adapter.js";
|
|
7
7
|
export type { BrowserAdapter, BrowserAdapterOptions, StorageLike } from "./browser-adapter.js";
|
|
8
|
+
export type { IDBFactoryLike } from "./indexed-entries.js";
|
|
8
9
|
export { migrateSnapshot, pendingMigrations } from "./migrations.js";
|
|
9
10
|
export { countSteps, primitivesFor, sayStep, stepsMigration } from "./steps.js";
|
|
10
11
|
export type { MigrationStep, StepCount } from "./steps.js";
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAChF,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;A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AE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7E,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvK,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* filesystem. An app bundled for the page imports from here, so a bundler
|
|
4
4
|
* never meets `node:fs` through the file adapter.
|
|
5
5
|
*/
|
|
6
|
-
export { browserStartsFresh, createBrowserAdapter, forgetFreshParam, freshHref, PRINCIPAL_KEY, rememberedPrincipal, } from "./browser-adapter.js";
|
|
6
|
+
export { BROWSER_DATABASE, browserStartsFresh, createBrowserAdapter, forgetFreshParam, freshHref, PRINCIPAL_KEY, rememberedPrincipal, } from "./browser-adapter.js";
|
|
7
7
|
export { migrateSnapshot, pendingMigrations } from "./migrations.js";
|
|
8
8
|
export { countSteps, primitivesFor, sayStep, stepsMigration } from "./steps.js";
|
|
9
9
|
export { openStore } from "./open-store.js";
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,iGAAiG;AACjG,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,+GAA+G;AAC/G,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D,4FAA4F;AAC5F,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG7E,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEtG,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -12,14 +12,14 @@ import type { StoredMeta } from "./meta.js";
|
|
|
12
12
|
* `meta.json` carrying the stored version. `--sqlite` swaps the adapter and
|
|
13
13
|
* changes nothing else, which is the actual claim about adapters.
|
|
14
14
|
*/
|
|
15
|
-
export declare const SERVE_USAGE = " graview serve <entry> [--data <dir>] [--port <n>] [--seed <file>] [--sqlite <file>]\n [--host <address>] [--trust-seat-headers] [--no-sync]\n Serves the app's store over HTTP, and live over a WebSocket at\n /graview/live. The op log is the wire: a client sends calls, the\n store judges them under the caller's own seat, and the ops come back,\n pushed to every socket as they land. Data lives in <dir> (default\n ./data) as readable JSON, or in a SQLite file with --sqlite. It listens on 127.0.0.1 and\n believes the seat a request names in its headers, because only this\n machine can reach it; on any other --host it will not start unless\n --trust-seat-headers says the network in front of it can be trusted.\n The app's declared connections (a Google calendar) run beside it, with\n credentials from the environment and their cursors beside the data;\n --no-sync leaves them off.\n\n graview sync-seed <entry> --seed <file> [--data <dir> | --sqlite <file>]\n [--apply] [--prune] [--json]\n Diffs the bootstrap seed against the live store and says, as content\n steps, what would bring the store in step with it: records put,\n fields patched, ties made. Prints and exits by default; --apply lands\n the steps as one logged, undoable operation; --prune also drops what\n the seed no longer has. The seed itself is only ever read at first\n install \u2014 this is how default content moves afterwards, in place of\n deleting the store.\n\n graview preview <document.json> [--seed <file>] [--port <n>] [--host <address>]\n [--data <dir> | --sqlite <file>] [--as <id>] [--roles a,b] [--no-sync]\n Serves the store and Graview's own faces over it \u2014 the scene and\n Pages, with the bar \u2014 so a document and a snapshot can be looked at\n with no product. Nothing to build or install: the page ships with\n graview. The store is in memory unless --data or --sqlite
|
|
15
|
+
export declare const SERVE_USAGE = " graview serve <entry> [--data <dir>] [--port <n>] [--seed <file>] [--sqlite <file>]\n [--host <address>] [--trust-seat-headers] [--no-sync]\n Serves the app's store over HTTP, and live over a WebSocket at\n /graview/live. The op log is the wire: a client sends calls, the\n store judges them under the caller's own seat, and the ops come back,\n pushed to every socket as they land. Data lives in <dir> (default\n ./data) as readable JSON, or in a SQLite file with --sqlite. It listens on 127.0.0.1 and\n believes the seat a request names in its headers, because only this\n machine can reach it; on any other --host it will not start unless\n --trust-seat-headers says the network in front of it can be trusted.\n The app's declared connections (a Google calendar) run beside it, with\n credentials from the environment and their cursors beside the data;\n --no-sync leaves them off.\n\n graview sync-seed <entry> --seed <file> [--data <dir> | --sqlite <file>]\n [--apply] [--prune] [--json]\n Diffs the bootstrap seed against the live store and says, as content\n steps, what would bring the store in step with it: records put,\n fields patched, ties made. Prints and exits by default; --apply lands\n the steps as one logged, undoable operation; --prune also drops what\n the seed no longer has. The seed itself is only ever read at first\n install \u2014 this is how default content moves afterwards, in place of\n deleting the store.\n\n graview preview <document.json | app module> [--seed <file>] [--port <n>] [--host <address>]\n [--data <dir> | --sqlite <file>] [--as <id>] [--roles a,b] [--no-sync]\n [--view <view.js> --manifest <manifest.json>]\n Serves the store and Graview's own faces over it \u2014 the scene and\n Pages, with the bar \u2014 so a document and a snapshot can be looked at\n with no product. Nothing to build or install: the page ships with\n graview. An app declared in code is taken as graview check takes it\n (./dist/domain/app.js), its module bundled for the page with the\n project's esbuild. The store is in memory unless --data or --sqlite\n name where to keep it; the page sits as a person holding every role\n the app declares, unless --as or --roles say who. Its connections run as\n serve's do, unless --no-sync. --view and --manifest draw a worker view\n proposed and not kept where it attaches, marked as a draft.\n\n graview shots <document.json | app module> [--seed <file>] [--places a,b] [--out <dir>]\n [--scheme light|dark|both] [--width <px>[,<px>]] [--faces pages,scene]\n [--view <view.js> --manifest <manifest.json>]\n Photographs places headless to PNGs, <place>-<scheme>-<width>.png in\n <dir> (default ./shots): each place by its address word or title (the\n home, overview, a lens's name, a kind's plural) or a path such as\n /tasks/t1; every place when none is named. Needs Playwright, which you\n install beside the project (npm i -D playwright, then npx playwright\n install chromium). --view and --manifest picture a proposed view\n before it is kept: name its place by its title, as a kept view's.\n";
|
|
16
16
|
/** The same store, whichever command asked: parsed from the flags every store command shares. */
|
|
17
17
|
export declare const STORE_FLAGS = "--data <dir> (default ./data) | --sqlite <file>, and --seed <file> for a first install";
|
|
18
18
|
export declare function flag(argv: readonly string[], name: string): string | undefined;
|
|
19
19
|
export interface StoreBackend {
|
|
20
20
|
readonly adapter: PersistenceAdapter<string> & {
|
|
21
|
-
loadMeta?(scope: string): StoredMeta | null
|
|
22
|
-
saveMeta?(scope: string, meta: StoredMeta): void
|
|
21
|
+
loadMeta?(scope: string): StoredMeta | null | Promise<StoredMeta | null>;
|
|
22
|
+
saveMeta?(scope: string, meta: StoredMeta): void | Promise<void>;
|
|
23
23
|
};
|
|
24
24
|
/** Where the data is, in words a person can open. */
|
|
25
25
|
readonly where: string;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQnD,OAAO,EAAuD,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;GASG;AAC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