document-model 1.0.40 → 1.0.41
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/browser/document-model.cjs +1 -1
- package/dist/browser/document-model.js +2 -2
- package/dist/browser/document.cjs +1 -1
- package/dist/browser/document.js +2 -2
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/{node/internal/index-DyCS1h0M.js → browser/internal/index-BD_7XeO5.js} +1 -1
- package/dist/{node/internal/index-Dl5T5qdc.js → browser/internal/index-BNBYVtaF.js} +1 -1
- package/dist/browser/internal/{index-4Z_H8F_J.js → index-BWV1Osza.js} +1 -1
- package/dist/browser/internal/{index-6u2yDIEF.js → index-BxGRRPwY.js} +1 -1
- package/dist/browser/internal/{object-EriwiDIs.js → object-DHqlosWD.js} +3 -3
- package/dist/browser/internal/{object-Fq6PThAX.js → object-StihF423.js} +413 -413
- package/dist/node/document-model.cjs +1 -1
- package/dist/node/document-model.js +2 -2
- package/dist/node/document.cjs +1 -1
- package/dist/node/document.js +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +3 -3
- package/dist/node/internal/{index-A6Rqm2SZ.js → index-DeKx7EaE.js} +1 -1
- package/dist/node/internal/{index-BpBnSlTZ.js → index-Dh0vfIdX.js} +1 -1
- package/dist/{browser/internal/index-QJX_Fa1V.js → node/internal/index-LD_vrQff.js} +1 -1
- package/dist/{browser/internal/index-DQeD1Q-a.js → node/internal/index-LEexvgqj.js} +1 -1
- package/dist/node/internal/object-CKxJA706.js +2 -0
- package/dist/node/internal/{object-S6TngMa9.js → object-CudRLU4J.js} +62 -62
- package/package.json +1 -1
- package/dist/node/internal/object-ifvac9k2.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var je = Object.defineProperty;
|
|
2
|
-
var Ie = (n,
|
|
3
|
-
var
|
|
4
|
-
import { produce as
|
|
2
|
+
var Ie = (n, i, p) => i in n ? je(n, i, { enumerable: !0, configurable: !0, writable: !0, value: p }) : n[i] = p;
|
|
3
|
+
var V = (n, i, p) => (Ie(n, typeof i != "symbol" ? i + "" : i, p), p);
|
|
4
|
+
import { produce as q, castDraft as at, castImmutable as Oe, freeze as Ue } from "immer";
|
|
5
5
|
import pt from "json-stringify-deterministic";
|
|
6
6
|
import { z as w } from "zod";
|
|
7
7
|
import Dt from "jszip";
|
|
@@ -12,7 +12,7 @@ function De() {
|
|
|
12
12
|
type: w.string()
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function W() {
|
|
16
16
|
return w.literal("global").or(w.literal("local"));
|
|
17
17
|
}
|
|
18
18
|
function $t() {
|
|
@@ -37,7 +37,7 @@ function Pt() {
|
|
|
37
37
|
return w.object({
|
|
38
38
|
input: w.lazy(() => ut()),
|
|
39
39
|
type: Nt,
|
|
40
|
-
scope:
|
|
40
|
+
scope: W()
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
function ut() {
|
|
@@ -65,7 +65,7 @@ function Wt() {
|
|
|
65
65
|
return w.object({
|
|
66
66
|
input: w.lazy(() => ft()),
|
|
67
67
|
type: Rt,
|
|
68
|
-
scope:
|
|
68
|
+
scope: W()
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
function ft() {
|
|
@@ -79,7 +79,7 @@ function Jt() {
|
|
|
79
79
|
return w.object({
|
|
80
80
|
input: mt(),
|
|
81
81
|
type: Ct,
|
|
82
|
-
scope:
|
|
82
|
+
scope: W()
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
const ht = w.string;
|
|
@@ -105,7 +105,7 @@ function Zt() {
|
|
|
105
105
|
return w.object({
|
|
106
106
|
input: xt(),
|
|
107
107
|
type: zt,
|
|
108
|
-
scope:
|
|
108
|
+
scope: W()
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -118,7 +118,7 @@ const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
118
118
|
LoadStateActionStateInputSchema: qt,
|
|
119
119
|
Load_StateSchema: Nt,
|
|
120
120
|
OperationSchema: Ne,
|
|
121
|
-
OperationScopeSchema:
|
|
121
|
+
OperationScopeSchema: W,
|
|
122
122
|
PruneActionInputSchema: ft,
|
|
123
123
|
PruneActionSchema: Wt,
|
|
124
124
|
PruneSchema: Rt,
|
|
@@ -135,24 +135,24 @@ const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
135
135
|
definedNonNullAnySchema: Te,
|
|
136
136
|
isDefinedNonNullAny: Mt
|
|
137
137
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
138
|
-
function Ce(n,
|
|
139
|
-
return { ...n, name:
|
|
138
|
+
function Ce(n, i) {
|
|
139
|
+
return { ...n, name: i };
|
|
140
140
|
}
|
|
141
|
-
function Le(n,
|
|
141
|
+
function Le(n, i, p) {
|
|
142
142
|
const c = {
|
|
143
143
|
skip: p,
|
|
144
144
|
document: n
|
|
145
|
-
}, { scope: f } =
|
|
146
|
-
return !f ||
|
|
145
|
+
}, { scope: f } = i;
|
|
146
|
+
return !f || i.skip === void 0 ? c : q(c, (u) => {
|
|
147
147
|
const [l] = u.document.operations[f].slice(-1);
|
|
148
|
-
|
|
148
|
+
i.skip && i.skip > 0 && (u.skip = i.skip), l.type === "NOOP" && i.index === l.index && u.skip > l.skip && u.document.operations[f].pop();
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
function ze(n,
|
|
152
|
-
const { scope: c, input: f } =
|
|
153
|
-
return
|
|
151
|
+
function ze(n, i, p) {
|
|
152
|
+
const { scope: c, input: f } = i;
|
|
153
|
+
return q({
|
|
154
154
|
document: n,
|
|
155
|
-
action:
|
|
155
|
+
action: i,
|
|
156
156
|
skip: p
|
|
157
157
|
}, (l) => {
|
|
158
158
|
if (l.document.operations[c].length < 1)
|
|
@@ -190,11 +190,11 @@ function ze(n, r, p) {
|
|
|
190
190
|
l.action = yt(c);
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
function $e(n,
|
|
194
|
-
const { scope: c, input: f } =
|
|
195
|
-
return
|
|
193
|
+
function $e(n, i, p) {
|
|
194
|
+
const { scope: c, input: f } = i;
|
|
195
|
+
return q({
|
|
196
196
|
document: n,
|
|
197
|
-
action:
|
|
197
|
+
action: i,
|
|
198
198
|
skip: p
|
|
199
199
|
}, (l) => {
|
|
200
200
|
if (l.skip > 0)
|
|
@@ -224,11 +224,11 @@ function $e(n, r, p) {
|
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
function Pe(n,
|
|
228
|
-
const { scope: c } =
|
|
227
|
+
function Pe(n, i, p) {
|
|
228
|
+
const { scope: c } = i, f = n.operations[c];
|
|
229
229
|
let {
|
|
230
230
|
input: { start: u, end: l }
|
|
231
|
-
} =
|
|
231
|
+
} = i;
|
|
232
232
|
u = u || 0, l = l || f.length;
|
|
233
233
|
const a = f.slice(u, l), x = f.slice(0, u), d = f.slice(l), v = lt(
|
|
234
234
|
n.initialState,
|
|
@@ -262,45 +262,45 @@ function Pe(n, r, p) {
|
|
|
262
262
|
p
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
|
-
function qe(n,
|
|
265
|
+
function qe(n, i) {
|
|
266
266
|
return {
|
|
267
267
|
...n,
|
|
268
|
-
name:
|
|
269
|
-
state:
|
|
268
|
+
name: i.name,
|
|
269
|
+
state: i.state ?? { global: {}, local: {} }
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
-
const Yt = "SET_NAME",
|
|
273
|
-
function Je(n,
|
|
274
|
-
|
|
275
|
-
return
|
|
272
|
+
const Yt = "SET_NAME", J = "UNDO", H = "REDO", Q = "PRUNE", Gt = "LOAD_STATE", We = "NOOP";
|
|
273
|
+
function Je(n, i) {
|
|
274
|
+
let p;
|
|
275
|
+
return "index" in i ? p = { ...i } : p = n.operations[i.scope].slice(-1)[0], ((p == null ? void 0 : p.index) ?? -1) + 1;
|
|
276
276
|
}
|
|
277
|
-
function He(n,
|
|
277
|
+
function He(n, i) {
|
|
278
278
|
return {
|
|
279
279
|
...n,
|
|
280
280
|
revision: {
|
|
281
281
|
...n.revision,
|
|
282
|
-
[
|
|
282
|
+
[i.scope]: Je(n, i)
|
|
283
283
|
},
|
|
284
284
|
lastModified: (/* @__PURE__ */ new Date()).toISOString()
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function Ze(n,
|
|
288
|
-
if ([
|
|
287
|
+
function Ze(n, i, p = 0) {
|
|
288
|
+
if ([J, H, Q].includes(i.type))
|
|
289
289
|
return n;
|
|
290
|
-
const { scope: c } =
|
|
290
|
+
const { scope: c } = i, f = n.operations[c].slice(
|
|
291
291
|
0,
|
|
292
292
|
n.revision[c]
|
|
293
293
|
), u = [...f].pop();
|
|
294
294
|
let l = ((u == null ? void 0 : u.index) ?? -1) + 1;
|
|
295
|
-
if ("index" in
|
|
296
|
-
if (
|
|
295
|
+
if ("index" in i) {
|
|
296
|
+
if (i.index > l + p)
|
|
297
297
|
throw new Error(
|
|
298
|
-
`Missing operations: expected ${l} with skip 0 or equivalent, got index ${
|
|
298
|
+
`Missing operations: expected ${l} with skip 0 or equivalent, got index ${i.index} with skip ${p}`
|
|
299
299
|
);
|
|
300
|
-
l =
|
|
300
|
+
l = i.index;
|
|
301
301
|
}
|
|
302
302
|
return f.push({
|
|
303
|
-
...
|
|
303
|
+
...i,
|
|
304
304
|
index: l,
|
|
305
305
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
306
306
|
hash: "",
|
|
@@ -311,35 +311,35 @@ function Ze(n, r, p = 0) {
|
|
|
311
311
|
operations: { ...n.operations, [c]: f }
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
function Ye(n,
|
|
315
|
-
let c = Ze(n,
|
|
316
|
-
return c = He(c,
|
|
314
|
+
function Ye(n, i, p = 0) {
|
|
315
|
+
let c = Ze(n, i, p);
|
|
316
|
+
return c = He(c, i), c;
|
|
317
317
|
}
|
|
318
|
-
function Ge(n,
|
|
319
|
-
switch ($t().parse(
|
|
318
|
+
function Ge(n, i, p) {
|
|
319
|
+
switch ($t().parse(i), i.type) {
|
|
320
320
|
case Yt:
|
|
321
|
-
return Ce(n,
|
|
322
|
-
case
|
|
323
|
-
return Pe(n,
|
|
321
|
+
return Ce(n, i.input);
|
|
322
|
+
case Q:
|
|
323
|
+
return Pe(n, i, p);
|
|
324
324
|
case Gt:
|
|
325
|
-
return qe(n,
|
|
325
|
+
return qe(n, i.input.state);
|
|
326
326
|
default:
|
|
327
327
|
return n;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function Ke(n,
|
|
331
|
-
switch (
|
|
332
|
-
case
|
|
333
|
-
return ze(n,
|
|
334
|
-
case
|
|
335
|
-
return $e(n,
|
|
330
|
+
function Ke(n, i, p) {
|
|
331
|
+
switch (i.type) {
|
|
332
|
+
case J:
|
|
333
|
+
return ze(n, i, p);
|
|
334
|
+
case H:
|
|
335
|
+
return $e(n, i, p);
|
|
336
336
|
default:
|
|
337
|
-
return { document: n, action:
|
|
337
|
+
return { document: n, action: i, skip: p };
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
function Kt(n,
|
|
340
|
+
function Kt(n, i, p, c, f = {}) {
|
|
341
341
|
const { skip: u, ignoreSkipOperations: l = !1 } = f;
|
|
342
|
-
let a = { ...
|
|
342
|
+
let a = { ...i }, x = u || 0, d = n, v = [...n.clipboard];
|
|
343
343
|
if (Ei(a)) {
|
|
344
344
|
const { document: g, skip: y } = Le(d, a, x);
|
|
345
345
|
x = y, d = g;
|
|
@@ -368,12 +368,12 @@ function Kt(n, r, p, c, f = {}) {
|
|
|
368
368
|
{ [a.scope]: g }
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
|
-
return d = Ye(d, a, x), d =
|
|
371
|
+
return d = Ye(d, a, x), d = q(d, (g) => {
|
|
372
372
|
const y = p(
|
|
373
373
|
g.state,
|
|
374
374
|
a,
|
|
375
375
|
c
|
|
376
|
-
), b = Ot(
|
|
376
|
+
), b = Ot(i) ? [...v] : [];
|
|
377
377
|
if (y)
|
|
378
378
|
return at({
|
|
379
379
|
...d,
|
|
@@ -381,8 +381,8 @@ function Kt(n, r, p, c, f = {}) {
|
|
|
381
381
|
state: y
|
|
382
382
|
});
|
|
383
383
|
g.clipboard = at([...b]);
|
|
384
|
-
}),
|
|
385
|
-
if ([
|
|
384
|
+
}), q(d, (g) => {
|
|
385
|
+
if ([J, H, Q].includes(a.type))
|
|
386
386
|
return g;
|
|
387
387
|
const y = a.scope || "global";
|
|
388
388
|
g.operations[y][g.operations[y].length - 1].hash = re(g, y), !Ut(a) && a.attachments && a.attachments.forEach((b) => {
|
|
@@ -397,21 +397,21 @@ function Ve(n) {
|
|
|
397
397
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
398
398
|
}
|
|
399
399
|
var st = { exports: {} };
|
|
400
|
-
typeof Object.create == "function" ? st.exports = function(
|
|
401
|
-
p && (
|
|
400
|
+
typeof Object.create == "function" ? st.exports = function(i, p) {
|
|
401
|
+
p && (i.super_ = p, i.prototype = Object.create(p.prototype, {
|
|
402
402
|
constructor: {
|
|
403
|
-
value:
|
|
403
|
+
value: i,
|
|
404
404
|
enumerable: !1,
|
|
405
405
|
writable: !0,
|
|
406
406
|
configurable: !0
|
|
407
407
|
}
|
|
408
408
|
}));
|
|
409
|
-
} : st.exports = function(
|
|
409
|
+
} : st.exports = function(i, p) {
|
|
410
410
|
if (p) {
|
|
411
|
-
|
|
411
|
+
i.super_ = p;
|
|
412
412
|
var c = function() {
|
|
413
413
|
};
|
|
414
|
-
c.prototype = p.prototype,
|
|
414
|
+
c.prototype = p.prototype, i.prototype = new c(), i.prototype.constructor = i;
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
var Xe = st.exports, ct = { exports: {} }, Vt = {}, tt = {};
|
|
@@ -424,51 +424,51 @@ for (var C = 0, ti = ot.length; C < ti; ++C)
|
|
|
424
424
|
O[45] = 62;
|
|
425
425
|
O[95] = 63;
|
|
426
426
|
function Xt(n) {
|
|
427
|
-
var
|
|
428
|
-
if (
|
|
427
|
+
var i = n.length;
|
|
428
|
+
if (i % 4 > 0)
|
|
429
429
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
430
430
|
var p = n.indexOf("=");
|
|
431
|
-
p === -1 && (p =
|
|
432
|
-
var c = p ===
|
|
431
|
+
p === -1 && (p = i);
|
|
432
|
+
var c = p === i ? 0 : 4 - p % 4;
|
|
433
433
|
return [p, c];
|
|
434
434
|
}
|
|
435
435
|
function ei(n) {
|
|
436
|
-
var
|
|
436
|
+
var i = Xt(n), p = i[0], c = i[1];
|
|
437
437
|
return (p + c) * 3 / 4 - c;
|
|
438
438
|
}
|
|
439
|
-
function ii(n,
|
|
440
|
-
return (
|
|
439
|
+
function ii(n, i, p) {
|
|
440
|
+
return (i + p) * 3 / 4 - p;
|
|
441
441
|
}
|
|
442
442
|
function ri(n) {
|
|
443
|
-
var
|
|
443
|
+
var i, p = Xt(n), c = p[0], f = p[1], u = new Qe(ii(n, c, f)), l = 0, a = f > 0 ? c - 4 : c, x;
|
|
444
444
|
for (x = 0; x < a; x += 4)
|
|
445
|
-
|
|
446
|
-
return f === 2 && (
|
|
445
|
+
i = O[n.charCodeAt(x)] << 18 | O[n.charCodeAt(x + 1)] << 12 | O[n.charCodeAt(x + 2)] << 6 | O[n.charCodeAt(x + 3)], u[l++] = i >> 16 & 255, u[l++] = i >> 8 & 255, u[l++] = i & 255;
|
|
446
|
+
return f === 2 && (i = O[n.charCodeAt(x)] << 2 | O[n.charCodeAt(x + 1)] >> 4, u[l++] = i & 255), f === 1 && (i = O[n.charCodeAt(x)] << 10 | O[n.charCodeAt(x + 1)] << 4 | O[n.charCodeAt(x + 2)] >> 2, u[l++] = i >> 8 & 255, u[l++] = i & 255), u;
|
|
447
447
|
}
|
|
448
448
|
function ni(n) {
|
|
449
449
|
return D[n >> 18 & 63] + D[n >> 12 & 63] + D[n >> 6 & 63] + D[n & 63];
|
|
450
450
|
}
|
|
451
|
-
function oi(n,
|
|
452
|
-
for (var c, f = [], u =
|
|
451
|
+
function oi(n, i, p) {
|
|
452
|
+
for (var c, f = [], u = i; u < p; u += 3)
|
|
453
453
|
c = (n[u] << 16 & 16711680) + (n[u + 1] << 8 & 65280) + (n[u + 2] & 255), f.push(ni(c));
|
|
454
454
|
return f.join("");
|
|
455
455
|
}
|
|
456
456
|
function ai(n) {
|
|
457
|
-
for (var
|
|
457
|
+
for (var i, p = n.length, c = p % 3, f = [], u = 16383, l = 0, a = p - c; l < a; l += u)
|
|
458
458
|
f.push(oi(n, l, l + u > a ? a : l + u));
|
|
459
|
-
return c === 1 ? (
|
|
460
|
-
D[
|
|
461
|
-
)) : c === 2 && (
|
|
462
|
-
D[
|
|
459
|
+
return c === 1 ? (i = n[p - 1], f.push(
|
|
460
|
+
D[i >> 2] + D[i << 4 & 63] + "=="
|
|
461
|
+
)) : c === 2 && (i = (n[p - 2] << 8) + n[p - 1], f.push(
|
|
462
|
+
D[i >> 10] + D[i >> 4 & 63] + D[i << 2 & 63] + "="
|
|
463
463
|
)), f.join("");
|
|
464
464
|
}
|
|
465
465
|
var dt = {};
|
|
466
466
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
467
|
-
dt.read = function(n,
|
|
468
|
-
var u, l, a = f * 8 - c - 1, x = (1 << a) - 1, d = x >> 1, v = -7, g = p ? f - 1 : 0, y = p ? -1 : 1, b = n[
|
|
469
|
-
for (g += y, u = b & (1 << -v) - 1, b >>= -v, v += a; v > 0; u = u * 256 + n[
|
|
467
|
+
dt.read = function(n, i, p, c, f) {
|
|
468
|
+
var u, l, a = f * 8 - c - 1, x = (1 << a) - 1, d = x >> 1, v = -7, g = p ? f - 1 : 0, y = p ? -1 : 1, b = n[i + g];
|
|
469
|
+
for (g += y, u = b & (1 << -v) - 1, b >>= -v, v += a; v > 0; u = u * 256 + n[i + g], g += y, v -= 8)
|
|
470
470
|
;
|
|
471
|
-
for (l = u & (1 << -v) - 1, u >>= -v, v += c; v > 0; l = l * 256 + n[
|
|
471
|
+
for (l = u & (1 << -v) - 1, u >>= -v, v += c; v > 0; l = l * 256 + n[i + g], g += y, v -= 8)
|
|
472
472
|
;
|
|
473
473
|
if (u === 0)
|
|
474
474
|
u = 1 - d;
|
|
@@ -479,9 +479,9 @@ dt.read = function(n, r, p, c, f) {
|
|
|
479
479
|
}
|
|
480
480
|
return (b ? -1 : 1) * l * Math.pow(2, u - c);
|
|
481
481
|
};
|
|
482
|
-
dt.write = function(n,
|
|
483
|
-
var l, a, x, d = u * 8 - f - 1, v = (1 << d) - 1, g = v >> 1, y = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, b = c ? 0 : u - 1, E = c ? 1 : -1, U =
|
|
484
|
-
for (
|
|
482
|
+
dt.write = function(n, i, p, c, f, u) {
|
|
483
|
+
var l, a, x, d = u * 8 - f - 1, v = (1 << d) - 1, g = v >> 1, y = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, b = c ? 0 : u - 1, E = c ? 1 : -1, U = i < 0 || i === 0 && 1 / i < 0 ? 1 : 0;
|
|
484
|
+
for (i = Math.abs(i), isNaN(i) || i === 1 / 0 ? (a = isNaN(i) ? 1 : 0, l = v) : (l = Math.floor(Math.log(i) / Math.LN2), i * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + g >= 1 ? i += y / x : i += y * Math.pow(2, 1 - g), i * x >= 2 && (l++, x /= 2), l + g >= v ? (a = 0, l = v) : l + g >= 1 ? (a = (i * x - 1) * Math.pow(2, f), l = l + g) : (a = i * Math.pow(2, g - 1) * Math.pow(2, f), l = 0)); f >= 8; n[p + b] = a & 255, b += E, a /= 256, f -= 8)
|
|
485
485
|
;
|
|
486
486
|
for (l = l << f | a, d += f; d > 0; n[p + b] = l & 255, b += E, l /= 256, d -= 8)
|
|
487
487
|
;
|
|
@@ -494,18 +494,18 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
494
494
|
* @license MIT
|
|
495
495
|
*/
|
|
496
496
|
(function(n) {
|
|
497
|
-
var
|
|
498
|
-
n.Buffer = a, n.SlowBuffer =
|
|
497
|
+
var i = tt, p = dt, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
498
|
+
n.Buffer = a, n.SlowBuffer = Y, n.INSPECT_MAX_BYTES = 50;
|
|
499
499
|
var f = 2147483647;
|
|
500
500
|
n.kMaxLength = f, a.TYPED_ARRAY_SUPPORT = u(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
501
501
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
502
502
|
);
|
|
503
503
|
function u() {
|
|
504
504
|
try {
|
|
505
|
-
var
|
|
505
|
+
var r = new Uint8Array(1), t = { foo: function() {
|
|
506
506
|
return 42;
|
|
507
507
|
} };
|
|
508
|
-
return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(
|
|
508
|
+
return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(r, t), r.foo() === 42;
|
|
509
509
|
} catch {
|
|
510
510
|
return !1;
|
|
511
511
|
}
|
|
@@ -523,120 +523,120 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
523
523
|
return this.byteOffset;
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
|
-
function l(
|
|
527
|
-
if (
|
|
528
|
-
throw new RangeError('The value "' +
|
|
529
|
-
var t = new Uint8Array(
|
|
526
|
+
function l(r) {
|
|
527
|
+
if (r > f)
|
|
528
|
+
throw new RangeError('The value "' + r + '" is invalid for option "size"');
|
|
529
|
+
var t = new Uint8Array(r);
|
|
530
530
|
return Object.setPrototypeOf(t, a.prototype), t;
|
|
531
531
|
}
|
|
532
|
-
function a(
|
|
533
|
-
if (typeof
|
|
532
|
+
function a(r, t, e) {
|
|
533
|
+
if (typeof r == "number") {
|
|
534
534
|
if (typeof t == "string")
|
|
535
535
|
throw new TypeError(
|
|
536
536
|
'The "string" argument must be of type string. Received type number'
|
|
537
537
|
);
|
|
538
|
-
return g(
|
|
538
|
+
return g(r);
|
|
539
539
|
}
|
|
540
|
-
return x(
|
|
540
|
+
return x(r, t, e);
|
|
541
541
|
}
|
|
542
542
|
a.poolSize = 8192;
|
|
543
|
-
function x(
|
|
544
|
-
if (typeof
|
|
545
|
-
return y(
|
|
546
|
-
if (ArrayBuffer.isView(
|
|
547
|
-
return E(
|
|
548
|
-
if (
|
|
543
|
+
function x(r, t, e) {
|
|
544
|
+
if (typeof r == "string")
|
|
545
|
+
return y(r, t);
|
|
546
|
+
if (ArrayBuffer.isView(r))
|
|
547
|
+
return E(r);
|
|
548
|
+
if (r == null)
|
|
549
549
|
throw new TypeError(
|
|
550
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof
|
|
550
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
|
|
551
551
|
);
|
|
552
|
-
if (T(
|
|
553
|
-
return U(
|
|
554
|
-
if (typeof
|
|
552
|
+
if (T(r, ArrayBuffer) || r && T(r.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (T(r, SharedArrayBuffer) || r && T(r.buffer, SharedArrayBuffer)))
|
|
553
|
+
return U(r, t, e);
|
|
554
|
+
if (typeof r == "number")
|
|
555
555
|
throw new TypeError(
|
|
556
556
|
'The "value" argument must not be of type number. Received type number'
|
|
557
557
|
);
|
|
558
|
-
var o =
|
|
559
|
-
if (o != null && o !==
|
|
558
|
+
var o = r.valueOf && r.valueOf();
|
|
559
|
+
if (o != null && o !== r)
|
|
560
560
|
return a.from(o, t, e);
|
|
561
|
-
var s = R(
|
|
561
|
+
var s = R(r);
|
|
562
562
|
if (s)
|
|
563
563
|
return s;
|
|
564
|
-
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof
|
|
564
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof r[Symbol.toPrimitive] == "function")
|
|
565
565
|
return a.from(
|
|
566
|
-
|
|
566
|
+
r[Symbol.toPrimitive]("string"),
|
|
567
567
|
t,
|
|
568
568
|
e
|
|
569
569
|
);
|
|
570
570
|
throw new TypeError(
|
|
571
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof
|
|
571
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
|
|
572
572
|
);
|
|
573
573
|
}
|
|
574
|
-
a.from = function(
|
|
575
|
-
return x(
|
|
574
|
+
a.from = function(r, t, e) {
|
|
575
|
+
return x(r, t, e);
|
|
576
576
|
}, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
|
|
577
|
-
function d(
|
|
578
|
-
if (typeof
|
|
577
|
+
function d(r) {
|
|
578
|
+
if (typeof r != "number")
|
|
579
579
|
throw new TypeError('"size" argument must be of type number');
|
|
580
|
-
if (
|
|
581
|
-
throw new RangeError('The value "' +
|
|
580
|
+
if (r < 0)
|
|
581
|
+
throw new RangeError('The value "' + r + '" is invalid for option "size"');
|
|
582
582
|
}
|
|
583
|
-
function v(
|
|
584
|
-
return d(
|
|
583
|
+
function v(r, t, e) {
|
|
584
|
+
return d(r), r <= 0 ? l(r) : t !== void 0 ? typeof e == "string" ? l(r).fill(t, e) : l(r).fill(t) : l(r);
|
|
585
585
|
}
|
|
586
|
-
a.alloc = function(
|
|
587
|
-
return v(
|
|
586
|
+
a.alloc = function(r, t, e) {
|
|
587
|
+
return v(r, t, e);
|
|
588
588
|
};
|
|
589
|
-
function g(
|
|
590
|
-
return d(
|
|
589
|
+
function g(r) {
|
|
590
|
+
return d(r), l(r < 0 ? 0 : $(r) | 0);
|
|
591
591
|
}
|
|
592
|
-
a.allocUnsafe = function(
|
|
593
|
-
return g(
|
|
594
|
-
}, a.allocUnsafeSlow = function(
|
|
595
|
-
return g(
|
|
592
|
+
a.allocUnsafe = function(r) {
|
|
593
|
+
return g(r);
|
|
594
|
+
}, a.allocUnsafeSlow = function(r) {
|
|
595
|
+
return g(r);
|
|
596
596
|
};
|
|
597
|
-
function y(
|
|
597
|
+
function y(r, t) {
|
|
598
598
|
if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
|
|
599
599
|
throw new TypeError("Unknown encoding: " + t);
|
|
600
|
-
var e = vt(
|
|
600
|
+
var e = vt(r, t) | 0, o = l(e), s = o.write(r, t);
|
|
601
601
|
return s !== e && (o = o.slice(0, s)), o;
|
|
602
602
|
}
|
|
603
|
-
function b(
|
|
604
|
-
for (var t =
|
|
605
|
-
e[o] =
|
|
603
|
+
function b(r) {
|
|
604
|
+
for (var t = r.length < 0 ? 0 : $(r.length) | 0, e = l(t), o = 0; o < t; o += 1)
|
|
605
|
+
e[o] = r[o] & 255;
|
|
606
606
|
return e;
|
|
607
607
|
}
|
|
608
|
-
function E(
|
|
609
|
-
if (T(
|
|
610
|
-
var t = new Uint8Array(
|
|
608
|
+
function E(r) {
|
|
609
|
+
if (T(r, Uint8Array)) {
|
|
610
|
+
var t = new Uint8Array(r);
|
|
611
611
|
return U(t.buffer, t.byteOffset, t.byteLength);
|
|
612
612
|
}
|
|
613
|
-
return b(
|
|
613
|
+
return b(r);
|
|
614
614
|
}
|
|
615
|
-
function U(
|
|
616
|
-
if (t < 0 ||
|
|
615
|
+
function U(r, t, e) {
|
|
616
|
+
if (t < 0 || r.byteLength < t)
|
|
617
617
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
618
|
-
if (
|
|
618
|
+
if (r.byteLength < t + (e || 0))
|
|
619
619
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
620
620
|
var o;
|
|
621
|
-
return t === void 0 && e === void 0 ? o = new Uint8Array(
|
|
621
|
+
return t === void 0 && e === void 0 ? o = new Uint8Array(r) : e === void 0 ? o = new Uint8Array(r, t) : o = new Uint8Array(r, t, e), Object.setPrototypeOf(o, a.prototype), o;
|
|
622
622
|
}
|
|
623
|
-
function R(
|
|
624
|
-
if (a.isBuffer(
|
|
625
|
-
var t =
|
|
626
|
-
return e.length === 0 ||
|
|
623
|
+
function R(r) {
|
|
624
|
+
if (a.isBuffer(r)) {
|
|
625
|
+
var t = $(r.length) | 0, e = l(t);
|
|
626
|
+
return e.length === 0 || r.copy(e, 0, 0, t), e;
|
|
627
627
|
}
|
|
628
|
-
if (
|
|
629
|
-
return typeof
|
|
630
|
-
if (
|
|
631
|
-
return b(
|
|
628
|
+
if (r.length !== void 0)
|
|
629
|
+
return typeof r.length != "number" || nt(r.length) ? l(0) : b(r);
|
|
630
|
+
if (r.type === "Buffer" && Array.isArray(r.data))
|
|
631
|
+
return b(r.data);
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
if (
|
|
633
|
+
function $(r) {
|
|
634
|
+
if (r >= f)
|
|
635
635
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
|
|
636
|
-
return
|
|
636
|
+
return r | 0;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
return +
|
|
638
|
+
function Y(r) {
|
|
639
|
+
return +r != r && (r = 0), a.alloc(+r);
|
|
640
640
|
}
|
|
641
641
|
a.isBuffer = function(t) {
|
|
642
642
|
return t != null && t._isBuffer === !0 && t !== a.prototype;
|
|
@@ -696,16 +696,16 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
696
696
|
}
|
|
697
697
|
return s;
|
|
698
698
|
};
|
|
699
|
-
function vt(
|
|
700
|
-
if (a.isBuffer(
|
|
701
|
-
return
|
|
702
|
-
if (ArrayBuffer.isView(
|
|
703
|
-
return
|
|
704
|
-
if (typeof
|
|
699
|
+
function vt(r, t) {
|
|
700
|
+
if (a.isBuffer(r))
|
|
701
|
+
return r.length;
|
|
702
|
+
if (ArrayBuffer.isView(r) || T(r, ArrayBuffer))
|
|
703
|
+
return r.byteLength;
|
|
704
|
+
if (typeof r != "string")
|
|
705
705
|
throw new TypeError(
|
|
706
|
-
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof
|
|
706
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof r
|
|
707
707
|
);
|
|
708
|
-
var e =
|
|
708
|
+
var e = r.length, o = arguments.length > 2 && arguments[2] === !0;
|
|
709
709
|
if (!o && e === 0)
|
|
710
710
|
return 0;
|
|
711
711
|
for (var s = !1; ; )
|
|
@@ -716,7 +716,7 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
716
716
|
return e;
|
|
717
717
|
case "utf8":
|
|
718
718
|
case "utf-8":
|
|
719
|
-
return rt(
|
|
719
|
+
return rt(r).length;
|
|
720
720
|
case "ucs2":
|
|
721
721
|
case "ucs-2":
|
|
722
722
|
case "utf16le":
|
|
@@ -725,20 +725,20 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
725
725
|
case "hex":
|
|
726
726
|
return e >>> 1;
|
|
727
727
|
case "base64":
|
|
728
|
-
return Bt(
|
|
728
|
+
return Bt(r).length;
|
|
729
729
|
default:
|
|
730
730
|
if (s)
|
|
731
|
-
return o ? -1 : rt(
|
|
731
|
+
return o ? -1 : rt(r).length;
|
|
732
732
|
t = ("" + t).toLowerCase(), s = !0;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
a.byteLength = vt;
|
|
736
|
-
function fe(
|
|
736
|
+
function fe(r, t, e) {
|
|
737
737
|
var o = !1;
|
|
738
738
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
|
|
739
739
|
return "";
|
|
740
|
-
for (
|
|
741
|
-
switch (
|
|
740
|
+
for (r || (r = "utf8"); ; )
|
|
741
|
+
switch (r) {
|
|
742
742
|
case "hex":
|
|
743
743
|
return Ee(this, t, e);
|
|
744
744
|
case "utf8":
|
|
@@ -758,14 +758,14 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
758
758
|
return _e(this, t, e);
|
|
759
759
|
default:
|
|
760
760
|
if (o)
|
|
761
|
-
throw new TypeError("Unknown encoding: " +
|
|
762
|
-
|
|
761
|
+
throw new TypeError("Unknown encoding: " + r);
|
|
762
|
+
r = (r + "").toLowerCase(), o = !0;
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
a.prototype._isBuffer = !0;
|
|
766
|
-
function M(
|
|
767
|
-
var o =
|
|
768
|
-
|
|
766
|
+
function M(r, t, e) {
|
|
767
|
+
var o = r[t];
|
|
768
|
+
r[t] = r[e], r[e] = o;
|
|
769
769
|
}
|
|
770
770
|
a.prototype.swap16 = function() {
|
|
771
771
|
var t = this.length;
|
|
@@ -820,28 +820,28 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
820
820
|
}
|
|
821
821
|
return h < _ ? -1 : _ < h ? 1 : 0;
|
|
822
822
|
};
|
|
823
|
-
function bt(
|
|
824
|
-
if (
|
|
823
|
+
function bt(r, t, e, o, s) {
|
|
824
|
+
if (r.length === 0)
|
|
825
825
|
return -1;
|
|
826
|
-
if (typeof e == "string" ? (o = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, nt(e) && (e = s ? 0 :
|
|
826
|
+
if (typeof e == "string" ? (o = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, nt(e) && (e = s ? 0 : r.length - 1), e < 0 && (e = r.length + e), e >= r.length) {
|
|
827
827
|
if (s)
|
|
828
828
|
return -1;
|
|
829
|
-
e =
|
|
829
|
+
e = r.length - 1;
|
|
830
830
|
} else if (e < 0)
|
|
831
831
|
if (s)
|
|
832
832
|
e = 0;
|
|
833
833
|
else
|
|
834
834
|
return -1;
|
|
835
835
|
if (typeof t == "string" && (t = a.from(t, o)), a.isBuffer(t))
|
|
836
|
-
return t.length === 0 ? -1 : Et(
|
|
836
|
+
return t.length === 0 ? -1 : Et(r, t, e, o, s);
|
|
837
837
|
if (typeof t == "number")
|
|
838
|
-
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? s ? Uint8Array.prototype.indexOf.call(
|
|
838
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? s ? Uint8Array.prototype.indexOf.call(r, t, e) : Uint8Array.prototype.lastIndexOf.call(r, t, e) : Et(r, [t], e, o, s);
|
|
839
839
|
throw new TypeError("val must be string, number or Buffer");
|
|
840
840
|
}
|
|
841
|
-
function Et(
|
|
842
|
-
var m = 1, h =
|
|
841
|
+
function Et(r, t, e, o, s) {
|
|
842
|
+
var m = 1, h = r.length, _ = t.length;
|
|
843
843
|
if (o !== void 0 && (o = String(o).toLowerCase(), o === "ucs2" || o === "ucs-2" || o === "utf16le" || o === "utf-16le")) {
|
|
844
|
-
if (
|
|
844
|
+
if (r.length < 2 || t.length < 2)
|
|
845
845
|
return -1;
|
|
846
846
|
m = 2, h /= 2, _ /= 2, e /= 2;
|
|
847
847
|
}
|
|
@@ -852,15 +852,15 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
852
852
|
if (s) {
|
|
853
853
|
var B = -1;
|
|
854
854
|
for (k = e; k < h; k++)
|
|
855
|
-
if (F(
|
|
855
|
+
if (F(r, k) === F(t, B === -1 ? 0 : k - B)) {
|
|
856
856
|
if (B === -1 && (B = k), k - B + 1 === _)
|
|
857
857
|
return B * m;
|
|
858
858
|
} else
|
|
859
859
|
B !== -1 && (k -= k - B), B = -1;
|
|
860
860
|
} else
|
|
861
861
|
for (e + _ > h && (e = h - _), k = e; k >= 0; k--) {
|
|
862
|
-
for (var A = !0,
|
|
863
|
-
if (F(
|
|
862
|
+
for (var A = !0, K = 0; K < _; K++)
|
|
863
|
+
if (F(r, k + K) !== F(t, K)) {
|
|
864
864
|
A = !1;
|
|
865
865
|
break;
|
|
866
866
|
}
|
|
@@ -876,9 +876,9 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
876
876
|
}, a.prototype.lastIndexOf = function(t, e, o) {
|
|
877
877
|
return bt(this, t, e, o, !1);
|
|
878
878
|
};
|
|
879
|
-
function me(
|
|
879
|
+
function me(r, t, e, o) {
|
|
880
880
|
e = Number(e) || 0;
|
|
881
|
-
var s =
|
|
881
|
+
var s = r.length - e;
|
|
882
882
|
o ? (o = Number(o), o > s && (o = s)) : o = s;
|
|
883
883
|
var m = t.length;
|
|
884
884
|
o > m / 2 && (o = m / 2);
|
|
@@ -886,21 +886,21 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
886
886
|
var _ = parseInt(t.substr(h * 2, 2), 16);
|
|
887
887
|
if (nt(_))
|
|
888
888
|
return h;
|
|
889
|
-
|
|
889
|
+
r[e + h] = _;
|
|
890
890
|
}
|
|
891
891
|
return h;
|
|
892
892
|
}
|
|
893
|
-
function he(
|
|
894
|
-
return
|
|
893
|
+
function he(r, t, e, o) {
|
|
894
|
+
return G(rt(t, r.length - e), r, e, o);
|
|
895
895
|
}
|
|
896
|
-
function xe(
|
|
897
|
-
return
|
|
896
|
+
function xe(r, t, e, o) {
|
|
897
|
+
return G(Ae(t), r, e, o);
|
|
898
898
|
}
|
|
899
|
-
function de(
|
|
900
|
-
return
|
|
899
|
+
function de(r, t, e, o) {
|
|
900
|
+
return G(Bt(t), r, e, o);
|
|
901
901
|
}
|
|
902
|
-
function we(
|
|
903
|
-
return
|
|
902
|
+
function we(r, t, e, o) {
|
|
903
|
+
return G(Se(t, r.length - e), r, e, o);
|
|
904
904
|
}
|
|
905
905
|
a.prototype.write = function(t, e, o, s) {
|
|
906
906
|
if (e === void 0)
|
|
@@ -946,13 +946,13 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
946
946
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
947
947
|
};
|
|
948
948
|
};
|
|
949
|
-
function ge(
|
|
950
|
-
return t === 0 && e ===
|
|
949
|
+
function ge(r, t, e) {
|
|
950
|
+
return t === 0 && e === r.length ? i.fromByteArray(r) : i.fromByteArray(r.slice(t, e));
|
|
951
951
|
}
|
|
952
|
-
function _t(
|
|
953
|
-
e = Math.min(
|
|
952
|
+
function _t(r, t, e) {
|
|
953
|
+
e = Math.min(r.length, e);
|
|
954
954
|
for (var o = [], s = t; s < e; ) {
|
|
955
|
-
var m =
|
|
955
|
+
var m = r[s], h = null, _ = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
|
|
956
956
|
if (s + _ <= e) {
|
|
957
957
|
var F, k, B, A;
|
|
958
958
|
switch (_) {
|
|
@@ -960,13 +960,13 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
960
960
|
m < 128 && (h = m);
|
|
961
961
|
break;
|
|
962
962
|
case 2:
|
|
963
|
-
F =
|
|
963
|
+
F = r[s + 1], (F & 192) === 128 && (A = (m & 31) << 6 | F & 63, A > 127 && (h = A));
|
|
964
964
|
break;
|
|
965
965
|
case 3:
|
|
966
|
-
F =
|
|
966
|
+
F = r[s + 1], k = r[s + 2], (F & 192) === 128 && (k & 192) === 128 && (A = (m & 15) << 12 | (F & 63) << 6 | k & 63, A > 2047 && (A < 55296 || A > 57343) && (h = A));
|
|
967
967
|
break;
|
|
968
968
|
case 4:
|
|
969
|
-
F =
|
|
969
|
+
F = r[s + 1], k = r[s + 2], B = r[s + 3], (F & 192) === 128 && (k & 192) === 128 && (B & 192) === 128 && (A = (m & 15) << 18 | (F & 63) << 12 | (k & 63) << 6 | B & 63, A > 65535 && A < 1114112 && (h = A));
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
h === null ? (h = 65533, _ = 1) : h > 65535 && (h -= 65536, o.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), o.push(h), s += _;
|
|
@@ -974,40 +974,40 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
974
974
|
return ye(o);
|
|
975
975
|
}
|
|
976
976
|
var Ft = 4096;
|
|
977
|
-
function ye(
|
|
978
|
-
var t =
|
|
977
|
+
function ye(r) {
|
|
978
|
+
var t = r.length;
|
|
979
979
|
if (t <= Ft)
|
|
980
|
-
return String.fromCharCode.apply(String,
|
|
980
|
+
return String.fromCharCode.apply(String, r);
|
|
981
981
|
for (var e = "", o = 0; o < t; )
|
|
982
982
|
e += String.fromCharCode.apply(
|
|
983
983
|
String,
|
|
984
|
-
|
|
984
|
+
r.slice(o, o += Ft)
|
|
985
985
|
);
|
|
986
986
|
return e;
|
|
987
987
|
}
|
|
988
|
-
function ve(
|
|
988
|
+
function ve(r, t, e) {
|
|
989
989
|
var o = "";
|
|
990
|
-
e = Math.min(
|
|
990
|
+
e = Math.min(r.length, e);
|
|
991
991
|
for (var s = t; s < e; ++s)
|
|
992
|
-
o += String.fromCharCode(
|
|
992
|
+
o += String.fromCharCode(r[s] & 127);
|
|
993
993
|
return o;
|
|
994
994
|
}
|
|
995
|
-
function be(
|
|
995
|
+
function be(r, t, e) {
|
|
996
996
|
var o = "";
|
|
997
|
-
e = Math.min(
|
|
997
|
+
e = Math.min(r.length, e);
|
|
998
998
|
for (var s = t; s < e; ++s)
|
|
999
|
-
o += String.fromCharCode(
|
|
999
|
+
o += String.fromCharCode(r[s]);
|
|
1000
1000
|
return o;
|
|
1001
1001
|
}
|
|
1002
|
-
function Ee(
|
|
1003
|
-
var o =
|
|
1002
|
+
function Ee(r, t, e) {
|
|
1003
|
+
var o = r.length;
|
|
1004
1004
|
(!t || t < 0) && (t = 0), (!e || e < 0 || e > o) && (e = o);
|
|
1005
1005
|
for (var s = "", m = t; m < e; ++m)
|
|
1006
|
-
s += Be[
|
|
1006
|
+
s += Be[r[m]];
|
|
1007
1007
|
return s;
|
|
1008
1008
|
}
|
|
1009
|
-
function _e(
|
|
1010
|
-
for (var o =
|
|
1009
|
+
function _e(r, t, e) {
|
|
1010
|
+
for (var o = r.slice(t, e), s = "", m = 0; m < o.length - 1; m += 2)
|
|
1011
1011
|
s += String.fromCharCode(o[m] + o[m + 1] * 256);
|
|
1012
1012
|
return s;
|
|
1013
1013
|
}
|
|
@@ -1017,10 +1017,10 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
1017
1017
|
var s = this.subarray(t, e);
|
|
1018
1018
|
return Object.setPrototypeOf(s, a.prototype), s;
|
|
1019
1019
|
};
|
|
1020
|
-
function S(
|
|
1021
|
-
if (
|
|
1020
|
+
function S(r, t, e) {
|
|
1021
|
+
if (r % 1 !== 0 || r < 0)
|
|
1022
1022
|
throw new RangeError("offset is not uint");
|
|
1023
|
-
if (
|
|
1023
|
+
if (r + t > e)
|
|
1024
1024
|
throw new RangeError("Trying to access beyond buffer length");
|
|
1025
1025
|
}
|
|
1026
1026
|
a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, o) {
|
|
@@ -1076,12 +1076,12 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
1076
1076
|
}, a.prototype.readDoubleBE = function(t, e) {
|
|
1077
1077
|
return t = t >>> 0, e || S(t, 8, this.length), p.read(this, t, !1, 52, 8);
|
|
1078
1078
|
};
|
|
1079
|
-
function j(
|
|
1080
|
-
if (!a.isBuffer(
|
|
1079
|
+
function j(r, t, e, o, s, m) {
|
|
1080
|
+
if (!a.isBuffer(r))
|
|
1081
1081
|
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1082
1082
|
if (t > s || t < m)
|
|
1083
1083
|
throw new RangeError('"value" argument is out of bounds');
|
|
1084
|
-
if (e + o >
|
|
1084
|
+
if (e + o > r.length)
|
|
1085
1085
|
throw new RangeError("Index out of range");
|
|
1086
1086
|
}
|
|
1087
1087
|
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, o, s) {
|
|
@@ -1141,22 +1141,22 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
1141
1141
|
}, a.prototype.writeInt32BE = function(t, e, o) {
|
|
1142
1142
|
return t = +t, e = e >>> 0, o || j(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
1143
1143
|
};
|
|
1144
|
-
function kt(
|
|
1145
|
-
if (e + o >
|
|
1144
|
+
function kt(r, t, e, o, s, m) {
|
|
1145
|
+
if (e + o > r.length)
|
|
1146
1146
|
throw new RangeError("Index out of range");
|
|
1147
1147
|
if (e < 0)
|
|
1148
1148
|
throw new RangeError("Index out of range");
|
|
1149
1149
|
}
|
|
1150
|
-
function At(
|
|
1151
|
-
return t = +t, e = e >>> 0, s || kt(
|
|
1150
|
+
function At(r, t, e, o, s) {
|
|
1151
|
+
return t = +t, e = e >>> 0, s || kt(r, t, e, 4), p.write(r, t, e, o, 23, 4), e + 4;
|
|
1152
1152
|
}
|
|
1153
1153
|
a.prototype.writeFloatLE = function(t, e, o) {
|
|
1154
1154
|
return At(this, t, e, !0, o);
|
|
1155
1155
|
}, a.prototype.writeFloatBE = function(t, e, o) {
|
|
1156
1156
|
return At(this, t, e, !1, o);
|
|
1157
1157
|
};
|
|
1158
|
-
function St(
|
|
1159
|
-
return t = +t, e = e >>> 0, s || kt(
|
|
1158
|
+
function St(r, t, e, o, s) {
|
|
1159
|
+
return t = +t, e = e >>> 0, s || kt(r, t, e, 8), p.write(r, t, e, o, 52, 8), e + 8;
|
|
1160
1160
|
}
|
|
1161
1161
|
a.prototype.writeDoubleLE = function(t, e, o) {
|
|
1162
1162
|
return St(this, t, e, !0, o);
|
|
@@ -1211,17 +1211,17 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
1211
1211
|
return this;
|
|
1212
1212
|
};
|
|
1213
1213
|
var Fe = /[^+/0-9A-Za-z-_]/g;
|
|
1214
|
-
function ke(
|
|
1215
|
-
if (
|
|
1214
|
+
function ke(r) {
|
|
1215
|
+
if (r = r.split("=")[0], r = r.trim().replace(Fe, ""), r.length < 2)
|
|
1216
1216
|
return "";
|
|
1217
|
-
for (;
|
|
1218
|
-
|
|
1219
|
-
return
|
|
1217
|
+
for (; r.length % 4 !== 0; )
|
|
1218
|
+
r = r + "=";
|
|
1219
|
+
return r;
|
|
1220
1220
|
}
|
|
1221
|
-
function rt(
|
|
1221
|
+
function rt(r, t) {
|
|
1222
1222
|
t = t || 1 / 0;
|
|
1223
|
-
for (var e, o =
|
|
1224
|
-
if (e =
|
|
1223
|
+
for (var e, o = r.length, s = null, m = [], h = 0; h < o; ++h) {
|
|
1224
|
+
if (e = r.charCodeAt(h), e > 55295 && e < 57344) {
|
|
1225
1225
|
if (!s) {
|
|
1226
1226
|
if (e > 56319) {
|
|
1227
1227
|
(t -= 3) > -1 && m.push(239, 191, 189);
|
|
@@ -1273,45 +1273,45 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
return m;
|
|
1275
1275
|
}
|
|
1276
|
-
function Ae(
|
|
1277
|
-
for (var t = [], e = 0; e <
|
|
1278
|
-
t.push(
|
|
1276
|
+
function Ae(r) {
|
|
1277
|
+
for (var t = [], e = 0; e < r.length; ++e)
|
|
1278
|
+
t.push(r.charCodeAt(e) & 255);
|
|
1279
1279
|
return t;
|
|
1280
1280
|
}
|
|
1281
|
-
function Se(
|
|
1282
|
-
for (var e, o, s, m = [], h = 0; h <
|
|
1283
|
-
e =
|
|
1281
|
+
function Se(r, t) {
|
|
1282
|
+
for (var e, o, s, m = [], h = 0; h < r.length && !((t -= 2) < 0); ++h)
|
|
1283
|
+
e = r.charCodeAt(h), o = e >> 8, s = e % 256, m.push(s), m.push(o);
|
|
1284
1284
|
return m;
|
|
1285
1285
|
}
|
|
1286
|
-
function Bt(
|
|
1287
|
-
return
|
|
1286
|
+
function Bt(r) {
|
|
1287
|
+
return i.toByteArray(ke(r));
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1290
|
-
for (var s = 0; s < o && !(s + e >= t.length || s >=
|
|
1291
|
-
t[s + e] =
|
|
1289
|
+
function G(r, t, e, o) {
|
|
1290
|
+
for (var s = 0; s < o && !(s + e >= t.length || s >= r.length); ++s)
|
|
1291
|
+
t[s + e] = r[s];
|
|
1292
1292
|
return s;
|
|
1293
1293
|
}
|
|
1294
|
-
function T(
|
|
1295
|
-
return
|
|
1294
|
+
function T(r, t) {
|
|
1295
|
+
return r instanceof t || r != null && r.constructor != null && r.constructor.name != null && r.constructor.name === t.name;
|
|
1296
1296
|
}
|
|
1297
|
-
function nt(
|
|
1298
|
-
return
|
|
1297
|
+
function nt(r) {
|
|
1298
|
+
return r !== r;
|
|
1299
1299
|
}
|
|
1300
1300
|
var Be = function() {
|
|
1301
|
-
for (var
|
|
1301
|
+
for (var r = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
|
|
1302
1302
|
for (var o = e * 16, s = 0; s < 16; ++s)
|
|
1303
|
-
t[o + s] =
|
|
1303
|
+
t[o + s] = r[e] + r[s];
|
|
1304
1304
|
return t;
|
|
1305
1305
|
}();
|
|
1306
1306
|
})(Vt);
|
|
1307
1307
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1308
|
-
(function(n,
|
|
1308
|
+
(function(n, i) {
|
|
1309
1309
|
var p = Vt, c = p.Buffer;
|
|
1310
1310
|
function f(l, a) {
|
|
1311
1311
|
for (var x in l)
|
|
1312
1312
|
a[x] = l[x];
|
|
1313
1313
|
}
|
|
1314
|
-
c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? n.exports = p : (f(p,
|
|
1314
|
+
c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? n.exports = p : (f(p, i), i.Buffer = u);
|
|
1315
1315
|
function u(l, a, x) {
|
|
1316
1316
|
return c(l, a, x);
|
|
1317
1317
|
}
|
|
@@ -1335,11 +1335,11 @@ dt.write = function(n, r, p, c, f, u) {
|
|
|
1335
1335
|
};
|
|
1336
1336
|
})(ct, ct.exports);
|
|
1337
1337
|
var Qt = ct.exports, te = Qt.Buffer;
|
|
1338
|
-
function et(n,
|
|
1339
|
-
this._block = te.alloc(n), this._finalSize =
|
|
1338
|
+
function et(n, i) {
|
|
1339
|
+
this._block = te.alloc(n), this._finalSize = i, this._blockSize = n, this._len = 0;
|
|
1340
1340
|
}
|
|
1341
|
-
et.prototype.update = function(n,
|
|
1342
|
-
typeof n == "string" && (
|
|
1341
|
+
et.prototype.update = function(n, i) {
|
|
1342
|
+
typeof n == "string" && (i = i || "utf8", n = te.from(n, i));
|
|
1343
1343
|
for (var p = this._block, c = this._blockSize, f = n.length, u = this._len, l = 0; l < f; ) {
|
|
1344
1344
|
for (var a = u % c, x = Math.min(f - l, c - a), d = 0; d < x; d++)
|
|
1345
1345
|
p[a + d] = n[l + d];
|
|
@@ -1348,8 +1348,8 @@ et.prototype.update = function(n, r) {
|
|
|
1348
1348
|
return this._len += f, this;
|
|
1349
1349
|
};
|
|
1350
1350
|
et.prototype.digest = function(n) {
|
|
1351
|
-
var
|
|
1352
|
-
this._block[
|
|
1351
|
+
var i = this._len % this._blockSize;
|
|
1352
|
+
this._block[i] = 128, this._block.fill(0, i + 1), i >= this._finalSize && (this._update(this._block), this._block.fill(0));
|
|
1353
1353
|
var p = this._len * 8;
|
|
1354
1354
|
if (p <= 4294967295)
|
|
1355
1355
|
this._block.writeUInt32BE(p, this._blockSize - 4);
|
|
@@ -1370,11 +1370,11 @@ var pi = et, si = Xe, ee = pi, ci = Qt.Buffer, li = [
|
|
|
1370
1370
|
-1894007588,
|
|
1371
1371
|
-899497514
|
|
1372
1372
|
], ui = new Array(80);
|
|
1373
|
-
function
|
|
1373
|
+
function Z() {
|
|
1374
1374
|
this.init(), this._w = ui, ee.call(this, 64, 56);
|
|
1375
1375
|
}
|
|
1376
|
-
si(
|
|
1377
|
-
|
|
1376
|
+
si(Z, ee);
|
|
1377
|
+
Z.prototype.init = function() {
|
|
1378
1378
|
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
|
|
1379
1379
|
};
|
|
1380
1380
|
function fi(n) {
|
|
@@ -1386,27 +1386,27 @@ function mi(n) {
|
|
|
1386
1386
|
function hi(n) {
|
|
1387
1387
|
return n << 30 | n >>> 2;
|
|
1388
1388
|
}
|
|
1389
|
-
function xi(n,
|
|
1390
|
-
return n === 0 ?
|
|
1389
|
+
function xi(n, i, p, c) {
|
|
1390
|
+
return n === 0 ? i & p | ~i & c : n === 2 ? i & p | i & c | p & c : i ^ p ^ c;
|
|
1391
1391
|
}
|
|
1392
|
-
|
|
1393
|
-
for (var
|
|
1394
|
-
|
|
1392
|
+
Z.prototype._update = function(n) {
|
|
1393
|
+
for (var i = this._w, p = this._a | 0, c = this._b | 0, f = this._c | 0, u = this._d | 0, l = this._e | 0, a = 0; a < 16; ++a)
|
|
1394
|
+
i[a] = n.readInt32BE(a * 4);
|
|
1395
1395
|
for (; a < 80; ++a)
|
|
1396
|
-
|
|
1396
|
+
i[a] = fi(i[a - 3] ^ i[a - 8] ^ i[a - 14] ^ i[a - 16]);
|
|
1397
1397
|
for (var x = 0; x < 80; ++x) {
|
|
1398
|
-
var d = ~~(x / 20), v = mi(p) + xi(d, c, f, u) + l +
|
|
1398
|
+
var d = ~~(x / 20), v = mi(p) + xi(d, c, f, u) + l + i[x] + li[d] | 0;
|
|
1399
1399
|
l = u, u = f, f = hi(c), c = p, p = v;
|
|
1400
1400
|
}
|
|
1401
1401
|
this._a = p + this._a | 0, this._b = c + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0;
|
|
1402
1402
|
};
|
|
1403
|
-
|
|
1403
|
+
Z.prototype._hash = function() {
|
|
1404
1404
|
var n = ci.allocUnsafe(20);
|
|
1405
1405
|
return n.writeInt32BE(this._a | 0, 0), n.writeInt32BE(this._b | 0, 4), n.writeInt32BE(this._c | 0, 8), n.writeInt32BE(this._d | 0, 12), n.writeInt32BE(this._e | 0, 16), n;
|
|
1406
1406
|
};
|
|
1407
|
-
var di =
|
|
1407
|
+
var di = Z;
|
|
1408
1408
|
const wi = /* @__PURE__ */ Ve(di), wt = new Error("File system not available.");
|
|
1409
|
-
function gi(n,
|
|
1409
|
+
function gi(n, i, p) {
|
|
1410
1410
|
throw wt;
|
|
1411
1411
|
}
|
|
1412
1412
|
function ie(n) {
|
|
@@ -1417,13 +1417,13 @@ function yi(n) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
const vi = async (n) => ie();
|
|
1419
1419
|
function bi(n) {
|
|
1420
|
-
let
|
|
1420
|
+
let i = "";
|
|
1421
1421
|
for (let p = 0; p < n.length; p += 2)
|
|
1422
|
-
|
|
1423
|
-
return btoa(
|
|
1422
|
+
i += String.fromCharCode(parseInt(n.substr(p, 2), 16));
|
|
1423
|
+
return btoa(i);
|
|
1424
1424
|
}
|
|
1425
|
-
const it = (n,
|
|
1426
|
-
if (
|
|
1425
|
+
const it = (n, i = "sha1") => {
|
|
1426
|
+
if (i !== "sha1")
|
|
1427
1427
|
throw new Error("Only sha1 algorithm is available.");
|
|
1428
1428
|
const p = new wi();
|
|
1429
1429
|
return bi(p.update(n).digest("hex"));
|
|
@@ -1432,17 +1432,17 @@ function Ei(n) {
|
|
|
1432
1432
|
return n.type === We && n.skip !== void 0 && n.skip > 0 && n.hash !== void 0;
|
|
1433
1433
|
}
|
|
1434
1434
|
function Ot(n) {
|
|
1435
|
-
return [
|
|
1435
|
+
return [J, H].includes(n.type);
|
|
1436
1436
|
}
|
|
1437
1437
|
function Ut(n) {
|
|
1438
|
-
return [Yt,
|
|
1438
|
+
return [Yt, J, H, Q, Gt].includes(n.type);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function z(n, i, p, c, f = "global") {
|
|
1441
1441
|
if (!n)
|
|
1442
1442
|
throw new Error("Empty action type");
|
|
1443
1443
|
if (typeof n != "string")
|
|
1444
1444
|
throw new Error(`Invalid action type: ${n}`);
|
|
1445
|
-
const u = { type: n, input:
|
|
1445
|
+
const u = { type: n, input: i, scope: f };
|
|
1446
1446
|
p && (u.attachments = p);
|
|
1447
1447
|
try {
|
|
1448
1448
|
c == null || c().parse(u.input);
|
|
@@ -1451,10 +1451,10 @@ function P(n, r, p, c, f = "global") {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
return u;
|
|
1453
1453
|
}
|
|
1454
|
-
function _i(n,
|
|
1455
|
-
return (p, c, f, u) =>
|
|
1454
|
+
function _i(n, i = Kt) {
|
|
1455
|
+
return (p, c, f, u) => i(p, c, n, f, u);
|
|
1456
1456
|
}
|
|
1457
|
-
const Fi = (n,
|
|
1457
|
+
const Fi = (n, i) => ({
|
|
1458
1458
|
name: "",
|
|
1459
1459
|
documentType: "",
|
|
1460
1460
|
revision: {
|
|
@@ -1465,11 +1465,11 @@ const Fi = (n, r) => ({
|
|
|
1465
1465
|
lastModified: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1466
1466
|
attachments: {},
|
|
1467
1467
|
...n,
|
|
1468
|
-
state: (
|
|
1469
|
-
}), ki = (n,
|
|
1468
|
+
state: (i == null ? void 0 : i(n == null ? void 0 : n.state)) ?? (n == null ? void 0 : n.state) ?? { global: {}, local: {} }
|
|
1469
|
+
}), ki = (n, i) => {
|
|
1470
1470
|
const p = Fi(
|
|
1471
1471
|
n,
|
|
1472
|
-
|
|
1472
|
+
i
|
|
1473
1473
|
);
|
|
1474
1474
|
return {
|
|
1475
1475
|
...p,
|
|
@@ -1477,16 +1477,16 @@ const Fi = (n, r) => ({
|
|
|
1477
1477
|
operations: { global: [], local: [] },
|
|
1478
1478
|
clipboard: []
|
|
1479
1479
|
};
|
|
1480
|
-
}, re = (n,
|
|
1481
|
-
const p = Math.random() *
|
|
1480
|
+
}, re = (n, i = "global") => it(pt(n.state[i])), $i = (n, i = 1e3) => {
|
|
1481
|
+
const p = Math.random() * i;
|
|
1482
1482
|
return it(`${(n ?? /* @__PURE__ */ new Date()).toISOString()}${p}`);
|
|
1483
1483
|
};
|
|
1484
|
-
function
|
|
1484
|
+
function X(n) {
|
|
1485
1485
|
return Oe(Ue(n, !0));
|
|
1486
1486
|
}
|
|
1487
|
-
function Ai(n,
|
|
1487
|
+
function Ai(n, i) {
|
|
1488
1488
|
const p = [...n];
|
|
1489
|
-
let c =
|
|
1489
|
+
let c = i || 0, f = p.length > 0 ? p[p.length - 1].index : 0;
|
|
1490
1490
|
const u = [];
|
|
1491
1491
|
for (const l of p.reverse()) {
|
|
1492
1492
|
if (c > 0) {
|
|
@@ -1507,9 +1507,9 @@ function Ai(n, r) {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
return u.reverse();
|
|
1509
1509
|
}
|
|
1510
|
-
function Si(n,
|
|
1510
|
+
function Si(n, i, p) {
|
|
1511
1511
|
const c = n.slice().sort((a, x) => a.skip - x.skip).sort((a, x) => a.index - x.index);
|
|
1512
|
-
let f = p, u = 0, l =
|
|
1512
|
+
let f = p, u = 0, l = i;
|
|
1513
1513
|
for (const a of c.reverse()) {
|
|
1514
1514
|
const x = l - a.index;
|
|
1515
1515
|
if (f = f - x, f > -1)
|
|
@@ -1520,32 +1520,32 @@ function Si(n, r, p) {
|
|
|
1520
1520
|
return u;
|
|
1521
1521
|
}
|
|
1522
1522
|
function Pi(n) {
|
|
1523
|
-
return Object.values(n).flatMap((
|
|
1524
|
-
(
|
|
1523
|
+
return Object.values(n).flatMap((i) => i).sort(
|
|
1524
|
+
(i, p) => new Date(i.timestamp).getTime() - new Date(p.timestamp).getTime()
|
|
1525
1525
|
);
|
|
1526
1526
|
}
|
|
1527
1527
|
function Bi(n) {
|
|
1528
|
-
return Object.values(n).flatMap((
|
|
1529
|
-
(
|
|
1528
|
+
return Object.values(n).flatMap((i) => i).sort(
|
|
1529
|
+
(i, p) => new Date(i.operation.timestamp).getTime() - new Date(p.operation.timestamp).getTime()
|
|
1530
1530
|
);
|
|
1531
1531
|
}
|
|
1532
|
-
function lt(n,
|
|
1532
|
+
function lt(n, i, p, c, f, u = Kt, l = {}) {
|
|
1533
1533
|
const a = _i(p, u);
|
|
1534
1534
|
return ne(
|
|
1535
1535
|
n,
|
|
1536
|
-
|
|
1536
|
+
i,
|
|
1537
1537
|
a,
|
|
1538
1538
|
c,
|
|
1539
1539
|
f,
|
|
1540
1540
|
l
|
|
1541
1541
|
);
|
|
1542
1542
|
}
|
|
1543
|
-
function ne(n,
|
|
1544
|
-
const l = ki(n), a = Object.keys(
|
|
1543
|
+
function ne(n, i, p, c, f, u = {}) {
|
|
1544
|
+
const l = ki(n), a = Object.keys(i).reduce((y, b) => {
|
|
1545
1545
|
const E = b;
|
|
1546
1546
|
return {
|
|
1547
1547
|
...y,
|
|
1548
|
-
[E]:
|
|
1548
|
+
[E]: i[E].slice(0, f == null ? void 0 : f.revision[E])
|
|
1549
1549
|
};
|
|
1550
1550
|
}, {}), x = Object.keys(a).reduce(
|
|
1551
1551
|
(y, b) => {
|
|
@@ -1572,15 +1572,15 @@ function ne(n, r, p, c, f, u = {}) {
|
|
|
1572
1572
|
d.operations
|
|
1573
1573
|
).reduce(
|
|
1574
1574
|
(y, b) => {
|
|
1575
|
-
const E = b, U = f && f.revision[E] <
|
|
1575
|
+
const E = b, U = f && f.revision[E] < i[E].length ? i[E].slice(f.revision[E]) : [];
|
|
1576
1576
|
return {
|
|
1577
1577
|
...y,
|
|
1578
1578
|
[E]: [
|
|
1579
|
-
...d.operations[E].map((R,
|
|
1580
|
-
var
|
|
1579
|
+
...d.operations[E].map((R, $) => {
|
|
1580
|
+
var Y;
|
|
1581
1581
|
return {
|
|
1582
1582
|
...R,
|
|
1583
|
-
timestamp: ((
|
|
1583
|
+
timestamp: ((Y = i[E][$]) == null ? void 0 : Y.timestamp) ?? R.timestamp
|
|
1584
1584
|
};
|
|
1585
1585
|
}),
|
|
1586
1586
|
...U
|
|
@@ -1595,39 +1595,39 @@ function ne(n, r, p, c, f, u = {}) {
|
|
|
1595
1595
|
}, n.lastModified);
|
|
1596
1596
|
return { ...d, operations: v, lastModified: g };
|
|
1597
1597
|
}
|
|
1598
|
-
function qi(n,
|
|
1599
|
-
return pt(n) === pt(
|
|
1598
|
+
function qi(n, i) {
|
|
1599
|
+
return pt(n) === pt(i);
|
|
1600
1600
|
}
|
|
1601
|
-
const oe = (n) =>
|
|
1601
|
+
const oe = (n) => z(
|
|
1602
1602
|
"SET_NAME",
|
|
1603
1603
|
n,
|
|
1604
1604
|
void 0,
|
|
1605
1605
|
ht,
|
|
1606
1606
|
void 0
|
|
1607
|
-
), ae = (n = 1,
|
|
1607
|
+
), ae = (n = 1, i = "global") => z(
|
|
1608
1608
|
"UNDO",
|
|
1609
1609
|
n,
|
|
1610
1610
|
void 0,
|
|
1611
1611
|
xt,
|
|
1612
|
-
|
|
1613
|
-
), pe = (n = 1,
|
|
1612
|
+
i
|
|
1613
|
+
), pe = (n = 1, i = "global") => z(
|
|
1614
1614
|
"REDO",
|
|
1615
1615
|
n,
|
|
1616
1616
|
void 0,
|
|
1617
1617
|
mt,
|
|
1618
|
-
|
|
1619
|
-
), se = (n,
|
|
1618
|
+
i
|
|
1619
|
+
), se = (n, i, p = "global") => z(
|
|
1620
1620
|
"PRUNE",
|
|
1621
|
-
{ start: n, end:
|
|
1621
|
+
{ start: n, end: i },
|
|
1622
1622
|
void 0,
|
|
1623
1623
|
ft,
|
|
1624
1624
|
p
|
|
1625
|
-
), gt = (n,
|
|
1625
|
+
), gt = (n, i) => z(
|
|
1626
1626
|
"LOAD_STATE",
|
|
1627
|
-
{ state: n, operations:
|
|
1627
|
+
{ state: n, operations: i },
|
|
1628
1628
|
void 0,
|
|
1629
1629
|
ut
|
|
1630
|
-
), yt = (n = "global") =>
|
|
1630
|
+
), yt = (n = "global") => z("NOOP", {}, void 0, void 0, n), Wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1631
1631
|
__proto__: null,
|
|
1632
1632
|
loadState: gt,
|
|
1633
1633
|
noop: yt,
|
|
@@ -1637,27 +1637,27 @@ const oe = (n) => P(
|
|
|
1637
1637
|
undo: ae
|
|
1638
1638
|
}, Symbol.toStringTag, { value: "Module" })), ce = { "application/andrew-inset": ["ez"], "application/appinstaller": ["appinstaller"], "application/applixware": ["aw"], "application/appx": ["appx"], "application/appxbundle": ["appxbundle"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/automationml-aml+xml": ["aml"], "application/automationml-amlx+zip": ["amlx"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cpl+xml": ["cpl"], "application/cu-seeme": ["cu"], "application/cwl": ["cwl"], "application/dash+xml": ["mpd"], "application/dash-patch+xml": ["mpp"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdf": ["fdf"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["*js"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/media-policy-dataset+xml": ["mpf"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"], "application/msix": ["msix"], "application/msixbundle": ["msixbundle"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-keys": ["asc"], "application/pgp-signature": ["sig", "*asc"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/sql": ["sql"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/watcherinfo+xml": ["wif"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xfdf": ["xfdf"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/aac": ["adts", "aac"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avci": ["avci"], "image/avcs": ["avcs"], "image/avif": ["avif"], "image/bmp": ["bmp", "dib"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/dpx": ["dpx"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm", "jpgm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/jt": ["jt"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/prc": ["prc"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/u3d": ["u3d"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/javascript": ["js", "mjs"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["md", "markdown"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/wgsl": ["wgsl"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "*jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
|
|
1639
1639
|
Object.freeze(ce);
|
|
1640
|
-
var I = function(n,
|
|
1640
|
+
var I = function(n, i, p, c) {
|
|
1641
1641
|
if (p === "a" && !c)
|
|
1642
1642
|
throw new TypeError("Private accessor was defined without a getter");
|
|
1643
|
-
if (typeof
|
|
1643
|
+
if (typeof i == "function" ? n !== i || !c : !i.has(n))
|
|
1644
1644
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1645
|
-
return p === "m" ? c : p === "a" ? c.call(n) : c ? c.value :
|
|
1646
|
-
}, L,
|
|
1645
|
+
return p === "m" ? c : p === "a" ? c.call(n) : c ? c.value : i.get(n);
|
|
1646
|
+
}, L, P, N;
|
|
1647
1647
|
class ji {
|
|
1648
|
-
constructor(...
|
|
1649
|
-
L.set(this, /* @__PURE__ */ new Map()),
|
|
1650
|
-
for (const p of
|
|
1648
|
+
constructor(...i) {
|
|
1649
|
+
L.set(this, /* @__PURE__ */ new Map()), P.set(this, /* @__PURE__ */ new Map()), N.set(this, /* @__PURE__ */ new Map());
|
|
1650
|
+
for (const p of i)
|
|
1651
1651
|
this.define(p);
|
|
1652
1652
|
}
|
|
1653
|
-
define(
|
|
1654
|
-
for (let [c, f] of Object.entries(
|
|
1653
|
+
define(i, p = !1) {
|
|
1654
|
+
for (let [c, f] of Object.entries(i)) {
|
|
1655
1655
|
c = c.toLowerCase(), f = f.map((a) => a.toLowerCase()), I(this, N, "f").has(c) || I(this, N, "f").set(c, /* @__PURE__ */ new Set());
|
|
1656
1656
|
const u = I(this, N, "f").get(c);
|
|
1657
1657
|
let l = !0;
|
|
1658
1658
|
for (let a of f) {
|
|
1659
1659
|
const x = a.startsWith("*");
|
|
1660
|
-
if (a = x ? a.slice(1) : a, u == null || u.add(a), l && I(this,
|
|
1660
|
+
if (a = x ? a.slice(1) : a, u == null || u.add(a), l && I(this, P, "f").set(c, a), l = !1, x)
|
|
1661
1661
|
continue;
|
|
1662
1662
|
const d = I(this, L, "f").get(a);
|
|
1663
1663
|
if (d && d != c && !p)
|
|
@@ -1667,42 +1667,42 @@ class ji {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
return this;
|
|
1669
1669
|
}
|
|
1670
|
-
getType(
|
|
1671
|
-
if (typeof
|
|
1670
|
+
getType(i) {
|
|
1671
|
+
if (typeof i != "string")
|
|
1672
1672
|
return null;
|
|
1673
|
-
const p =
|
|
1673
|
+
const p = i.replace(/^.*[/\\]/, "").toLowerCase(), c = p.replace(/^.*\./, "").toLowerCase(), f = p.length < i.length;
|
|
1674
1674
|
return !(c.length < p.length - 1) && f ? null : I(this, L, "f").get(c) ?? null;
|
|
1675
1675
|
}
|
|
1676
|
-
getExtension(
|
|
1676
|
+
getExtension(i) {
|
|
1677
1677
|
var p;
|
|
1678
|
-
return typeof
|
|
1678
|
+
return typeof i != "string" ? null : (i = (p = i == null ? void 0 : i.split) == null ? void 0 : p.call(i, ";")[0], (i && I(this, P, "f").get(i.trim().toLowerCase())) ?? null);
|
|
1679
1679
|
}
|
|
1680
|
-
getAllExtensions(
|
|
1681
|
-
return typeof
|
|
1680
|
+
getAllExtensions(i) {
|
|
1681
|
+
return typeof i != "string" ? null : I(this, N, "f").get(i.toLowerCase()) ?? null;
|
|
1682
1682
|
}
|
|
1683
1683
|
_freeze() {
|
|
1684
1684
|
this.define = () => {
|
|
1685
1685
|
throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
|
|
1686
1686
|
}, Object.freeze(this);
|
|
1687
|
-
for (const
|
|
1688
|
-
Object.freeze(
|
|
1687
|
+
for (const i of I(this, N, "f").values())
|
|
1688
|
+
Object.freeze(i);
|
|
1689
1689
|
return this;
|
|
1690
1690
|
}
|
|
1691
1691
|
_getTestState() {
|
|
1692
1692
|
return {
|
|
1693
1693
|
types: I(this, L, "f"),
|
|
1694
|
-
extensions: I(this,
|
|
1694
|
+
extensions: I(this, P, "f")
|
|
1695
1695
|
};
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
1698
|
-
L = /* @__PURE__ */ new WeakMap(),
|
|
1698
|
+
L = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
|
|
1699
1699
|
const Ii = new ji(ce)._freeze();
|
|
1700
1700
|
function Oi(n) {
|
|
1701
|
-
const
|
|
1701
|
+
const i = [], p = Object.keys(n);
|
|
1702
1702
|
for (const c of p) {
|
|
1703
1703
|
const f = n[c].sort((u, l) => u.index - l.index);
|
|
1704
1704
|
for (let u = 0; u < f.length; u++)
|
|
1705
|
-
f[u].index !== u &&
|
|
1705
|
+
f[u].index !== u && i.push({
|
|
1706
1706
|
message: `Invalid operation index ${f[u].index} at position ${u}`,
|
|
1707
1707
|
details: {
|
|
1708
1708
|
position: u,
|
|
@@ -1711,48 +1711,48 @@ function Oi(n) {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
});
|
|
1713
1713
|
}
|
|
1714
|
-
return
|
|
1714
|
+
return i;
|
|
1715
1715
|
}
|
|
1716
1716
|
const le = async (n) => {
|
|
1717
|
-
const
|
|
1717
|
+
const i = new Dt(), { name: p, revision: c, documentType: f, created: u, lastModified: l } = n, a = {
|
|
1718
1718
|
name: p,
|
|
1719
1719
|
revision: c,
|
|
1720
1720
|
documentType: f,
|
|
1721
1721
|
created: u,
|
|
1722
1722
|
lastModified: l
|
|
1723
1723
|
};
|
|
1724
|
-
return
|
|
1724
|
+
return i.file("header.json", JSON.stringify(a, null, 2)), i.file(
|
|
1725
1725
|
"state.json",
|
|
1726
1726
|
JSON.stringify(n.initialState || {}, null, 2)
|
|
1727
|
-
),
|
|
1727
|
+
), i.file("operations.json", JSON.stringify(n.operations, null, 2)), Object.keys(n.attachments).forEach((d) => {
|
|
1728
1728
|
const { data: v, ...g } = n.attachments[d];
|
|
1729
|
-
|
|
1729
|
+
i.file(d, v, {
|
|
1730
1730
|
base64: !0,
|
|
1731
1731
|
createFolders: !0,
|
|
1732
1732
|
comment: JSON.stringify(g)
|
|
1733
1733
|
});
|
|
1734
|
-
}),
|
|
1735
|
-
}, Ui = async (n,
|
|
1734
|
+
}), i;
|
|
1735
|
+
}, Ui = async (n, i, p, c) => {
|
|
1736
1736
|
await (await le(n)).generateAsync({
|
|
1737
1737
|
type: "uint8array",
|
|
1738
1738
|
streamFiles: !0
|
|
1739
1739
|
});
|
|
1740
1740
|
const u = c ?? n.name, l = `.${p}.zip`;
|
|
1741
1741
|
return gi(
|
|
1742
|
-
|
|
1742
|
+
i,
|
|
1743
1743
|
u.endsWith(l) ? u : `${u}${l}`
|
|
1744
1744
|
);
|
|
1745
|
-
}, Ji = async (n,
|
|
1746
|
-
const c = await (await le(n)).generateAsync({ type: "blob" }), f = await
|
|
1745
|
+
}, Ji = async (n, i) => {
|
|
1746
|
+
const c = await (await le(n)).generateAsync({ type: "blob" }), f = await i.createWritable();
|
|
1747
1747
|
await f.write(c), await f.close();
|
|
1748
|
-
}, Tt = async (n,
|
|
1748
|
+
}, Tt = async (n, i) => {
|
|
1749
1749
|
const p = ie();
|
|
1750
|
-
return Ti(p,
|
|
1751
|
-
}, Ti = async (n,
|
|
1750
|
+
return Ti(p, i);
|
|
1751
|
+
}, Ti = async (n, i) => {
|
|
1752
1752
|
const p = new Dt();
|
|
1753
|
-
return await p.loadAsync(n), Di(p,
|
|
1753
|
+
return await p.loadAsync(n), Di(p, i);
|
|
1754
1754
|
};
|
|
1755
|
-
async function Di(n,
|
|
1755
|
+
async function Di(n, i) {
|
|
1756
1756
|
const p = n.file("state.json");
|
|
1757
1757
|
if (!p)
|
|
1758
1758
|
throw new Error("Initial state not found");
|
|
@@ -1773,7 +1773,7 @@ async function Di(n, r) {
|
|
|
1773
1773
|
let v = ne(
|
|
1774
1774
|
f,
|
|
1775
1775
|
x,
|
|
1776
|
-
|
|
1776
|
+
i,
|
|
1777
1777
|
void 0,
|
|
1778
1778
|
l
|
|
1779
1779
|
);
|
|
@@ -1783,11 +1783,11 @@ async function Di(n, r) {
|
|
|
1783
1783
|
}), v;
|
|
1784
1784
|
}
|
|
1785
1785
|
function ue(n) {
|
|
1786
|
-
const
|
|
1787
|
-
return { extension:
|
|
1786
|
+
const i = n.replace(/^.*\./, "") || void 0, p = n.replace(/^.*[/\\]/, "") || void 0;
|
|
1787
|
+
return { extension: i, fileName: p };
|
|
1788
1788
|
}
|
|
1789
1789
|
async function Hi(n) {
|
|
1790
|
-
const { buffer:
|
|
1790
|
+
const { buffer: i, mimeType: p = "application/octet-stream" } = await yi(), c = ue(n), f = i.toString("base64");
|
|
1791
1791
|
return {
|
|
1792
1792
|
data: f,
|
|
1793
1793
|
hash: it(f),
|
|
@@ -1796,7 +1796,7 @@ async function Hi(n) {
|
|
|
1796
1796
|
};
|
|
1797
1797
|
}
|
|
1798
1798
|
async function Zi(n) {
|
|
1799
|
-
const
|
|
1799
|
+
const i = await vi(), p = Ii.getType(n) || "application/octet-stream", c = ue(n), f = i.toString("base64");
|
|
1800
1800
|
return { data: f, hash: it(f), mimeType: p, ...c };
|
|
1801
1801
|
}
|
|
1802
1802
|
class Yi {
|
|
@@ -1805,21 +1805,21 @@ class Yi {
|
|
|
1805
1805
|
* @param reducer - The reducer function that updates the state.
|
|
1806
1806
|
* @param document - The initial state of the document.
|
|
1807
1807
|
*/
|
|
1808
|
-
constructor(
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
this._reducer =
|
|
1808
|
+
constructor(i, p, c) {
|
|
1809
|
+
V(this, "_document");
|
|
1810
|
+
V(this, "_reducer");
|
|
1811
|
+
V(this, "_signalDispatch");
|
|
1812
|
+
this._reducer = i, this._document = p, this._signalDispatch = c;
|
|
1813
1813
|
}
|
|
1814
1814
|
/**
|
|
1815
1815
|
* Dispatches an action to update the state of the document.
|
|
1816
1816
|
* @param action - The action to dispatch.
|
|
1817
1817
|
* @returns The Document instance.
|
|
1818
1818
|
*/
|
|
1819
|
-
dispatch(
|
|
1819
|
+
dispatch(i, p) {
|
|
1820
1820
|
return this._document = this._reducer(
|
|
1821
1821
|
this._document,
|
|
1822
|
-
|
|
1822
|
+
i,
|
|
1823
1823
|
this._signalDispatch,
|
|
1824
1824
|
p
|
|
1825
1825
|
), this;
|
|
@@ -1830,15 +1830,15 @@ class Yi {
|
|
|
1830
1830
|
* @param extension - The file extension to use when saving the state.
|
|
1831
1831
|
* @returns The file path where the state was saved.
|
|
1832
1832
|
*/
|
|
1833
|
-
saveToFile(
|
|
1834
|
-
return Ui(this._document,
|
|
1833
|
+
saveToFile(i, p, c) {
|
|
1834
|
+
return Ui(this._document, i, p, c);
|
|
1835
1835
|
}
|
|
1836
1836
|
/**
|
|
1837
1837
|
* Loads the state of the document from a file.
|
|
1838
1838
|
* @param path - The file path where the state is stored.
|
|
1839
1839
|
*/
|
|
1840
|
-
async loadFromFile(
|
|
1841
|
-
this._document = await Tt(
|
|
1840
|
+
async loadFromFile(i) {
|
|
1841
|
+
this._document = await Tt(i, this._reducer);
|
|
1842
1842
|
}
|
|
1843
1843
|
/**
|
|
1844
1844
|
* Loads the state of the document from a file and returns it.
|
|
@@ -1846,20 +1846,20 @@ class Yi {
|
|
|
1846
1846
|
* @param reducer - The reducer function that updates the state.
|
|
1847
1847
|
* @returns The state of the document.
|
|
1848
1848
|
*/
|
|
1849
|
-
static async stateFromFile(
|
|
1850
|
-
return await Tt(
|
|
1849
|
+
static async stateFromFile(i, p) {
|
|
1850
|
+
return await Tt(i, p);
|
|
1851
1851
|
}
|
|
1852
1852
|
/**
|
|
1853
1853
|
* Gets the current state of the document.
|
|
1854
1854
|
*/
|
|
1855
1855
|
get state() {
|
|
1856
|
-
return
|
|
1856
|
+
return X(this._document.state);
|
|
1857
1857
|
}
|
|
1858
1858
|
/**
|
|
1859
1859
|
* Gets the list of operations performed on the document.
|
|
1860
1860
|
*/
|
|
1861
1861
|
get operations() {
|
|
1862
|
-
return
|
|
1862
|
+
return X(this._document.operations);
|
|
1863
1863
|
}
|
|
1864
1864
|
/**
|
|
1865
1865
|
* Gets the name of the document.
|
|
@@ -1891,68 +1891,68 @@ class Yi {
|
|
|
1891
1891
|
get revision() {
|
|
1892
1892
|
return this._document.revision.global;
|
|
1893
1893
|
}
|
|
1894
|
-
getRevision(
|
|
1895
|
-
return this._document.revision[
|
|
1894
|
+
getRevision(i) {
|
|
1895
|
+
return this._document.revision[i];
|
|
1896
1896
|
}
|
|
1897
1897
|
/**
|
|
1898
1898
|
* Gets the initial state of the document.
|
|
1899
1899
|
*/
|
|
1900
1900
|
get initialState() {
|
|
1901
|
-
return
|
|
1901
|
+
return X(this._document.initialState);
|
|
1902
1902
|
}
|
|
1903
1903
|
/**
|
|
1904
1904
|
* Returns the current document as an object
|
|
1905
1905
|
*/
|
|
1906
1906
|
toDocument() {
|
|
1907
|
-
return
|
|
1907
|
+
return X(this._document);
|
|
1908
1908
|
}
|
|
1909
1909
|
/**
|
|
1910
1910
|
* Gets the attachment associated with the given key.
|
|
1911
1911
|
* @param attachment - The key of the attachment to retrieve.
|
|
1912
1912
|
*/
|
|
1913
|
-
getAttachment(
|
|
1914
|
-
return this._document.attachments[
|
|
1913
|
+
getAttachment(i) {
|
|
1914
|
+
return this._document.attachments[i];
|
|
1915
1915
|
}
|
|
1916
1916
|
/**
|
|
1917
1917
|
* Sets the name of the document.
|
|
1918
1918
|
* @param name - The new name of the document.
|
|
1919
1919
|
*/
|
|
1920
|
-
setName(
|
|
1921
|
-
return this.dispatch(oe(
|
|
1920
|
+
setName(i) {
|
|
1921
|
+
return this.dispatch(oe(i)), this;
|
|
1922
1922
|
}
|
|
1923
1923
|
/**
|
|
1924
1924
|
* Reverts a number of actions from the document.
|
|
1925
1925
|
* @param count - The number of actions to revert.
|
|
1926
1926
|
*/
|
|
1927
|
-
undo(
|
|
1928
|
-
return this.dispatch(ae(
|
|
1927
|
+
undo(i) {
|
|
1928
|
+
return this.dispatch(ae(i)), this;
|
|
1929
1929
|
}
|
|
1930
1930
|
/**
|
|
1931
1931
|
* Reapplies a number of actions to the document.
|
|
1932
1932
|
* @param count - The number of actions to reapply.
|
|
1933
1933
|
*/
|
|
1934
|
-
redo(
|
|
1935
|
-
return this.dispatch(pe(
|
|
1934
|
+
redo(i) {
|
|
1935
|
+
return this.dispatch(pe(i)), this;
|
|
1936
1936
|
}
|
|
1937
1937
|
/**
|
|
1938
1938
|
* Removes a range of operations from the document.
|
|
1939
1939
|
* @param start - The starting index of the range to remove.
|
|
1940
1940
|
* @param end - The ending index of the range to remove.
|
|
1941
1941
|
*/
|
|
1942
|
-
prune(
|
|
1943
|
-
return this.dispatch(se(
|
|
1942
|
+
prune(i, p) {
|
|
1943
|
+
return this.dispatch(se(i, p)), this;
|
|
1944
1944
|
}
|
|
1945
1945
|
/**
|
|
1946
1946
|
* Loads a document state and a set of operations.
|
|
1947
1947
|
* @param state - The state to load.
|
|
1948
1948
|
* @param operations - The operations to apply to the document.
|
|
1949
1949
|
*/
|
|
1950
|
-
loadState(
|
|
1951
|
-
return this.dispatch(gt(
|
|
1950
|
+
loadState(i, p) {
|
|
1951
|
+
return this.dispatch(gt(i, p)), this;
|
|
1952
1952
|
}
|
|
1953
1953
|
}
|
|
1954
|
-
function Gi(n,
|
|
1955
|
-
|
|
1954
|
+
function Gi(n, i) {
|
|
1955
|
+
i.forEach((p) => {
|
|
1956
1956
|
Object.getOwnPropertyNames(p.prototype).forEach((c) => {
|
|
1957
1957
|
Object.defineProperty(
|
|
1958
1958
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
@@ -1975,7 +1975,7 @@ export {
|
|
|
1975
1975
|
_i as c,
|
|
1976
1976
|
Ji as d,
|
|
1977
1977
|
Ti as e,
|
|
1978
|
-
|
|
1978
|
+
z as f,
|
|
1979
1979
|
Gi as g,
|
|
1980
1980
|
Wi as h,
|
|
1981
1981
|
Ut as i,
|
|
@@ -1991,7 +1991,7 @@ export {
|
|
|
1991
1991
|
Ui as s,
|
|
1992
1992
|
Ot as t,
|
|
1993
1993
|
Ai as u,
|
|
1994
|
-
|
|
1994
|
+
X as v,
|
|
1995
1995
|
ne as w,
|
|
1996
1996
|
lt as x,
|
|
1997
1997
|
Bi as y,
|