document-model 1.1.0-experimental.1 → 1.1.0-experimental.2
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/cjs/document-model.js +1 -1
- package/dist/browser/cjs/document.js +1 -1
- package/dist/browser/cjs/index.js +1 -1
- package/dist/browser/cjs/internal/{index-DypcJuba.js → index-DLodkpOq.js} +1 -1
- package/dist/browser/cjs/internal/index-azT4DEce.js +1 -0
- package/dist/browser/cjs/internal/{object-BU2CI8g7.js → object-CMr-_AP8.js} +21 -21
- package/dist/browser/es/document-model.js +2 -2
- package/dist/browser/es/document.js +2 -2
- package/dist/browser/es/index.js +3 -3
- package/dist/browser/es/internal/index-BzNpRs2a.js +44 -0
- package/dist/browser/es/internal/{index-CyBZ1dJQ.js → index-CL_1ivGq.js} +1 -1
- package/dist/browser/es/internal/{object-CPDHmXxz.js → object-FFc9n_3I.js} +917 -840
- package/dist/browser/src/document/object.d.ts +35 -0
- package/dist/browser/src/document/types.d.ts +6 -0
- package/dist/browser/src/document/utils/base.d.ts +5 -4
- package/dist/browser/src/document/utils/document-helpers.d.ts +1 -1
- package/dist/browser/src/document/utils/index.d.ts +1 -1
- package/dist/node/cjs/document-model.js +1 -1
- package/dist/node/cjs/document.js +1 -1
- package/dist/node/cjs/index.js +1 -1
- package/dist/node/cjs/internal/{index-Bt4KwBzM.js → index-CPeTtUsk.js} +1 -1
- package/dist/node/cjs/internal/index-CTavCc1t.js +1 -0
- package/dist/node/cjs/internal/object-DhI24-1e.js +20 -0
- package/dist/node/es/document-model.js +2 -2
- package/dist/node/es/document.js +2 -2
- package/dist/node/es/index.js +3 -3
- package/dist/node/es/internal/index-8lUz8qED.js +44 -0
- package/dist/node/es/internal/{index-6nUwJlFL.js → index-A880In4b.js} +1 -1
- package/dist/node/es/internal/{object-DofGWMf1.js → object-C9n9Ijnt.js} +675 -598
- package/dist/node/src/document/object.d.ts +35 -0
- package/dist/node/src/document/types.d.ts +6 -0
- package/dist/node/src/document/utils/base.d.ts +5 -4
- package/dist/node/src/document/utils/document-helpers.d.ts +1 -1
- package/dist/node/src/document/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/browser/cjs/internal/index-DZx9eknf.js +0 -1
- package/dist/browser/es/internal/index-BP3Z2ZVF.js +0 -43
- package/dist/node/cjs/internal/index-CwTTSCCW.js +0 -1
- package/dist/node/cjs/internal/object-Bc_eSRcx.js +0 -20
- package/dist/node/es/internal/index-CLgAZiia.js +0 -43
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var st = (t, e, n) => (
|
|
4
|
-
import { produce as pt, castDraft as at, castImmutable as
|
|
5
|
-
import { z as
|
|
1
|
+
var pe = Object.defineProperty;
|
|
2
|
+
var ce = (t, e, n) => e in t ? pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var st = (t, e, n) => (ce(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { produce as pt, castDraft as at, castImmutable as le, freeze as me } from "immer";
|
|
5
|
+
import { z as f } from "zod";
|
|
6
6
|
import Dt from "jszip";
|
|
7
|
-
import
|
|
7
|
+
import ue from "crypto";
|
|
8
8
|
import ut from "fs";
|
|
9
|
-
import
|
|
10
|
-
import { join as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
-
__typename:
|
|
15
|
-
type:
|
|
9
|
+
import fe from "https";
|
|
10
|
+
import { join as de } from "path";
|
|
11
|
+
const Tt = (t) => t != null, ge = f.any().refine((t) => Tt(t)), _t = f.enum(["LOAD_STATE"]), Nt = f.enum(["PRUNE"]), vt = f.enum(["REDO"]), It = f.enum(["SET_NAME"]), At = f.enum(["UNDO"]);
|
|
12
|
+
function he() {
|
|
13
|
+
return f.object({
|
|
14
|
+
__typename: f.literal("Action").optional(),
|
|
15
|
+
type: f.string()
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
function Y() {
|
|
19
|
-
return
|
|
19
|
+
return f.literal("global").or(f.literal("local"));
|
|
20
20
|
}
|
|
21
21
|
function Pt() {
|
|
22
|
-
return
|
|
22
|
+
return f.union([
|
|
23
23
|
Mt(),
|
|
24
|
+
Rt(),
|
|
24
25
|
Ct(),
|
|
25
26
|
Ft(),
|
|
26
|
-
Lt()
|
|
27
|
-
Rt()
|
|
27
|
+
Lt()
|
|
28
28
|
]);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
__typename:
|
|
33
|
-
data:
|
|
34
|
-
extension:
|
|
35
|
-
fileName:
|
|
36
|
-
mimeType:
|
|
30
|
+
function xe() {
|
|
31
|
+
return f.object({
|
|
32
|
+
__typename: f.literal("DocumentFile").optional(),
|
|
33
|
+
data: f.string(),
|
|
34
|
+
extension: f.string().nullable(),
|
|
35
|
+
fileName: f.string().nullable(),
|
|
36
|
+
mimeType: f.string()
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
function Mt() {
|
|
40
|
-
return
|
|
41
|
-
input:
|
|
42
|
-
type:
|
|
40
|
+
return f.object({
|
|
41
|
+
input: f.lazy(() => ht()),
|
|
42
|
+
type: _t,
|
|
43
43
|
scope: Y()
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
function ht() {
|
|
47
|
-
return
|
|
48
|
-
operations:
|
|
49
|
-
state:
|
|
47
|
+
return f.object({
|
|
48
|
+
operations: f.number(),
|
|
49
|
+
state: f.lazy(() => zt())
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
function zt() {
|
|
53
|
-
return
|
|
54
|
-
data:
|
|
55
|
-
name:
|
|
53
|
+
return f.object({
|
|
54
|
+
data: f.unknown().nullish(),
|
|
55
|
+
name: f.string()
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
60
|
-
__typename:
|
|
61
|
-
hash:
|
|
62
|
-
index:
|
|
63
|
-
timestamp:
|
|
64
|
-
type:
|
|
58
|
+
function ye() {
|
|
59
|
+
return f.object({
|
|
60
|
+
__typename: f.literal("Operation").optional(),
|
|
61
|
+
hash: f.string(),
|
|
62
|
+
index: f.number(),
|
|
63
|
+
timestamp: f.string().datetime(),
|
|
64
|
+
type: f.string()
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
69
|
-
input:
|
|
67
|
+
function Rt() {
|
|
68
|
+
return f.object({
|
|
69
|
+
input: f.lazy(() => xt()),
|
|
70
70
|
type: Nt,
|
|
71
71
|
scope: Y()
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
function xt() {
|
|
75
|
-
return
|
|
76
|
-
end:
|
|
77
|
-
start:
|
|
75
|
+
return f.object({
|
|
76
|
+
end: f.number().nullish(),
|
|
77
|
+
start: f.number().nullish()
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
const yt =
|
|
81
|
-
function
|
|
82
|
-
return
|
|
80
|
+
const yt = f.number;
|
|
81
|
+
function Ct() {
|
|
82
|
+
return f.object({
|
|
83
83
|
input: yt(),
|
|
84
84
|
type: vt,
|
|
85
85
|
scope: Y()
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
const bt =
|
|
89
|
-
function
|
|
90
|
-
return
|
|
88
|
+
const bt = f.string;
|
|
89
|
+
function Ft() {
|
|
90
|
+
return f.object({
|
|
91
91
|
input: bt(),
|
|
92
92
|
type: It,
|
|
93
|
-
scope:
|
|
93
|
+
scope: f.literal("global")
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return
|
|
98
|
-
__typename:
|
|
99
|
-
hash:
|
|
100
|
-
index:
|
|
101
|
-
input:
|
|
102
|
-
timestamp:
|
|
103
|
-
type:
|
|
96
|
+
function be() {
|
|
97
|
+
return f.object({
|
|
98
|
+
__typename: f.literal("SetNameOperation").optional(),
|
|
99
|
+
hash: f.string(),
|
|
100
|
+
index: f.number(),
|
|
101
|
+
input: f.string(),
|
|
102
|
+
timestamp: f.string().datetime(),
|
|
103
|
+
type: f.string()
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
const wt =
|
|
107
|
-
function
|
|
108
|
-
return
|
|
106
|
+
const wt = f.number;
|
|
107
|
+
function Lt() {
|
|
108
|
+
return f.object({
|
|
109
109
|
input: wt(),
|
|
110
110
|
type: At,
|
|
111
111
|
scope: Y()
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
115
115
|
__proto__: null,
|
|
116
|
-
ActionSchema:
|
|
116
|
+
ActionSchema: he,
|
|
117
117
|
BaseActionSchema: Pt,
|
|
118
|
-
DocumentFileSchema:
|
|
118
|
+
DocumentFileSchema: xe,
|
|
119
119
|
LoadStateActionInputSchema: ht,
|
|
120
120
|
LoadStateActionSchema: Mt,
|
|
121
121
|
LoadStateActionStateInputSchema: zt,
|
|
122
|
-
Load_StateSchema:
|
|
123
|
-
OperationSchema:
|
|
122
|
+
Load_StateSchema: _t,
|
|
123
|
+
OperationSchema: ye,
|
|
124
124
|
OperationScopeSchema: Y,
|
|
125
125
|
PruneActionInputSchema: xt,
|
|
126
|
-
PruneActionSchema:
|
|
126
|
+
PruneActionSchema: Rt,
|
|
127
127
|
PruneSchema: Nt,
|
|
128
128
|
RedoActionInputSchema: yt,
|
|
129
|
-
RedoActionSchema:
|
|
129
|
+
RedoActionSchema: Ct,
|
|
130
130
|
RedoSchema: vt,
|
|
131
131
|
SetNameActionInputSchema: bt,
|
|
132
|
-
SetNameActionSchema:
|
|
133
|
-
SetNameOperationSchema:
|
|
132
|
+
SetNameActionSchema: Ft,
|
|
133
|
+
SetNameOperationSchema: be,
|
|
134
134
|
Set_NameSchema: It,
|
|
135
135
|
UndoActionInputSchema: wt,
|
|
136
|
-
UndoActionSchema:
|
|
136
|
+
UndoActionSchema: Lt,
|
|
137
137
|
UndoSchema: At,
|
|
138
|
-
definedNonNullAnySchema:
|
|
139
|
-
isDefinedNonNullAny:
|
|
138
|
+
definedNonNullAnySchema: ge,
|
|
139
|
+
isDefinedNonNullAny: Tt
|
|
140
140
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
141
|
-
function
|
|
141
|
+
function we(t) {
|
|
142
142
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
143
143
|
}
|
|
144
144
|
var ft = { exports: {} };
|
|
145
145
|
(function(t, e) {
|
|
146
|
-
const { hasOwnProperty: n } = Object.prototype, i =
|
|
147
|
-
i.configure =
|
|
146
|
+
const { hasOwnProperty: n } = Object.prototype, i = C();
|
|
147
|
+
i.configure = C, i.stringify = i, i.default = i, e.stringify = i, e.configure = C, t.exports = i;
|
|
148
148
|
const o = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
|
|
149
|
-
function a(
|
|
150
|
-
return
|
|
149
|
+
function a(c) {
|
|
150
|
+
return c.length < 5e3 && !o.test(c) ? `"${c}"` : JSON.stringify(c);
|
|
151
151
|
}
|
|
152
|
-
function r(
|
|
153
|
-
if (
|
|
154
|
-
return
|
|
155
|
-
for (let
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
for (;
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
function r(c) {
|
|
153
|
+
if (c.length > 200)
|
|
154
|
+
return c.sort();
|
|
155
|
+
for (let l = 1; l < c.length; l++) {
|
|
156
|
+
const u = c[l];
|
|
157
|
+
let _ = l;
|
|
158
|
+
for (; _ !== 0 && c[_ - 1] > u; )
|
|
159
|
+
c[_] = c[_ - 1], _--;
|
|
160
|
+
c[_] = u;
|
|
161
161
|
}
|
|
162
|
-
return
|
|
162
|
+
return c;
|
|
163
163
|
}
|
|
164
164
|
const p = Object.getOwnPropertyDescriptor(
|
|
165
165
|
Object.getPrototypeOf(
|
|
@@ -169,25 +169,25 @@ var ft = { exports: {} };
|
|
|
169
169
|
),
|
|
170
170
|
Symbol.toStringTag
|
|
171
171
|
).get;
|
|
172
|
-
function c
|
|
173
|
-
return p.call(
|
|
172
|
+
function m(c) {
|
|
173
|
+
return p.call(c) !== void 0 && c.length !== 0;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
for (let
|
|
180
|
-
|
|
181
|
-
return
|
|
175
|
+
function d(c, l, u) {
|
|
176
|
+
c.length < u && (u = c.length);
|
|
177
|
+
const _ = l === "," ? "" : " ";
|
|
178
|
+
let F = `"0":${_}${c[0]}`;
|
|
179
|
+
for (let M = 1; M < u; M++)
|
|
180
|
+
F += `${l}"${M}":${_}${c[M]}`;
|
|
181
|
+
return F;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
if (n.call(
|
|
185
|
-
const
|
|
186
|
-
if (typeof
|
|
187
|
-
return `"${
|
|
188
|
-
if (
|
|
189
|
-
return
|
|
190
|
-
if (
|
|
183
|
+
function h(c) {
|
|
184
|
+
if (n.call(c, "circularValue")) {
|
|
185
|
+
const l = c.circularValue;
|
|
186
|
+
if (typeof l == "string")
|
|
187
|
+
return `"${l}"`;
|
|
188
|
+
if (l == null)
|
|
189
|
+
return l;
|
|
190
|
+
if (l === Error || l === TypeError)
|
|
191
191
|
return {
|
|
192
192
|
toString() {
|
|
193
193
|
throw new TypeError("Converting circular structure to JSON");
|
|
@@ -197,180 +197,180 @@ var ft = { exports: {} };
|
|
|
197
197
|
}
|
|
198
198
|
return '"[Circular]"';
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
let
|
|
202
|
-
if (n.call(
|
|
203
|
-
throw new TypeError(`The "${
|
|
204
|
-
return
|
|
200
|
+
function b(c, l) {
|
|
201
|
+
let u;
|
|
202
|
+
if (n.call(c, l) && (u = c[l], typeof u != "boolean"))
|
|
203
|
+
throw new TypeError(`The "${l}" argument must be of type boolean`);
|
|
204
|
+
return u === void 0 ? !0 : u;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
let
|
|
208
|
-
if (n.call(
|
|
209
|
-
if (
|
|
210
|
-
throw new TypeError(`The "${
|
|
211
|
-
if (!Number.isInteger(
|
|
212
|
-
throw new TypeError(`The "${
|
|
213
|
-
if (
|
|
214
|
-
throw new RangeError(`The "${
|
|
206
|
+
function O(c, l) {
|
|
207
|
+
let u;
|
|
208
|
+
if (n.call(c, l)) {
|
|
209
|
+
if (u = c[l], typeof u != "number")
|
|
210
|
+
throw new TypeError(`The "${l}" argument must be of type number`);
|
|
211
|
+
if (!Number.isInteger(u))
|
|
212
|
+
throw new TypeError(`The "${l}" argument must be an integer`);
|
|
213
|
+
if (u < 1)
|
|
214
|
+
throw new RangeError(`The "${l}" argument must be >= 1`);
|
|
215
215
|
}
|
|
216
|
-
return
|
|
216
|
+
return u === void 0 ? 1 / 0 : u;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
return
|
|
218
|
+
function v(c) {
|
|
219
|
+
return c === 1 ? "1 item" : `${c} items`;
|
|
220
220
|
}
|
|
221
|
-
function T(
|
|
222
|
-
const
|
|
223
|
-
for (const
|
|
224
|
-
(typeof
|
|
225
|
-
return
|
|
221
|
+
function T(c) {
|
|
222
|
+
const l = /* @__PURE__ */ new Set();
|
|
223
|
+
for (const u of c)
|
|
224
|
+
(typeof u == "string" || typeof u == "number") && l.add(String(u));
|
|
225
|
+
return l;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
if (n.call(
|
|
229
|
-
const
|
|
230
|
-
if (typeof
|
|
227
|
+
function P(c) {
|
|
228
|
+
if (n.call(c, "strict")) {
|
|
229
|
+
const l = c.strict;
|
|
230
|
+
if (typeof l != "boolean")
|
|
231
231
|
throw new TypeError('The "strict" argument must be of type boolean');
|
|
232
|
-
if (
|
|
233
|
-
return (
|
|
234
|
-
let
|
|
235
|
-
throw typeof
|
|
232
|
+
if (l)
|
|
233
|
+
return (u) => {
|
|
234
|
+
let _ = `Object can not safely be stringified. Received type ${typeof u}`;
|
|
235
|
+
throw typeof u != "function" && (_ += ` (${u.toString()})`), new Error(_);
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
function nt(
|
|
245
|
-
let
|
|
246
|
-
switch (typeof
|
|
239
|
+
function C(c) {
|
|
240
|
+
c = { ...c };
|
|
241
|
+
const l = P(c);
|
|
242
|
+
l && (c.bigint === void 0 && (c.bigint = !1), "circularValue" in c || (c.circularValue = Error));
|
|
243
|
+
const u = h(c), _ = b(c, "bigint"), F = b(c, "deterministic"), M = O(c, "maximumDepth"), k = O(c, "maximumBreadth");
|
|
244
|
+
function nt(A, s, g, w, y, j) {
|
|
245
|
+
let x = s[A];
|
|
246
|
+
switch (typeof x == "object" && x !== null && typeof x.toJSON == "function" && (x = x.toJSON(A)), x = w.call(s, A, x), typeof x) {
|
|
247
247
|
case "string":
|
|
248
|
-
return a(
|
|
248
|
+
return a(x);
|
|
249
249
|
case "object": {
|
|
250
|
-
if (
|
|
250
|
+
if (x === null)
|
|
251
251
|
return "null";
|
|
252
|
-
if (
|
|
253
|
-
return
|
|
254
|
-
let
|
|
255
|
-
const
|
|
256
|
-
if (Array.isArray(
|
|
257
|
-
if (
|
|
252
|
+
if (g.indexOf(x) !== -1)
|
|
253
|
+
return u;
|
|
254
|
+
let S = "", $ = ",";
|
|
255
|
+
const D = j;
|
|
256
|
+
if (Array.isArray(x)) {
|
|
257
|
+
if (x.length === 0)
|
|
258
258
|
return "[]";
|
|
259
|
-
if (
|
|
259
|
+
if (M < g.length + 1)
|
|
260
260
|
return '"[Array]"';
|
|
261
|
-
|
|
262
|
-
${
|
|
263
|
-
${
|
|
264
|
-
const
|
|
265
|
-
let
|
|
266
|
-
for (;
|
|
267
|
-
const ot = nt(String(
|
|
268
|
-
|
|
261
|
+
g.push(x), y !== "" && (j += y, S += `
|
|
262
|
+
${j}`, $ = `,
|
|
263
|
+
${j}`);
|
|
264
|
+
const R = Math.min(x.length, k);
|
|
265
|
+
let U = 0;
|
|
266
|
+
for (; U < R - 1; U++) {
|
|
267
|
+
const ot = nt(String(U), x, g, w, y, j);
|
|
268
|
+
S += ot !== void 0 ? ot : "null", S += $;
|
|
269
269
|
}
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
272
|
-
const ot =
|
|
273
|
-
|
|
270
|
+
const J = nt(String(U), x, g, w, y, j);
|
|
271
|
+
if (S += J !== void 0 ? J : "null", x.length - 1 > k) {
|
|
272
|
+
const ot = x.length - k - 1;
|
|
273
|
+
S += `${$}"... ${v(ot)} not stringified"`;
|
|
274
274
|
}
|
|
275
|
-
return
|
|
276
|
-
${
|
|
275
|
+
return y !== "" && (S += `
|
|
276
|
+
${D}`), g.pop(), `[${S}]`;
|
|
277
277
|
}
|
|
278
|
-
let N = Object.keys(
|
|
278
|
+
let N = Object.keys(x);
|
|
279
279
|
const I = N.length;
|
|
280
280
|
if (I === 0)
|
|
281
281
|
return "{}";
|
|
282
|
-
if (
|
|
282
|
+
if (M < g.length + 1)
|
|
283
283
|
return '"[Object]"';
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
${
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
for (let
|
|
290
|
-
const
|
|
291
|
-
|
|
284
|
+
let E = "", z = "";
|
|
285
|
+
y !== "" && (j += y, $ = `,
|
|
286
|
+
${j}`, E = " ");
|
|
287
|
+
const q = Math.min(I, k);
|
|
288
|
+
F && !m(x) && (N = r(N)), g.push(x);
|
|
289
|
+
for (let R = 0; R < q; R++) {
|
|
290
|
+
const U = N[R], J = nt(U, x, g, w, y, j);
|
|
291
|
+
J !== void 0 && (S += `${z}${a(U)}:${E}${J}`, z = $);
|
|
292
292
|
}
|
|
293
|
-
if (I >
|
|
294
|
-
const
|
|
295
|
-
|
|
293
|
+
if (I > k) {
|
|
294
|
+
const R = I - k;
|
|
295
|
+
S += `${z}"...":${E}"${v(R)} not stringified"`, z = $;
|
|
296
296
|
}
|
|
297
|
-
return
|
|
298
|
-
${
|
|
299
|
-
${
|
|
297
|
+
return y !== "" && z.length > 1 && (S = `
|
|
298
|
+
${j}${S}
|
|
299
|
+
${D}`), g.pop(), `{${S}}`;
|
|
300
300
|
}
|
|
301
301
|
case "number":
|
|
302
|
-
return isFinite(
|
|
302
|
+
return isFinite(x) ? String(x) : l ? l(x) : "null";
|
|
303
303
|
case "boolean":
|
|
304
|
-
return
|
|
304
|
+
return x === !0 ? "true" : "false";
|
|
305
305
|
case "undefined":
|
|
306
306
|
return;
|
|
307
307
|
case "bigint":
|
|
308
|
-
if (
|
|
309
|
-
return String(
|
|
308
|
+
if (_)
|
|
309
|
+
return String(x);
|
|
310
310
|
default:
|
|
311
|
-
return
|
|
311
|
+
return l ? l(x) : void 0;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function it(
|
|
315
|
-
switch (typeof s == "object" && s !== null && typeof s.toJSON == "function" && (s = s.toJSON(
|
|
314
|
+
function it(A, s, g, w, y, j) {
|
|
315
|
+
switch (typeof s == "object" && s !== null && typeof s.toJSON == "function" && (s = s.toJSON(A)), typeof s) {
|
|
316
316
|
case "string":
|
|
317
317
|
return a(s);
|
|
318
318
|
case "object": {
|
|
319
319
|
if (s === null)
|
|
320
320
|
return "null";
|
|
321
|
-
if (
|
|
322
|
-
return
|
|
323
|
-
const
|
|
324
|
-
let
|
|
321
|
+
if (g.indexOf(s) !== -1)
|
|
322
|
+
return u;
|
|
323
|
+
const x = j;
|
|
324
|
+
let S = "", $ = ",";
|
|
325
325
|
if (Array.isArray(s)) {
|
|
326
326
|
if (s.length === 0)
|
|
327
327
|
return "[]";
|
|
328
|
-
if (
|
|
328
|
+
if (M < g.length + 1)
|
|
329
329
|
return '"[Array]"';
|
|
330
|
-
|
|
331
|
-
${
|
|
332
|
-
${
|
|
333
|
-
const I = Math.min(s.length,
|
|
334
|
-
let
|
|
335
|
-
for (;
|
|
336
|
-
const
|
|
337
|
-
|
|
330
|
+
g.push(s), y !== "" && (j += y, S += `
|
|
331
|
+
${j}`, $ = `,
|
|
332
|
+
${j}`);
|
|
333
|
+
const I = Math.min(s.length, k);
|
|
334
|
+
let E = 0;
|
|
335
|
+
for (; E < I - 1; E++) {
|
|
336
|
+
const q = it(String(E), s[E], g, w, y, j);
|
|
337
|
+
S += q !== void 0 ? q : "null", S += $;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
342
|
-
|
|
339
|
+
const z = it(String(E), s[E], g, w, y, j);
|
|
340
|
+
if (S += z !== void 0 ? z : "null", s.length - 1 > k) {
|
|
341
|
+
const q = s.length - k - 1;
|
|
342
|
+
S += `${$}"... ${v(q)} not stringified"`;
|
|
343
343
|
}
|
|
344
|
-
return
|
|
345
|
-
${
|
|
344
|
+
return y !== "" && (S += `
|
|
345
|
+
${x}`), g.pop(), `[${S}]`;
|
|
346
346
|
}
|
|
347
|
-
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
${
|
|
347
|
+
g.push(s);
|
|
348
|
+
let D = "";
|
|
349
|
+
y !== "" && (j += y, $ = `,
|
|
350
|
+
${j}`, D = " ");
|
|
351
351
|
let N = "";
|
|
352
|
-
for (const I of
|
|
353
|
-
const
|
|
354
|
-
|
|
352
|
+
for (const I of w) {
|
|
353
|
+
const E = it(I, s[I], g, w, y, j);
|
|
354
|
+
E !== void 0 && (S += `${N}${a(I)}:${D}${E}`, N = $);
|
|
355
355
|
}
|
|
356
|
-
return
|
|
357
|
-
${
|
|
358
|
-
${
|
|
356
|
+
return y !== "" && N.length > 1 && (S = `
|
|
357
|
+
${j}${S}
|
|
358
|
+
${x}`), g.pop(), `{${S}}`;
|
|
359
359
|
}
|
|
360
360
|
case "number":
|
|
361
|
-
return isFinite(s) ? String(s) :
|
|
361
|
+
return isFinite(s) ? String(s) : l ? l(s) : "null";
|
|
362
362
|
case "boolean":
|
|
363
363
|
return s === !0 ? "true" : "false";
|
|
364
364
|
case "undefined":
|
|
365
365
|
return;
|
|
366
366
|
case "bigint":
|
|
367
|
-
if (
|
|
367
|
+
if (_)
|
|
368
368
|
return String(s);
|
|
369
369
|
default:
|
|
370
|
-
return
|
|
370
|
+
return l ? l(s) : void 0;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
function G(
|
|
373
|
+
function G(A, s, g, w, y) {
|
|
374
374
|
switch (typeof s) {
|
|
375
375
|
case "string":
|
|
376
376
|
return a(s);
|
|
@@ -378,74 +378,74 @@ ${g}`), d.pop(), `{${O}}`;
|
|
|
378
378
|
if (s === null)
|
|
379
379
|
return "null";
|
|
380
380
|
if (typeof s.toJSON == "function") {
|
|
381
|
-
if (s = s.toJSON(
|
|
382
|
-
return G(
|
|
381
|
+
if (s = s.toJSON(A), typeof s != "object")
|
|
382
|
+
return G(A, s, g, w, y);
|
|
383
383
|
if (s === null)
|
|
384
384
|
return "null";
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
387
|
-
return
|
|
388
|
-
const
|
|
386
|
+
if (g.indexOf(s) !== -1)
|
|
387
|
+
return u;
|
|
388
|
+
const j = y;
|
|
389
389
|
if (Array.isArray(s)) {
|
|
390
390
|
if (s.length === 0)
|
|
391
391
|
return "[]";
|
|
392
|
-
if (
|
|
392
|
+
if (M < g.length + 1)
|
|
393
393
|
return '"[Array]"';
|
|
394
|
-
|
|
395
|
-
let
|
|
396
|
-
${
|
|
397
|
-
const
|
|
398
|
-
${
|
|
399
|
-
let
|
|
400
|
-
for (;
|
|
401
|
-
const
|
|
402
|
-
|
|
394
|
+
g.push(s), y += w;
|
|
395
|
+
let E = `
|
|
396
|
+
${y}`;
|
|
397
|
+
const z = `,
|
|
398
|
+
${y}`, q = Math.min(s.length, k);
|
|
399
|
+
let R = 0;
|
|
400
|
+
for (; R < q - 1; R++) {
|
|
401
|
+
const J = G(String(R), s[R], g, w, y);
|
|
402
|
+
E += J !== void 0 ? J : "null", E += z;
|
|
403
403
|
}
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
const
|
|
407
|
-
|
|
404
|
+
const U = G(String(R), s[R], g, w, y);
|
|
405
|
+
if (E += U !== void 0 ? U : "null", s.length - 1 > k) {
|
|
406
|
+
const J = s.length - k - 1;
|
|
407
|
+
E += `${z}"... ${v(J)} not stringified"`;
|
|
408
408
|
}
|
|
409
|
-
return
|
|
410
|
-
${
|
|
409
|
+
return E += `
|
|
410
|
+
${j}`, g.pop(), `[${E}]`;
|
|
411
411
|
}
|
|
412
|
-
let
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
412
|
+
let x = Object.keys(s);
|
|
413
|
+
const S = x.length;
|
|
414
|
+
if (S === 0)
|
|
415
415
|
return "{}";
|
|
416
|
-
if (
|
|
416
|
+
if (M < g.length + 1)
|
|
417
417
|
return '"[Object]"';
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
${
|
|
421
|
-
let
|
|
422
|
-
|
|
423
|
-
for (let
|
|
424
|
-
const
|
|
425
|
-
|
|
418
|
+
y += w;
|
|
419
|
+
const $ = `,
|
|
420
|
+
${y}`;
|
|
421
|
+
let D = "", N = "", I = Math.min(S, k);
|
|
422
|
+
m(s) && (D += d(s, $, k), x = x.slice(s.length), I -= s.length, N = $), F && (x = r(x)), g.push(s);
|
|
423
|
+
for (let E = 0; E < I; E++) {
|
|
424
|
+
const z = x[E], q = G(z, s[z], g, w, y);
|
|
425
|
+
q !== void 0 && (D += `${N}${a(z)}: ${q}`, N = $);
|
|
426
426
|
}
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
|
|
427
|
+
if (S > k) {
|
|
428
|
+
const E = S - k;
|
|
429
|
+
D += `${N}"...": "${v(E)} not stringified"`, N = $;
|
|
430
430
|
}
|
|
431
|
-
return N !== "" && (
|
|
432
|
-
${
|
|
433
|
-
${
|
|
431
|
+
return N !== "" && (D = `
|
|
432
|
+
${y}${D}
|
|
433
|
+
${j}`), g.pop(), `{${D}}`;
|
|
434
434
|
}
|
|
435
435
|
case "number":
|
|
436
|
-
return isFinite(s) ? String(s) :
|
|
436
|
+
return isFinite(s) ? String(s) : l ? l(s) : "null";
|
|
437
437
|
case "boolean":
|
|
438
438
|
return s === !0 ? "true" : "false";
|
|
439
439
|
case "undefined":
|
|
440
440
|
return;
|
|
441
441
|
case "bigint":
|
|
442
|
-
if (
|
|
442
|
+
if (_)
|
|
443
443
|
return String(s);
|
|
444
444
|
default:
|
|
445
|
-
return
|
|
445
|
+
return l ? l(s) : void 0;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
function Z(
|
|
448
|
+
function Z(A, s, g) {
|
|
449
449
|
switch (typeof s) {
|
|
450
450
|
case "string":
|
|
451
451
|
return a(s);
|
|
@@ -453,85 +453,85 @@ ${S}`), d.pop(), `{${_}}`;
|
|
|
453
453
|
if (s === null)
|
|
454
454
|
return "null";
|
|
455
455
|
if (typeof s.toJSON == "function") {
|
|
456
|
-
if (s = s.toJSON(
|
|
457
|
-
return Z(
|
|
456
|
+
if (s = s.toJSON(A), typeof s != "object")
|
|
457
|
+
return Z(A, s, g);
|
|
458
458
|
if (s === null)
|
|
459
459
|
return "null";
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
462
|
-
return
|
|
463
|
-
let
|
|
461
|
+
if (g.indexOf(s) !== -1)
|
|
462
|
+
return u;
|
|
463
|
+
let w = "";
|
|
464
464
|
if (Array.isArray(s)) {
|
|
465
465
|
if (s.length === 0)
|
|
466
466
|
return "[]";
|
|
467
|
-
if (
|
|
467
|
+
if (M < g.length + 1)
|
|
468
468
|
return '"[Array]"';
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
let
|
|
472
|
-
for (;
|
|
473
|
-
const I = Z(String(
|
|
474
|
-
|
|
469
|
+
g.push(s);
|
|
470
|
+
const $ = Math.min(s.length, k);
|
|
471
|
+
let D = 0;
|
|
472
|
+
for (; D < $ - 1; D++) {
|
|
473
|
+
const I = Z(String(D), s[D], g);
|
|
474
|
+
w += I !== void 0 ? I : "null", w += ",";
|
|
475
475
|
}
|
|
476
|
-
const N = Z(String(
|
|
477
|
-
if (
|
|
478
|
-
const I = s.length -
|
|
479
|
-
|
|
476
|
+
const N = Z(String(D), s[D], g);
|
|
477
|
+
if (w += N !== void 0 ? N : "null", s.length - 1 > k) {
|
|
478
|
+
const I = s.length - k - 1;
|
|
479
|
+
w += `,"... ${v(I)} not stringified"`;
|
|
480
480
|
}
|
|
481
|
-
return
|
|
481
|
+
return g.pop(), `[${w}]`;
|
|
482
482
|
}
|
|
483
|
-
let
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
483
|
+
let y = Object.keys(s);
|
|
484
|
+
const j = y.length;
|
|
485
|
+
if (j === 0)
|
|
486
486
|
return "{}";
|
|
487
|
-
if (
|
|
487
|
+
if (M < g.length + 1)
|
|
488
488
|
return '"[Object]"';
|
|
489
|
-
let
|
|
490
|
-
|
|
491
|
-
for (let
|
|
492
|
-
const
|
|
493
|
-
N !== void 0 && (
|
|
489
|
+
let x = "", S = Math.min(j, k);
|
|
490
|
+
m(s) && (w += d(s, ",", k), y = y.slice(s.length), S -= s.length, x = ","), F && (y = r(y)), g.push(s);
|
|
491
|
+
for (let $ = 0; $ < S; $++) {
|
|
492
|
+
const D = y[$], N = Z(D, s[D], g);
|
|
493
|
+
N !== void 0 && (w += `${x}${a(D)}:${N}`, x = ",");
|
|
494
494
|
}
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
497
|
-
|
|
495
|
+
if (j > k) {
|
|
496
|
+
const $ = j - k;
|
|
497
|
+
w += `${x}"...":"${v($)} not stringified"`;
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return g.pop(), `{${w}}`;
|
|
500
500
|
}
|
|
501
501
|
case "number":
|
|
502
|
-
return isFinite(s) ? String(s) :
|
|
502
|
+
return isFinite(s) ? String(s) : l ? l(s) : "null";
|
|
503
503
|
case "boolean":
|
|
504
504
|
return s === !0 ? "true" : "false";
|
|
505
505
|
case "undefined":
|
|
506
506
|
return;
|
|
507
507
|
case "bigint":
|
|
508
|
-
if (
|
|
508
|
+
if (_)
|
|
509
509
|
return String(s);
|
|
510
510
|
default:
|
|
511
|
-
return
|
|
511
|
+
return l ? l(s) : void 0;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function ae(A, s, g) {
|
|
515
515
|
if (arguments.length > 1) {
|
|
516
|
-
let
|
|
517
|
-
if (typeof
|
|
516
|
+
let w = "";
|
|
517
|
+
if (typeof g == "number" ? w = " ".repeat(Math.min(g, 10)) : typeof g == "string" && (w = g.slice(0, 10)), s != null) {
|
|
518
518
|
if (typeof s == "function")
|
|
519
|
-
return nt("", { "":
|
|
519
|
+
return nt("", { "": A }, [], s, w, "");
|
|
520
520
|
if (Array.isArray(s))
|
|
521
|
-
return it("",
|
|
521
|
+
return it("", A, [], T(s), w, "");
|
|
522
522
|
}
|
|
523
|
-
if (
|
|
524
|
-
return G("",
|
|
523
|
+
if (w.length !== 0)
|
|
524
|
+
return G("", A, [], w, "");
|
|
525
525
|
}
|
|
526
|
-
return Z("",
|
|
526
|
+
return Z("", A, []);
|
|
527
527
|
}
|
|
528
|
-
return
|
|
528
|
+
return ae;
|
|
529
529
|
}
|
|
530
530
|
})(ft, ft.exports);
|
|
531
|
-
var
|
|
532
|
-
const K = /* @__PURE__ */
|
|
531
|
+
var Oe = ft.exports;
|
|
532
|
+
const K = /* @__PURE__ */ we(Oe);
|
|
533
533
|
K.configure;
|
|
534
|
-
function
|
|
534
|
+
function Se(t, e) {
|
|
535
535
|
return { ...t, name: e };
|
|
536
536
|
}
|
|
537
537
|
function je(t, e, n) {
|
|
@@ -553,30 +553,30 @@ function je(t, e, n) {
|
|
|
553
553
|
throw new Error(
|
|
554
554
|
"Cannot undo: skip value from reducer cannot be used with UNDO action"
|
|
555
555
|
);
|
|
556
|
-
const p = r.document.operations[i].at(-1),
|
|
557
|
-
if (r.skip += o,
|
|
556
|
+
const p = r.document.operations[i].at(-1), m = p && p.type === "NOOP" && p.skip > 0;
|
|
557
|
+
if (r.skip += o, m) {
|
|
558
558
|
r.skip += p.skip;
|
|
559
|
-
const
|
|
560
|
-
|
|
559
|
+
const O = r.document.operations[i][r.document.operations[i].length - 2];
|
|
560
|
+
O && p.index - O.index === 1 && r.document.operations[i].pop();
|
|
561
561
|
}
|
|
562
562
|
if (r.document.operations[i].length < r.skip)
|
|
563
563
|
throw new Error(
|
|
564
564
|
"Cannot undo: you can't undo more operations than the ones in the scope history"
|
|
565
565
|
);
|
|
566
|
-
const
|
|
567
|
-
let
|
|
568
|
-
for (;
|
|
569
|
-
const
|
|
570
|
-
if (!
|
|
571
|
-
|
|
566
|
+
const d = r.document.operations[i].length - 1;
|
|
567
|
+
let h = o, b = m ? d - p.skip : d;
|
|
568
|
+
for (; h > 0 && b >= 0; ) {
|
|
569
|
+
const O = r.document.operations[i][b];
|
|
570
|
+
if (!O) {
|
|
571
|
+
h--, b--;
|
|
572
572
|
continue;
|
|
573
573
|
}
|
|
574
|
-
|
|
574
|
+
O.type === "NOOP" && O.skip > 0 ? (b = b - (O.skip + 1), r.skip += O.skip + 1) : (r.document.clipboard.push({ ...O }), h--, b--);
|
|
575
575
|
}
|
|
576
|
-
r.action =
|
|
576
|
+
r.action = re(i);
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function Ee(t, e, n) {
|
|
580
580
|
const { scope: i, input: o } = e;
|
|
581
581
|
return pt({
|
|
582
582
|
document: t,
|
|
@@ -596,93 +596,93 @@ function Se(t, e, n) {
|
|
|
596
596
|
if (r.document.clipboard.length < 1)
|
|
597
597
|
throw new Error("Cannot redo: no operations in the clipboard");
|
|
598
598
|
const p = r.document.clipboard.findLastIndex(
|
|
599
|
-
(
|
|
599
|
+
(d) => d.scope === i
|
|
600
600
|
);
|
|
601
601
|
if (p < 0)
|
|
602
602
|
throw new Error(
|
|
603
603
|
`Cannot redo: no operations in clipboard for scope "${i}"`
|
|
604
604
|
);
|
|
605
|
-
const
|
|
605
|
+
const m = r.document.clipboard.splice(p, 1)[0];
|
|
606
606
|
r.action = at({
|
|
607
|
-
type:
|
|
608
|
-
scope:
|
|
609
|
-
input:
|
|
607
|
+
type: m.type,
|
|
608
|
+
scope: m.scope,
|
|
609
|
+
input: m.input
|
|
610
610
|
});
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function $e(t, e, n) {
|
|
614
614
|
const { scope: i } = e, o = t.operations[i];
|
|
615
615
|
let {
|
|
616
616
|
input: { start: a, end: r }
|
|
617
617
|
} = e;
|
|
618
618
|
a = a || 0, r = r || o.length;
|
|
619
|
-
const p = o.slice(a, r),
|
|
619
|
+
const p = o.slice(a, r), m = o.slice(0, a), d = o.slice(r), h = gt(
|
|
620
620
|
t.initialState,
|
|
621
621
|
{
|
|
622
622
|
...t.operations,
|
|
623
|
-
[i]:
|
|
623
|
+
[i]: m.concat(p)
|
|
624
624
|
},
|
|
625
625
|
n
|
|
626
|
-
), { name:
|
|
626
|
+
), { name: b, state: O } = h, v = m.length, T = m.length ? m[m.length - 1].timestamp : d.length ? d[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
|
|
627
627
|
return gt(
|
|
628
628
|
t.initialState,
|
|
629
629
|
{
|
|
630
630
|
...t.operations,
|
|
631
631
|
[i]: [
|
|
632
|
-
...
|
|
632
|
+
...m,
|
|
633
633
|
{
|
|
634
634
|
...Et(
|
|
635
|
-
{ name:
|
|
635
|
+
{ name: b, state: O },
|
|
636
636
|
p.length
|
|
637
637
|
),
|
|
638
638
|
timestamp: T,
|
|
639
|
-
index:
|
|
640
|
-
hash:
|
|
639
|
+
index: v,
|
|
640
|
+
hash: jt({ state: O }, "global")
|
|
641
641
|
},
|
|
642
|
-
...
|
|
643
|
-
...
|
|
644
|
-
index:
|
|
642
|
+
...d.map((P, C) => ({
|
|
643
|
+
...P,
|
|
644
|
+
index: v + C + 1
|
|
645
645
|
}))
|
|
646
646
|
]
|
|
647
647
|
},
|
|
648
648
|
n
|
|
649
649
|
);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function ke(t, e) {
|
|
652
652
|
return {
|
|
653
653
|
...t,
|
|
654
654
|
name: e.name,
|
|
655
655
|
state: e.state ?? { global: {}, local: {} }
|
|
656
656
|
};
|
|
657
657
|
}
|
|
658
|
-
const qt = "SET_NAME", tt = "UNDO", et = "REDO", ct = "PRUNE", Ut = "LOAD_STATE", ke = "NOOP", Jt = { "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"] };
|
|
658
|
+
const qt = "SET_NAME", tt = "UNDO", et = "REDO", ct = "PRUNE", Ut = "LOAD_STATE", De = "NOOP", Jt = { "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"] };
|
|
659
659
|
Object.freeze(Jt);
|
|
660
|
-
var
|
|
660
|
+
var L = function(t, e, n, i) {
|
|
661
661
|
if (n === "a" && !i)
|
|
662
662
|
throw new TypeError("Private accessor was defined without a getter");
|
|
663
663
|
if (typeof e == "function" ? t !== e || !i : !e.has(t))
|
|
664
664
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
665
665
|
return n === "m" ? i : n === "a" ? i.call(t) : i ? i.value : e.get(t);
|
|
666
|
-
}, B, Q,
|
|
667
|
-
class
|
|
666
|
+
}, B, Q, H;
|
|
667
|
+
class Te {
|
|
668
668
|
constructor(...e) {
|
|
669
|
-
B.set(this, /* @__PURE__ */ new Map()), Q.set(this, /* @__PURE__ */ new Map()),
|
|
669
|
+
B.set(this, /* @__PURE__ */ new Map()), Q.set(this, /* @__PURE__ */ new Map()), H.set(this, /* @__PURE__ */ new Map());
|
|
670
670
|
for (const n of e)
|
|
671
671
|
this.define(n);
|
|
672
672
|
}
|
|
673
673
|
define(e, n = !1) {
|
|
674
674
|
for (let [i, o] of Object.entries(e)) {
|
|
675
|
-
i = i.toLowerCase(), o = o.map((p) => p.toLowerCase()),
|
|
676
|
-
const a =
|
|
675
|
+
i = i.toLowerCase(), o = o.map((p) => p.toLowerCase()), L(this, H, "f").has(i) || L(this, H, "f").set(i, /* @__PURE__ */ new Set());
|
|
676
|
+
const a = L(this, H, "f").get(i);
|
|
677
677
|
let r = !0;
|
|
678
678
|
for (let p of o) {
|
|
679
|
-
const
|
|
680
|
-
if (p =
|
|
679
|
+
const m = p.startsWith("*");
|
|
680
|
+
if (p = m ? p.slice(1) : p, a == null || a.add(p), r && L(this, Q, "f").set(i, p), r = !1, m)
|
|
681
681
|
continue;
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
684
|
-
throw new Error(`"${i} -> ${p}" conflicts with "${
|
|
685
|
-
|
|
682
|
+
const d = L(this, B, "f").get(p);
|
|
683
|
+
if (d && d != i && !n)
|
|
684
|
+
throw new Error(`"${i} -> ${p}" conflicts with "${d} -> ${p}". Pass \`force=true\` to override this definition.`);
|
|
685
|
+
L(this, B, "f").set(p, i);
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
return this;
|
|
@@ -691,34 +691,34 @@ class De {
|
|
|
691
691
|
if (typeof e != "string")
|
|
692
692
|
return null;
|
|
693
693
|
const n = e.replace(/^.*[/\\]/, "").toLowerCase(), i = n.replace(/^.*\./, "").toLowerCase(), o = n.length < e.length;
|
|
694
|
-
return !(i.length < n.length - 1) && o ? null :
|
|
694
|
+
return !(i.length < n.length - 1) && o ? null : L(this, B, "f").get(i) ?? null;
|
|
695
695
|
}
|
|
696
696
|
getExtension(e) {
|
|
697
697
|
var n;
|
|
698
|
-
return typeof e != "string" ? null : (e = (n = e == null ? void 0 : e.split) == null ? void 0 : n.call(e, ";")[0], (e &&
|
|
698
|
+
return typeof e != "string" ? null : (e = (n = e == null ? void 0 : e.split) == null ? void 0 : n.call(e, ";")[0], (e && L(this, Q, "f").get(e.trim().toLowerCase())) ?? null);
|
|
699
699
|
}
|
|
700
700
|
getAllExtensions(e) {
|
|
701
|
-
return typeof e != "string" ? null :
|
|
701
|
+
return typeof e != "string" ? null : L(this, H, "f").get(e.toLowerCase()) ?? null;
|
|
702
702
|
}
|
|
703
703
|
_freeze() {
|
|
704
704
|
this.define = () => {
|
|
705
705
|
throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
|
|
706
706
|
}, Object.freeze(this);
|
|
707
|
-
for (const e of
|
|
707
|
+
for (const e of L(this, H, "f").values())
|
|
708
708
|
Object.freeze(e);
|
|
709
709
|
return this;
|
|
710
710
|
}
|
|
711
711
|
_getTestState() {
|
|
712
712
|
return {
|
|
713
|
-
types:
|
|
714
|
-
extensions:
|
|
713
|
+
types: L(this, B, "f"),
|
|
714
|
+
extensions: L(this, Q, "f")
|
|
715
715
|
};
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
B = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(),
|
|
719
|
-
const _e = new
|
|
720
|
-
function
|
|
721
|
-
const i =
|
|
718
|
+
B = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap();
|
|
719
|
+
const _e = new Te(Jt)._freeze();
|
|
720
|
+
function Ne(t, e, n) {
|
|
721
|
+
const i = de(t, e);
|
|
722
722
|
return ut.mkdirSync(t, { recursive: !0 }), new Promise((o, a) => {
|
|
723
723
|
try {
|
|
724
724
|
ut.writeFile(i, n, {}, (r) => {
|
|
@@ -732,9 +732,9 @@ function Te(t, e, n) {
|
|
|
732
732
|
function Vt(t) {
|
|
733
733
|
return ut.readFileSync(t);
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function ve(t) {
|
|
736
736
|
return new Promise((e, n) => {
|
|
737
|
-
|
|
737
|
+
fe.get(t, (i) => {
|
|
738
738
|
const o = [], a = i.headers["content-type"];
|
|
739
739
|
i.on("data", (r) => {
|
|
740
740
|
o.push(r);
|
|
@@ -746,8 +746,8 @@ function Ne(t) {
|
|
|
746
746
|
});
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
function
|
|
749
|
+
const Ie = async (t) => Vt(t), lt = (t, e = "sha1") => ue.createHash(e).update(t).digest("base64");
|
|
750
|
+
function Ae(t) {
|
|
751
751
|
const e = [], n = Object.keys(t);
|
|
752
752
|
for (const i of n) {
|
|
753
753
|
const o = t[i].sort((a, r) => a.index - r.index);
|
|
@@ -774,72 +774,72 @@ const Xt = async (t) => {
|
|
|
774
774
|
return e.file("header.json", JSON.stringify(p, null, 2)), e.file(
|
|
775
775
|
"state.json",
|
|
776
776
|
JSON.stringify(t.initialState || {}, null, 2)
|
|
777
|
-
), e.file("operations.json", JSON.stringify(t.operations, null, 2)), Object.keys(t.attachments).forEach((
|
|
778
|
-
const { data:
|
|
779
|
-
e.file(
|
|
777
|
+
), e.file("operations.json", JSON.stringify(t.operations, null, 2)), Object.keys(t.attachments).forEach((d) => {
|
|
778
|
+
const { data: h, ...b } = t.attachments[d];
|
|
779
|
+
e.file(d, h, {
|
|
780
780
|
base64: !0,
|
|
781
781
|
createFolders: !0,
|
|
782
|
-
comment: JSON.stringify(
|
|
782
|
+
comment: JSON.stringify(b)
|
|
783
783
|
});
|
|
784
784
|
}), e;
|
|
785
|
-
},
|
|
785
|
+
}, Pe = async (t, e, n, i) => {
|
|
786
786
|
const a = await (await Xt(t)).generateAsync({
|
|
787
787
|
type: "uint8array",
|
|
788
788
|
streamFiles: !0
|
|
789
789
|
}), r = i ?? t.name, p = `.${n}.zip`;
|
|
790
|
-
return
|
|
790
|
+
return Ne(
|
|
791
791
|
e,
|
|
792
792
|
r.endsWith(p) ? r : `${r}${p}`,
|
|
793
793
|
a
|
|
794
794
|
);
|
|
795
|
-
},
|
|
795
|
+
}, mn = async (t, e) => {
|
|
796
796
|
const i = await (await Xt(t)).generateAsync({ type: "blob" }), o = await e.createWritable();
|
|
797
797
|
await o.write(i), await o.close();
|
|
798
798
|
}, $t = async (t, e, n) => {
|
|
799
799
|
const i = Vt(t);
|
|
800
|
-
return
|
|
801
|
-
},
|
|
800
|
+
return Me(i, e, n);
|
|
801
|
+
}, Me = async (t, e, n) => {
|
|
802
802
|
const i = new Dt();
|
|
803
|
-
return await i.loadAsync(t),
|
|
803
|
+
return await i.loadAsync(t), ze(i, e, n);
|
|
804
804
|
};
|
|
805
|
-
async function
|
|
805
|
+
async function ze(t, e, n) {
|
|
806
806
|
const i = t.file("state.json");
|
|
807
807
|
if (!i)
|
|
808
808
|
throw new Error("Initial state not found");
|
|
809
809
|
const o = await i.async("string"), a = JSON.parse(o), r = t.file("header.json");
|
|
810
810
|
let p;
|
|
811
811
|
r && (p = JSON.parse(await r.async("string")));
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
812
|
+
const m = t.file("operations.json");
|
|
813
|
+
if (!m)
|
|
814
814
|
throw new Error("Operations history not found");
|
|
815
|
-
const
|
|
816
|
-
await
|
|
817
|
-
),
|
|
818
|
-
if (
|
|
819
|
-
const
|
|
820
|
-
throw new Error(
|
|
815
|
+
const d = JSON.parse(
|
|
816
|
+
await m.async("string")
|
|
817
|
+
), h = Ae(d);
|
|
818
|
+
if (h.length) {
|
|
819
|
+
const O = h.map((v) => v.message);
|
|
820
|
+
throw new Error(O.join(`
|
|
821
821
|
`));
|
|
822
822
|
}
|
|
823
|
-
let
|
|
823
|
+
let b = te(
|
|
824
824
|
a,
|
|
825
|
-
|
|
825
|
+
d,
|
|
826
826
|
e,
|
|
827
827
|
void 0,
|
|
828
828
|
p,
|
|
829
829
|
{},
|
|
830
830
|
n
|
|
831
831
|
);
|
|
832
|
-
return p && (
|
|
833
|
-
...
|
|
832
|
+
return p && (b = {
|
|
833
|
+
...b,
|
|
834
834
|
...p
|
|
835
|
-
}),
|
|
835
|
+
}), b;
|
|
836
836
|
}
|
|
837
837
|
function Ht(t) {
|
|
838
838
|
const e = t.replace(/^.*\./, "") || void 0, n = t.replace(/^.*[/\\]/, "") || void 0;
|
|
839
839
|
return { extension: e, fileName: n };
|
|
840
840
|
}
|
|
841
|
-
async function
|
|
842
|
-
const { buffer: e, mimeType: n = "application/octet-stream" } = await
|
|
841
|
+
async function un(t) {
|
|
842
|
+
const { buffer: e, mimeType: n = "application/octet-stream" } = await ve(t), i = Ht(t), o = e.toString("base64");
|
|
843
843
|
return {
|
|
844
844
|
data: o,
|
|
845
845
|
hash: lt(o),
|
|
@@ -847,8 +847,8 @@ async function mn(t) {
|
|
|
847
847
|
...i
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
async function
|
|
851
|
-
const e = await
|
|
850
|
+
async function fn(t) {
|
|
851
|
+
const e = await Ie(t), n = _e.getType(t) || "application/octet-stream", i = Ht(t), o = e.toString("base64");
|
|
852
852
|
return { data: o, hash: lt(o), mimeType: n, ...i };
|
|
853
853
|
}
|
|
854
854
|
var Bt = /* @__PURE__ */ ((t) => (t.UNEXPECTED_INDEX = "UNEXPECTED_INDEX", t))(Bt || {}), Kt = /* @__PURE__ */ ((t) => (t.DUPLICATED_INDEX = "DUPLICATED_INDEX", t.MISSING_INDEX = "MISSING_INDEX", t))(Kt || {});
|
|
@@ -869,7 +869,7 @@ function Ot(t) {
|
|
|
869
869
|
}
|
|
870
870
|
return e;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function V(t) {
|
|
873
873
|
var i, o, a;
|
|
874
874
|
const e = [];
|
|
875
875
|
let n = t.length - 1;
|
|
@@ -883,7 +883,7 @@ function J(t) {
|
|
|
883
883
|
}
|
|
884
884
|
return e;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Re(t) {
|
|
887
887
|
const e = [...t], n = e[e.length - 1];
|
|
888
888
|
return n && (n.type === "NOOP" ? e.push({
|
|
889
889
|
...n,
|
|
@@ -900,7 +900,7 @@ function ze(t) {
|
|
|
900
900
|
hash: n.hash
|
|
901
901
|
})), e;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function X(t) {
|
|
904
904
|
return t.slice().sort((e, n) => e.skip - n.skip).sort((e, n) => e.index - n.index);
|
|
905
905
|
}
|
|
906
906
|
const Ce = (t, e, n) => [...e, ...n].sort(
|
|
@@ -916,11 +916,11 @@ const Ce = (t, e, n) => [...e, ...n].sort(
|
|
|
916
916
|
index: t.index + o,
|
|
917
917
|
skip: o === 0 ? t.skip : 0
|
|
918
918
|
}));
|
|
919
|
-
function
|
|
919
|
+
function St(t, e) {
|
|
920
920
|
return K(t) === K(e);
|
|
921
921
|
}
|
|
922
922
|
function Le(t, e) {
|
|
923
|
-
const n =
|
|
923
|
+
const n = V(X(t.slice())), i = V(X(e.slice()));
|
|
924
924
|
if (n.length < 1)
|
|
925
925
|
return [i, []];
|
|
926
926
|
const o = [];
|
|
@@ -930,10 +930,10 @@ function Le(t, e) {
|
|
|
930
930
|
let p = n.shift();
|
|
931
931
|
for (; p && Wt(p, r); )
|
|
932
932
|
o.push(p), p = n.shift();
|
|
933
|
-
if (p ? a || (
|
|
934
|
-
let
|
|
935
|
-
for (;
|
|
936
|
-
o.push(
|
|
933
|
+
if (p ? a || (St(p, r) ? (i.shift(), o.push(p)) : (n.unshift(p), a = !0)) : a = !0, a) {
|
|
934
|
+
let m = i.shift();
|
|
935
|
+
for (; m; )
|
|
936
|
+
o.push(m), m = i.shift();
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
if (!a) {
|
|
@@ -941,7 +941,7 @@ function Le(t, e) {
|
|
|
941
941
|
for (; r; )
|
|
942
942
|
o.push(r), r = n.shift();
|
|
943
943
|
}
|
|
944
|
-
return [
|
|
944
|
+
return [V(o), n];
|
|
945
945
|
}
|
|
946
946
|
function Wt(t, e) {
|
|
947
947
|
return t.index < e.index || t.index === e.index && t.skip < e.skip;
|
|
@@ -953,20 +953,20 @@ function Gt(t, e) {
|
|
|
953
953
|
);
|
|
954
954
|
let r = !1;
|
|
955
955
|
for (let p = 0; p < a; p++) {
|
|
956
|
-
const
|
|
957
|
-
|
|
956
|
+
const m = t[p], d = e[p];
|
|
957
|
+
m && d ? !r && St(m, d) ? n.push(m) : (r = !0, i.push(m), o.push(d)) : m ? i.push(m) : d && o.push(d);
|
|
958
958
|
}
|
|
959
959
|
return [n, i, o];
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function qe(t, e, n) {
|
|
962
962
|
const [i, o, a] = Gt(
|
|
963
|
-
|
|
964
|
-
|
|
963
|
+
V(t),
|
|
964
|
+
V(e)
|
|
965
965
|
), r = mt(i), p = 1 + Math.max(
|
|
966
966
|
r,
|
|
967
967
|
mt(o),
|
|
968
968
|
mt(a)
|
|
969
|
-
),
|
|
969
|
+
), m = n(
|
|
970
970
|
{
|
|
971
971
|
index: p,
|
|
972
972
|
skip: p - (r + 1)
|
|
@@ -974,7 +974,7 @@ function Re(t, e, n) {
|
|
|
974
974
|
o,
|
|
975
975
|
a
|
|
976
976
|
);
|
|
977
|
-
return i.concat(
|
|
977
|
+
return i.concat(m);
|
|
978
978
|
}
|
|
979
979
|
function mt(t) {
|
|
980
980
|
const e = t[t.length - 1];
|
|
@@ -984,47 +984,47 @@ function Zt(t) {
|
|
|
984
984
|
var i, o, a;
|
|
985
985
|
if (t.length < 1)
|
|
986
986
|
return -1;
|
|
987
|
-
const e =
|
|
987
|
+
const e = V(t);
|
|
988
988
|
let n = (((i = e[e.length - 1]) == null ? void 0 : i.skip) || 0) + 1;
|
|
989
989
|
return e.length > 1 && (n += ((o = e[e.length - 2]) == null ? void 0 : o.skip) || 0), (((a = e[e.length - 1]) == null ? void 0 : a.index) || -1) < n ? -1 : n;
|
|
990
990
|
}
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
),
|
|
991
|
+
const Ue = (t) => Ot(
|
|
992
|
+
V(X(t))
|
|
993
|
+
), Je = (t) => t.reduce((n, i) => {
|
|
994
994
|
var o;
|
|
995
995
|
return n[i.scope] || (n[i.scope] = []), (o = n[i.scope]) == null || o.push(i), n;
|
|
996
|
-
}, {}),
|
|
997
|
-
var
|
|
996
|
+
}, {}), Ve = (t, e) => {
|
|
997
|
+
var m;
|
|
998
998
|
const n = {
|
|
999
999
|
integrityIssues: [],
|
|
1000
1000
|
validOperations: [],
|
|
1001
1001
|
invalidOperations: [],
|
|
1002
1002
|
duplicatedOperations: []
|
|
1003
|
-
}, i =
|
|
1003
|
+
}, i = X(t), o = X(e), a = Ot([
|
|
1004
1004
|
...i,
|
|
1005
1005
|
...o
|
|
1006
|
-
]), p = (
|
|
1007
|
-
(
|
|
1006
|
+
]), p = (m = [...a.filter(
|
|
1007
|
+
(d) => d.category === "MISSING_INDEX"
|
|
1008
1008
|
/* MISSING_INDEX */
|
|
1009
|
-
)].sort((
|
|
1010
|
-
for (const
|
|
1011
|
-
if (p &&
|
|
1012
|
-
n.invalidOperations.push(
|
|
1009
|
+
)].sort((d, h) => h.operation.index - d.operation.index).pop()) == null ? void 0 : m.operation;
|
|
1010
|
+
for (const d of o) {
|
|
1011
|
+
if (p && d.index >= p.index) {
|
|
1012
|
+
n.invalidOperations.push(d);
|
|
1013
1013
|
continue;
|
|
1014
1014
|
}
|
|
1015
|
-
if (a.some((
|
|
1016
|
-
n.duplicatedOperations.push(
|
|
1015
|
+
if (a.some((b) => b.operation.index === d.index && b.operation.skip === d.skip && b.category === "DUPLICATED_INDEX")) {
|
|
1016
|
+
n.duplicatedOperations.push(d);
|
|
1017
1017
|
continue;
|
|
1018
1018
|
}
|
|
1019
|
-
n.validOperations.push(
|
|
1019
|
+
n.validOperations.push(d);
|
|
1020
1020
|
}
|
|
1021
1021
|
return n.integrityIssues.push(...a), n;
|
|
1022
1022
|
};
|
|
1023
|
-
function
|
|
1023
|
+
function Xe(t, e) {
|
|
1024
1024
|
return t.filter((n) => !e.some((i) => n.type === "NOOP" && n.skip === 0 && n.index === i.index || n.index === i.index && n.skip === i.skip && n.scope === i.scope && n.hash === i.hash && n.type === i.type));
|
|
1025
1025
|
}
|
|
1026
1026
|
function Qt(t, e) {
|
|
1027
|
-
const [n] =
|
|
1027
|
+
const [n] = X(t).slice(-1), i = (n == null ? void 0 : n.index) ?? -1, o = i + 1, a = {
|
|
1028
1028
|
...e,
|
|
1029
1029
|
index: e.index ?? o
|
|
1030
1030
|
};
|
|
@@ -1032,8 +1032,8 @@ function Qt(t, e) {
|
|
|
1032
1032
|
throw new Error(
|
|
1033
1033
|
`The skip header operation index must be greater than or equal to ${i}`
|
|
1034
1034
|
);
|
|
1035
|
-
return (
|
|
1036
|
-
|
|
1035
|
+
return (V(
|
|
1036
|
+
X([...t, a])
|
|
1037
1037
|
) || []).slice(0, -1);
|
|
1038
1038
|
}
|
|
1039
1039
|
function dt(t) {
|
|
@@ -1043,57 +1043,54 @@ function dt(t) {
|
|
|
1043
1043
|
const [o, a] = i;
|
|
1044
1044
|
return {
|
|
1045
1045
|
...n,
|
|
1046
|
-
[o]:
|
|
1046
|
+
[o]: V(X(a))
|
|
1047
1047
|
};
|
|
1048
1048
|
},
|
|
1049
1049
|
{}
|
|
1050
1050
|
)
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
const
|
|
1053
|
+
const dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1054
1054
|
__proto__: null,
|
|
1055
1055
|
IntegrityIssueSubType: Kt,
|
|
1056
1056
|
IntegrityIssueType: Bt,
|
|
1057
|
-
addUndo:
|
|
1057
|
+
addUndo: Re,
|
|
1058
1058
|
attachBranch: Le,
|
|
1059
1059
|
checkCleanedOperationsIntegrity: Ot,
|
|
1060
|
-
checkOperationsIntegrity:
|
|
1061
|
-
garbageCollect:
|
|
1062
|
-
|
|
1063
|
-
groupOperationsByScope:
|
|
1064
|
-
merge:
|
|
1060
|
+
checkOperationsIntegrity: Ue,
|
|
1061
|
+
garbageCollect: V,
|
|
1062
|
+
garbageCollectDocumentOperations: dt,
|
|
1063
|
+
groupOperationsByScope: Je,
|
|
1064
|
+
merge: qe,
|
|
1065
1065
|
nextSkipNumber: Zt,
|
|
1066
|
-
operationsAreEqual:
|
|
1066
|
+
operationsAreEqual: St,
|
|
1067
1067
|
precedes: Wt,
|
|
1068
|
-
prepareOperations:
|
|
1069
|
-
removeExistingOperations:
|
|
1068
|
+
prepareOperations: Ve,
|
|
1069
|
+
removeExistingOperations: Xe,
|
|
1070
1070
|
reshuffleByTimestamp: Ce,
|
|
1071
1071
|
reshuffleByTimestampAndIndex: Fe,
|
|
1072
1072
|
skipHeaderOperations: Qt,
|
|
1073
|
-
sortOperations:
|
|
1073
|
+
sortOperations: X,
|
|
1074
1074
|
split: Gt
|
|
1075
1075
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1076
|
-
function
|
|
1076
|
+
function He(t, e) {
|
|
1077
1077
|
let n;
|
|
1078
1078
|
return "index" in e ? n = { ...e } : n = t.operations[e.scope].at(-1), ((n == null ? void 0 : n.index) ?? -1) + 1;
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function Be(t, e) {
|
|
1081
1081
|
return {
|
|
1082
1082
|
...t,
|
|
1083
1083
|
revision: {
|
|
1084
1084
|
...t.revision,
|
|
1085
|
-
[e.scope]:
|
|
1085
|
+
[e.scope]: He(t, e)
|
|
1086
1086
|
},
|
|
1087
1087
|
lastModified: (/* @__PURE__ */ new Date()).toISOString()
|
|
1088
1088
|
};
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function Ke(t, e, n = 0) {
|
|
1091
1091
|
if ([tt, et, ct].includes(e.type))
|
|
1092
1092
|
return t;
|
|
1093
|
-
const { scope: i } = e, o = t.operations[i].slice(
|
|
1094
|
-
0,
|
|
1095
|
-
t.revision[i]
|
|
1096
|
-
), a = [...o].pop();
|
|
1093
|
+
const { scope: i } = e, o = t.operations[i].slice(), a = o.at(-1);
|
|
1097
1094
|
let r = ((a == null ? void 0 : a.index) ?? -1) + 1;
|
|
1098
1095
|
if ("index" in e) {
|
|
1099
1096
|
if (e.index - n > r)
|
|
@@ -1115,109 +1112,137 @@ function Be(t, e, n = 0) {
|
|
|
1115
1112
|
operations: { ...t.operations, [i]: o }
|
|
1116
1113
|
};
|
|
1117
1114
|
}
|
|
1118
|
-
function
|
|
1119
|
-
let i =
|
|
1120
|
-
return i =
|
|
1115
|
+
function We(t, e, n = 0) {
|
|
1116
|
+
let i = Ke(t, e, n);
|
|
1117
|
+
return i = Be(i, e), i;
|
|
1121
1118
|
}
|
|
1122
|
-
function
|
|
1119
|
+
function Ge(t, e, n) {
|
|
1123
1120
|
switch (Pt().parse(e), e.type) {
|
|
1124
1121
|
case qt:
|
|
1125
|
-
return
|
|
1122
|
+
return Se(t, e.input);
|
|
1126
1123
|
case ct:
|
|
1127
|
-
return
|
|
1124
|
+
return $e(t, e, n);
|
|
1128
1125
|
case Ut:
|
|
1129
|
-
return
|
|
1126
|
+
return ke(t, e.input.state);
|
|
1130
1127
|
default:
|
|
1131
1128
|
return t;
|
|
1132
1129
|
}
|
|
1133
1130
|
}
|
|
1134
|
-
function
|
|
1131
|
+
function gn(t, e, n) {
|
|
1135
1132
|
switch (e.type) {
|
|
1136
1133
|
case tt:
|
|
1137
1134
|
return je(t, e, n);
|
|
1138
1135
|
case et:
|
|
1139
|
-
return
|
|
1136
|
+
return Ee(t, e, n);
|
|
1140
1137
|
default:
|
|
1141
1138
|
return { document: t, action: e, skip: n };
|
|
1142
1139
|
}
|
|
1143
1140
|
}
|
|
1144
|
-
function
|
|
1145
|
-
const
|
|
1146
|
-
if (!
|
|
1141
|
+
function Ze(t, e, n, i, o = !1, a = ee) {
|
|
1142
|
+
const r = e.scope, p = t.operations[r].at(-1);
|
|
1143
|
+
if (!p)
|
|
1147
1144
|
return t;
|
|
1148
|
-
const
|
|
1145
|
+
const m = dt(
|
|
1149
1146
|
{
|
|
1150
1147
|
...t.operations,
|
|
1151
|
-
[
|
|
1152
|
-
t.operations[
|
|
1153
|
-
|
|
1148
|
+
[r]: Qt(
|
|
1149
|
+
t.operations[r],
|
|
1150
|
+
p
|
|
1154
1151
|
)
|
|
1155
1152
|
}
|
|
1156
|
-
), { state: p } = gt(
|
|
1157
|
-
t.initialState,
|
|
1158
|
-
r,
|
|
1159
|
-
n,
|
|
1160
|
-
void 0,
|
|
1161
|
-
void 0,
|
|
1162
|
-
void 0
|
|
1163
1153
|
);
|
|
1154
|
+
let d;
|
|
1155
|
+
const h = m[r].at(-1);
|
|
1156
|
+
if (o && (h != null && h.resultingState))
|
|
1157
|
+
d = a(
|
|
1158
|
+
h.resultingState
|
|
1159
|
+
);
|
|
1160
|
+
else {
|
|
1161
|
+
const { state: b } = gt(
|
|
1162
|
+
t.initialState,
|
|
1163
|
+
m,
|
|
1164
|
+
n,
|
|
1165
|
+
void 0,
|
|
1166
|
+
void 0,
|
|
1167
|
+
void 0,
|
|
1168
|
+
void 0,
|
|
1169
|
+
{
|
|
1170
|
+
reuseHash: !0,
|
|
1171
|
+
reuseOperationResultingState: o,
|
|
1172
|
+
operationResultingStateParser: a
|
|
1173
|
+
}
|
|
1174
|
+
);
|
|
1175
|
+
d = b[r];
|
|
1176
|
+
}
|
|
1164
1177
|
return {
|
|
1165
1178
|
...t,
|
|
1166
|
-
state:
|
|
1179
|
+
state: {
|
|
1180
|
+
...t.state,
|
|
1181
|
+
[r]: d
|
|
1182
|
+
},
|
|
1167
1183
|
operations: dt({
|
|
1168
1184
|
...t.operations
|
|
1169
1185
|
})
|
|
1170
1186
|
};
|
|
1171
1187
|
}
|
|
1172
1188
|
function Yt(t, e, n, i, o = {}) {
|
|
1173
|
-
const {
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1189
|
+
const {
|
|
1190
|
+
skip: a,
|
|
1191
|
+
ignoreSkipOperations: r = !1,
|
|
1192
|
+
reuseHash: p = !1,
|
|
1193
|
+
reuseOperationResultingState: m = !1,
|
|
1194
|
+
operationResultingStateParser: d
|
|
1195
|
+
} = o, h = { ...e }, b = a || 0;
|
|
1196
|
+
let O = { ...t };
|
|
1197
|
+
const v = !r && (b > 0 || "index" in h && h.skip > 0);
|
|
1198
|
+
return kt(h) && (O = Ge(O, h, n)), O = We(O, h, b), v && (O = Ze(
|
|
1199
|
+
O,
|
|
1200
|
+
h,
|
|
1201
|
+
n,
|
|
1202
|
+
b,
|
|
1203
|
+
m,
|
|
1204
|
+
d
|
|
1205
|
+
)), O = pt(O, (T) => {
|
|
1181
1206
|
try {
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
|
|
1207
|
+
const P = n(
|
|
1208
|
+
T.state,
|
|
1209
|
+
h,
|
|
1185
1210
|
i
|
|
1186
1211
|
);
|
|
1187
|
-
if (
|
|
1212
|
+
if (P)
|
|
1188
1213
|
return at({
|
|
1189
|
-
...
|
|
1214
|
+
...O,
|
|
1190
1215
|
// clipboard: [...clipboardValue],
|
|
1191
|
-
state:
|
|
1216
|
+
state: P
|
|
1192
1217
|
});
|
|
1193
|
-
} catch (
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1218
|
+
} catch (P) {
|
|
1219
|
+
const C = O.operations[h.scope].length - 1;
|
|
1220
|
+
T.operations[h.scope][C].error = P.message, T.operations[h.scope][C].skip = 0, v && (T.state = at({ ...t.state }), T.operations = at({
|
|
1196
1221
|
...t.operations,
|
|
1197
|
-
[
|
|
1198
|
-
...t.operations[
|
|
1222
|
+
[h.scope]: [
|
|
1223
|
+
...t.operations[h.scope],
|
|
1199
1224
|
{
|
|
1200
|
-
...
|
|
1225
|
+
...T.operations[h.scope][C]
|
|
1201
1226
|
}
|
|
1202
1227
|
]
|
|
1203
1228
|
}));
|
|
1204
1229
|
}
|
|
1205
|
-
}), pt(
|
|
1206
|
-
if ([tt, et, ct].includes(
|
|
1207
|
-
return
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
const { hash:
|
|
1211
|
-
|
|
1212
|
-
...
|
|
1230
|
+
}), pt(O, (T) => {
|
|
1231
|
+
if ([tt, et, ct].includes(h.type))
|
|
1232
|
+
return T;
|
|
1233
|
+
const P = h.scope || "global", C = p && Object.prototype.hasOwnProperty.call(h, "hash") ? h.hash : jt(T, P);
|
|
1234
|
+
T.operations[P][T.operations[P].length - 1].hash = C, !kt(h) && h.attachments && h.attachments.forEach((c) => {
|
|
1235
|
+
const { hash: l, ...u } = c;
|
|
1236
|
+
T.attachments[l] = {
|
|
1237
|
+
...u
|
|
1213
1238
|
};
|
|
1214
1239
|
});
|
|
1215
1240
|
});
|
|
1216
1241
|
}
|
|
1217
|
-
function gn(t) {
|
|
1218
|
-
return t.type === ke && t.skip !== void 0 && t.skip > 0 && t.hash !== void 0;
|
|
1219
|
-
}
|
|
1220
1242
|
function hn(t) {
|
|
1243
|
+
return t.type === De && t.skip !== void 0 && t.skip > 0 && t.hash !== void 0;
|
|
1244
|
+
}
|
|
1245
|
+
function xn(t) {
|
|
1221
1246
|
return [tt, et].includes(t.type);
|
|
1222
1247
|
}
|
|
1223
1248
|
function kt(t) {
|
|
@@ -1237,10 +1262,10 @@ function W(t, e, n, i, o = "global") {
|
|
|
1237
1262
|
}
|
|
1238
1263
|
return a;
|
|
1239
1264
|
}
|
|
1240
|
-
function
|
|
1265
|
+
function Qe(t, e = Yt) {
|
|
1241
1266
|
return (n, i, o, a) => e(n, i, t, o, a);
|
|
1242
1267
|
}
|
|
1243
|
-
const
|
|
1268
|
+
const Ye = (t, e) => ({
|
|
1244
1269
|
name: "",
|
|
1245
1270
|
documentType: "",
|
|
1246
1271
|
revision: {
|
|
@@ -1252,8 +1277,8 @@ const Qe = (t, e) => ({
|
|
|
1252
1277
|
attachments: {},
|
|
1253
1278
|
...t,
|
|
1254
1279
|
state: (e == null ? void 0 : e(t == null ? void 0 : t.state)) ?? (t == null ? void 0 : t.state) ?? { global: {}, local: {} }
|
|
1255
|
-
}),
|
|
1256
|
-
const n =
|
|
1280
|
+
}), tn = (t, e) => {
|
|
1281
|
+
const n = Ye(
|
|
1257
1282
|
t,
|
|
1258
1283
|
e
|
|
1259
1284
|
);
|
|
@@ -1263,64 +1288,64 @@ const Qe = (t, e) => ({
|
|
|
1263
1288
|
operations: { global: [], local: [] },
|
|
1264
1289
|
clipboard: []
|
|
1265
1290
|
};
|
|
1266
|
-
},
|
|
1291
|
+
}, jt = (t, e = "global") => lt(K(t.state[e] || "")), yn = (t, e = 1e3) => {
|
|
1267
1292
|
const n = Math.random() * e;
|
|
1268
1293
|
return lt(`${(t ?? /* @__PURE__ */ new Date()).toISOString()}${n}`);
|
|
1269
1294
|
};
|
|
1270
1295
|
function rt(t) {
|
|
1271
|
-
return
|
|
1296
|
+
return le(me(t, !0));
|
|
1272
1297
|
}
|
|
1273
|
-
function
|
|
1298
|
+
function bn(t, e) {
|
|
1274
1299
|
const n = [...t];
|
|
1275
1300
|
let i = e || 0, o = n.length > 0 ? n[n.length - 1].index : 0;
|
|
1276
1301
|
const a = [];
|
|
1277
1302
|
for (const r of n.reverse()) {
|
|
1278
1303
|
if (i > 0) {
|
|
1279
|
-
const
|
|
1280
|
-
i -=
|
|
1304
|
+
const d = o - r.index;
|
|
1305
|
+
i -= d;
|
|
1281
1306
|
}
|
|
1282
1307
|
if (i < 0)
|
|
1283
1308
|
throw new Error("Invalid operation index, missing operations");
|
|
1284
1309
|
const p = {
|
|
1285
1310
|
ignore: i > 0,
|
|
1286
1311
|
operation: r
|
|
1287
|
-
},
|
|
1288
|
-
if (
|
|
1289
|
-
const
|
|
1290
|
-
i = i +
|
|
1312
|
+
}, m = r.skip > 0 ? r.skip + 1 : 0;
|
|
1313
|
+
if (m > 0 && m > i) {
|
|
1314
|
+
const d = m - i;
|
|
1315
|
+
i = i + d;
|
|
1291
1316
|
}
|
|
1292
1317
|
o = r.index, a.push(p);
|
|
1293
1318
|
}
|
|
1294
1319
|
return a.reverse();
|
|
1295
1320
|
}
|
|
1296
|
-
function
|
|
1297
|
-
const i = t.slice().sort((p,
|
|
1321
|
+
function wn(t, e, n) {
|
|
1322
|
+
const i = t.slice().sort((p, m) => p.skip - m.skip).sort((p, m) => p.index - m.index);
|
|
1298
1323
|
let o = n, a = 0, r = e;
|
|
1299
1324
|
for (const p of i.reverse()) {
|
|
1300
|
-
const
|
|
1301
|
-
if (o = o -
|
|
1325
|
+
const m = r - p.index;
|
|
1326
|
+
if (o = o - m, o > -1)
|
|
1302
1327
|
a++, r = p.index;
|
|
1303
1328
|
else
|
|
1304
1329
|
break;
|
|
1305
1330
|
}
|
|
1306
1331
|
return a;
|
|
1307
1332
|
}
|
|
1308
|
-
function
|
|
1333
|
+
function On(t) {
|
|
1309
1334
|
return Object.values(t).flatMap((e) => e).sort(
|
|
1310
1335
|
(e, n) => new Date(e.timestamp).getTime() - new Date(n.timestamp).getTime()
|
|
1311
1336
|
);
|
|
1312
1337
|
}
|
|
1313
|
-
function
|
|
1338
|
+
function Sn(t) {
|
|
1314
1339
|
return Object.values(t).flatMap((e) => e).sort(
|
|
1315
1340
|
(e, n) => new Date(e.operation.timestamp).getTime() - new Date(n.operation.timestamp).getTime()
|
|
1316
1341
|
);
|
|
1317
1342
|
}
|
|
1318
1343
|
function gt(t, e, n, i, o, a = Yt, r = {}, p) {
|
|
1319
|
-
const
|
|
1344
|
+
const m = Qe(n, a);
|
|
1320
1345
|
return te(
|
|
1321
1346
|
t,
|
|
1322
1347
|
e,
|
|
1323
|
-
|
|
1348
|
+
m,
|
|
1324
1349
|
i,
|
|
1325
1350
|
o,
|
|
1326
1351
|
r,
|
|
@@ -1328,68 +1353,119 @@ function gt(t, e, n, i, o, a = Yt, r = {}, p) {
|
|
|
1328
1353
|
);
|
|
1329
1354
|
}
|
|
1330
1355
|
function te(t, e, n, i, o, a = {}, r) {
|
|
1331
|
-
const
|
|
1332
|
-
|
|
1356
|
+
const {
|
|
1357
|
+
checkHashes: p = !0,
|
|
1358
|
+
reuseOperationResultingState: m,
|
|
1359
|
+
operationResultingStateParser: d = ee
|
|
1360
|
+
} = r || {};
|
|
1361
|
+
let h = t;
|
|
1362
|
+
const b = [], O = {
|
|
1363
|
+
global: [],
|
|
1364
|
+
local: []
|
|
1365
|
+
};
|
|
1366
|
+
if (m)
|
|
1367
|
+
for (const [c, l] of Object.entries(e)) {
|
|
1368
|
+
const u = l.findLastIndex(
|
|
1369
|
+
(F) => !!F.resultingState
|
|
1370
|
+
);
|
|
1371
|
+
if (u < 0) {
|
|
1372
|
+
b.push(...l);
|
|
1373
|
+
continue;
|
|
1374
|
+
}
|
|
1375
|
+
const _ = l[u];
|
|
1376
|
+
try {
|
|
1377
|
+
const F = d(
|
|
1378
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion
|
|
1379
|
+
_.resultingState
|
|
1380
|
+
);
|
|
1381
|
+
h = {
|
|
1382
|
+
...h,
|
|
1383
|
+
state: {
|
|
1384
|
+
...h.state,
|
|
1385
|
+
// TODO how to deal with attachments?
|
|
1386
|
+
[c]: F
|
|
1387
|
+
}
|
|
1388
|
+
}, O[c].push(
|
|
1389
|
+
...l.slice(0, u + 1)
|
|
1390
|
+
), b.push(...l.slice(u + 1));
|
|
1391
|
+
} catch {
|
|
1392
|
+
b.push(...l);
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
else
|
|
1396
|
+
b.push(...Object.values(e).flat());
|
|
1397
|
+
const v = tn(h);
|
|
1398
|
+
v.initialState = t, v.operations = O;
|
|
1399
|
+
const T = b.reduce((c, l) => n(c, l, i, {
|
|
1400
|
+
skip: l.skip,
|
|
1333
1401
|
ignoreSkipOperations: !0,
|
|
1334
1402
|
reuseHash: !p
|
|
1335
|
-
}),
|
|
1403
|
+
}), v);
|
|
1336
1404
|
if (!p)
|
|
1337
|
-
for (const
|
|
1338
|
-
for (let
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1341
|
-
if (
|
|
1342
|
-
throw new Error(`Hash mismatch for scope ${
|
|
1405
|
+
for (const c of Object.keys(T.state))
|
|
1406
|
+
for (let l = b.length - 1; l >= 0; l--) {
|
|
1407
|
+
const u = b[l];
|
|
1408
|
+
if (u.scope === c) {
|
|
1409
|
+
if (u.hash !== jt(T, c))
|
|
1410
|
+
throw new Error(`Hash mismatch for scope ${c}`);
|
|
1343
1411
|
break;
|
|
1344
1412
|
}
|
|
1345
1413
|
}
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1414
|
+
const P = Object.keys(
|
|
1415
|
+
T.operations
|
|
1348
1416
|
).reduce(
|
|
1349
|
-
(
|
|
1350
|
-
const
|
|
1417
|
+
(c, l) => {
|
|
1418
|
+
const u = l;
|
|
1351
1419
|
return {
|
|
1352
|
-
...
|
|
1353
|
-
[
|
|
1354
|
-
...
|
|
1355
|
-
var
|
|
1420
|
+
...c,
|
|
1421
|
+
[u]: [
|
|
1422
|
+
...T.operations[u].map((_, F) => {
|
|
1423
|
+
var M;
|
|
1356
1424
|
return {
|
|
1357
|
-
...
|
|
1358
|
-
timestamp: ((
|
|
1425
|
+
..._,
|
|
1426
|
+
timestamp: ((M = e[u][F]) == null ? void 0 : M.timestamp) ?? _.timestamp
|
|
1359
1427
|
};
|
|
1360
1428
|
})
|
|
1361
1429
|
]
|
|
1362
1430
|
};
|
|
1363
1431
|
},
|
|
1364
1432
|
{ global: [], local: [] }
|
|
1365
|
-
),
|
|
1366
|
-
const
|
|
1367
|
-
return (
|
|
1433
|
+
), C = Object.values(P).reduce((c, l) => {
|
|
1434
|
+
const u = l[l.length - 1];
|
|
1435
|
+
return (u == null ? void 0 : u.timestamp) > c && (c = u.timestamp), c;
|
|
1368
1436
|
}, t.lastModified);
|
|
1369
|
-
return { ...
|
|
1437
|
+
return { ...T, operations: P, lastModified: C };
|
|
1370
1438
|
}
|
|
1371
1439
|
function jn(t, e) {
|
|
1372
1440
|
return K(t) === K(e);
|
|
1373
1441
|
}
|
|
1374
|
-
|
|
1442
|
+
function ee(t) {
|
|
1443
|
+
const e = typeof t;
|
|
1444
|
+
if (e === "string")
|
|
1445
|
+
return JSON.parse(t);
|
|
1446
|
+
if (e === "object")
|
|
1447
|
+
return t;
|
|
1448
|
+
throw new Error(`Providing resulting state is of type: ${e}`);
|
|
1449
|
+
}
|
|
1450
|
+
const ne = (t) => W(
|
|
1375
1451
|
"SET_NAME",
|
|
1376
1452
|
t,
|
|
1377
1453
|
void 0,
|
|
1378
1454
|
bt,
|
|
1379
1455
|
void 0
|
|
1380
|
-
),
|
|
1456
|
+
), ie = (t = 1, e = "global") => W(
|
|
1381
1457
|
"UNDO",
|
|
1382
1458
|
t,
|
|
1383
1459
|
void 0,
|
|
1384
1460
|
wt,
|
|
1385
1461
|
e
|
|
1386
|
-
),
|
|
1462
|
+
), oe = (t = 1, e = "global") => W(
|
|
1387
1463
|
"REDO",
|
|
1388
1464
|
t,
|
|
1389
1465
|
void 0,
|
|
1390
1466
|
yt,
|
|
1391
1467
|
e
|
|
1392
|
-
),
|
|
1468
|
+
), se = (t, e, n = "global") => W(
|
|
1393
1469
|
"PRUNE",
|
|
1394
1470
|
{ start: t, end: e },
|
|
1395
1471
|
void 0,
|
|
@@ -1400,16 +1476,16 @@ const ee = (t) => W(
|
|
|
1400
1476
|
{ state: t, operations: e },
|
|
1401
1477
|
void 0,
|
|
1402
1478
|
ht
|
|
1403
|
-
),
|
|
1479
|
+
), re = (t = "global") => W("NOOP", {}, void 0, void 0, t), En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1404
1480
|
__proto__: null,
|
|
1405
1481
|
loadState: Et,
|
|
1406
|
-
noop:
|
|
1407
|
-
prune:
|
|
1408
|
-
redo:
|
|
1409
|
-
setName:
|
|
1410
|
-
undo:
|
|
1482
|
+
noop: re,
|
|
1483
|
+
prune: se,
|
|
1484
|
+
redo: oe,
|
|
1485
|
+
setName: ne,
|
|
1486
|
+
undo: ie
|
|
1411
1487
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1412
|
-
class
|
|
1488
|
+
class $n {
|
|
1413
1489
|
/**
|
|
1414
1490
|
* Constructs a BaseDocument instance with an initial state.
|
|
1415
1491
|
* @param reducer - The reducer function that updates the state.
|
|
@@ -1441,7 +1517,7 @@ class En {
|
|
|
1441
1517
|
* @returns The file path where the state was saved.
|
|
1442
1518
|
*/
|
|
1443
1519
|
saveToFile(e, n, i) {
|
|
1444
|
-
return
|
|
1520
|
+
return Pe(this._document, e, n, i);
|
|
1445
1521
|
}
|
|
1446
1522
|
/**
|
|
1447
1523
|
* Loads the state of the document from a file.
|
|
@@ -1528,21 +1604,21 @@ class En {
|
|
|
1528
1604
|
* @param name - The new name of the document.
|
|
1529
1605
|
*/
|
|
1530
1606
|
setName(e) {
|
|
1531
|
-
return this.dispatch(
|
|
1607
|
+
return this.dispatch(ne(e)), this;
|
|
1532
1608
|
}
|
|
1533
1609
|
/**
|
|
1534
1610
|
* Reverts a number of actions from the document.
|
|
1535
1611
|
* @param count - The number of actions to revert.
|
|
1536
1612
|
*/
|
|
1537
1613
|
undo(e) {
|
|
1538
|
-
return this.dispatch(
|
|
1614
|
+
return this.dispatch(ie(e)), this;
|
|
1539
1615
|
}
|
|
1540
1616
|
/**
|
|
1541
1617
|
* Reapplies a number of actions to the document.
|
|
1542
1618
|
* @param count - The number of actions to reapply.
|
|
1543
1619
|
*/
|
|
1544
1620
|
redo(e) {
|
|
1545
|
-
return this.dispatch(
|
|
1621
|
+
return this.dispatch(oe(e)), this;
|
|
1546
1622
|
}
|
|
1547
1623
|
/**
|
|
1548
1624
|
* Removes a range of operations from the document.
|
|
@@ -1550,7 +1626,7 @@ class En {
|
|
|
1550
1626
|
* @param end - The ending index of the range to remove.
|
|
1551
1627
|
*/
|
|
1552
1628
|
prune(e, n) {
|
|
1553
|
-
return this.dispatch(
|
|
1629
|
+
return this.dispatch(se(e, n)), this;
|
|
1554
1630
|
}
|
|
1555
1631
|
/**
|
|
1556
1632
|
* Loads a document state and a set of operations.
|
|
@@ -1561,7 +1637,7 @@ class En {
|
|
|
1561
1637
|
return this.dispatch(Et(e, n)), this;
|
|
1562
1638
|
}
|
|
1563
1639
|
}
|
|
1564
|
-
function
|
|
1640
|
+
function kn(t, e) {
|
|
1565
1641
|
e.forEach((n) => {
|
|
1566
1642
|
Object.getOwnPropertyNames(n.prototype).forEach((i) => {
|
|
1567
1643
|
Object.defineProperty(
|
|
@@ -1575,36 +1651,37 @@ function $n(t, e) {
|
|
|
1575
1651
|
});
|
|
1576
1652
|
}
|
|
1577
1653
|
export {
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
Ye as
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1654
|
+
Sn as A,
|
|
1655
|
+
$n as B,
|
|
1656
|
+
On as C,
|
|
1657
|
+
Ae as D,
|
|
1658
|
+
Yt as E,
|
|
1659
|
+
gn as F,
|
|
1660
|
+
ln as G,
|
|
1661
|
+
Ye as a,
|
|
1662
|
+
tn as b,
|
|
1663
|
+
Qe as c,
|
|
1664
|
+
mn as d,
|
|
1665
|
+
Me as e,
|
|
1589
1666
|
W as f,
|
|
1590
|
-
|
|
1591
|
-
|
|
1667
|
+
kn as g,
|
|
1668
|
+
En as h,
|
|
1592
1669
|
kt as i,
|
|
1593
|
-
|
|
1670
|
+
wn as j,
|
|
1594
1671
|
Xt as k,
|
|
1595
1672
|
$t as l,
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1673
|
+
dn as m,
|
|
1674
|
+
fn as n,
|
|
1675
|
+
un as o,
|
|
1676
|
+
jt as p,
|
|
1677
|
+
yn as q,
|
|
1678
|
+
hn as r,
|
|
1679
|
+
Pe as s,
|
|
1603
1680
|
jn as t,
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1681
|
+
xn as u,
|
|
1682
|
+
bn as v,
|
|
1683
|
+
ee as w,
|
|
1684
|
+
rt as x,
|
|
1685
|
+
te as y,
|
|
1686
|
+
gt as z
|
|
1610
1687
|
};
|