document-model 1.1.0-experimental.3 → 1.1.0

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.
Files changed (37) hide show
  1. package/dist/browser/cjs/document-model.js +1 -1
  2. package/dist/browser/cjs/document.js +1 -1
  3. package/dist/browser/cjs/index.js +1 -1
  4. package/dist/browser/cjs/internal/{index-dwAOfmBp.js → index-Bqu_Uzaf.js} +1 -1
  5. package/dist/browser/cjs/internal/{index-DMRH7zDy.js → index-DD_uV5_l.js} +1 -1
  6. package/dist/browser/cjs/internal/object-CHFtJl_E.js +25 -0
  7. package/dist/browser/es/document-model.js +2 -2
  8. package/dist/browser/es/document.js +9 -7
  9. package/dist/browser/es/index.js +3 -3
  10. package/dist/browser/es/internal/{index-DQztOVJu.js → index-C9_nWw6z.js} +1 -1
  11. package/dist/browser/es/internal/index-CNILoLzv.js +46 -0
  12. package/dist/browser/es/internal/{object-iTBekDVP.js → object-CJvDhUxl.js} +1003 -965
  13. package/dist/browser/src/document/object.d.ts +35 -0
  14. package/dist/browser/src/document/reducer.d.ts +17 -0
  15. package/dist/browser/src/document/types.d.ts +2 -0
  16. package/dist/browser/src/document/utils/document-helpers.d.ts +9 -0
  17. package/dist/node/cjs/document-model.js +1 -1
  18. package/dist/node/cjs/document.js +1 -1
  19. package/dist/node/cjs/index.js +1 -1
  20. package/dist/node/cjs/internal/{index-BNFVmPew.js → index-DSsY5px9.js} +1 -1
  21. package/dist/node/cjs/internal/{index-FvRO8SnG.js → index-eJODAZgf.js} +1 -1
  22. package/dist/node/cjs/internal/object-9bv72oJK.js +20 -0
  23. package/dist/node/es/document-model.js +2 -2
  24. package/dist/node/es/document.js +10 -8
  25. package/dist/node/es/index.js +3 -3
  26. package/dist/node/es/internal/index-Dug-2E00.js +46 -0
  27. package/dist/node/es/internal/{index-DOpbr_uw.js → index-nccvxxIw.js} +1 -1
  28. package/dist/node/es/internal/{object-C2s2eZ08.js → object-B9OVOSMl.js} +668 -630
  29. package/dist/node/src/document/object.d.ts +35 -0
  30. package/dist/node/src/document/reducer.d.ts +17 -0
  31. package/dist/node/src/document/types.d.ts +2 -0
  32. package/dist/node/src/document/utils/document-helpers.d.ts +9 -0
  33. package/package.json +3 -1
  34. package/dist/browser/cjs/internal/object-C-PazS9q.js +0 -25
  35. package/dist/browser/es/internal/index-BVJxzkIs.js +0 -44
  36. package/dist/node/cjs/internal/object-Xvr4kDQj.js +0 -20
  37. package/dist/node/es/internal/index-BIrQOTP_.js +0 -44
@@ -1,29 +1,29 @@
1
- var Xe = Object.defineProperty;
2
- var Ve = (i, r, o) => r in i ? Xe(i, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[r] = o;
3
- var At = (i, r, o) => (Ve(i, typeof r != "symbol" ? r + "" : r, o), o);
4
- import { produce as Ot, castDraft as Bt, castImmutable as Ke, freeze as Ge } from "immer";
1
+ var Ye = Object.defineProperty;
2
+ var Qe = (i, r, o) => r in i ? Ye(i, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[r] = o;
3
+ var Ft = (i, r, o) => (Qe(i, typeof r != "symbol" ? r + "" : r, o), o);
4
+ import { produce as jt, castDraft as It, castImmutable as ti, freeze as ei } from "immer";
5
5
  import { z as _ } from "zod";
6
- import oe from "jszip";
7
- const ae = (i) => i != null, Ze = _.any().refine((i) => ae(i)), se = _.enum(["LOAD_STATE"]), pe = _.enum(["PRUNE"]), ce = _.enum(["REDO"]), le = _.enum(["SET_NAME"]), ue = _.enum(["UNDO"]);
8
- function Ye() {
6
+ import pe from "jszip";
7
+ const ce = (i) => i != null, ii = _.any().refine((i) => ce(i)), le = _.enum(["LOAD_STATE"]), ue = _.enum(["PRUNE"]), fe = _.enum(["REDO"]), he = _.enum(["SET_NAME"]), me = _.enum(["UNDO"]);
8
+ function ri() {
9
9
  return _.object({
10
10
  __typename: _.literal("Action").optional(),
11
11
  type: _.string()
12
12
  });
13
13
  }
14
- function yt() {
14
+ function wt() {
15
15
  return _.literal("global").or(_.literal("local"));
16
16
  }
17
- function fe() {
17
+ function xe() {
18
18
  return _.union([
19
- he(),
20
- xe(),
21
19
  de(),
22
- ge(),
23
- ye()
20
+ ye(),
21
+ we(),
22
+ Ee(),
23
+ be()
24
24
  ]);
25
25
  }
26
- function Qe() {
26
+ function ni() {
27
27
  return _.object({
28
28
  __typename: _.literal("DocumentFile").optional(),
29
29
  data: _.string(),
@@ -32,26 +32,26 @@ function Qe() {
32
32
  mimeType: _.string()
33
33
  });
34
34
  }
35
- function he() {
35
+ function de() {
36
36
  return _.object({
37
- input: _.lazy(() => zt()),
38
- type: se,
39
- scope: yt()
37
+ input: _.lazy(() => Ht()),
38
+ type: le,
39
+ scope: wt()
40
40
  });
41
41
  }
42
- function zt() {
42
+ function Ht() {
43
43
  return _.object({
44
44
  operations: _.number(),
45
- state: _.lazy(() => me())
45
+ state: _.lazy(() => ge())
46
46
  });
47
47
  }
48
- function me() {
48
+ function ge() {
49
49
  return _.object({
50
50
  data: _.unknown().nullish(),
51
51
  name: _.string()
52
52
  });
53
53
  }
54
- function ti() {
54
+ function oi() {
55
55
  return _.object({
56
56
  __typename: _.literal("Operation").optional(),
57
57
  hash: _.string(),
@@ -60,36 +60,36 @@ function ti() {
60
60
  type: _.string()
61
61
  });
62
62
  }
63
- function xe() {
63
+ function ye() {
64
64
  return _.object({
65
- input: _.lazy(() => qt()),
66
- type: pe,
67
- scope: yt()
65
+ input: _.lazy(() => Jt()),
66
+ type: ue,
67
+ scope: wt()
68
68
  });
69
69
  }
70
- function qt() {
70
+ function Jt() {
71
71
  return _.object({
72
72
  end: _.number().nullish(),
73
73
  start: _.number().nullish()
74
74
  });
75
75
  }
76
- const Jt = _.number;
77
- function de() {
76
+ const Vt = _.number;
77
+ function we() {
78
78
  return _.object({
79
- input: Jt(),
80
- type: ce,
81
- scope: yt()
79
+ input: Vt(),
80
+ type: fe,
81
+ scope: wt()
82
82
  });
83
83
  }
84
- const Ht = _.string;
85
- function ge() {
84
+ const Wt = _.string;
85
+ function Ee() {
86
86
  return _.object({
87
- input: Ht(),
88
- type: le,
87
+ input: Wt(),
88
+ type: he,
89
89
  scope: _.literal("global")
90
90
  });
91
91
  }
92
- function ei() {
92
+ function ai() {
93
93
  return _.object({
94
94
  __typename: _.literal("SetNameOperation").optional(),
95
95
  hash: _.string(),
@@ -99,61 +99,61 @@ function ei() {
99
99
  type: _.string()
100
100
  });
101
101
  }
102
- const Wt = _.number;
103
- function ye() {
102
+ const Xt = _.number;
103
+ function be() {
104
104
  return _.object({
105
- input: Wt(),
106
- type: ue,
107
- scope: yt()
105
+ input: Xt(),
106
+ type: me,
107
+ scope: wt()
108
108
  });
109
109
  }
110
- const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
110
+ const Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
111
111
  __proto__: null,
112
- ActionSchema: Ye,
113
- BaseActionSchema: fe,
114
- DocumentFileSchema: Qe,
115
- LoadStateActionInputSchema: zt,
116
- LoadStateActionSchema: he,
117
- LoadStateActionStateInputSchema: me,
118
- Load_StateSchema: se,
119
- OperationSchema: ti,
120
- OperationScopeSchema: yt,
121
- PruneActionInputSchema: qt,
122
- PruneActionSchema: xe,
123
- PruneSchema: pe,
124
- RedoActionInputSchema: Jt,
125
- RedoActionSchema: de,
126
- RedoSchema: ce,
127
- SetNameActionInputSchema: Ht,
128
- SetNameActionSchema: ge,
129
- SetNameOperationSchema: ei,
130
- Set_NameSchema: le,
131
- UndoActionInputSchema: Wt,
132
- UndoActionSchema: ye,
133
- UndoSchema: ue,
134
- definedNonNullAnySchema: Ze,
135
- isDefinedNonNullAny: ae
112
+ ActionSchema: ri,
113
+ BaseActionSchema: xe,
114
+ DocumentFileSchema: ni,
115
+ LoadStateActionInputSchema: Ht,
116
+ LoadStateActionSchema: de,
117
+ LoadStateActionStateInputSchema: ge,
118
+ Load_StateSchema: le,
119
+ OperationSchema: oi,
120
+ OperationScopeSchema: wt,
121
+ PruneActionInputSchema: Jt,
122
+ PruneActionSchema: ye,
123
+ PruneSchema: ue,
124
+ RedoActionInputSchema: Vt,
125
+ RedoActionSchema: we,
126
+ RedoSchema: fe,
127
+ SetNameActionInputSchema: Wt,
128
+ SetNameActionSchema: Ee,
129
+ SetNameOperationSchema: ai,
130
+ Set_NameSchema: he,
131
+ UndoActionInputSchema: Xt,
132
+ UndoActionSchema: be,
133
+ UndoSchema: me,
134
+ definedNonNullAnySchema: ii,
135
+ isDefinedNonNullAny: ce
136
136
  }, Symbol.toStringTag, { value: "Module" }));
137
- function Xt(i) {
137
+ function Kt(i) {
138
138
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
139
139
  }
140
- var Nt = { exports: {} };
140
+ var Rt = { exports: {} };
141
141
  (function(i, r) {
142
- const { hasOwnProperty: o } = Object.prototype, p = Z();
143
- p.configure = Z, p.stringify = p, p.default = p, r.stringify = p, r.configure = Z, i.exports = p;
144
- const u = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
142
+ const { hasOwnProperty: o } = Object.prototype, p = Y();
143
+ p.configure = Y, p.stringify = p, p.default = p, r.stringify = p, r.configure = Y, i.exports = p;
144
+ const l = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
145
145
  function f(w) {
146
- return w.length < 5e3 && !u.test(w) ? `"${w}"` : JSON.stringify(w);
146
+ return w.length < 5e3 && !l.test(w) ? `"${w}"` : JSON.stringify(w);
147
147
  }
148
148
  function c(w) {
149
149
  if (w.length > 200)
150
150
  return w.sort();
151
151
  for (let E = 1; E < w.length; E++) {
152
- const S = w[E];
153
- let R = E;
154
- for (; R !== 0 && w[R - 1] > S; )
155
- w[R] = w[R - 1], R--;
156
- w[R] = S;
152
+ const v = w[E];
153
+ let M = E;
154
+ for (; M !== 0 && w[M - 1] > v; )
155
+ w[M] = w[M - 1], M--;
156
+ w[M] = v;
157
157
  }
158
158
  return w;
159
159
  }
@@ -168,13 +168,13 @@ var Nt = { exports: {} };
168
168
  function h(w) {
169
169
  return a.call(w) !== void 0 && w.length !== 0;
170
170
  }
171
- function g(w, E, S) {
172
- w.length < S && (S = w.length);
173
- const R = E === "," ? "" : " ";
174
- let H = `"0":${R}${w[0]}`;
175
- for (let W = 1; W < S; W++)
176
- H += `${E}"${W}":${R}${w[W]}`;
177
- return H;
171
+ function g(w, E, v) {
172
+ w.length < v && (v = w.length);
173
+ const M = E === "," ? "" : " ";
174
+ let J = `"0":${M}${w[0]}`;
175
+ for (let V = 1; V < v; V++)
176
+ J += `${E}"${V}":${M}${w[V]}`;
177
+ return J;
178
178
  }
179
179
  function y(w) {
180
180
  if (o.call(w, "circularValue")) {
@@ -194,30 +194,30 @@ var Nt = { exports: {} };
194
194
  return '"[Circular]"';
195
195
  }
196
196
  function b(w, E) {
197
- let S;
198
- if (o.call(w, E) && (S = w[E], typeof S != "boolean"))
197
+ let v;
198
+ if (o.call(w, E) && (v = w[E], typeof v != "boolean"))
199
199
  throw new TypeError(`The "${E}" argument must be of type boolean`);
200
- return S === void 0 ? !0 : S;
200
+ return v === void 0 ? !0 : v;
201
201
  }
202
202
  function F(w, E) {
203
- let S;
203
+ let v;
204
204
  if (o.call(w, E)) {
205
- if (S = w[E], typeof S != "number")
205
+ if (v = w[E], typeof v != "number")
206
206
  throw new TypeError(`The "${E}" argument must be of type number`);
207
- if (!Number.isInteger(S))
207
+ if (!Number.isInteger(v))
208
208
  throw new TypeError(`The "${E}" argument must be an integer`);
209
- if (S < 1)
209
+ if (v < 1)
210
210
  throw new RangeError(`The "${E}" argument must be >= 1`);
211
211
  }
212
- return S === void 0 ? 1 / 0 : S;
212
+ return v === void 0 ? 1 / 0 : v;
213
213
  }
214
214
  function j(w) {
215
215
  return w === 1 ? "1 item" : `${w} items`;
216
216
  }
217
- function $(w) {
217
+ function U(w) {
218
218
  const E = /* @__PURE__ */ new Set();
219
- for (const S of w)
220
- (typeof S == "string" || typeof S == "number") && E.add(String(S));
219
+ for (const v of w)
220
+ (typeof v == "string" || typeof v == "number") && E.add(String(v));
221
221
  return E;
222
222
  }
223
223
  function q(w) {
@@ -226,73 +226,73 @@ var Nt = { exports: {} };
226
226
  if (typeof E != "boolean")
227
227
  throw new TypeError('The "strict" argument must be of type boolean');
228
228
  if (E)
229
- return (S) => {
230
- let R = `Object can not safely be stringified. Received type ${typeof S}`;
231
- throw typeof S != "function" && (R += ` (${S.toString()})`), new Error(R);
229
+ return (v) => {
230
+ let M = `Object can not safely be stringified. Received type ${typeof v}`;
231
+ throw typeof v != "function" && (M += ` (${v.toString()})`), new Error(M);
232
232
  };
233
233
  }
234
234
  }
235
- function Z(w) {
235
+ function Y(w) {
236
236
  w = { ...w };
237
237
  const E = q(w);
238
238
  E && (w.bigint === void 0 && (w.bigint = !1), "circularValue" in w || (w.circularValue = Error));
239
- const S = y(w), R = b(w, "bigint"), H = b(w, "deterministic"), W = F(w, "maximumDepth"), M = F(w, "maximumBreadth");
240
- function ut(X, m, v, T, O, C) {
241
- let A = m[X];
242
- switch (typeof A == "object" && A !== null && typeof A.toJSON == "function" && (A = A.toJSON(X)), A = T.call(m, X, A), typeof A) {
239
+ const v = y(w), M = b(w, "bigint"), J = b(w, "deterministic"), V = F(w, "maximumDepth"), R = F(w, "maximumBreadth");
240
+ function ft(W, m, S, D, B, C) {
241
+ let A = m[W];
242
+ switch (typeof A == "object" && A !== null && typeof A.toJSON == "function" && (A = A.toJSON(W)), A = D.call(m, W, A), typeof A) {
243
243
  case "string":
244
244
  return f(A);
245
245
  case "object": {
246
246
  if (A === null)
247
247
  return "null";
248
- if (v.indexOf(A) !== -1)
249
- return S;
250
- let k = "", B = ",";
248
+ if (S.indexOf(A) !== -1)
249
+ return v;
250
+ let T = "", O = ",";
251
251
  const I = C;
252
252
  if (Array.isArray(A)) {
253
253
  if (A.length === 0)
254
254
  return "[]";
255
- if (W < v.length + 1)
255
+ if (V < S.length + 1)
256
256
  return '"[Array]"';
257
- v.push(A), O !== "" && (C += O, k += `
258
- ${C}`, B = `,
257
+ S.push(A), B !== "" && (C += B, T += `
258
+ ${C}`, O = `,
259
259
  ${C}`);
260
- const V = Math.min(A.length, M);
261
- let Q = 0;
262
- for (; Q < V - 1; Q++) {
263
- const ct = ut(String(Q), A, v, T, O, C);
264
- k += ct !== void 0 ? ct : "null", k += B;
260
+ const X = Math.min(A.length, R);
261
+ let tt = 0;
262
+ for (; tt < X - 1; tt++) {
263
+ const lt = ft(String(tt), A, S, D, B, C);
264
+ T += lt !== void 0 ? lt : "null", T += O;
265
265
  }
266
- const tt = ut(String(Q), A, v, T, O, C);
267
- if (k += tt !== void 0 ? tt : "null", A.length - 1 > M) {
268
- const ct = A.length - M - 1;
269
- k += `${B}"... ${j(ct)} not stringified"`;
266
+ const et = ft(String(tt), A, S, D, B, C);
267
+ if (T += et !== void 0 ? et : "null", A.length - 1 > R) {
268
+ const lt = A.length - R - 1;
269
+ T += `${O}"... ${j(lt)} not stringified"`;
270
270
  }
271
- return O !== "" && (k += `
272
- ${I}`), v.pop(), `[${k}]`;
271
+ return B !== "" && (T += `
272
+ ${I}`), S.pop(), `[${T}]`;
273
273
  }
274
274
  let L = Object.keys(A);
275
- const J = L.length;
276
- if (J === 0)
275
+ const H = L.length;
276
+ if (H === 0)
277
277
  return "{}";
278
- if (W < v.length + 1)
278
+ if (V < S.length + 1)
279
279
  return '"[Object]"';
280
- let U = "", K = "";
281
- O !== "" && (C += O, B = `,
282
- ${C}`, U = " ");
283
- const Y = Math.min(J, M);
284
- H && !h(A) && (L = c(L)), v.push(A);
285
- for (let V = 0; V < Y; V++) {
286
- const Q = L[V], tt = ut(Q, A, v, T, O, C);
287
- tt !== void 0 && (k += `${K}${f(Q)}:${U}${tt}`, K = B);
280
+ let $ = "", K = "";
281
+ B !== "" && (C += B, O = `,
282
+ ${C}`, $ = " ");
283
+ const Q = Math.min(H, R);
284
+ J && !h(A) && (L = c(L)), S.push(A);
285
+ for (let X = 0; X < Q; X++) {
286
+ const tt = L[X], et = ft(tt, A, S, D, B, C);
287
+ et !== void 0 && (T += `${K}${f(tt)}:${$}${et}`, K = O);
288
288
  }
289
- if (J > M) {
290
- const V = J - M;
291
- k += `${K}"...":${U}"${j(V)} not stringified"`, K = B;
289
+ if (H > R) {
290
+ const X = H - R;
291
+ T += `${K}"...":${$}"${j(X)} not stringified"`, K = O;
292
292
  }
293
- return O !== "" && K.length > 1 && (k = `
294
- ${C}${k}
295
- ${I}`), v.pop(), `{${k}}`;
293
+ return B !== "" && K.length > 1 && (T = `
294
+ ${C}${T}
295
+ ${I}`), S.pop(), `{${T}}`;
296
296
  }
297
297
  case "number":
298
298
  return isFinite(A) ? String(A) : E ? E(A) : "null";
@@ -301,57 +301,57 @@ ${I}`), v.pop(), `{${k}}`;
301
301
  case "undefined":
302
302
  return;
303
303
  case "bigint":
304
- if (R)
304
+ if (M)
305
305
  return String(A);
306
306
  default:
307
307
  return E ? E(A) : void 0;
308
308
  }
309
309
  }
310
- function ft(X, m, v, T, O, C) {
311
- switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(X)), typeof m) {
310
+ function ht(W, m, S, D, B, C) {
311
+ switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(W)), typeof m) {
312
312
  case "string":
313
313
  return f(m);
314
314
  case "object": {
315
315
  if (m === null)
316
316
  return "null";
317
- if (v.indexOf(m) !== -1)
318
- return S;
317
+ if (S.indexOf(m) !== -1)
318
+ return v;
319
319
  const A = C;
320
- let k = "", B = ",";
320
+ let T = "", O = ",";
321
321
  if (Array.isArray(m)) {
322
322
  if (m.length === 0)
323
323
  return "[]";
324
- if (W < v.length + 1)
324
+ if (V < S.length + 1)
325
325
  return '"[Array]"';
326
- v.push(m), O !== "" && (C += O, k += `
327
- ${C}`, B = `,
326
+ S.push(m), B !== "" && (C += B, T += `
327
+ ${C}`, O = `,
328
328
  ${C}`);
329
- const J = Math.min(m.length, M);
330
- let U = 0;
331
- for (; U < J - 1; U++) {
332
- const Y = ft(String(U), m[U], v, T, O, C);
333
- k += Y !== void 0 ? Y : "null", k += B;
329
+ const H = Math.min(m.length, R);
330
+ let $ = 0;
331
+ for (; $ < H - 1; $++) {
332
+ const Q = ht(String($), m[$], S, D, B, C);
333
+ T += Q !== void 0 ? Q : "null", T += O;
334
334
  }
335
- const K = ft(String(U), m[U], v, T, O, C);
336
- if (k += K !== void 0 ? K : "null", m.length - 1 > M) {
337
- const Y = m.length - M - 1;
338
- k += `${B}"... ${j(Y)} not stringified"`;
335
+ const K = ht(String($), m[$], S, D, B, C);
336
+ if (T += K !== void 0 ? K : "null", m.length - 1 > R) {
337
+ const Q = m.length - R - 1;
338
+ T += `${O}"... ${j(Q)} not stringified"`;
339
339
  }
340
- return O !== "" && (k += `
341
- ${A}`), v.pop(), `[${k}]`;
340
+ return B !== "" && (T += `
341
+ ${A}`), S.pop(), `[${T}]`;
342
342
  }
343
- v.push(m);
343
+ S.push(m);
344
344
  let I = "";
345
- O !== "" && (C += O, B = `,
345
+ B !== "" && (C += B, O = `,
346
346
  ${C}`, I = " ");
347
347
  let L = "";
348
- for (const J of T) {
349
- const U = ft(J, m[J], v, T, O, C);
350
- U !== void 0 && (k += `${L}${f(J)}:${I}${U}`, L = B);
348
+ for (const H of D) {
349
+ const $ = ht(H, m[H], S, D, B, C);
350
+ $ !== void 0 && (T += `${L}${f(H)}:${I}${$}`, L = O);
351
351
  }
352
- return O !== "" && L.length > 1 && (k = `
353
- ${C}${k}
354
- ${A}`), v.pop(), `{${k}}`;
352
+ return B !== "" && L.length > 1 && (T = `
353
+ ${C}${T}
354
+ ${A}`), S.pop(), `{${T}}`;
355
355
  }
356
356
  case "number":
357
357
  return isFinite(m) ? String(m) : E ? E(m) : "null";
@@ -360,13 +360,13 @@ ${A}`), v.pop(), `{${k}}`;
360
360
  case "undefined":
361
361
  return;
362
362
  case "bigint":
363
- if (R)
363
+ if (M)
364
364
  return String(m);
365
365
  default:
366
366
  return E ? E(m) : void 0;
367
367
  }
368
368
  }
369
- function st(X, m, v, T, O) {
369
+ function pt(W, m, S, D, B) {
370
370
  switch (typeof m) {
371
371
  case "string":
372
372
  return f(m);
@@ -374,59 +374,59 @@ ${A}`), v.pop(), `{${k}}`;
374
374
  if (m === null)
375
375
  return "null";
376
376
  if (typeof m.toJSON == "function") {
377
- if (m = m.toJSON(X), typeof m != "object")
378
- return st(X, m, v, T, O);
377
+ if (m = m.toJSON(W), typeof m != "object")
378
+ return pt(W, m, S, D, B);
379
379
  if (m === null)
380
380
  return "null";
381
381
  }
382
- if (v.indexOf(m) !== -1)
383
- return S;
384
- const C = O;
382
+ if (S.indexOf(m) !== -1)
383
+ return v;
384
+ const C = B;
385
385
  if (Array.isArray(m)) {
386
386
  if (m.length === 0)
387
387
  return "[]";
388
- if (W < v.length + 1)
388
+ if (V < S.length + 1)
389
389
  return '"[Array]"';
390
- v.push(m), O += T;
391
- let U = `
392
- ${O}`;
390
+ S.push(m), B += D;
391
+ let $ = `
392
+ ${B}`;
393
393
  const K = `,
394
- ${O}`, Y = Math.min(m.length, M);
395
- let V = 0;
396
- for (; V < Y - 1; V++) {
397
- const tt = st(String(V), m[V], v, T, O);
398
- U += tt !== void 0 ? tt : "null", U += K;
394
+ ${B}`, Q = Math.min(m.length, R);
395
+ let X = 0;
396
+ for (; X < Q - 1; X++) {
397
+ const et = pt(String(X), m[X], S, D, B);
398
+ $ += et !== void 0 ? et : "null", $ += K;
399
399
  }
400
- const Q = st(String(V), m[V], v, T, O);
401
- if (U += Q !== void 0 ? Q : "null", m.length - 1 > M) {
402
- const tt = m.length - M - 1;
403
- U += `${K}"... ${j(tt)} not stringified"`;
400
+ const tt = pt(String(X), m[X], S, D, B);
401
+ if ($ += tt !== void 0 ? tt : "null", m.length - 1 > R) {
402
+ const et = m.length - R - 1;
403
+ $ += `${K}"... ${j(et)} not stringified"`;
404
404
  }
405
- return U += `
406
- ${C}`, v.pop(), `[${U}]`;
405
+ return $ += `
406
+ ${C}`, S.pop(), `[${$}]`;
407
407
  }
408
408
  let A = Object.keys(m);
409
- const k = A.length;
410
- if (k === 0)
409
+ const T = A.length;
410
+ if (T === 0)
411
411
  return "{}";
412
- if (W < v.length + 1)
412
+ if (V < S.length + 1)
413
413
  return '"[Object]"';
414
- O += T;
415
- const B = `,
416
- ${O}`;
417
- let I = "", L = "", J = Math.min(k, M);
418
- h(m) && (I += g(m, B, M), A = A.slice(m.length), J -= m.length, L = B), H && (A = c(A)), v.push(m);
419
- for (let U = 0; U < J; U++) {
420
- const K = A[U], Y = st(K, m[K], v, T, O);
421
- Y !== void 0 && (I += `${L}${f(K)}: ${Y}`, L = B);
414
+ B += D;
415
+ const O = `,
416
+ ${B}`;
417
+ let I = "", L = "", H = Math.min(T, R);
418
+ h(m) && (I += g(m, O, R), A = A.slice(m.length), H -= m.length, L = O), J && (A = c(A)), S.push(m);
419
+ for (let $ = 0; $ < H; $++) {
420
+ const K = A[$], Q = pt(K, m[K], S, D, B);
421
+ Q !== void 0 && (I += `${L}${f(K)}: ${Q}`, L = O);
422
422
  }
423
- if (k > M) {
424
- const U = k - M;
425
- I += `${L}"...": "${j(U)} not stringified"`, L = B;
423
+ if (T > R) {
424
+ const $ = T - R;
425
+ I += `${L}"...": "${j($)} not stringified"`, L = O;
426
426
  }
427
427
  return L !== "" && (I = `
428
- ${O}${I}
429
- ${C}`), v.pop(), `{${I}}`;
428
+ ${B}${I}
429
+ ${C}`), S.pop(), `{${I}}`;
430
430
  }
431
431
  case "number":
432
432
  return isFinite(m) ? String(m) : E ? E(m) : "null";
@@ -435,13 +435,13 @@ ${C}`), v.pop(), `{${I}}`;
435
435
  case "undefined":
436
436
  return;
437
437
  case "bigint":
438
- if (R)
438
+ if (M)
439
439
  return String(m);
440
440
  default:
441
441
  return E ? E(m) : void 0;
442
442
  }
443
443
  }
444
- function pt(X, m, v) {
444
+ function ct(W, m, S) {
445
445
  switch (typeof m) {
446
446
  case "string":
447
447
  return f(m);
@@ -449,50 +449,50 @@ ${C}`), v.pop(), `{${I}}`;
449
449
  if (m === null)
450
450
  return "null";
451
451
  if (typeof m.toJSON == "function") {
452
- if (m = m.toJSON(X), typeof m != "object")
453
- return pt(X, m, v);
452
+ if (m = m.toJSON(W), typeof m != "object")
453
+ return ct(W, m, S);
454
454
  if (m === null)
455
455
  return "null";
456
456
  }
457
- if (v.indexOf(m) !== -1)
458
- return S;
459
- let T = "";
457
+ if (S.indexOf(m) !== -1)
458
+ return v;
459
+ let D = "";
460
460
  if (Array.isArray(m)) {
461
461
  if (m.length === 0)
462
462
  return "[]";
463
- if (W < v.length + 1)
463
+ if (V < S.length + 1)
464
464
  return '"[Array]"';
465
- v.push(m);
466
- const B = Math.min(m.length, M);
465
+ S.push(m);
466
+ const O = Math.min(m.length, R);
467
467
  let I = 0;
468
- for (; I < B - 1; I++) {
469
- const J = pt(String(I), m[I], v);
470
- T += J !== void 0 ? J : "null", T += ",";
468
+ for (; I < O - 1; I++) {
469
+ const H = ct(String(I), m[I], S);
470
+ D += H !== void 0 ? H : "null", D += ",";
471
471
  }
472
- const L = pt(String(I), m[I], v);
473
- if (T += L !== void 0 ? L : "null", m.length - 1 > M) {
474
- const J = m.length - M - 1;
475
- T += `,"... ${j(J)} not stringified"`;
472
+ const L = ct(String(I), m[I], S);
473
+ if (D += L !== void 0 ? L : "null", m.length - 1 > R) {
474
+ const H = m.length - R - 1;
475
+ D += `,"... ${j(H)} not stringified"`;
476
476
  }
477
- return v.pop(), `[${T}]`;
477
+ return S.pop(), `[${D}]`;
478
478
  }
479
- let O = Object.keys(m);
480
- const C = O.length;
479
+ let B = Object.keys(m);
480
+ const C = B.length;
481
481
  if (C === 0)
482
482
  return "{}";
483
- if (W < v.length + 1)
483
+ if (V < S.length + 1)
484
484
  return '"[Object]"';
485
- let A = "", k = Math.min(C, M);
486
- h(m) && (T += g(m, ",", M), O = O.slice(m.length), k -= m.length, A = ","), H && (O = c(O)), v.push(m);
487
- for (let B = 0; B < k; B++) {
488
- const I = O[B], L = pt(I, m[I], v);
489
- L !== void 0 && (T += `${A}${f(I)}:${L}`, A = ",");
485
+ let A = "", T = Math.min(C, R);
486
+ h(m) && (D += g(m, ",", R), B = B.slice(m.length), T -= m.length, A = ","), J && (B = c(B)), S.push(m);
487
+ for (let O = 0; O < T; O++) {
488
+ const I = B[O], L = ct(I, m[I], S);
489
+ L !== void 0 && (D += `${A}${f(I)}:${L}`, A = ",");
490
490
  }
491
- if (C > M) {
492
- const B = C - M;
493
- T += `${A}"...":"${j(B)} not stringified"`;
491
+ if (C > R) {
492
+ const O = C - R;
493
+ D += `${A}"...":"${j(O)} not stringified"`;
494
494
  }
495
- return v.pop(), `{${T}}`;
495
+ return S.pop(), `{${D}}`;
496
496
  }
497
497
  case "number":
498
498
  return isFinite(m) ? String(m) : E ? E(m) : "null";
@@ -501,38 +501,67 @@ ${C}`), v.pop(), `{${I}}`;
501
501
  case "undefined":
502
502
  return;
503
503
  case "bigint":
504
- if (R)
504
+ if (M)
505
505
  return String(m);
506
506
  default:
507
507
  return E ? E(m) : void 0;
508
508
  }
509
509
  }
510
- function Dt(X, m, v) {
510
+ function Ct(W, m, S) {
511
511
  if (arguments.length > 1) {
512
- let T = "";
513
- if (typeof v == "number" ? T = " ".repeat(Math.min(v, 10)) : typeof v == "string" && (T = v.slice(0, 10)), m != null) {
512
+ let D = "";
513
+ if (typeof S == "number" ? D = " ".repeat(Math.min(S, 10)) : typeof S == "string" && (D = S.slice(0, 10)), m != null) {
514
514
  if (typeof m == "function")
515
- return ut("", { "": X }, [], m, T, "");
515
+ return ft("", { "": W }, [], m, D, "");
516
516
  if (Array.isArray(m))
517
- return ft("", X, [], $(m), T, "");
517
+ return ht("", W, [], U(m), D, "");
518
518
  }
519
- if (T.length !== 0)
520
- return st("", X, [], T, "");
519
+ if (D.length !== 0)
520
+ return pt("", W, [], D, "");
521
521
  }
522
- return pt("", X, []);
522
+ return ct("", W, []);
523
523
  }
524
- return Dt;
524
+ return Ct;
525
525
  }
526
- })(Nt, Nt.exports);
527
- var ii = Nt.exports;
528
- const xt = /* @__PURE__ */ Xt(ii);
529
- xt.configure;
530
- function ri(i, r) {
526
+ })(Rt, Rt.exports);
527
+ var si = Rt.exports;
528
+ const dt = /* @__PURE__ */ Kt(si);
529
+ dt.configure;
530
+ let Ot;
531
+ const pi = new Uint8Array(16);
532
+ function ci() {
533
+ if (!Ot && (Ot = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ot))
534
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
535
+ return Ot(pi);
536
+ }
537
+ const G = [];
538
+ for (let i = 0; i < 256; ++i)
539
+ G.push((i + 256).toString(16).slice(1));
540
+ function li(i, r = 0) {
541
+ return G[i[r + 0]] + G[i[r + 1]] + G[i[r + 2]] + G[i[r + 3]] + "-" + G[i[r + 4]] + G[i[r + 5]] + "-" + G[i[r + 6]] + G[i[r + 7]] + "-" + G[i[r + 8]] + G[i[r + 9]] + "-" + G[i[r + 10]] + G[i[r + 11]] + G[i[r + 12]] + G[i[r + 13]] + G[i[r + 14]] + G[i[r + 15]];
542
+ }
543
+ const ui = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = {
544
+ randomUUID: ui
545
+ };
546
+ function fi(i, r, o) {
547
+ if (oe.randomUUID && !r && !i)
548
+ return oe.randomUUID();
549
+ i = i || {};
550
+ const p = i.random || (i.rng || ci)();
551
+ if (p[6] = p[6] & 15 | 64, p[8] = p[8] & 63 | 128, r) {
552
+ o = o || 0;
553
+ for (let l = 0; l < 16; ++l)
554
+ r[o + l] = p[l];
555
+ return r;
556
+ }
557
+ return li(p);
558
+ }
559
+ function hi(i, r) {
531
560
  return { ...i, name: r };
532
561
  }
533
- function ni(i, r, o) {
534
- const { scope: p, input: u } = r;
535
- return Ot({
562
+ function mi(i, r, o) {
563
+ const { scope: p, input: l } = r;
564
+ return jt({
536
565
  document: i,
537
566
  action: r,
538
567
  skip: o
@@ -541,7 +570,7 @@ function ni(i, r, o) {
541
570
  throw new Error(
542
571
  `Cannot undo: no operations in history for scope "${p}"`
543
572
  );
544
- if (u < 1)
573
+ if (l < 1)
545
574
  throw new Error(
546
575
  "Invalid UNDO action: input value must be greater than 0"
547
576
  );
@@ -550,7 +579,7 @@ function ni(i, r, o) {
550
579
  "Cannot undo: skip value from reducer cannot be used with UNDO action"
551
580
  );
552
581
  const a = c.document.operations[p].at(-1), h = a && a.type === "NOOP" && a.skip > 0;
553
- if (c.skip += u, h) {
582
+ if (c.skip += l, h) {
554
583
  c.skip += a.skip;
555
584
  const F = c.document.operations[p][c.document.operations[p].length - 2];
556
585
  F && a.index - F.index === 1 && c.document.operations[p].pop();
@@ -560,7 +589,7 @@ function ni(i, r, o) {
560
589
  "Cannot undo: you can't undo more operations than the ones in the scope history"
561
590
  );
562
591
  const g = c.document.operations[p].length - 1;
563
- let y = u, b = h ? g - a.skip : g;
592
+ let y = l, b = h ? g - a.skip : g;
564
593
  for (; y > 0 && b >= 0; ) {
565
594
  const F = c.document.operations[p][b];
566
595
  if (!F) {
@@ -569,12 +598,12 @@ function ni(i, r, o) {
569
598
  }
570
599
  F.type === "NOOP" && F.skip > 0 ? (b = b - (F.skip + 1), c.skip += F.skip + 1) : (c.document.clipboard.push({ ...F }), y--, b--);
571
600
  }
572
- c.action = He(p);
601
+ c.action = Ge(p);
573
602
  });
574
603
  }
575
- function oi(i, r, o) {
576
- const { scope: p, input: u } = r;
577
- return Ot({
604
+ function xi(i, r, o) {
605
+ const { scope: p, input: l } = r;
606
+ return jt({
578
607
  document: i,
579
608
  action: r,
580
609
  skip: o
@@ -583,11 +612,11 @@ function oi(i, r, o) {
583
612
  throw new Error(
584
613
  "Cannot redo: skip value from reducer cannot be used with REDO action"
585
614
  );
586
- if (u > 1)
615
+ if (l > 1)
587
616
  throw new Error(
588
617
  "Cannot redo: you can only redo one operation at a time"
589
618
  );
590
- if (u < 1)
619
+ if (l < 1)
591
620
  throw new Error("Invalid REDO action: invalid redo input value");
592
621
  if (c.document.clipboard.length < 1)
593
622
  throw new Error("Cannot redo: no operations in the clipboard");
@@ -599,86 +628,86 @@ function oi(i, r, o) {
599
628
  `Cannot redo: no operations in clipboard for scope "${p}"`
600
629
  );
601
630
  const h = c.document.clipboard.splice(a, 1)[0];
602
- c.action = Bt({
631
+ c.action = It({
603
632
  type: h.type,
604
633
  scope: h.scope,
605
634
  input: h.input
606
635
  });
607
636
  });
608
637
  }
609
- function ai(i, r, o) {
610
- const { scope: p } = r, u = i.operations[p];
638
+ function di(i, r, o) {
639
+ const { scope: p } = r, l = i.operations[p];
611
640
  let {
612
641
  input: { start: f, end: c }
613
642
  } = r;
614
- f = f || 0, c = c || u.length;
615
- const a = u.slice(f, c), h = u.slice(0, f), g = u.slice(c), y = Pt(
643
+ f = f || 0, c = c || l.length;
644
+ const a = l.slice(f, c), h = l.slice(0, f), g = l.slice(c), y = qt(
616
645
  i.initialState,
617
646
  {
618
647
  ...i.operations,
619
648
  [p]: h.concat(a)
620
649
  },
621
650
  o
622
- ), { name: b, state: F } = y, j = h.length, $ = h.length ? h[h.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
623
- return Pt(
651
+ ), { name: b, state: F } = y, j = h.length, U = h.length ? h[h.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
652
+ return qt(
624
653
  i.initialState,
625
654
  {
626
655
  ...i.operations,
627
656
  [p]: [
628
657
  ...h,
629
658
  {
630
- ...te(
659
+ ...ie(
631
660
  { name: b, state: F },
632
661
  a.length
633
662
  ),
634
- timestamp: $,
663
+ timestamp: U,
635
664
  index: j,
636
- hash: Qt({ state: F }, "global")
665
+ hash: ee({ state: F }, "global")
637
666
  },
638
- ...g.map((q, Z) => ({
667
+ ...g.map((q, Y) => ({
639
668
  ...q,
640
- index: j + Z + 1
669
+ index: j + Y + 1
641
670
  }))
642
671
  ]
643
672
  },
644
673
  o
645
674
  );
646
675
  }
647
- function si(i, r) {
676
+ function gi(i, r) {
648
677
  return {
649
678
  ...i,
650
679
  name: r.name,
651
680
  state: r.state ?? { global: {}, local: {} }
652
681
  };
653
682
  }
654
- const we = "SET_NAME", wt = "UNDO", Et = "REDO", It = "PRUNE", Ee = "LOAD_STATE", pi = "NOOP", be = { "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"] };
655
- Object.freeze(be);
656
- var et = function(i, r, o, p) {
683
+ const ve = "SET_NAME", Et = "UNDO", bt = "REDO", Dt = "PRUNE", Se = "LOAD_STATE", yi = "NOOP", _e = { "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"] };
684
+ Object.freeze(_e);
685
+ var it = function(i, r, o, p) {
657
686
  if (o === "a" && !p)
658
687
  throw new TypeError("Private accessor was defined without a getter");
659
688
  if (typeof r == "function" ? i !== r || !p : !r.has(i))
660
689
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
661
690
  return o === "m" ? p : o === "a" ? p.call(i) : p ? p.value : r.get(i);
662
- }, mt, gt, lt;
663
- class ci {
691
+ }, xt, yt, ut;
692
+ class wi {
664
693
  constructor(...r) {
665
- mt.set(this, /* @__PURE__ */ new Map()), gt.set(this, /* @__PURE__ */ new Map()), lt.set(this, /* @__PURE__ */ new Map());
694
+ xt.set(this, /* @__PURE__ */ new Map()), yt.set(this, /* @__PURE__ */ new Map()), ut.set(this, /* @__PURE__ */ new Map());
666
695
  for (const o of r)
667
696
  this.define(o);
668
697
  }
669
698
  define(r, o = !1) {
670
- for (let [p, u] of Object.entries(r)) {
671
- p = p.toLowerCase(), u = u.map((a) => a.toLowerCase()), et(this, lt, "f").has(p) || et(this, lt, "f").set(p, /* @__PURE__ */ new Set());
672
- const f = et(this, lt, "f").get(p);
699
+ for (let [p, l] of Object.entries(r)) {
700
+ p = p.toLowerCase(), l = l.map((a) => a.toLowerCase()), it(this, ut, "f").has(p) || it(this, ut, "f").set(p, /* @__PURE__ */ new Set());
701
+ const f = it(this, ut, "f").get(p);
673
702
  let c = !0;
674
- for (let a of u) {
703
+ for (let a of l) {
675
704
  const h = a.startsWith("*");
676
- if (a = h ? a.slice(1) : a, f == null || f.add(a), c && et(this, gt, "f").set(p, a), c = !1, h)
705
+ if (a = h ? a.slice(1) : a, f == null || f.add(a), c && it(this, yt, "f").set(p, a), c = !1, h)
677
706
  continue;
678
- const g = et(this, mt, "f").get(a);
707
+ const g = it(this, xt, "f").get(a);
679
708
  if (g && g != p && !o)
680
709
  throw new Error(`"${p} -> ${a}" conflicts with "${g} -> ${a}". Pass \`force=true\` to override this definition.`);
681
- et(this, mt, "f").set(a, p);
710
+ it(this, xt, "f").set(a, p);
682
711
  }
683
712
  }
684
713
  return this;
@@ -686,35 +715,35 @@ class ci {
686
715
  getType(r) {
687
716
  if (typeof r != "string")
688
717
  return null;
689
- const o = r.replace(/^.*[/\\]/, "").toLowerCase(), p = o.replace(/^.*\./, "").toLowerCase(), u = o.length < r.length;
690
- return !(p.length < o.length - 1) && u ? null : et(this, mt, "f").get(p) ?? null;
718
+ const o = r.replace(/^.*[/\\]/, "").toLowerCase(), p = o.replace(/^.*\./, "").toLowerCase(), l = o.length < r.length;
719
+ return !(p.length < o.length - 1) && l ? null : it(this, xt, "f").get(p) ?? null;
691
720
  }
692
721
  getExtension(r) {
693
722
  var o;
694
- return typeof r != "string" ? null : (r = (o = r == null ? void 0 : r.split) == null ? void 0 : o.call(r, ";")[0], (r && et(this, gt, "f").get(r.trim().toLowerCase())) ?? null);
723
+ return typeof r != "string" ? null : (r = (o = r == null ? void 0 : r.split) == null ? void 0 : o.call(r, ";")[0], (r && it(this, yt, "f").get(r.trim().toLowerCase())) ?? null);
695
724
  }
696
725
  getAllExtensions(r) {
697
- return typeof r != "string" ? null : et(this, lt, "f").get(r.toLowerCase()) ?? null;
726
+ return typeof r != "string" ? null : it(this, ut, "f").get(r.toLowerCase()) ?? null;
698
727
  }
699
728
  _freeze() {
700
729
  this.define = () => {
701
730
  throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
702
731
  }, Object.freeze(this);
703
- for (const r of et(this, lt, "f").values())
732
+ for (const r of it(this, ut, "f").values())
704
733
  Object.freeze(r);
705
734
  return this;
706
735
  }
707
736
  _getTestState() {
708
737
  return {
709
- types: et(this, mt, "f"),
710
- extensions: et(this, gt, "f")
738
+ types: it(this, xt, "f"),
739
+ extensions: it(this, yt, "f")
711
740
  };
712
741
  }
713
742
  }
714
- mt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap();
715
- const li = new ci(be)._freeze();
716
- var Mt = { exports: {} };
717
- typeof Object.create == "function" ? Mt.exports = function(r, o) {
743
+ xt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap();
744
+ const Ei = new wi(_e)._freeze();
745
+ var Lt = { exports: {} };
746
+ typeof Object.create == "function" ? Lt.exports = function(r, o) {
718
747
  o && (r.super_ = o, r.prototype = Object.create(o.prototype, {
719
748
  constructor: {
720
749
  value: r,
@@ -723,7 +752,7 @@ typeof Object.create == "function" ? Mt.exports = function(r, o) {
723
752
  configurable: !0
724
753
  }
725
754
  }));
726
- } : Mt.exports = function(r, o) {
755
+ } : Lt.exports = function(r, o) {
727
756
  if (o) {
728
757
  r.super_ = o;
729
758
  var p = function() {
@@ -731,16 +760,16 @@ typeof Object.create == "function" ? Mt.exports = function(r, o) {
731
760
  p.prototype = o.prototype, r.prototype = new p(), r.prototype.constructor = r;
732
761
  }
733
762
  };
734
- var Se = Mt.exports, Rt = { exports: {} }, ve = {}, jt = {};
735
- jt.byteLength = hi;
736
- jt.toByteArray = xi;
737
- jt.fromByteArray = yi;
738
- var nt = [], it = [], ui = typeof Uint8Array < "u" ? Uint8Array : Array, Ut = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
739
- for (var ht = 0, fi = Ut.length; ht < fi; ++ht)
740
- nt[ht] = Ut[ht], it[Ut.charCodeAt(ht)] = ht;
741
- it[45] = 62;
742
- it[95] = 63;
743
- function _e(i) {
763
+ var Ae = Lt.exports, Pt = { exports: {} }, Fe = {}, Tt = {};
764
+ Tt.byteLength = Si;
765
+ Tt.toByteArray = Ai;
766
+ Tt.fromByteArray = Bi;
767
+ var ot = [], rt = [], bi = typeof Uint8Array < "u" ? Uint8Array : Array, Nt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
768
+ for (var mt = 0, vi = Nt.length; mt < vi; ++mt)
769
+ ot[mt] = Nt[mt], rt[Nt.charCodeAt(mt)] = mt;
770
+ rt[45] = 62;
771
+ rt[95] = 63;
772
+ function Oe(i) {
744
773
  var r = i.length;
745
774
  if (r % 4 > 0)
746
775
  throw new Error("Invalid string. Length must be a multiple of 4");
@@ -749,40 +778,40 @@ function _e(i) {
749
778
  var p = o === r ? 0 : 4 - o % 4;
750
779
  return [o, p];
751
780
  }
752
- function hi(i) {
753
- var r = _e(i), o = r[0], p = r[1];
781
+ function Si(i) {
782
+ var r = Oe(i), o = r[0], p = r[1];
754
783
  return (o + p) * 3 / 4 - p;
755
784
  }
756
- function mi(i, r, o) {
785
+ function _i(i, r, o) {
757
786
  return (r + o) * 3 / 4 - o;
758
787
  }
759
- function xi(i) {
760
- var r, o = _e(i), p = o[0], u = o[1], f = new ui(mi(i, p, u)), c = 0, a = u > 0 ? p - 4 : p, h;
788
+ function Ai(i) {
789
+ var r, o = Oe(i), p = o[0], l = o[1], f = new bi(_i(i, p, l)), c = 0, a = l > 0 ? p - 4 : p, h;
761
790
  for (h = 0; h < a; h += 4)
762
- r = it[i.charCodeAt(h)] << 18 | it[i.charCodeAt(h + 1)] << 12 | it[i.charCodeAt(h + 2)] << 6 | it[i.charCodeAt(h + 3)], f[c++] = r >> 16 & 255, f[c++] = r >> 8 & 255, f[c++] = r & 255;
763
- return u === 2 && (r = it[i.charCodeAt(h)] << 2 | it[i.charCodeAt(h + 1)] >> 4, f[c++] = r & 255), u === 1 && (r = it[i.charCodeAt(h)] << 10 | it[i.charCodeAt(h + 1)] << 4 | it[i.charCodeAt(h + 2)] >> 2, f[c++] = r >> 8 & 255, f[c++] = r & 255), f;
764
- }
765
- function di(i) {
766
- return nt[i >> 18 & 63] + nt[i >> 12 & 63] + nt[i >> 6 & 63] + nt[i & 63];
767
- }
768
- function gi(i, r, o) {
769
- for (var p, u = [], f = r; f < o; f += 3)
770
- p = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), u.push(di(p));
771
- return u.join("");
772
- }
773
- function yi(i) {
774
- for (var r, o = i.length, p = o % 3, u = [], f = 16383, c = 0, a = o - p; c < a; c += f)
775
- u.push(gi(i, c, c + f > a ? a : c + f));
776
- return p === 1 ? (r = i[o - 1], u.push(
777
- nt[r >> 2] + nt[r << 4 & 63] + "=="
778
- )) : p === 2 && (r = (i[o - 2] << 8) + i[o - 1], u.push(
779
- nt[r >> 10] + nt[r >> 4 & 63] + nt[r << 2 & 63] + "="
780
- )), u.join("");
781
- }
782
- var Vt = {};
791
+ r = rt[i.charCodeAt(h)] << 18 | rt[i.charCodeAt(h + 1)] << 12 | rt[i.charCodeAt(h + 2)] << 6 | rt[i.charCodeAt(h + 3)], f[c++] = r >> 16 & 255, f[c++] = r >> 8 & 255, f[c++] = r & 255;
792
+ return l === 2 && (r = rt[i.charCodeAt(h)] << 2 | rt[i.charCodeAt(h + 1)] >> 4, f[c++] = r & 255), l === 1 && (r = rt[i.charCodeAt(h)] << 10 | rt[i.charCodeAt(h + 1)] << 4 | rt[i.charCodeAt(h + 2)] >> 2, f[c++] = r >> 8 & 255, f[c++] = r & 255), f;
793
+ }
794
+ function Fi(i) {
795
+ return ot[i >> 18 & 63] + ot[i >> 12 & 63] + ot[i >> 6 & 63] + ot[i & 63];
796
+ }
797
+ function Oi(i, r, o) {
798
+ for (var p, l = [], f = r; f < o; f += 3)
799
+ p = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), l.push(Fi(p));
800
+ return l.join("");
801
+ }
802
+ function Bi(i) {
803
+ for (var r, o = i.length, p = o % 3, l = [], f = 16383, c = 0, a = o - p; c < a; c += f)
804
+ l.push(Oi(i, c, c + f > a ? a : c + f));
805
+ return p === 1 ? (r = i[o - 1], l.push(
806
+ ot[r >> 2] + ot[r << 4 & 63] + "=="
807
+ )) : p === 2 && (r = (i[o - 2] << 8) + i[o - 1], l.push(
808
+ ot[r >> 10] + ot[r >> 4 & 63] + ot[r << 2 & 63] + "="
809
+ )), l.join("");
810
+ }
811
+ var Gt = {};
783
812
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
784
- Vt.read = function(i, r, o, p, u) {
785
- var f, c, a = u * 8 - p - 1, h = (1 << a) - 1, g = h >> 1, y = -7, b = o ? u - 1 : 0, F = o ? -1 : 1, j = i[r + b];
813
+ Gt.read = function(i, r, o, p, l) {
814
+ var f, c, a = l * 8 - p - 1, h = (1 << a) - 1, g = h >> 1, y = -7, b = o ? l - 1 : 0, F = o ? -1 : 1, j = i[r + b];
786
815
  for (b += F, f = j & (1 << -y) - 1, j >>= -y, y += a; y > 0; f = f * 256 + i[r + b], b += F, y -= 8)
787
816
  ;
788
817
  for (c = f & (1 << -y) - 1, f >>= -y, y += p; y > 0; c = c * 256 + i[r + b], b += F, y -= 8)
@@ -796,13 +825,13 @@ Vt.read = function(i, r, o, p, u) {
796
825
  }
797
826
  return (j ? -1 : 1) * c * Math.pow(2, f - p);
798
827
  };
799
- Vt.write = function(i, r, o, p, u, f) {
800
- var c, a, h, g = f * 8 - u - 1, y = (1 << g) - 1, b = y >> 1, F = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, j = p ? 0 : f - 1, $ = p ? 1 : -1, q = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
801
- for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, c = y) : (c = Math.floor(Math.log(r) / Math.LN2), r * (h = Math.pow(2, -c)) < 1 && (c--, h *= 2), c + b >= 1 ? r += F / h : r += F * Math.pow(2, 1 - b), r * h >= 2 && (c++, h /= 2), c + b >= y ? (a = 0, c = y) : c + b >= 1 ? (a = (r * h - 1) * Math.pow(2, u), c = c + b) : (a = r * Math.pow(2, b - 1) * Math.pow(2, u), c = 0)); u >= 8; i[o + j] = a & 255, j += $, a /= 256, u -= 8)
828
+ Gt.write = function(i, r, o, p, l, f) {
829
+ var c, a, h, g = f * 8 - l - 1, y = (1 << g) - 1, b = y >> 1, F = l === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, j = p ? 0 : f - 1, U = p ? 1 : -1, q = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
830
+ for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, c = y) : (c = Math.floor(Math.log(r) / Math.LN2), r * (h = Math.pow(2, -c)) < 1 && (c--, h *= 2), c + b >= 1 ? r += F / h : r += F * Math.pow(2, 1 - b), r * h >= 2 && (c++, h /= 2), c + b >= y ? (a = 0, c = y) : c + b >= 1 ? (a = (r * h - 1) * Math.pow(2, l), c = c + b) : (a = r * Math.pow(2, b - 1) * Math.pow(2, l), c = 0)); l >= 8; i[o + j] = a & 255, j += U, a /= 256, l -= 8)
802
831
  ;
803
- for (c = c << u | a, g += u; g > 0; i[o + j] = c & 255, j += $, c /= 256, g -= 8)
832
+ for (c = c << l | a, g += l; g > 0; i[o + j] = c & 255, j += U, c /= 256, g -= 8)
804
833
  ;
805
- i[o + j - $] |= q * 128;
834
+ i[o + j - U] |= q * 128;
806
835
  };
807
836
  /*!
808
837
  * The buffer module from node.js, for the browser.
@@ -811,10 +840,10 @@ Vt.write = function(i, r, o, p, u, f) {
811
840
  * @license MIT
812
841
  */
813
842
  (function(i) {
814
- var r = jt, o = Vt, p = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
843
+ var r = Tt, o = Gt, p = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
815
844
  i.Buffer = a, i.SlowBuffer = E, i.INSPECT_MAX_BYTES = 50;
816
- var u = 2147483647;
817
- i.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = f(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
845
+ var l = 2147483647;
846
+ i.kMaxLength = l, a.TYPED_ARRAY_SUPPORT = f(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
818
847
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
819
848
  );
820
849
  function f() {
@@ -841,7 +870,7 @@ Vt.write = function(i, r, o, p, u, f) {
841
870
  }
842
871
  });
843
872
  function c(n) {
844
- if (n > u)
873
+ if (n > l)
845
874
  throw new RangeError('The value "' + n + '" is invalid for option "size"');
846
875
  var t = new Uint8Array(n);
847
876
  return Object.setPrototypeOf(t, a.prototype), t;
@@ -861,12 +890,12 @@ Vt.write = function(i, r, o, p, u, f) {
861
890
  if (typeof n == "string")
862
891
  return F(n, t);
863
892
  if (ArrayBuffer.isView(n))
864
- return $(n);
893
+ return U(n);
865
894
  if (n == null)
866
895
  throw new TypeError(
867
896
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof n
868
897
  );
869
- if (rt(n, ArrayBuffer) || n && rt(n.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (rt(n, SharedArrayBuffer) || n && rt(n.buffer, SharedArrayBuffer)))
898
+ if (nt(n, ArrayBuffer) || n && nt(n.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (nt(n, SharedArrayBuffer) || n && nt(n.buffer, SharedArrayBuffer)))
870
899
  return q(n, t, e);
871
900
  if (typeof n == "number")
872
901
  throw new TypeError(
@@ -875,9 +904,9 @@ Vt.write = function(i, r, o, p, u, f) {
875
904
  var s = n.valueOf && n.valueOf();
876
905
  if (s != null && s !== n)
877
906
  return a.from(s, t, e);
878
- var l = Z(n);
879
- if (l)
880
- return l;
907
+ var u = Y(n);
908
+ if (u)
909
+ return u;
881
910
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof n[Symbol.toPrimitive] == "function")
882
911
  return a.from(
883
912
  n[Symbol.toPrimitive]("string"),
@@ -914,16 +943,16 @@ Vt.write = function(i, r, o, p, u, f) {
914
943
  function F(n, t) {
915
944
  if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
916
945
  throw new TypeError("Unknown encoding: " + t);
917
- var e = S(n, t) | 0, s = c(e), l = s.write(n, t);
918
- return l !== e && (s = s.slice(0, l)), s;
946
+ var e = v(n, t) | 0, s = c(e), u = s.write(n, t);
947
+ return u !== e && (s = s.slice(0, u)), s;
919
948
  }
920
949
  function j(n) {
921
950
  for (var t = n.length < 0 ? 0 : w(n.length) | 0, e = c(t), s = 0; s < t; s += 1)
922
951
  e[s] = n[s] & 255;
923
952
  return e;
924
953
  }
925
- function $(n) {
926
- if (rt(n, Uint8Array)) {
954
+ function U(n) {
955
+ if (nt(n, Uint8Array)) {
927
956
  var t = new Uint8Array(n);
928
957
  return q(t.buffer, t.byteOffset, t.byteLength);
929
958
  }
@@ -937,19 +966,19 @@ Vt.write = function(i, r, o, p, u, f) {
937
966
  var s;
938
967
  return t === void 0 && e === void 0 ? s = new Uint8Array(n) : e === void 0 ? s = new Uint8Array(n, t) : s = new Uint8Array(n, t, e), Object.setPrototypeOf(s, a.prototype), s;
939
968
  }
940
- function Z(n) {
969
+ function Y(n) {
941
970
  if (a.isBuffer(n)) {
942
971
  var t = w(n.length) | 0, e = c(t);
943
972
  return e.length === 0 || n.copy(e, 0, 0, t), e;
944
973
  }
945
974
  if (n.length !== void 0)
946
- return typeof n.length != "number" || Ct(n.length) ? c(0) : j(n);
975
+ return typeof n.length != "number" || $t(n.length) ? c(0) : j(n);
947
976
  if (n.type === "Buffer" && Array.isArray(n.data))
948
977
  return j(n.data);
949
978
  }
950
979
  function w(n) {
951
- if (n >= u)
952
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
980
+ if (n >= l)
981
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
953
982
  return n | 0;
954
983
  }
955
984
  function E(n) {
@@ -958,18 +987,18 @@ Vt.write = function(i, r, o, p, u, f) {
958
987
  a.isBuffer = function(t) {
959
988
  return t != null && t._isBuffer === !0 && t !== a.prototype;
960
989
  }, a.compare = function(t, e) {
961
- if (rt(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), rt(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
990
+ if (nt(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), nt(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
962
991
  throw new TypeError(
963
992
  'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
964
993
  );
965
994
  if (t === e)
966
995
  return 0;
967
- for (var s = t.length, l = e.length, x = 0, d = Math.min(s, l); x < d; ++x)
996
+ for (var s = t.length, u = e.length, x = 0, d = Math.min(s, u); x < d; ++x)
968
997
  if (t[x] !== e[x]) {
969
- s = t[x], l = e[x];
998
+ s = t[x], u = e[x];
970
999
  break;
971
1000
  }
972
- return s < l ? -1 : l < s ? 1 : 0;
1001
+ return s < u ? -1 : u < s ? 1 : 0;
973
1002
  }, a.isEncoding = function(t) {
974
1003
  switch (String(t).toLowerCase()) {
975
1004
  case "hex":
@@ -996,27 +1025,27 @@ Vt.write = function(i, r, o, p, u, f) {
996
1025
  if (e === void 0)
997
1026
  for (e = 0, s = 0; s < t.length; ++s)
998
1027
  e += t[s].length;
999
- var l = a.allocUnsafe(e), x = 0;
1028
+ var u = a.allocUnsafe(e), x = 0;
1000
1029
  for (s = 0; s < t.length; ++s) {
1001
1030
  var d = t[s];
1002
- if (rt(d, Uint8Array))
1003
- x + d.length > l.length ? a.from(d).copy(l, x) : Uint8Array.prototype.set.call(
1004
- l,
1031
+ if (nt(d, Uint8Array))
1032
+ x + d.length > u.length ? a.from(d).copy(u, x) : Uint8Array.prototype.set.call(
1033
+ u,
1005
1034
  d,
1006
1035
  x
1007
1036
  );
1008
1037
  else if (a.isBuffer(d))
1009
- d.copy(l, x);
1038
+ d.copy(u, x);
1010
1039
  else
1011
1040
  throw new TypeError('"list" argument must be an Array of Buffers');
1012
1041
  x += d.length;
1013
1042
  }
1014
- return l;
1043
+ return u;
1015
1044
  };
1016
- function S(n, t) {
1045
+ function v(n, t) {
1017
1046
  if (a.isBuffer(n))
1018
1047
  return n.length;
1019
- if (ArrayBuffer.isView(n) || rt(n, ArrayBuffer))
1048
+ if (ArrayBuffer.isView(n) || nt(n, ArrayBuffer))
1020
1049
  return n.byteLength;
1021
1050
  if (typeof n != "string")
1022
1051
  throw new TypeError(
@@ -1025,7 +1054,7 @@ Vt.write = function(i, r, o, p, u, f) {
1025
1054
  var e = n.length, s = arguments.length > 2 && arguments[2] === !0;
1026
1055
  if (!s && e === 0)
1027
1056
  return 0;
1028
- for (var l = !1; ; )
1057
+ for (var u = !1; ; )
1029
1058
  switch (t) {
1030
1059
  case "ascii":
1031
1060
  case "latin1":
@@ -1033,7 +1062,7 @@ Vt.write = function(i, r, o, p, u, f) {
1033
1062
  return e;
1034
1063
  case "utf8":
1035
1064
  case "utf-8":
1036
- return V(n).length;
1065
+ return X(n).length;
1037
1066
  case "ucs2":
1038
1067
  case "ucs-2":
1039
1068
  case "utf16le":
@@ -1042,15 +1071,15 @@ Vt.write = function(i, r, o, p, u, f) {
1042
1071
  case "hex":
1043
1072
  return e >>> 1;
1044
1073
  case "base64":
1045
- return ct(n).length;
1074
+ return lt(n).length;
1046
1075
  default:
1047
- if (l)
1048
- return s ? -1 : V(n).length;
1049
- t = ("" + t).toLowerCase(), l = !0;
1076
+ if (u)
1077
+ return s ? -1 : X(n).length;
1078
+ t = ("" + t).toLowerCase(), u = !0;
1050
1079
  }
1051
1080
  }
1052
- a.byteLength = S;
1053
- function R(n, t, e) {
1081
+ a.byteLength = v;
1082
+ function M(n, t, e) {
1054
1083
  var s = !1;
1055
1084
  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))
1056
1085
  return "";
@@ -1062,17 +1091,17 @@ Vt.write = function(i, r, o, p, u, f) {
1062
1091
  case "utf-8":
1063
1092
  return m(this, t, e);
1064
1093
  case "ascii":
1065
- return O(this, t, e);
1094
+ return B(this, t, e);
1066
1095
  case "latin1":
1067
1096
  case "binary":
1068
1097
  return C(this, t, e);
1069
1098
  case "base64":
1070
- return X(this, t, e);
1099
+ return W(this, t, e);
1071
1100
  case "ucs2":
1072
1101
  case "ucs-2":
1073
1102
  case "utf16le":
1074
1103
  case "utf-16le":
1075
- return k(this, t, e);
1104
+ return T(this, t, e);
1076
1105
  default:
1077
1106
  if (s)
1078
1107
  throw new TypeError("Unknown encoding: " + n);
@@ -1080,7 +1109,7 @@ Vt.write = function(i, r, o, p, u, f) {
1080
1109
  }
1081
1110
  }
1082
1111
  a.prototype._isBuffer = !0;
1083
- function H(n, t, e) {
1112
+ function J(n, t, e) {
1084
1113
  var s = n[t];
1085
1114
  n[t] = n[e], n[e] = s;
1086
1115
  }
@@ -1089,25 +1118,25 @@ Vt.write = function(i, r, o, p, u, f) {
1089
1118
  if (t % 2 !== 0)
1090
1119
  throw new RangeError("Buffer size must be a multiple of 16-bits");
1091
1120
  for (var e = 0; e < t; e += 2)
1092
- H(this, e, e + 1);
1121
+ J(this, e, e + 1);
1093
1122
  return this;
1094
1123
  }, a.prototype.swap32 = function() {
1095
1124
  var t = this.length;
1096
1125
  if (t % 4 !== 0)
1097
1126
  throw new RangeError("Buffer size must be a multiple of 32-bits");
1098
1127
  for (var e = 0; e < t; e += 4)
1099
- H(this, e, e + 3), H(this, e + 1, e + 2);
1128
+ J(this, e, e + 3), J(this, e + 1, e + 2);
1100
1129
  return this;
1101
1130
  }, a.prototype.swap64 = function() {
1102
1131
  var t = this.length;
1103
1132
  if (t % 8 !== 0)
1104
1133
  throw new RangeError("Buffer size must be a multiple of 64-bits");
1105
1134
  for (var e = 0; e < t; e += 8)
1106
- H(this, e, e + 7), H(this, e + 1, e + 6), H(this, e + 2, e + 5), H(this, e + 3, e + 4);
1135
+ J(this, e, e + 7), J(this, e + 1, e + 6), J(this, e + 2, e + 5), J(this, e + 3, e + 4);
1107
1136
  return this;
1108
1137
  }, a.prototype.toString = function() {
1109
1138
  var t = this.length;
1110
- return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) : R.apply(this, arguments);
1139
+ return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) : M.apply(this, arguments);
1111
1140
  }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
1112
1141
  if (!a.isBuffer(t))
1113
1142
  throw new TypeError("Argument must be a Buffer");
@@ -1115,69 +1144,69 @@ Vt.write = function(i, r, o, p, u, f) {
1115
1144
  }, a.prototype.inspect = function() {
1116
1145
  var t = "", e = i.INSPECT_MAX_BYTES;
1117
1146
  return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
1118
- }, p && (a.prototype[p] = a.prototype.inspect), a.prototype.compare = function(t, e, s, l, x) {
1119
- if (rt(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
1147
+ }, p && (a.prototype[p] = a.prototype.inspect), a.prototype.compare = function(t, e, s, u, x) {
1148
+ if (nt(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
1120
1149
  throw new TypeError(
1121
1150
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
1122
1151
  );
1123
- if (e === void 0 && (e = 0), s === void 0 && (s = t ? t.length : 0), l === void 0 && (l = 0), x === void 0 && (x = this.length), e < 0 || s > t.length || l < 0 || x > this.length)
1152
+ if (e === void 0 && (e = 0), s === void 0 && (s = t ? t.length : 0), u === void 0 && (u = 0), x === void 0 && (x = this.length), e < 0 || s > t.length || u < 0 || x > this.length)
1124
1153
  throw new RangeError("out of range index");
1125
- if (l >= x && e >= s)
1154
+ if (u >= x && e >= s)
1126
1155
  return 0;
1127
- if (l >= x)
1156
+ if (u >= x)
1128
1157
  return -1;
1129
1158
  if (e >= s)
1130
1159
  return 1;
1131
- if (e >>>= 0, s >>>= 0, l >>>= 0, x >>>= 0, this === t)
1160
+ if (e >>>= 0, s >>>= 0, u >>>= 0, x >>>= 0, this === t)
1132
1161
  return 0;
1133
- for (var d = x - l, D = s - e, N = Math.min(d, D), P = this.slice(l, x), G = t.slice(e, s), z = 0; z < N; ++z)
1134
- if (P[z] !== G[z]) {
1135
- d = P[z], D = G[z];
1162
+ for (var d = x - u, k = s - e, N = Math.min(d, k), P = this.slice(u, x), Z = t.slice(e, s), z = 0; z < N; ++z)
1163
+ if (P[z] !== Z[z]) {
1164
+ d = P[z], k = Z[z];
1136
1165
  break;
1137
1166
  }
1138
- return d < D ? -1 : D < d ? 1 : 0;
1167
+ return d < k ? -1 : k < d ? 1 : 0;
1139
1168
  };
1140
- function W(n, t, e, s, l) {
1169
+ function V(n, t, e, s, u) {
1141
1170
  if (n.length === 0)
1142
1171
  return -1;
1143
- if (typeof e == "string" ? (s = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, Ct(e) && (e = l ? 0 : n.length - 1), e < 0 && (e = n.length + e), e >= n.length) {
1144
- if (l)
1172
+ if (typeof e == "string" ? (s = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, $t(e) && (e = u ? 0 : n.length - 1), e < 0 && (e = n.length + e), e >= n.length) {
1173
+ if (u)
1145
1174
  return -1;
1146
1175
  e = n.length - 1;
1147
1176
  } else if (e < 0)
1148
- if (l)
1177
+ if (u)
1149
1178
  e = 0;
1150
1179
  else
1151
1180
  return -1;
1152
1181
  if (typeof t == "string" && (t = a.from(t, s)), a.isBuffer(t))
1153
- return t.length === 0 ? -1 : M(n, t, e, s, l);
1182
+ return t.length === 0 ? -1 : R(n, t, e, s, u);
1154
1183
  if (typeof t == "number")
1155
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) : M(n, [t], e, s, l);
1184
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? u ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) : R(n, [t], e, s, u);
1156
1185
  throw new TypeError("val must be string, number or Buffer");
1157
1186
  }
1158
- function M(n, t, e, s, l) {
1159
- var x = 1, d = n.length, D = t.length;
1187
+ function R(n, t, e, s, u) {
1188
+ var x = 1, d = n.length, k = t.length;
1160
1189
  if (s !== void 0 && (s = String(s).toLowerCase(), s === "ucs2" || s === "ucs-2" || s === "utf16le" || s === "utf-16le")) {
1161
1190
  if (n.length < 2 || t.length < 2)
1162
1191
  return -1;
1163
- x = 2, d /= 2, D /= 2, e /= 2;
1192
+ x = 2, d /= 2, k /= 2, e /= 2;
1164
1193
  }
1165
- function N(ee, ie) {
1166
- return x === 1 ? ee[ie] : ee.readUInt16BE(ie * x);
1194
+ function N(re, ne) {
1195
+ return x === 1 ? re[ne] : re.readUInt16BE(ne * x);
1167
1196
  }
1168
1197
  var P;
1169
- if (l) {
1170
- var G = -1;
1198
+ if (u) {
1199
+ var Z = -1;
1171
1200
  for (P = e; P < d; P++)
1172
- if (N(n, P) === N(t, G === -1 ? 0 : P - G)) {
1173
- if (G === -1 && (G = P), P - G + 1 === D)
1174
- return G * x;
1201
+ if (N(n, P) === N(t, Z === -1 ? 0 : P - Z)) {
1202
+ if (Z === -1 && (Z = P), P - Z + 1 === k)
1203
+ return Z * x;
1175
1204
  } else
1176
- G !== -1 && (P -= P - G), G = -1;
1205
+ Z !== -1 && (P -= P - Z), Z = -1;
1177
1206
  } else
1178
- for (e + D > d && (e = d - D), P = e; P >= 0; P--) {
1179
- for (var z = !0, _t = 0; _t < D; _t++)
1180
- if (N(n, P + _t) !== N(t, _t)) {
1207
+ for (e + k > d && (e = d - k), P = e; P >= 0; P--) {
1208
+ for (var z = !0, At = 0; At < k; At++)
1209
+ if (N(n, P + At) !== N(t, At)) {
1181
1210
  z = !1;
1182
1211
  break;
1183
1212
  }
@@ -1189,43 +1218,43 @@ Vt.write = function(i, r, o, p, u, f) {
1189
1218
  a.prototype.includes = function(t, e, s) {
1190
1219
  return this.indexOf(t, e, s) !== -1;
1191
1220
  }, a.prototype.indexOf = function(t, e, s) {
1192
- return W(this, t, e, s, !0);
1221
+ return V(this, t, e, s, !0);
1193
1222
  }, a.prototype.lastIndexOf = function(t, e, s) {
1194
- return W(this, t, e, s, !1);
1223
+ return V(this, t, e, s, !1);
1195
1224
  };
1196
- function ut(n, t, e, s) {
1225
+ function ft(n, t, e, s) {
1197
1226
  e = Number(e) || 0;
1198
- var l = n.length - e;
1199
- s ? (s = Number(s), s > l && (s = l)) : s = l;
1227
+ var u = n.length - e;
1228
+ s ? (s = Number(s), s > u && (s = u)) : s = u;
1200
1229
  var x = t.length;
1201
1230
  s > x / 2 && (s = x / 2);
1202
1231
  for (var d = 0; d < s; ++d) {
1203
- var D = parseInt(t.substr(d * 2, 2), 16);
1204
- if (Ct(D))
1232
+ var k = parseInt(t.substr(d * 2, 2), 16);
1233
+ if ($t(k))
1205
1234
  return d;
1206
- n[e + d] = D;
1235
+ n[e + d] = k;
1207
1236
  }
1208
1237
  return d;
1209
1238
  }
1210
- function ft(n, t, e, s) {
1211
- return vt(V(t, n.length - e), n, e, s);
1212
- }
1213
- function st(n, t, e, s) {
1214
- return vt(Q(t), n, e, s);
1239
+ function ht(n, t, e, s) {
1240
+ return _t(X(t, n.length - e), n, e, s);
1215
1241
  }
1216
1242
  function pt(n, t, e, s) {
1217
- return vt(ct(t), n, e, s);
1243
+ return _t(tt(t), n, e, s);
1218
1244
  }
1219
- function Dt(n, t, e, s) {
1220
- return vt(tt(t, n.length - e), n, e, s);
1245
+ function ct(n, t, e, s) {
1246
+ return _t(lt(t), n, e, s);
1221
1247
  }
1222
- a.prototype.write = function(t, e, s, l) {
1248
+ function Ct(n, t, e, s) {
1249
+ return _t(et(t, n.length - e), n, e, s);
1250
+ }
1251
+ a.prototype.write = function(t, e, s, u) {
1223
1252
  if (e === void 0)
1224
- l = "utf8", s = this.length, e = 0;
1253
+ u = "utf8", s = this.length, e = 0;
1225
1254
  else if (s === void 0 && typeof e == "string")
1226
- l = e, s = this.length, e = 0;
1255
+ u = e, s = this.length, e = 0;
1227
1256
  else if (isFinite(e))
1228
- e = e >>> 0, isFinite(s) ? (s = s >>> 0, l === void 0 && (l = "utf8")) : (l = s, s = void 0);
1257
+ e = e >>> 0, isFinite(s) ? (s = s >>> 0, u === void 0 && (u = "utf8")) : (u = s, s = void 0);
1229
1258
  else
1230
1259
  throw new Error(
1231
1260
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
@@ -1233,29 +1262,29 @@ Vt.write = function(i, r, o, p, u, f) {
1233
1262
  var x = this.length - e;
1234
1263
  if ((s === void 0 || s > x) && (s = x), t.length > 0 && (s < 0 || e < 0) || e > this.length)
1235
1264
  throw new RangeError("Attempt to write outside buffer bounds");
1236
- l || (l = "utf8");
1265
+ u || (u = "utf8");
1237
1266
  for (var d = !1; ; )
1238
- switch (l) {
1267
+ switch (u) {
1239
1268
  case "hex":
1240
- return ut(this, t, e, s);
1269
+ return ft(this, t, e, s);
1241
1270
  case "utf8":
1242
1271
  case "utf-8":
1243
- return ft(this, t, e, s);
1272
+ return ht(this, t, e, s);
1244
1273
  case "ascii":
1245
1274
  case "latin1":
1246
1275
  case "binary":
1247
- return st(this, t, e, s);
1248
- case "base64":
1249
1276
  return pt(this, t, e, s);
1277
+ case "base64":
1278
+ return ct(this, t, e, s);
1250
1279
  case "ucs2":
1251
1280
  case "ucs-2":
1252
1281
  case "utf16le":
1253
1282
  case "utf-16le":
1254
- return Dt(this, t, e, s);
1283
+ return Ct(this, t, e, s);
1255
1284
  default:
1256
1285
  if (d)
1257
- throw new TypeError("Unknown encoding: " + l);
1258
- l = ("" + l).toLowerCase(), d = !0;
1286
+ throw new TypeError("Unknown encoding: " + u);
1287
+ u = ("" + u).toLowerCase(), d = !0;
1259
1288
  }
1260
1289
  }, a.prototype.toJSON = function() {
1261
1290
  return {
@@ -1263,161 +1292,161 @@ Vt.write = function(i, r, o, p, u, f) {
1263
1292
  data: Array.prototype.slice.call(this._arr || this, 0)
1264
1293
  };
1265
1294
  };
1266
- function X(n, t, e) {
1295
+ function W(n, t, e) {
1267
1296
  return t === 0 && e === n.length ? r.fromByteArray(n) : r.fromByteArray(n.slice(t, e));
1268
1297
  }
1269
1298
  function m(n, t, e) {
1270
1299
  e = Math.min(n.length, e);
1271
- for (var s = [], l = t; l < e; ) {
1272
- var x = n[l], d = null, D = x > 239 ? 4 : x > 223 ? 3 : x > 191 ? 2 : 1;
1273
- if (l + D <= e) {
1274
- var N, P, G, z;
1275
- switch (D) {
1300
+ for (var s = [], u = t; u < e; ) {
1301
+ var x = n[u], d = null, k = x > 239 ? 4 : x > 223 ? 3 : x > 191 ? 2 : 1;
1302
+ if (u + k <= e) {
1303
+ var N, P, Z, z;
1304
+ switch (k) {
1276
1305
  case 1:
1277
1306
  x < 128 && (d = x);
1278
1307
  break;
1279
1308
  case 2:
1280
- N = n[l + 1], (N & 192) === 128 && (z = (x & 31) << 6 | N & 63, z > 127 && (d = z));
1309
+ N = n[u + 1], (N & 192) === 128 && (z = (x & 31) << 6 | N & 63, z > 127 && (d = z));
1281
1310
  break;
1282
1311
  case 3:
1283
- N = n[l + 1], P = n[l + 2], (N & 192) === 128 && (P & 192) === 128 && (z = (x & 15) << 12 | (N & 63) << 6 | P & 63, z > 2047 && (z < 55296 || z > 57343) && (d = z));
1312
+ N = n[u + 1], P = n[u + 2], (N & 192) === 128 && (P & 192) === 128 && (z = (x & 15) << 12 | (N & 63) << 6 | P & 63, z > 2047 && (z < 55296 || z > 57343) && (d = z));
1284
1313
  break;
1285
1314
  case 4:
1286
- N = n[l + 1], P = n[l + 2], G = n[l + 3], (N & 192) === 128 && (P & 192) === 128 && (G & 192) === 128 && (z = (x & 15) << 18 | (N & 63) << 12 | (P & 63) << 6 | G & 63, z > 65535 && z < 1114112 && (d = z));
1315
+ N = n[u + 1], P = n[u + 2], Z = n[u + 3], (N & 192) === 128 && (P & 192) === 128 && (Z & 192) === 128 && (z = (x & 15) << 18 | (N & 63) << 12 | (P & 63) << 6 | Z & 63, z > 65535 && z < 1114112 && (d = z));
1287
1316
  }
1288
1317
  }
1289
- d === null ? (d = 65533, D = 1) : d > 65535 && (d -= 65536, s.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), s.push(d), l += D;
1318
+ d === null ? (d = 65533, k = 1) : d > 65535 && (d -= 65536, s.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), s.push(d), u += k;
1290
1319
  }
1291
- return T(s);
1320
+ return D(s);
1292
1321
  }
1293
- var v = 4096;
1294
- function T(n) {
1322
+ var S = 4096;
1323
+ function D(n) {
1295
1324
  var t = n.length;
1296
- if (t <= v)
1325
+ if (t <= S)
1297
1326
  return String.fromCharCode.apply(String, n);
1298
1327
  for (var e = "", s = 0; s < t; )
1299
1328
  e += String.fromCharCode.apply(
1300
1329
  String,
1301
- n.slice(s, s += v)
1330
+ n.slice(s, s += S)
1302
1331
  );
1303
1332
  return e;
1304
1333
  }
1305
- function O(n, t, e) {
1334
+ function B(n, t, e) {
1306
1335
  var s = "";
1307
1336
  e = Math.min(n.length, e);
1308
- for (var l = t; l < e; ++l)
1309
- s += String.fromCharCode(n[l] & 127);
1337
+ for (var u = t; u < e; ++u)
1338
+ s += String.fromCharCode(n[u] & 127);
1310
1339
  return s;
1311
1340
  }
1312
1341
  function C(n, t, e) {
1313
1342
  var s = "";
1314
1343
  e = Math.min(n.length, e);
1315
- for (var l = t; l < e; ++l)
1316
- s += String.fromCharCode(n[l]);
1344
+ for (var u = t; u < e; ++u)
1345
+ s += String.fromCharCode(n[u]);
1317
1346
  return s;
1318
1347
  }
1319
1348
  function A(n, t, e) {
1320
1349
  var s = n.length;
1321
1350
  (!t || t < 0) && (t = 0), (!e || e < 0 || e > s) && (e = s);
1322
- for (var l = "", x = t; x < e; ++x)
1323
- l += We[n[x]];
1324
- return l;
1351
+ for (var u = "", x = t; x < e; ++x)
1352
+ u += Ze[n[x]];
1353
+ return u;
1325
1354
  }
1326
- function k(n, t, e) {
1327
- for (var s = n.slice(t, e), l = "", x = 0; x < s.length - 1; x += 2)
1328
- l += String.fromCharCode(s[x] + s[x + 1] * 256);
1329
- return l;
1355
+ function T(n, t, e) {
1356
+ for (var s = n.slice(t, e), u = "", x = 0; x < s.length - 1; x += 2)
1357
+ u += String.fromCharCode(s[x] + s[x + 1] * 256);
1358
+ return u;
1330
1359
  }
1331
1360
  a.prototype.slice = function(t, e) {
1332
1361
  var s = this.length;
1333
1362
  t = ~~t, e = e === void 0 ? s : ~~e, t < 0 ? (t += s, t < 0 && (t = 0)) : t > s && (t = s), e < 0 ? (e += s, e < 0 && (e = 0)) : e > s && (e = s), e < t && (e = t);
1334
- var l = this.subarray(t, e);
1335
- return Object.setPrototypeOf(l, a.prototype), l;
1363
+ var u = this.subarray(t, e);
1364
+ return Object.setPrototypeOf(u, a.prototype), u;
1336
1365
  };
1337
- function B(n, t, e) {
1366
+ function O(n, t, e) {
1338
1367
  if (n % 1 !== 0 || n < 0)
1339
1368
  throw new RangeError("offset is not uint");
1340
1369
  if (n + t > e)
1341
1370
  throw new RangeError("Trying to access beyond buffer length");
1342
1371
  }
1343
1372
  a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, s) {
1344
- t = t >>> 0, e = e >>> 0, s || B(t, e, this.length);
1345
- for (var l = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
1346
- l += this[t + d] * x;
1347
- return l;
1373
+ t = t >>> 0, e = e >>> 0, s || O(t, e, this.length);
1374
+ for (var u = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
1375
+ u += this[t + d] * x;
1376
+ return u;
1348
1377
  }, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, s) {
1349
- t = t >>> 0, e = e >>> 0, s || B(t, e, this.length);
1350
- for (var l = this[t + --e], x = 1; e > 0 && (x *= 256); )
1351
- l += this[t + --e] * x;
1352
- return l;
1378
+ t = t >>> 0, e = e >>> 0, s || O(t, e, this.length);
1379
+ for (var u = this[t + --e], x = 1; e > 0 && (x *= 256); )
1380
+ u += this[t + --e] * x;
1381
+ return u;
1353
1382
  }, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
1354
- return t = t >>> 0, e || B(t, 1, this.length), this[t];
1383
+ return t = t >>> 0, e || O(t, 1, this.length), this[t];
1355
1384
  }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(t, e) {
1356
- return t = t >>> 0, e || B(t, 2, this.length), this[t] | this[t + 1] << 8;
1385
+ return t = t >>> 0, e || O(t, 2, this.length), this[t] | this[t + 1] << 8;
1357
1386
  }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(t, e) {
1358
- return t = t >>> 0, e || B(t, 2, this.length), this[t] << 8 | this[t + 1];
1387
+ return t = t >>> 0, e || O(t, 2, this.length), this[t] << 8 | this[t + 1];
1359
1388
  }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(t, e) {
1360
- return t = t >>> 0, e || B(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1389
+ return t = t >>> 0, e || O(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1361
1390
  }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(t, e) {
1362
- return t = t >>> 0, e || B(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1391
+ return t = t >>> 0, e || O(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1363
1392
  }, a.prototype.readIntLE = function(t, e, s) {
1364
- t = t >>> 0, e = e >>> 0, s || B(t, e, this.length);
1365
- for (var l = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
1366
- l += this[t + d] * x;
1367
- return x *= 128, l >= x && (l -= Math.pow(2, 8 * e)), l;
1393
+ t = t >>> 0, e = e >>> 0, s || O(t, e, this.length);
1394
+ for (var u = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
1395
+ u += this[t + d] * x;
1396
+ return x *= 128, u >= x && (u -= Math.pow(2, 8 * e)), u;
1368
1397
  }, a.prototype.readIntBE = function(t, e, s) {
1369
- t = t >>> 0, e = e >>> 0, s || B(t, e, this.length);
1370
- for (var l = e, x = 1, d = this[t + --l]; l > 0 && (x *= 256); )
1371
- d += this[t + --l] * x;
1398
+ t = t >>> 0, e = e >>> 0, s || O(t, e, this.length);
1399
+ for (var u = e, x = 1, d = this[t + --u]; u > 0 && (x *= 256); )
1400
+ d += this[t + --u] * x;
1372
1401
  return x *= 128, d >= x && (d -= Math.pow(2, 8 * e)), d;
1373
1402
  }, a.prototype.readInt8 = function(t, e) {
1374
- return t = t >>> 0, e || B(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1403
+ return t = t >>> 0, e || O(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1375
1404
  }, a.prototype.readInt16LE = function(t, e) {
1376
- t = t >>> 0, e || B(t, 2, this.length);
1405
+ t = t >>> 0, e || O(t, 2, this.length);
1377
1406
  var s = this[t] | this[t + 1] << 8;
1378
1407
  return s & 32768 ? s | 4294901760 : s;
1379
1408
  }, a.prototype.readInt16BE = function(t, e) {
1380
- t = t >>> 0, e || B(t, 2, this.length);
1409
+ t = t >>> 0, e || O(t, 2, this.length);
1381
1410
  var s = this[t + 1] | this[t] << 8;
1382
1411
  return s & 32768 ? s | 4294901760 : s;
1383
1412
  }, a.prototype.readInt32LE = function(t, e) {
1384
- return t = t >>> 0, e || B(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1413
+ return t = t >>> 0, e || O(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1385
1414
  }, a.prototype.readInt32BE = function(t, e) {
1386
- return t = t >>> 0, e || B(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1415
+ return t = t >>> 0, e || O(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1387
1416
  }, a.prototype.readFloatLE = function(t, e) {
1388
- return t = t >>> 0, e || B(t, 4, this.length), o.read(this, t, !0, 23, 4);
1417
+ return t = t >>> 0, e || O(t, 4, this.length), o.read(this, t, !0, 23, 4);
1389
1418
  }, a.prototype.readFloatBE = function(t, e) {
1390
- return t = t >>> 0, e || B(t, 4, this.length), o.read(this, t, !1, 23, 4);
1419
+ return t = t >>> 0, e || O(t, 4, this.length), o.read(this, t, !1, 23, 4);
1391
1420
  }, a.prototype.readDoubleLE = function(t, e) {
1392
- return t = t >>> 0, e || B(t, 8, this.length), o.read(this, t, !0, 52, 8);
1421
+ return t = t >>> 0, e || O(t, 8, this.length), o.read(this, t, !0, 52, 8);
1393
1422
  }, a.prototype.readDoubleBE = function(t, e) {
1394
- return t = t >>> 0, e || B(t, 8, this.length), o.read(this, t, !1, 52, 8);
1423
+ return t = t >>> 0, e || O(t, 8, this.length), o.read(this, t, !1, 52, 8);
1395
1424
  };
1396
- function I(n, t, e, s, l, x) {
1425
+ function I(n, t, e, s, u, x) {
1397
1426
  if (!a.isBuffer(n))
1398
1427
  throw new TypeError('"buffer" argument must be a Buffer instance');
1399
- if (t > l || t < x)
1428
+ if (t > u || t < x)
1400
1429
  throw new RangeError('"value" argument is out of bounds');
1401
1430
  if (e + s > n.length)
1402
1431
  throw new RangeError("Index out of range");
1403
1432
  }
1404
- a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, s, l) {
1405
- if (t = +t, e = e >>> 0, s = s >>> 0, !l) {
1433
+ a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, s, u) {
1434
+ if (t = +t, e = e >>> 0, s = s >>> 0, !u) {
1406
1435
  var x = Math.pow(2, 8 * s) - 1;
1407
1436
  I(this, t, e, s, x, 0);
1408
1437
  }
1409
- var d = 1, D = 0;
1410
- for (this[e] = t & 255; ++D < s && (d *= 256); )
1411
- this[e + D] = t / d & 255;
1438
+ var d = 1, k = 0;
1439
+ for (this[e] = t & 255; ++k < s && (d *= 256); )
1440
+ this[e + k] = t / d & 255;
1412
1441
  return e + s;
1413
- }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, s, l) {
1414
- if (t = +t, e = e >>> 0, s = s >>> 0, !l) {
1442
+ }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, s, u) {
1443
+ if (t = +t, e = e >>> 0, s = s >>> 0, !u) {
1415
1444
  var x = Math.pow(2, 8 * s) - 1;
1416
1445
  I(this, t, e, s, x, 0);
1417
1446
  }
1418
- var d = s - 1, D = 1;
1419
- for (this[e + d] = t & 255; --d >= 0 && (D *= 256); )
1420
- this[e + d] = t / D & 255;
1447
+ var d = s - 1, k = 1;
1448
+ for (this[e + d] = t & 255; --d >= 0 && (k *= 256); )
1449
+ this[e + d] = t / k & 255;
1421
1450
  return e + s;
1422
1451
  }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, s) {
1423
1452
  return t = +t, e = e >>> 0, s || I(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
@@ -1429,23 +1458,23 @@ Vt.write = function(i, r, o, p, u, f) {
1429
1458
  return t = +t, e = e >>> 0, s || I(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
1430
1459
  }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, s) {
1431
1460
  return t = +t, e = e >>> 0, s || I(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1432
- }, a.prototype.writeIntLE = function(t, e, s, l) {
1433
- if (t = +t, e = e >>> 0, !l) {
1461
+ }, a.prototype.writeIntLE = function(t, e, s, u) {
1462
+ if (t = +t, e = e >>> 0, !u) {
1434
1463
  var x = Math.pow(2, 8 * s - 1);
1435
1464
  I(this, t, e, s, x - 1, -x);
1436
1465
  }
1437
- var d = 0, D = 1, N = 0;
1438
- for (this[e] = t & 255; ++d < s && (D *= 256); )
1439
- t < 0 && N === 0 && this[e + d - 1] !== 0 && (N = 1), this[e + d] = (t / D >> 0) - N & 255;
1466
+ var d = 0, k = 1, N = 0;
1467
+ for (this[e] = t & 255; ++d < s && (k *= 256); )
1468
+ t < 0 && N === 0 && this[e + d - 1] !== 0 && (N = 1), this[e + d] = (t / k >> 0) - N & 255;
1440
1469
  return e + s;
1441
- }, a.prototype.writeIntBE = function(t, e, s, l) {
1442
- if (t = +t, e = e >>> 0, !l) {
1470
+ }, a.prototype.writeIntBE = function(t, e, s, u) {
1471
+ if (t = +t, e = e >>> 0, !u) {
1443
1472
  var x = Math.pow(2, 8 * s - 1);
1444
1473
  I(this, t, e, s, x - 1, -x);
1445
1474
  }
1446
- var d = s - 1, D = 1, N = 0;
1447
- for (this[e + d] = t & 255; --d >= 0 && (D *= 256); )
1448
- t < 0 && N === 0 && this[e + d + 1] !== 0 && (N = 1), this[e + d] = (t / D >> 0) - N & 255;
1475
+ var d = s - 1, k = 1, N = 0;
1476
+ for (this[e + d] = t & 255; --d >= 0 && (k *= 256); )
1477
+ t < 0 && N === 0 && this[e + d + 1] !== 0 && (N = 1), this[e + d] = (t / k >> 0) - N & 255;
1449
1478
  return e + s;
1450
1479
  }, a.prototype.writeInt8 = function(t, e, s) {
1451
1480
  return t = +t, e = e >>> 0, s || I(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
@@ -1458,54 +1487,54 @@ Vt.write = function(i, r, o, p, u, f) {
1458
1487
  }, a.prototype.writeInt32BE = function(t, e, s) {
1459
1488
  return t = +t, e = e >>> 0, s || I(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;
1460
1489
  };
1461
- function L(n, t, e, s, l, x) {
1490
+ function L(n, t, e, s, u, x) {
1462
1491
  if (e + s > n.length)
1463
1492
  throw new RangeError("Index out of range");
1464
1493
  if (e < 0)
1465
1494
  throw new RangeError("Index out of range");
1466
1495
  }
1467
- function J(n, t, e, s, l) {
1468
- return t = +t, e = e >>> 0, l || L(n, t, e, 4), o.write(n, t, e, s, 23, 4), e + 4;
1496
+ function H(n, t, e, s, u) {
1497
+ return t = +t, e = e >>> 0, u || L(n, t, e, 4), o.write(n, t, e, s, 23, 4), e + 4;
1469
1498
  }
1470
1499
  a.prototype.writeFloatLE = function(t, e, s) {
1471
- return J(this, t, e, !0, s);
1500
+ return H(this, t, e, !0, s);
1472
1501
  }, a.prototype.writeFloatBE = function(t, e, s) {
1473
- return J(this, t, e, !1, s);
1502
+ return H(this, t, e, !1, s);
1474
1503
  };
1475
- function U(n, t, e, s, l) {
1476
- return t = +t, e = e >>> 0, l || L(n, t, e, 8), o.write(n, t, e, s, 52, 8), e + 8;
1504
+ function $(n, t, e, s, u) {
1505
+ return t = +t, e = e >>> 0, u || L(n, t, e, 8), o.write(n, t, e, s, 52, 8), e + 8;
1477
1506
  }
1478
1507
  a.prototype.writeDoubleLE = function(t, e, s) {
1479
- return U(this, t, e, !0, s);
1508
+ return $(this, t, e, !0, s);
1480
1509
  }, a.prototype.writeDoubleBE = function(t, e, s) {
1481
- return U(this, t, e, !1, s);
1482
- }, a.prototype.copy = function(t, e, s, l) {
1510
+ return $(this, t, e, !1, s);
1511
+ }, a.prototype.copy = function(t, e, s, u) {
1483
1512
  if (!a.isBuffer(t))
1484
1513
  throw new TypeError("argument should be a Buffer");
1485
- if (s || (s = 0), !l && l !== 0 && (l = this.length), e >= t.length && (e = t.length), e || (e = 0), l > 0 && l < s && (l = s), l === s || t.length === 0 || this.length === 0)
1514
+ if (s || (s = 0), !u && u !== 0 && (u = this.length), e >= t.length && (e = t.length), e || (e = 0), u > 0 && u < s && (u = s), u === s || t.length === 0 || this.length === 0)
1486
1515
  return 0;
1487
1516
  if (e < 0)
1488
1517
  throw new RangeError("targetStart out of bounds");
1489
1518
  if (s < 0 || s >= this.length)
1490
1519
  throw new RangeError("Index out of range");
1491
- if (l < 0)
1520
+ if (u < 0)
1492
1521
  throw new RangeError("sourceEnd out of bounds");
1493
- l > this.length && (l = this.length), t.length - e < l - s && (l = t.length - e + s);
1494
- var x = l - s;
1495
- return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, s, l) : Uint8Array.prototype.set.call(
1522
+ u > this.length && (u = this.length), t.length - e < u - s && (u = t.length - e + s);
1523
+ var x = u - s;
1524
+ return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, s, u) : Uint8Array.prototype.set.call(
1496
1525
  t,
1497
- this.subarray(s, l),
1526
+ this.subarray(s, u),
1498
1527
  e
1499
1528
  ), x;
1500
- }, a.prototype.fill = function(t, e, s, l) {
1529
+ }, a.prototype.fill = function(t, e, s, u) {
1501
1530
  if (typeof t == "string") {
1502
- if (typeof e == "string" ? (l = e, e = 0, s = this.length) : typeof s == "string" && (l = s, s = this.length), l !== void 0 && typeof l != "string")
1531
+ if (typeof e == "string" ? (u = e, e = 0, s = this.length) : typeof s == "string" && (u = s, s = this.length), u !== void 0 && typeof u != "string")
1503
1532
  throw new TypeError("encoding must be a string");
1504
- if (typeof l == "string" && !a.isEncoding(l))
1505
- throw new TypeError("Unknown encoding: " + l);
1533
+ if (typeof u == "string" && !a.isEncoding(u))
1534
+ throw new TypeError("Unknown encoding: " + u);
1506
1535
  if (t.length === 1) {
1507
1536
  var x = t.charCodeAt(0);
1508
- (l === "utf8" && x < 128 || l === "latin1") && (t = x);
1537
+ (u === "utf8" && x < 128 || u === "latin1") && (t = x);
1509
1538
  }
1510
1539
  } else
1511
1540
  typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
@@ -1519,27 +1548,27 @@ Vt.write = function(i, r, o, p, u, f) {
1519
1548
  for (d = e; d < s; ++d)
1520
1549
  this[d] = t;
1521
1550
  else {
1522
- var D = a.isBuffer(t) ? t : a.from(t, l), N = D.length;
1551
+ var k = a.isBuffer(t) ? t : a.from(t, u), N = k.length;
1523
1552
  if (N === 0)
1524
1553
  throw new TypeError('The value "' + t + '" is invalid for argument "value"');
1525
1554
  for (d = 0; d < s - e; ++d)
1526
- this[d + e] = D[d % N];
1555
+ this[d + e] = k[d % N];
1527
1556
  }
1528
1557
  return this;
1529
1558
  };
1530
1559
  var K = /[^+/0-9A-Za-z-_]/g;
1531
- function Y(n) {
1560
+ function Q(n) {
1532
1561
  if (n = n.split("=")[0], n = n.trim().replace(K, ""), n.length < 2)
1533
1562
  return "";
1534
1563
  for (; n.length % 4 !== 0; )
1535
1564
  n = n + "=";
1536
1565
  return n;
1537
1566
  }
1538
- function V(n, t) {
1567
+ function X(n, t) {
1539
1568
  t = t || 1 / 0;
1540
- for (var e, s = n.length, l = null, x = [], d = 0; d < s; ++d) {
1569
+ for (var e, s = n.length, u = null, x = [], d = 0; d < s; ++d) {
1541
1570
  if (e = n.charCodeAt(d), e > 55295 && e < 57344) {
1542
- if (!l) {
1571
+ if (!u) {
1543
1572
  if (e > 56319) {
1544
1573
  (t -= 3) > -1 && x.push(239, 191, 189);
1545
1574
  continue;
@@ -1547,17 +1576,17 @@ Vt.write = function(i, r, o, p, u, f) {
1547
1576
  (t -= 3) > -1 && x.push(239, 191, 189);
1548
1577
  continue;
1549
1578
  }
1550
- l = e;
1579
+ u = e;
1551
1580
  continue;
1552
1581
  }
1553
1582
  if (e < 56320) {
1554
- (t -= 3) > -1 && x.push(239, 191, 189), l = e;
1583
+ (t -= 3) > -1 && x.push(239, 191, 189), u = e;
1555
1584
  continue;
1556
1585
  }
1557
- e = (l - 55296 << 10 | e - 56320) + 65536;
1586
+ e = (u - 55296 << 10 | e - 56320) + 65536;
1558
1587
  } else
1559
- l && (t -= 3) > -1 && x.push(239, 191, 189);
1560
- if (l = null, e < 128) {
1588
+ u && (t -= 3) > -1 && x.push(239, 191, 189);
1589
+ if (u = null, e < 128) {
1561
1590
  if ((t -= 1) < 0)
1562
1591
  break;
1563
1592
  x.push(e);
@@ -1590,49 +1619,49 @@ Vt.write = function(i, r, o, p, u, f) {
1590
1619
  }
1591
1620
  return x;
1592
1621
  }
1593
- function Q(n) {
1622
+ function tt(n) {
1594
1623
  for (var t = [], e = 0; e < n.length; ++e)
1595
1624
  t.push(n.charCodeAt(e) & 255);
1596
1625
  return t;
1597
1626
  }
1598
- function tt(n, t) {
1599
- for (var e, s, l, x = [], d = 0; d < n.length && !((t -= 2) < 0); ++d)
1600
- e = n.charCodeAt(d), s = e >> 8, l = e % 256, x.push(l), x.push(s);
1627
+ function et(n, t) {
1628
+ for (var e, s, u, x = [], d = 0; d < n.length && !((t -= 2) < 0); ++d)
1629
+ e = n.charCodeAt(d), s = e >> 8, u = e % 256, x.push(u), x.push(s);
1601
1630
  return x;
1602
1631
  }
1603
- function ct(n) {
1604
- return r.toByteArray(Y(n));
1632
+ function lt(n) {
1633
+ return r.toByteArray(Q(n));
1605
1634
  }
1606
- function vt(n, t, e, s) {
1607
- for (var l = 0; l < s && !(l + e >= t.length || l >= n.length); ++l)
1608
- t[l + e] = n[l];
1609
- return l;
1635
+ function _t(n, t, e, s) {
1636
+ for (var u = 0; u < s && !(u + e >= t.length || u >= n.length); ++u)
1637
+ t[u + e] = n[u];
1638
+ return u;
1610
1639
  }
1611
- function rt(n, t) {
1640
+ function nt(n, t) {
1612
1641
  return n instanceof t || n != null && n.constructor != null && n.constructor.name != null && n.constructor.name === t.name;
1613
1642
  }
1614
- function Ct(n) {
1643
+ function $t(n) {
1615
1644
  return n !== n;
1616
1645
  }
1617
- var We = function() {
1646
+ var Ze = function() {
1618
1647
  for (var n = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
1619
- for (var s = e * 16, l = 0; l < 16; ++l)
1620
- t[s + l] = n[e] + n[l];
1648
+ for (var s = e * 16, u = 0; u < 16; ++u)
1649
+ t[s + u] = n[e] + n[u];
1621
1650
  return t;
1622
1651
  }();
1623
- })(ve);
1652
+ })(Fe);
1624
1653
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1625
1654
  (function(i, r) {
1626
- var o = ve, p = o.Buffer;
1627
- function u(c, a) {
1655
+ var o = Fe, p = o.Buffer;
1656
+ function l(c, a) {
1628
1657
  for (var h in c)
1629
1658
  a[h] = c[h];
1630
1659
  }
1631
- p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ? i.exports = o : (u(o, r), r.Buffer = f);
1660
+ p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ? i.exports = o : (l(o, r), r.Buffer = f);
1632
1661
  function f(c, a, h) {
1633
1662
  return p(c, a, h);
1634
1663
  }
1635
- f.prototype = Object.create(p.prototype), u(p, f), f.from = function(c, a, h) {
1664
+ f.prototype = Object.create(p.prototype), l(p, f), f.from = function(c, a, h) {
1636
1665
  if (typeof c == "number")
1637
1666
  throw new TypeError("Argument must not be a number");
1638
1667
  return p(c, a, h);
@@ -1650,80 +1679,80 @@ Vt.write = function(i, r, o, p, u, f) {
1650
1679
  throw new TypeError("Argument must be a number");
1651
1680
  return o.SlowBuffer(c);
1652
1681
  };
1653
- })(Rt, Rt.exports);
1654
- var Kt = Rt.exports, Ae = Kt.Buffer;
1655
- function Tt(i, r) {
1656
- this._block = Ae.alloc(i), this._finalSize = r, this._blockSize = i, this._len = 0;
1657
- }
1658
- Tt.prototype.update = function(i, r) {
1659
- typeof i == "string" && (r = r || "utf8", i = Ae.from(i, r));
1660
- for (var o = this._block, p = this._blockSize, u = i.length, f = this._len, c = 0; c < u; ) {
1661
- for (var a = f % p, h = Math.min(u - c, p - a), g = 0; g < h; g++)
1682
+ })(Pt, Pt.exports);
1683
+ var Zt = Pt.exports, Be = Zt.Buffer;
1684
+ function kt(i, r) {
1685
+ this._block = Be.alloc(i), this._finalSize = r, this._blockSize = i, this._len = 0;
1686
+ }
1687
+ kt.prototype.update = function(i, r) {
1688
+ typeof i == "string" && (r = r || "utf8", i = Be.from(i, r));
1689
+ for (var o = this._block, p = this._blockSize, l = i.length, f = this._len, c = 0; c < l; ) {
1690
+ for (var a = f % p, h = Math.min(l - c, p - a), g = 0; g < h; g++)
1662
1691
  o[a + g] = i[c + g];
1663
1692
  f += h, c += h, f % p === 0 && this._update(o);
1664
1693
  }
1665
- return this._len += u, this;
1694
+ return this._len += l, this;
1666
1695
  };
1667
- Tt.prototype.digest = function(i) {
1696
+ kt.prototype.digest = function(i) {
1668
1697
  var r = this._len % this._blockSize;
1669
1698
  this._block[r] = 128, this._block.fill(0, r + 1), r >= this._finalSize && (this._update(this._block), this._block.fill(0));
1670
1699
  var o = this._len * 8;
1671
1700
  if (o <= 4294967295)
1672
1701
  this._block.writeUInt32BE(o, this._blockSize - 4);
1673
1702
  else {
1674
- var p = (o & 4294967295) >>> 0, u = (o - p) / 4294967296;
1675
- this._block.writeUInt32BE(u, this._blockSize - 8), this._block.writeUInt32BE(p, this._blockSize - 4);
1703
+ var p = (o & 4294967295) >>> 0, l = (o - p) / 4294967296;
1704
+ this._block.writeUInt32BE(l, this._blockSize - 8), this._block.writeUInt32BE(p, this._blockSize - 4);
1676
1705
  }
1677
1706
  this._update(this._block);
1678
1707
  var f = this._hash();
1679
1708
  return i ? f.toString(i) : f;
1680
1709
  };
1681
- Tt.prototype._update = function() {
1710
+ kt.prototype._update = function() {
1682
1711
  throw new Error("_update must be implemented by subclass");
1683
1712
  };
1684
- var Fe = Tt, wi = Se, Be = Fe, Ei = Kt.Buffer, bi = [
1713
+ var Ie = kt, Ii = Ae, je = Ie, ji = Zt.Buffer, Di = [
1685
1714
  1518500249,
1686
1715
  1859775393,
1687
1716
  -1894007588,
1688
1717
  -899497514
1689
- ], Si = new Array(80);
1690
- function bt() {
1691
- this.init(), this._w = Si, Be.call(this, 64, 56);
1718
+ ], Ti = new Array(80);
1719
+ function vt() {
1720
+ this.init(), this._w = Ti, je.call(this, 64, 56);
1692
1721
  }
1693
- wi(bt, Be);
1694
- bt.prototype.init = function() {
1722
+ Ii(vt, je);
1723
+ vt.prototype.init = function() {
1695
1724
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
1696
1725
  };
1697
- function vi(i) {
1726
+ function ki(i) {
1698
1727
  return i << 1 | i >>> 31;
1699
1728
  }
1700
- function _i(i) {
1729
+ function Ui(i) {
1701
1730
  return i << 5 | i >>> 27;
1702
1731
  }
1703
- function Ai(i) {
1732
+ function Ci(i) {
1704
1733
  return i << 30 | i >>> 2;
1705
1734
  }
1706
- function Fi(i, r, o, p) {
1735
+ function $i(i, r, o, p) {
1707
1736
  return i === 0 ? r & o | ~r & p : i === 2 ? r & o | r & p | o & p : r ^ o ^ p;
1708
1737
  }
1709
- bt.prototype._update = function(i) {
1710
- for (var r = this._w, o = this._a | 0, p = this._b | 0, u = this._c | 0, f = this._d | 0, c = this._e | 0, a = 0; a < 16; ++a)
1738
+ vt.prototype._update = function(i) {
1739
+ for (var r = this._w, o = this._a | 0, p = this._b | 0, l = this._c | 0, f = this._d | 0, c = this._e | 0, a = 0; a < 16; ++a)
1711
1740
  r[a] = i.readInt32BE(a * 4);
1712
1741
  for (; a < 80; ++a)
1713
- r[a] = vi(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
1742
+ r[a] = ki(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
1714
1743
  for (var h = 0; h < 80; ++h) {
1715
- var g = ~~(h / 20), y = _i(o) + Fi(g, p, u, f) + c + r[h] + bi[g] | 0;
1716
- c = f, f = u, u = Ai(p), p = o, o = y;
1744
+ var g = ~~(h / 20), y = Ui(o) + $i(g, p, l, f) + c + r[h] + Di[g] | 0;
1745
+ c = f, f = l, l = Ci(p), p = o, o = y;
1717
1746
  }
1718
- this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0;
1747
+ this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = l + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0;
1719
1748
  };
1720
- bt.prototype._hash = function() {
1721
- var i = Ei.allocUnsafe(20);
1749
+ vt.prototype._hash = function() {
1750
+ var i = ji.allocUnsafe(20);
1722
1751
  return i.writeInt32BE(this._a | 0, 0), i.writeInt32BE(this._b | 0, 4), i.writeInt32BE(this._c | 0, 8), i.writeInt32BE(this._d | 0, 12), i.writeInt32BE(this._e | 0, 16), i;
1723
1752
  };
1724
- var Bi = bt;
1725
- const Oi = /* @__PURE__ */ Xt(Bi);
1726
- var Ii = Se, Oe = Fe, ji = Kt.Buffer, Ti = [
1753
+ var Ni = vt;
1754
+ const Mi = /* @__PURE__ */ Kt(Ni);
1755
+ var Ri = Ae, De = Ie, Li = Zt.Buffer, Pi = [
1727
1756
  1116352408,
1728
1757
  1899447441,
1729
1758
  3049323471,
@@ -1788,88 +1817,88 @@ var Ii = Se, Oe = Fe, ji = Kt.Buffer, Ti = [
1788
1817
  2756734187,
1789
1818
  3204031479,
1790
1819
  3329325298
1791
- ], ki = new Array(64);
1820
+ ], zi = new Array(64);
1792
1821
  function St() {
1793
- this.init(), this._w = ki, Oe.call(this, 64, 56);
1822
+ this.init(), this._w = zi, De.call(this, 64, 56);
1794
1823
  }
1795
- Ii(St, Oe);
1824
+ Ri(St, De);
1796
1825
  St.prototype.init = function() {
1797
1826
  return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;
1798
1827
  };
1799
- function Di(i, r, o) {
1828
+ function qi(i, r, o) {
1800
1829
  return o ^ i & (r ^ o);
1801
1830
  }
1802
- function Ci(i, r, o) {
1831
+ function Hi(i, r, o) {
1803
1832
  return i & r | o & (i | r);
1804
1833
  }
1805
- function Ui(i) {
1834
+ function Ji(i) {
1806
1835
  return (i >>> 2 | i << 30) ^ (i >>> 13 | i << 19) ^ (i >>> 22 | i << 10);
1807
1836
  }
1808
- function $i(i) {
1837
+ function Vi(i) {
1809
1838
  return (i >>> 6 | i << 26) ^ (i >>> 11 | i << 21) ^ (i >>> 25 | i << 7);
1810
1839
  }
1811
- function Ni(i) {
1840
+ function Wi(i) {
1812
1841
  return (i >>> 7 | i << 25) ^ (i >>> 18 | i << 14) ^ i >>> 3;
1813
1842
  }
1814
- function Mi(i) {
1843
+ function Xi(i) {
1815
1844
  return (i >>> 17 | i << 15) ^ (i >>> 19 | i << 13) ^ i >>> 10;
1816
1845
  }
1817
1846
  St.prototype._update = function(i) {
1818
- for (var r = this._w, o = this._a | 0, p = this._b | 0, u = this._c | 0, f = this._d | 0, c = this._e | 0, a = this._f | 0, h = this._g | 0, g = this._h | 0, y = 0; y < 16; ++y)
1847
+ for (var r = this._w, o = this._a | 0, p = this._b | 0, l = this._c | 0, f = this._d | 0, c = this._e | 0, a = this._f | 0, h = this._g | 0, g = this._h | 0, y = 0; y < 16; ++y)
1819
1848
  r[y] = i.readInt32BE(y * 4);
1820
1849
  for (; y < 64; ++y)
1821
- r[y] = Mi(r[y - 2]) + r[y - 7] + Ni(r[y - 15]) + r[y - 16] | 0;
1850
+ r[y] = Xi(r[y - 2]) + r[y - 7] + Wi(r[y - 15]) + r[y - 16] | 0;
1822
1851
  for (var b = 0; b < 64; ++b) {
1823
- var F = g + $i(c) + Di(c, a, h) + Ti[b] + r[b] | 0, j = Ui(o) + Ci(o, p, u) | 0;
1824
- g = h, h = a, a = c, c = f + F | 0, f = u, u = p, p = o, o = F + j | 0;
1852
+ var F = g + Vi(c) + qi(c, a, h) + Pi[b] + r[b] | 0, j = Ji(o) + Hi(o, p, l) | 0;
1853
+ g = h, h = a, a = c, c = f + F | 0, f = l, l = p, p = o, o = F + j | 0;
1825
1854
  }
1826
- this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0, this._f = a + this._f | 0, this._g = h + this._g | 0, this._h = g + this._h | 0;
1855
+ this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = l + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0, this._f = a + this._f | 0, this._g = h + this._g | 0, this._h = g + this._h | 0;
1827
1856
  };
1828
1857
  St.prototype._hash = function() {
1829
- var i = ji.allocUnsafe(32);
1858
+ var i = Li.allocUnsafe(32);
1830
1859
  return i.writeInt32BE(this._a, 0), i.writeInt32BE(this._b, 4), i.writeInt32BE(this._c, 8), i.writeInt32BE(this._d, 12), i.writeInt32BE(this._e, 16), i.writeInt32BE(this._f, 20), i.writeInt32BE(this._g, 24), i.writeInt32BE(this._h, 28), i;
1831
1860
  };
1832
- var Ri = St;
1833
- const Li = /* @__PURE__ */ Xt(Ri), Gt = new Error("File system not available.");
1834
- function Pi(i, r, o) {
1835
- throw Gt;
1861
+ var Ki = St;
1862
+ const Gi = /* @__PURE__ */ Kt(Ki), Yt = new Error("File system not available.");
1863
+ function Zi(i, r, o) {
1864
+ throw Yt;
1836
1865
  }
1837
- function Ie(i) {
1838
- throw Gt;
1866
+ function Te(i) {
1867
+ throw Yt;
1839
1868
  }
1840
- function zi(i) {
1841
- throw Gt;
1869
+ function Yi(i) {
1870
+ throw Yt;
1842
1871
  }
1843
- const qi = async (i) => Ie(), Ji = {
1844
- sha1: Oi,
1845
- sha256: Li
1846
- }, kt = (i, r = "sha1") => {
1872
+ const Qi = async (i) => Te(), tr = {
1873
+ sha1: Mi,
1874
+ sha256: Gi
1875
+ }, Ut = (i, r = "sha1") => {
1847
1876
  if (!["sha1", "sha256"].includes(r))
1848
1877
  throw new Error("Hashing algorithm not supported: Available: sha1, sha256");
1849
- const o = Ji[r];
1878
+ const o = tr[r];
1850
1879
  return new o().update(i).digest("base64");
1851
1880
  };
1852
- function Hi(i) {
1881
+ function er(i) {
1853
1882
  const r = [], o = Object.keys(i);
1854
1883
  for (const p of o) {
1855
- const u = i[p].sort((f, c) => f.index - c.index);
1856
- for (let f = 0; f < u.length; f++)
1857
- u[f].index !== f && r.push({
1858
- message: `Invalid operation index ${u[f].index} at position ${f}`,
1884
+ const l = i[p].sort((f, c) => f.index - c.index);
1885
+ for (let f = 0; f < l.length; f++)
1886
+ l[f].index !== f && r.push({
1887
+ message: `Invalid operation index ${l[f].index} at position ${f}`,
1859
1888
  details: {
1860
1889
  position: f,
1861
- operation: u[f],
1862
- scope: u[f].scope
1890
+ operation: l[f],
1891
+ scope: l[f].scope
1863
1892
  }
1864
1893
  });
1865
1894
  }
1866
1895
  return r;
1867
1896
  }
1868
- const je = async (i) => {
1869
- const r = new oe(), { name: o, revision: p, documentType: u, created: f, lastModified: c } = i, a = {
1897
+ const ke = async (i) => {
1898
+ const r = new pe(), { name: o, revision: p, documentType: l, created: f, lastModified: c } = i, a = {
1870
1899
  name: o,
1871
1900
  revision: p,
1872
- documentType: u,
1901
+ documentType: l,
1873
1902
  created: f,
1874
1903
  lastModified: c
1875
1904
  };
@@ -1884,31 +1913,31 @@ const je = async (i) => {
1884
1913
  comment: JSON.stringify(b)
1885
1914
  });
1886
1915
  }), r;
1887
- }, Wi = async (i, r, o, p) => {
1888
- await (await je(i)).generateAsync({
1916
+ }, ir = async (i, r, o, p) => {
1917
+ await (await ke(i)).generateAsync({
1889
1918
  type: "uint8array",
1890
1919
  streamFiles: !0
1891
1920
  });
1892
1921
  const f = p ?? i.name, c = `.${o}.zip`;
1893
- return Pi(
1922
+ return Zi(
1894
1923
  r,
1895
1924
  f.endsWith(c) ? f : `${f}${c}`
1896
1925
  );
1897
- }, yr = async (i, r) => {
1898
- const p = await (await je(i)).generateAsync({ type: "blob" }), u = await r.createWritable();
1899
- await u.write(p), await u.close();
1900
- }, re = async (i, r, o) => {
1901
- const p = Ie();
1902
- return Xi(p, r, o);
1903
- }, Xi = async (i, r, o) => {
1904
- const p = new oe();
1905
- return await p.loadAsync(i), Vi(p, r, o);
1926
+ }, Or = async (i, r) => {
1927
+ const p = await (await ke(i)).generateAsync({ type: "blob" }), l = await r.createWritable();
1928
+ await l.write(p), await l.close();
1929
+ }, ae = async (i, r, o) => {
1930
+ const p = Te();
1931
+ return rr(p, r, o);
1932
+ }, rr = async (i, r, o) => {
1933
+ const p = new pe();
1934
+ return await p.loadAsync(i), nr(p, r, o);
1906
1935
  };
1907
- async function Vi(i, r, o) {
1936
+ async function nr(i, r, o) {
1908
1937
  const p = i.file("state.json");
1909
1938
  if (!p)
1910
1939
  throw new Error("Initial state not found");
1911
- const u = await p.async("string"), f = JSON.parse(u), c = i.file("header.json");
1940
+ const l = await p.async("string"), f = JSON.parse(l), c = i.file("header.json");
1912
1941
  let a;
1913
1942
  c && (a = JSON.parse(await c.async("string")));
1914
1943
  const h = i.file("operations.json");
@@ -1916,13 +1945,13 @@ async function Vi(i, r, o) {
1916
1945
  throw new Error("Operations history not found");
1917
1946
  const g = JSON.parse(
1918
1947
  await h.async("string")
1919
- ), y = Hi(g);
1948
+ ), y = er(g);
1920
1949
  if (y.length) {
1921
1950
  const F = y.map((j) => j.message);
1922
1951
  throw new Error(F.join(`
1923
1952
  `));
1924
1953
  }
1925
- let b = Re(
1954
+ let b = He(
1926
1955
  f,
1927
1956
  g,
1928
1957
  r,
@@ -1936,48 +1965,48 @@ async function Vi(i, r, o) {
1936
1965
  ...a
1937
1966
  }), b;
1938
1967
  }
1939
- function Te(i) {
1968
+ function Ue(i) {
1940
1969
  const r = i.replace(/^.*\./, "") || void 0, o = i.replace(/^.*[/\\]/, "") || void 0;
1941
1970
  return { extension: r, fileName: o };
1942
1971
  }
1943
- async function wr(i) {
1944
- const { buffer: r, mimeType: o = "application/octet-stream" } = await zi(), p = Te(i), u = r.toString("base64");
1972
+ async function Br(i) {
1973
+ const { buffer: r, mimeType: o = "application/octet-stream" } = await Yi(), p = Ue(i), l = r.toString("base64");
1945
1974
  return {
1946
- data: u,
1947
- hash: kt(u),
1975
+ data: l,
1976
+ hash: Ut(l),
1948
1977
  mimeType: o,
1949
1978
  ...p
1950
1979
  };
1951
1980
  }
1952
- async function Er(i) {
1953
- const r = await qi(), o = li.getType(i) || "application/octet-stream", p = Te(i), u = r.toString("base64");
1954
- return { data: u, hash: kt(u), mimeType: o, ...p };
1981
+ async function Ir(i) {
1982
+ const r = await Qi(), o = Ei.getType(i) || "application/octet-stream", p = Ue(i), l = r.toString("base64");
1983
+ return { data: l, hash: Ut(l), mimeType: o, ...p };
1955
1984
  }
1956
- var ke = /* @__PURE__ */ ((i) => (i.UNEXPECTED_INDEX = "UNEXPECTED_INDEX", i))(ke || {}), De = /* @__PURE__ */ ((i) => (i.DUPLICATED_INDEX = "DUPLICATED_INDEX", i.MISSING_INDEX = "MISSING_INDEX", i))(De || {});
1957
- function Zt(i) {
1985
+ var Ce = /* @__PURE__ */ ((i) => (i.UNEXPECTED_INDEX = "UNEXPECTED_INDEX", i))(Ce || {}), $e = /* @__PURE__ */ ((i) => (i.DUPLICATED_INDEX = "DUPLICATED_INDEX", i.MISSING_INDEX = "MISSING_INDEX", i))($e || {});
1986
+ function Qt(i) {
1958
1987
  const r = [];
1959
1988
  let o = -1;
1960
1989
  for (const p of i) {
1961
- const u = p.index - p.skip;
1962
- u !== o + 1 && r.push({
1990
+ const l = p.index - p.skip;
1991
+ l !== o + 1 && r.push({
1963
1992
  operation: {
1964
1993
  index: p.index,
1965
1994
  skip: p.skip
1966
1995
  },
1967
1996
  issue: "UNEXPECTED_INDEX",
1968
- category: u > o + 1 ? "MISSING_INDEX" : "DUPLICATED_INDEX",
1997
+ category: l > o + 1 ? "MISSING_INDEX" : "DUPLICATED_INDEX",
1969
1998
  message: `Expected index ${o + 1} with skip 0 or equivalent, got index ${p.index} with skip ${p.skip}`
1970
1999
  }), o = p.index;
1971
2000
  }
1972
2001
  return r;
1973
2002
  }
1974
- function ot(i) {
1975
- var p, u, f;
2003
+ function at(i) {
2004
+ var p, l, f;
1976
2005
  const r = [];
1977
2006
  let o = i.length - 1;
1978
2007
  for (; o > -1; ) {
1979
2008
  r.unshift(i[o]);
1980
- const c = (((p = i[o]) == null ? void 0 : p.index) || 0) - (((u = i[o]) == null ? void 0 : u.skip) || 0) - 1;
2009
+ const c = (((p = i[o]) == null ? void 0 : p.index) || 0) - (((l = i[o]) == null ? void 0 : l.skip) || 0) - 1;
1981
2010
  let a = o - 1;
1982
2011
  for (; a > -1 && (((f = i[a]) == null ? void 0 : f.index) || 0) > c; )
1983
2012
  a--;
@@ -1985,13 +2014,13 @@ function ot(i) {
1985
2014
  }
1986
2015
  return r;
1987
2016
  }
1988
- function Ki(i) {
2017
+ function or(i) {
1989
2018
  const r = [...i], o = r[r.length - 1];
1990
2019
  return o && (o.type === "NOOP" ? r.push({
1991
2020
  ...o,
1992
2021
  index: o.index,
1993
2022
  type: "NOOP",
1994
- skip: $e(i)
2023
+ skip: Re(i)
1995
2024
  }) : r.push({
1996
2025
  type: "NOOP",
1997
2026
  index: o.index + 1,
@@ -2002,114 +2031,117 @@ function Ki(i) {
2002
2031
  hash: o.hash
2003
2032
  })), r;
2004
2033
  }
2005
- function at(i) {
2034
+ function st(i) {
2006
2035
  return i.slice().sort((r, o) => r.skip - o.skip).sort((r, o) => r.index - o.index);
2007
2036
  }
2008
- const Gi = (i, r, o) => [...r, ...o].sort(
2009
- (p, u) => new Date(p.timestamp).getTime() - new Date(u.timestamp).getTime()
2010
- ).map((p, u) => ({
2037
+ const ar = (i, r, o) => [...r, ...o].sort(
2038
+ (p, l) => new Date(p.timestamp).getTime() - new Date(l.timestamp).getTime()
2039
+ ).map((p, l) => ({
2011
2040
  ...p,
2012
- index: i.index + u,
2013
- skip: u === 0 ? i.skip : 0
2014
- })), Zi = (i, r, o) => [...r, ...o].sort(
2015
- (p, u) => new Date(p.timestamp).getTime() - new Date(u.timestamp).getTime()
2016
- ).sort((p, u) => p.index - u.index).map((p, u) => ({
2041
+ index: i.index + l,
2042
+ skip: l === 0 ? i.skip : 0
2043
+ })), sr = (i, r, o) => [...r, ...o].sort(
2044
+ (p, l) => new Date(p.timestamp).getTime() - new Date(l.timestamp).getTime()
2045
+ ).sort((p, l) => p.index - l.index).map((p, l) => ({
2017
2046
  ...p,
2018
- index: i.index + u,
2019
- skip: u === 0 ? i.skip : 0
2047
+ index: i.index + l,
2048
+ skip: l === 0 ? i.skip : 0
2020
2049
  }));
2021
- function Yt(i, r) {
2022
- return xt(i) === xt(r);
2050
+ function te(i, r) {
2051
+ return dt(i) === dt(r);
2023
2052
  }
2024
- function Yi(i, r) {
2025
- const o = ot(at(i.slice())), p = ot(at(r.slice()));
2053
+ function pr(i, r) {
2054
+ const o = at(st(i.slice())), p = at(st(r.slice()));
2026
2055
  if (o.length < 1)
2027
2056
  return [p, []];
2028
- const u = [];
2057
+ const l = [];
2029
2058
  let f = !1;
2030
2059
  for (; p.length > 0; ) {
2031
2060
  const c = p[0];
2032
2061
  let a = o.shift();
2033
- for (; a && Ce(a, c); )
2034
- u.push(a), a = o.shift();
2035
- if (a ? f || (Yt(a, c) ? (p.shift(), u.push(a)) : (o.unshift(a), f = !0)) : f = !0, f) {
2062
+ for (; a && Ne(a, c); )
2063
+ l.push(a), a = o.shift();
2064
+ if (a ? f || (te(a, c) ? (p.shift(), l.push(a)) : (o.unshift(a), f = !0)) : f = !0, f) {
2036
2065
  let h = p.shift();
2037
2066
  for (; h; )
2038
- u.push(h), h = p.shift();
2067
+ l.push(h), h = p.shift();
2039
2068
  }
2040
2069
  }
2041
2070
  if (!f) {
2042
2071
  let c = o.shift();
2043
2072
  for (; c; )
2044
- u.push(c), c = o.shift();
2073
+ l.push(c), c = o.shift();
2045
2074
  }
2046
- return [ot(u), o];
2075
+ return [at(l), o];
2047
2076
  }
2048
- function Ce(i, r) {
2077
+ function Ne(i, r) {
2049
2078
  return i.index < r.index || i.index === r.index && i.skip < r.skip;
2050
2079
  }
2051
- function Ue(i, r) {
2052
- const o = [], p = [], u = [], f = Math.max(
2080
+ function Me(i, r) {
2081
+ const o = [], p = [], l = [], f = Math.max(
2053
2082
  i.length,
2054
2083
  r.length
2055
2084
  );
2056
2085
  let c = !1;
2057
2086
  for (let a = 0; a < f; a++) {
2058
2087
  const h = i[a], g = r[a];
2059
- h && g ? !c && Yt(h, g) ? o.push(h) : (c = !0, p.push(h), u.push(g)) : h ? p.push(h) : g && u.push(g);
2088
+ h && g ? !c && te(h, g) ? o.push(h) : (c = !0, p.push(h), l.push(g)) : h ? p.push(h) : g && l.push(g);
2060
2089
  }
2061
- return [o, p, u];
2090
+ return [o, p, l];
2062
2091
  }
2063
- function Qi(i, r, o) {
2064
- const [p, u, f] = Ue(
2065
- ot(i),
2066
- ot(r)
2067
- ), c = $t(p), a = 1 + Math.max(
2092
+ function cr(i, r, o) {
2093
+ const [p, l, f] = Me(
2094
+ at(i),
2095
+ at(r)
2096
+ ), c = Mt(p), a = 1 + Math.max(
2068
2097
  c,
2069
- $t(u),
2070
- $t(f)
2071
- ), h = o(
2098
+ Mt(l),
2099
+ Mt(f)
2100
+ ), h = Pe(
2101
+ f,
2102
+ l
2103
+ ), g = o(
2072
2104
  {
2073
2105
  index: a,
2074
2106
  skip: a - (c + 1)
2075
2107
  },
2076
- u,
2077
- f
2108
+ l,
2109
+ h
2078
2110
  );
2079
- return p.concat(h);
2111
+ return p.concat(g);
2080
2112
  }
2081
- function $t(i) {
2113
+ function Mt(i) {
2082
2114
  const r = i[i.length - 1];
2083
2115
  return r ? r.index : -1;
2084
2116
  }
2085
- function $e(i) {
2086
- var p, u, f;
2117
+ function Re(i) {
2118
+ var p, l, f;
2087
2119
  if (i.length < 1)
2088
2120
  return -1;
2089
- const r = ot(i);
2121
+ const r = at(i);
2090
2122
  let o = (((p = r[r.length - 1]) == null ? void 0 : p.skip) || 0) + 1;
2091
- return r.length > 1 && (o += ((u = r[r.length - 2]) == null ? void 0 : u.skip) || 0), (((f = r[r.length - 1]) == null ? void 0 : f.index) || -1) < o ? -1 : o;
2092
- }
2093
- const tr = (i) => Zt(
2094
- ot(at(i))
2095
- ), er = (i) => i.reduce((o, p) => {
2096
- var u;
2097
- return o[p.scope] || (o[p.scope] = []), (u = o[p.scope]) == null || u.push(p), o;
2098
- }, {}), ir = (i, r) => {
2123
+ return r.length > 1 && (o += ((l = r[r.length - 2]) == null ? void 0 : l.skip) || 0), (((f = r[r.length - 1]) == null ? void 0 : f.index) || -1) < o ? -1 : o;
2124
+ }
2125
+ const lr = (i) => Qt(
2126
+ at(st(i))
2127
+ ), ur = (i) => i.reduce((o, p) => {
2128
+ var l;
2129
+ return o[p.scope] || (o[p.scope] = []), (l = o[p.scope]) == null || l.push(p), o;
2130
+ }, {}), fr = (i, r) => {
2099
2131
  var h;
2100
2132
  const o = {
2101
2133
  integrityIssues: [],
2102
2134
  validOperations: [],
2103
2135
  invalidOperations: [],
2104
2136
  duplicatedOperations: []
2105
- }, p = at(i), u = at(r), f = Zt([
2137
+ }, p = st(i), l = st(r), f = Qt([
2106
2138
  ...p,
2107
- ...u
2139
+ ...l
2108
2140
  ]), a = (h = [...f.filter(
2109
2141
  (g) => g.category === "MISSING_INDEX"
2110
2142
  /* MISSING_INDEX */
2111
2143
  )].sort((g, y) => y.operation.index - g.operation.index).pop()) == null ? void 0 : h.operation;
2112
- for (const g of u) {
2144
+ for (const g of l) {
2113
2145
  if (a && g.index >= a.index) {
2114
2146
  o.invalidOperations.push(g);
2115
2147
  continue;
@@ -2122,138 +2154,140 @@ const tr = (i) => Zt(
2122
2154
  }
2123
2155
  return o.integrityIssues.push(...f), o;
2124
2156
  };
2125
- function rr(i, r) {
2157
+ function hr(i, r) {
2126
2158
  return i.filter((o) => !r.some((p) => o.type === "NOOP" && o.skip === 0 && o.index === p.index || o.index === p.index && o.skip === p.skip && o.scope === p.scope && o.hash === p.hash && o.type === p.type));
2127
2159
  }
2128
- function Ne(i, r) {
2129
- const [o] = at(i).slice(-1), p = (o == null ? void 0 : o.index) ?? -1, u = p + 1, f = {
2160
+ function Le(i, r) {
2161
+ const [o] = st(i).slice(-1), p = (o == null ? void 0 : o.index) ?? -1, l = p + 1, f = {
2130
2162
  ...r,
2131
- index: r.index ?? u
2163
+ index: r.index ?? l
2132
2164
  };
2133
2165
  if (f.index < p)
2134
2166
  throw new Error(
2135
2167
  `The skip header operation index must be greater than or equal to ${p}`
2136
2168
  );
2137
- return (ot(
2138
- at([...i, f])
2169
+ return (at(
2170
+ st([...i, f])
2139
2171
  ) || []).slice(0, -1);
2140
2172
  }
2141
- function Lt(i) {
2173
+ function zt(i) {
2142
2174
  return {
2143
2175
  ...Object.entries(i).reduce(
2144
2176
  (o, p) => {
2145
- const [u, f] = p;
2177
+ const [l, f] = p;
2146
2178
  return {
2147
2179
  ...o,
2148
- [u]: ot(at(f))
2180
+ [l]: at(st(f))
2149
2181
  };
2150
2182
  },
2151
2183
  {}
2152
2184
  )
2153
2185
  };
2154
2186
  }
2155
- const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2187
+ function Pe(i, r) {
2188
+ return i.filter((o) => o.id ? !r.some((p) => p.id === o.id) : !0);
2189
+ }
2190
+ const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2156
2191
  __proto__: null,
2157
- IntegrityIssueSubType: De,
2158
- IntegrityIssueType: ke,
2159
- addUndo: Ki,
2160
- attachBranch: Yi,
2161
- checkCleanedOperationsIntegrity: Zt,
2162
- checkOperationsIntegrity: tr,
2163
- garbageCollect: ot,
2164
- garbageCollectDocumentOperations: Lt,
2165
- groupOperationsByScope: er,
2166
- merge: Qi,
2167
- nextSkipNumber: $e,
2168
- operationsAreEqual: Yt,
2169
- precedes: Ce,
2170
- prepareOperations: ir,
2171
- removeExistingOperations: rr,
2172
- reshuffleByTimestamp: Gi,
2173
- reshuffleByTimestampAndIndex: Zi,
2174
- skipHeaderOperations: Ne,
2175
- sortOperations: at,
2176
- split: Ue
2192
+ IntegrityIssueSubType: $e,
2193
+ IntegrityIssueType: Ce,
2194
+ addUndo: or,
2195
+ attachBranch: pr,
2196
+ checkCleanedOperationsIntegrity: Qt,
2197
+ checkOperationsIntegrity: lr,
2198
+ filterDuplicatedOperations: Pe,
2199
+ garbageCollect: at,
2200
+ garbageCollectDocumentOperations: zt,
2201
+ groupOperationsByScope: ur,
2202
+ merge: cr,
2203
+ nextSkipNumber: Re,
2204
+ operationsAreEqual: te,
2205
+ precedes: Ne,
2206
+ prepareOperations: fr,
2207
+ removeExistingOperations: hr,
2208
+ reshuffleByTimestamp: ar,
2209
+ reshuffleByTimestampAndIndex: sr,
2210
+ skipHeaderOperations: Le,
2211
+ sortOperations: st,
2212
+ split: Me
2177
2213
  }, Symbol.toStringTag, { value: "Module" }));
2178
- function nr(i, r) {
2214
+ function mr(i, r) {
2179
2215
  let o;
2180
2216
  return "index" in r ? o = { ...r } : o = i.operations[r.scope].at(-1), ((o == null ? void 0 : o.index) ?? -1) + 1;
2181
2217
  }
2182
- function or(i, r) {
2218
+ function ze(i, r) {
2183
2219
  return {
2184
2220
  ...i,
2185
2221
  revision: {
2186
2222
  ...i.revision,
2187
- [r.scope]: nr(i, r)
2223
+ [r.scope]: mr(i, r)
2188
2224
  },
2189
2225
  lastModified: (/* @__PURE__ */ new Date()).toISOString()
2190
2226
  };
2191
2227
  }
2192
- function ar(i, r, o = 0, p = !1) {
2193
- if ([wt, Et, It].includes(r.type))
2228
+ function xr(i, r, o = 0) {
2229
+ if ([Et, bt, Dt].includes(r.type))
2194
2230
  return i;
2195
- const { scope: u } = r, f = i.operations[u].slice(), c = f.at(-1);
2231
+ const { scope: p } = r, l = i.operations[p].slice();
2232
+ let f;
2233
+ const c = l.at(-1);
2196
2234
  let a = ((c == null ? void 0 : c.index) ?? -1) + 1;
2197
2235
  if ("index" in r) {
2198
2236
  if (r.index - o > a)
2199
2237
  throw new Error(
2200
2238
  `Missing operations: expected ${a} with skip 0 or equivalent, got index ${r.index} with skip ${o}`
2201
2239
  );
2202
- a = r.index;
2203
- }
2204
- const h = {
2240
+ a = r.index, f = r.id;
2241
+ } else
2242
+ f = fi();
2243
+ return l.push({
2205
2244
  ...r,
2245
+ id: f,
2206
2246
  index: a,
2207
2247
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2208
2248
  hash: "",
2209
- scope: u,
2249
+ scope: p,
2210
2250
  skip: o,
2211
2251
  error: void 0
2212
- };
2213
- return p && (h.resultingState = i.state[u]), f.push(h), {
2252
+ }), {
2214
2253
  ...i,
2215
- operations: { ...i.operations, [u]: f }
2254
+ operations: { ...i.operations, [p]: l }
2216
2255
  };
2217
2256
  }
2218
- function sr(i, r, o = 0, p = !1) {
2219
- let u = ar(
2220
- i,
2221
- r,
2222
- o,
2223
- p
2224
- );
2225
- return u = or(u, r), u;
2226
- }
2227
- function pr(i, r, o) {
2228
- switch (fe().parse(r), r.type) {
2229
- case we:
2230
- return ri(i, r.input);
2231
- case It:
2232
- return ai(i, r, o);
2233
- case Ee:
2234
- return si(i, r.input.state);
2257
+ function dr(i, r, o = 0) {
2258
+ let p = xr(i, r, o);
2259
+ return p = ze(p, r), p;
2260
+ }
2261
+ function gr(i, r, o) {
2262
+ switch (xe().parse(r), r.type) {
2263
+ case ve:
2264
+ return hi(i, r.input);
2265
+ case Dt:
2266
+ return di(i, r, o);
2267
+ case Se:
2268
+ return gi(i, r.input.state);
2235
2269
  default:
2236
2270
  return i;
2237
2271
  }
2238
2272
  }
2239
- function Sr(i, r, o) {
2273
+ function Dr(i, r, o) {
2240
2274
  switch (r.type) {
2241
- case wt:
2242
- return ni(i, r, o);
2243
2275
  case Et:
2244
- return oi(i, r, o);
2276
+ return mi(i, r, o);
2277
+ case bt:
2278
+ return xi(i, r, o);
2245
2279
  default:
2246
2280
  return { document: i, action: r, skip: o };
2247
2281
  }
2248
2282
  }
2249
- function cr(i, r, o, p, u = !1, f = Le) {
2283
+ function yr(i, r, o, p, l = !1, f = Je) {
2250
2284
  const c = r.scope, a = i.operations[c].at(-1);
2251
2285
  if (!a)
2252
2286
  return i;
2253
- const h = Lt(
2287
+ const h = zt(
2254
2288
  {
2255
2289
  ...i.operations,
2256
- [c]: Ne(
2290
+ [c]: Le(
2257
2291
  i.operations[c],
2258
2292
  a
2259
2293
  )
@@ -2261,12 +2295,12 @@ function cr(i, r, o, p, u = !1, f = Le) {
2261
2295
  );
2262
2296
  let g;
2263
2297
  const y = h[c].at(-1);
2264
- if (u && (y != null && y.resultingState))
2298
+ if (l && (y != null && y.resultingState))
2265
2299
  g = f(
2266
2300
  y.resultingState
2267
2301
  );
2268
2302
  else {
2269
- const { state: b } = Pt(
2303
+ const { state: b } = qt(
2270
2304
  i.initialState,
2271
2305
  h,
2272
2306
  o,
@@ -2276,7 +2310,7 @@ function cr(i, r, o, p, u = !1, f = Le) {
2276
2310
  void 0,
2277
2311
  {
2278
2312
  reuseHash: !0,
2279
- reuseOperationResultingState: u,
2313
+ reuseOperationResultingState: l,
2280
2314
  operationResultingStateParser: f
2281
2315
  }
2282
2316
  );
@@ -2288,85 +2322,80 @@ function cr(i, r, o, p, u = !1, f = Le) {
2288
2322
  ...i.state,
2289
2323
  [c]: g
2290
2324
  },
2291
- operations: Lt({
2325
+ operations: zt({
2292
2326
  ...i.operations
2293
2327
  })
2294
2328
  };
2295
2329
  }
2296
- function Me(i, r, o, p, u = {}) {
2330
+ function qe(i, r, o, p, l = {}) {
2297
2331
  const {
2298
2332
  skip: f,
2299
2333
  ignoreSkipOperations: c = !1,
2300
2334
  reuseHash: a = !1,
2301
2335
  reuseOperationResultingState: h = !1,
2302
2336
  operationResultingStateParser: g
2303
- } = u, y = { ...r }, b = f || 0;
2337
+ } = l, y = { ...r }, b = f || 0;
2304
2338
  let F = { ...i };
2305
2339
  const j = !c && (b > 0 || "index" in y && y.skip > 0);
2306
- return ne(y) && (F = pr(F, y, o)), F = sr(
2307
- F,
2308
- y,
2309
- b,
2310
- h
2311
- ), j && (F = cr(
2340
+ return se(y) && (F = gr(F, y, o)), F = dr(F, y, b), j && (F = yr(
2312
2341
  F,
2313
2342
  y,
2314
2343
  o,
2315
2344
  b,
2316
2345
  h,
2317
2346
  g
2318
- )), F = Ot(F, ($) => {
2347
+ )), F = jt(F, (U) => {
2319
2348
  try {
2320
2349
  const q = o(
2321
- $.state,
2350
+ U.state,
2322
2351
  y,
2323
2352
  p
2324
2353
  );
2325
2354
  if (q)
2326
- return Bt({
2355
+ return It({
2327
2356
  ...F,
2328
2357
  // clipboard: [...clipboardValue],
2329
2358
  state: q
2330
2359
  });
2331
2360
  } catch (q) {
2332
- const Z = F.operations[y.scope].length - 1;
2333
- $.operations[y.scope][Z].error = q.message, $.operations[y.scope][Z].skip = 0, j && ($.state = Bt({ ...i.state }), $.operations = Bt({
2361
+ const Y = F.operations[y.scope].length - 1;
2362
+ U.operations[y.scope][Y].error = q.message, U.operations[y.scope][Y].skip = 0, j && (U.state = It({ ...i.state }), U.operations = It({
2334
2363
  ...i.operations,
2335
2364
  [y.scope]: [
2336
2365
  ...i.operations[y.scope],
2337
2366
  {
2338
- ...$.operations[y.scope][Z]
2367
+ ...U.operations[y.scope][Y]
2339
2368
  }
2340
2369
  ]
2341
2370
  }));
2342
2371
  }
2343
- }), Ot(F, ($) => {
2344
- if ([wt, Et, It].includes(y.type))
2345
- return $;
2346
- const q = y.scope || "global", Z = a && Object.prototype.hasOwnProperty.call(y, "hash") ? y.hash : Qt($, q);
2347
- $.operations[q][$.operations[q].length - 1].hash = Z, !ne(y) && y.attachments && y.attachments.forEach((w) => {
2348
- const { hash: E, ...S } = w;
2349
- $.attachments[E] = {
2350
- ...S
2372
+ }), jt(F, (U) => {
2373
+ if ([Et, bt, Dt].includes(y.type))
2374
+ return U;
2375
+ const q = y.scope || "global", Y = a && Object.prototype.hasOwnProperty.call(y, "hash") ? y.hash : ee(U, q), w = U.operations[q].at(-1);
2376
+ w && (w.hash = Y, h && (w.resultingState = U.state[q]), !se(y) && y.attachments && y.attachments.forEach((E) => {
2377
+ const { hash: v, ...M } = E;
2378
+ U.attachments[v] = {
2379
+ ...M
2351
2380
  };
2352
- });
2381
+ }));
2353
2382
  });
2354
2383
  }
2355
- function vr(i) {
2356
- return i.type === pi && i.skip !== void 0 && i.skip > 0 && i.hash !== void 0;
2384
+ function Tr(i) {
2385
+ return i.type === yi && i.skip !== void 0 && i.skip > 0 && i.hash !== void 0;
2357
2386
  }
2358
- function _r(i) {
2359
- return [wt, Et].includes(i.type);
2387
+ function kr(i) {
2388
+ return [Et, bt].includes(i.type);
2360
2389
  }
2361
- function ne(i) {
2362
- return [we, wt, Et, It, Ee].includes(i.type);
2390
+ function se(i) {
2391
+ return [ve, Et, bt, Dt, Se].includes(i.type);
2363
2392
  }
2364
- function dt(i, r, o, p, u = "global") {
2393
+ function gt(i, r, o, p, l = "global") {
2365
2394
  if (!i)
2366
2395
  throw new Error("Empty action type");
2367
2396
  if (typeof i != "string")
2368
2397
  throw new Error(`Invalid action type: ${JSON.stringify(i)}`);
2369
- const f = { type: i, input: r, scope: u };
2398
+ const f = { type: i, input: r, scope: l };
2370
2399
  o && (f.attachments = o);
2371
2400
  try {
2372
2401
  p == null || p().parse(f.input);
@@ -2375,10 +2404,10 @@ function dt(i, r, o, p, u = "global") {
2375
2404
  }
2376
2405
  return f;
2377
2406
  }
2378
- function lr(i, r = Me) {
2379
- return (o, p, u, f) => r(o, p, i, u, f);
2407
+ function wr(i, r = qe) {
2408
+ return (o, p, l, f) => r(o, p, i, l, f);
2380
2409
  }
2381
- const ur = (i, r) => ({
2410
+ const Er = (i, r) => ({
2382
2411
  name: "",
2383
2412
  documentType: "",
2384
2413
  revision: {
@@ -2390,8 +2419,8 @@ const ur = (i, r) => ({
2390
2419
  attachments: {},
2391
2420
  ...i,
2392
2421
  state: (r == null ? void 0 : r(i == null ? void 0 : i.state)) ?? (i == null ? void 0 : i.state) ?? { global: {}, local: {} }
2393
- }), fr = (i, r) => {
2394
- const o = ur(
2422
+ }), br = (i, r) => {
2423
+ const o = Er(
2395
2424
  i,
2396
2425
  r
2397
2426
  );
@@ -2401,20 +2430,20 @@ const ur = (i, r) => ({
2401
2430
  operations: { global: [], local: [] },
2402
2431
  clipboard: []
2403
2432
  };
2404
- }, Qt = (i, r = "global") => kt(xt(i.state[r] || "")), Ar = (i, r = 1e3) => {
2433
+ }, ee = (i, r = "global") => Ut(dt(i.state[r] || "")), Ur = (i, r = 1e3) => {
2405
2434
  const o = Math.random() * r;
2406
- return kt(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${o}`);
2435
+ return Ut(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${o}`);
2407
2436
  };
2408
- function Ft(i) {
2409
- return Ke(Ge(i, !0));
2437
+ function Bt(i) {
2438
+ return ti(ei(i, !0));
2410
2439
  }
2411
- function Fr(i, r) {
2440
+ function Cr(i, r) {
2412
2441
  const o = [...i];
2413
- let p = r || 0, u = o.length > 0 ? o[o.length - 1].index : 0;
2442
+ let p = r || 0, l = o.length > 0 ? o[o.length - 1].index : 0;
2414
2443
  const f = [];
2415
2444
  for (const c of o.reverse()) {
2416
2445
  if (p > 0) {
2417
- const g = u - c.index;
2446
+ const g = l - c.index;
2418
2447
  p -= g;
2419
2448
  }
2420
2449
  if (p < 0)
@@ -2427,49 +2456,49 @@ function Fr(i, r) {
2427
2456
  const g = h - p;
2428
2457
  p = p + g;
2429
2458
  }
2430
- u = c.index, f.push(a);
2459
+ l = c.index, f.push(a);
2431
2460
  }
2432
2461
  return f.reverse();
2433
2462
  }
2434
- function Br(i, r, o) {
2463
+ function $r(i, r, o) {
2435
2464
  const p = i.slice().sort((a, h) => a.skip - h.skip).sort((a, h) => a.index - h.index);
2436
- let u = o, f = 0, c = r;
2465
+ let l = o, f = 0, c = r;
2437
2466
  for (const a of p.reverse()) {
2438
2467
  const h = c - a.index;
2439
- if (u = u - h, u > -1)
2468
+ if (l = l - h, l > -1)
2440
2469
  f++, c = a.index;
2441
2470
  else
2442
2471
  break;
2443
2472
  }
2444
2473
  return f;
2445
2474
  }
2446
- function Or(i) {
2475
+ function Nr(i) {
2447
2476
  return Object.values(i).flatMap((r) => r).sort(
2448
2477
  (r, o) => new Date(r.timestamp).getTime() - new Date(o.timestamp).getTime()
2449
2478
  );
2450
2479
  }
2451
- function Ir(i) {
2480
+ function Mr(i) {
2452
2481
  return Object.values(i).flatMap((r) => r).sort(
2453
2482
  (r, o) => new Date(r.operation.timestamp).getTime() - new Date(o.operation.timestamp).getTime()
2454
2483
  );
2455
2484
  }
2456
- function Pt(i, r, o, p, u, f = Me, c = {}, a) {
2457
- const h = lr(o, f);
2458
- return Re(
2485
+ function qt(i, r, o, p, l, f = qe, c = {}, a) {
2486
+ const h = wr(o, f);
2487
+ return He(
2459
2488
  i,
2460
2489
  r,
2461
2490
  h,
2462
2491
  p,
2463
- u,
2492
+ l,
2464
2493
  c,
2465
2494
  a
2466
2495
  );
2467
2496
  }
2468
- function Re(i, r, o, p, u, f = {}, c) {
2497
+ function He(i, r, o, p, l, f = {}, c) {
2469
2498
  const {
2470
2499
  checkHashes: a = !0,
2471
2500
  reuseOperationResultingState: h,
2472
- operationResultingStateParser: g = Le
2501
+ operationResultingStateParser: g = Je
2473
2502
  } = c || {};
2474
2503
  let y = i;
2475
2504
  const b = [], F = {
@@ -2478,81 +2507,88 @@ function Re(i, r, o, p, u, f = {}, c) {
2478
2507
  };
2479
2508
  if (h)
2480
2509
  for (const [w, E] of Object.entries(r)) {
2481
- const S = E.findLastIndex(
2482
- (H) => !!H.resultingState
2510
+ const v = E.findLastIndex(
2511
+ (J) => !!J.resultingState
2483
2512
  );
2484
- if (S < 0) {
2513
+ if (v < 0) {
2485
2514
  b.push(...E);
2486
2515
  continue;
2487
2516
  }
2488
- const R = E[S];
2517
+ const M = E[v];
2489
2518
  try {
2490
- const H = g(
2519
+ const J = g(
2491
2520
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion
2492
- R.resultingState
2521
+ M.resultingState
2493
2522
  );
2494
2523
  y = {
2495
2524
  ...y,
2496
2525
  state: {
2497
2526
  ...y.state,
2498
2527
  // TODO how to deal with attachments?
2499
- [w]: H
2528
+ [w]: J
2500
2529
  }
2501
2530
  }, F[w].push(
2502
- ...E.slice(0, S + 1)
2503
- ), b.push(...E.slice(S + 1));
2531
+ ...E.slice(0, v + 1)
2532
+ ), b.push(...E.slice(v + 1));
2504
2533
  } catch {
2505
2534
  b.push(...E);
2506
2535
  }
2507
2536
  }
2508
2537
  else
2509
2538
  b.push(...Object.values(r).flat());
2510
- const j = fr(y);
2539
+ const j = br(y);
2511
2540
  j.initialState = i, j.operations = F;
2512
- const $ = b.reduce((w, E) => o(w, E, p, {
2513
- skip: E.skip,
2514
- ignoreSkipOperations: !0,
2515
- reuseHash: !a
2516
- }), j);
2541
+ let U = j;
2542
+ if (b.length)
2543
+ U = b.reduce((w, E) => o(w, E, p, {
2544
+ skip: E.skip,
2545
+ ignoreSkipOperations: !0,
2546
+ reuseHash: !a
2547
+ }), j);
2548
+ else
2549
+ for (const w of Object.values(F)) {
2550
+ const E = w.at(-1);
2551
+ E && (U = ze(U, E));
2552
+ }
2517
2553
  if (!a)
2518
- for (const w of Object.keys($.state))
2554
+ for (const w of Object.keys(U.state))
2519
2555
  for (let E = b.length - 1; E >= 0; E--) {
2520
- const S = b[E];
2521
- if (S.scope === w) {
2522
- if (S.hash !== Qt($, w))
2556
+ const v = b[E];
2557
+ if (v.scope === w) {
2558
+ if (v.hash !== ee(U, w))
2523
2559
  throw new Error(`Hash mismatch for scope ${w}`);
2524
2560
  break;
2525
2561
  }
2526
2562
  }
2527
2563
  const q = Object.keys(
2528
- $.operations
2564
+ U.operations
2529
2565
  ).reduce(
2530
2566
  (w, E) => {
2531
- const S = E;
2567
+ const v = E;
2532
2568
  return {
2533
2569
  ...w,
2534
- [S]: [
2535
- ...$.operations[S].map((R, H) => {
2536
- var W;
2570
+ [v]: [
2571
+ ...U.operations[v].map((M, J) => {
2572
+ var V;
2537
2573
  return {
2538
- ...R,
2539
- timestamp: ((W = r[S][H]) == null ? void 0 : W.timestamp) ?? R.timestamp
2574
+ ...M,
2575
+ timestamp: ((V = r[v][J]) == null ? void 0 : V.timestamp) ?? M.timestamp
2540
2576
  };
2541
2577
  })
2542
2578
  ]
2543
2579
  };
2544
2580
  },
2545
2581
  { global: [], local: [] }
2546
- ), Z = Object.values(q).reduce((w, E) => {
2547
- const S = E[E.length - 1];
2548
- return (S == null ? void 0 : S.timestamp) > w && (w = S.timestamp), w;
2582
+ ), Y = Object.values(q).reduce((w, E) => {
2583
+ const v = E[E.length - 1];
2584
+ return (v == null ? void 0 : v.timestamp) > w && (w = v.timestamp), w;
2549
2585
  }, i.lastModified);
2550
- return { ...$, operations: q, lastModified: Z };
2586
+ return { ...U, operations: q, lastModified: Y };
2551
2587
  }
2552
- function jr(i, r) {
2553
- return xt(i) === xt(r);
2588
+ function Rr(i, r) {
2589
+ return dt(i) === dt(r);
2554
2590
  }
2555
- function Le(i) {
2591
+ function Je(i) {
2556
2592
  const r = typeof i;
2557
2593
  if (r === "string")
2558
2594
  return JSON.parse(i);
@@ -2560,54 +2596,54 @@ function Le(i) {
2560
2596
  return i;
2561
2597
  throw new Error(`Providing resulting state is of type: ${r}`);
2562
2598
  }
2563
- const Pe = (i) => dt(
2599
+ const Ve = (i) => gt(
2564
2600
  "SET_NAME",
2565
2601
  i,
2566
2602
  void 0,
2567
- Ht,
2603
+ Wt,
2568
2604
  void 0
2569
- ), ze = (i = 1, r = "global") => dt(
2605
+ ), We = (i = 1, r = "global") => gt(
2570
2606
  "UNDO",
2571
2607
  i,
2572
2608
  void 0,
2573
- Wt,
2609
+ Xt,
2574
2610
  r
2575
- ), qe = (i = 1, r = "global") => dt(
2611
+ ), Xe = (i = 1, r = "global") => gt(
2576
2612
  "REDO",
2577
2613
  i,
2578
2614
  void 0,
2579
- Jt,
2615
+ Vt,
2580
2616
  r
2581
- ), Je = (i, r, o = "global") => dt(
2617
+ ), Ke = (i, r, o = "global") => gt(
2582
2618
  "PRUNE",
2583
2619
  { start: i, end: r },
2584
2620
  void 0,
2585
- qt,
2621
+ Jt,
2586
2622
  o
2587
- ), te = (i, r) => dt(
2623
+ ), ie = (i, r) => gt(
2588
2624
  "LOAD_STATE",
2589
2625
  { state: i, operations: r },
2590
2626
  void 0,
2591
- zt
2592
- ), He = (i = "global") => dt("NOOP", {}, void 0, void 0, i), Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2627
+ Ht
2628
+ ), Ge = (i = "global") => gt("NOOP", {}, void 0, void 0, i), Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2593
2629
  __proto__: null,
2594
- loadState: te,
2595
- noop: He,
2596
- prune: Je,
2597
- redo: qe,
2598
- setName: Pe,
2599
- undo: ze
2630
+ loadState: ie,
2631
+ noop: Ge,
2632
+ prune: Ke,
2633
+ redo: Xe,
2634
+ setName: Ve,
2635
+ undo: We
2600
2636
  }, Symbol.toStringTag, { value: "Module" }));
2601
- class kr {
2637
+ class Pr {
2602
2638
  /**
2603
2639
  * Constructs a BaseDocument instance with an initial state.
2604
2640
  * @param reducer - The reducer function that updates the state.
2605
2641
  * @param document - The initial state of the document.
2606
2642
  */
2607
2643
  constructor(r, o, p) {
2608
- At(this, "_document");
2609
- At(this, "_reducer");
2610
- At(this, "_signalDispatch");
2644
+ Ft(this, "_document");
2645
+ Ft(this, "_reducer");
2646
+ Ft(this, "_signalDispatch");
2611
2647
  this._reducer = r, this._document = o, this._signalDispatch = p;
2612
2648
  }
2613
2649
  /**
@@ -2630,14 +2666,14 @@ class kr {
2630
2666
  * @returns The file path where the state was saved.
2631
2667
  */
2632
2668
  saveToFile(r, o, p) {
2633
- return Wi(this._document, r, o, p);
2669
+ return ir(this._document, r, o, p);
2634
2670
  }
2635
2671
  /**
2636
2672
  * Loads the state of the document from a file.
2637
2673
  * @param path - The file path where the state is stored.
2638
2674
  */
2639
2675
  async loadFromFile(r) {
2640
- this._document = await re(r, this._reducer);
2676
+ this._document = await ae(r, this._reducer);
2641
2677
  }
2642
2678
  /**
2643
2679
  * Loads the state of the document from a file and returns it.
@@ -2646,19 +2682,19 @@ class kr {
2646
2682
  * @returns The state of the document.
2647
2683
  */
2648
2684
  static async stateFromFile(r, o) {
2649
- return await re(r, o);
2685
+ return await ae(r, o);
2650
2686
  }
2651
2687
  /**
2652
2688
  * Gets the current state of the document.
2653
2689
  */
2654
2690
  get state() {
2655
- return Ft(this._document.state);
2691
+ return Bt(this._document.state);
2656
2692
  }
2657
2693
  /**
2658
2694
  * Gets the list of operations performed on the document.
2659
2695
  */
2660
2696
  get operations() {
2661
- return Ft(this._document.operations);
2697
+ return Bt(this._document.operations);
2662
2698
  }
2663
2699
  /**
2664
2700
  * Gets the name of the document.
@@ -2697,13 +2733,13 @@ class kr {
2697
2733
  * Gets the initial state of the document.
2698
2734
  */
2699
2735
  get initialState() {
2700
- return Ft(this._document.initialState);
2736
+ return Bt(this._document.initialState);
2701
2737
  }
2702
2738
  /**
2703
2739
  * Returns the current document as an object
2704
2740
  */
2705
2741
  toDocument() {
2706
- return Ft(this._document);
2742
+ return Bt(this._document);
2707
2743
  }
2708
2744
  /**
2709
2745
  * Gets the attachment associated with the given key.
@@ -2717,21 +2753,21 @@ class kr {
2717
2753
  * @param name - The new name of the document.
2718
2754
  */
2719
2755
  setName(r) {
2720
- return this.dispatch(Pe(r)), this;
2756
+ return this.dispatch(Ve(r)), this;
2721
2757
  }
2722
2758
  /**
2723
2759
  * Reverts a number of actions from the document.
2724
2760
  * @param count - The number of actions to revert.
2725
2761
  */
2726
2762
  undo(r) {
2727
- return this.dispatch(ze(r)), this;
2763
+ return this.dispatch(We(r)), this;
2728
2764
  }
2729
2765
  /**
2730
2766
  * Reapplies a number of actions to the document.
2731
2767
  * @param count - The number of actions to reapply.
2732
2768
  */
2733
2769
  redo(r) {
2734
- return this.dispatch(qe(r)), this;
2770
+ return this.dispatch(Xe(r)), this;
2735
2771
  }
2736
2772
  /**
2737
2773
  * Removes a range of operations from the document.
@@ -2739,7 +2775,7 @@ class kr {
2739
2775
  * @param end - The ending index of the range to remove.
2740
2776
  */
2741
2777
  prune(r, o) {
2742
- return this.dispatch(Je(r, o)), this;
2778
+ return this.dispatch(Ke(r, o)), this;
2743
2779
  }
2744
2780
  /**
2745
2781
  * Loads a document state and a set of operations.
@@ -2747,10 +2783,10 @@ class kr {
2747
2783
  * @param operations - The operations to apply to the document.
2748
2784
  */
2749
2785
  loadState(r, o) {
2750
- return this.dispatch(te(r, o)), this;
2786
+ return this.dispatch(ie(r, o)), this;
2751
2787
  }
2752
2788
  }
2753
- function Dr(i, r) {
2789
+ function zr(i, r) {
2754
2790
  r.forEach((o) => {
2755
2791
  Object.getOwnPropertyNames(o.prototype).forEach((p) => {
2756
2792
  Object.defineProperty(
@@ -2764,37 +2800,39 @@ function Dr(i, r) {
2764
2800
  });
2765
2801
  }
2766
2802
  export {
2767
- Ir as A,
2768
- kr as B,
2769
- Or as C,
2770
- Hi as D,
2771
- Me as E,
2772
- Sr as F,
2773
- gr as G,
2774
- ur as a,
2775
- fr as b,
2776
- lr as c,
2777
- yr as d,
2778
- Xi as e,
2779
- dt as f,
2780
- Dr as g,
2781
- Tr as h,
2782
- ne as i,
2783
- Br as j,
2784
- je as k,
2785
- re as l,
2786
- br as m,
2787
- Er as n,
2788
- wr as o,
2789
- Qt as p,
2790
- Ar as q,
2791
- vr as r,
2792
- Wi as s,
2793
- jr as t,
2794
- _r as u,
2795
- Fr as v,
2796
- Le as w,
2797
- Ft as x,
2798
- Re as y,
2799
- Pt as z
2803
+ Mr as A,
2804
+ Pr as B,
2805
+ Nr as C,
2806
+ er as D,
2807
+ qe as E,
2808
+ Dr as F,
2809
+ dr as G,
2810
+ ze as H,
2811
+ Fr as I,
2812
+ Er as a,
2813
+ br as b,
2814
+ wr as c,
2815
+ Or as d,
2816
+ rr as e,
2817
+ gt as f,
2818
+ zr as g,
2819
+ Lr as h,
2820
+ se as i,
2821
+ $r as j,
2822
+ ke as k,
2823
+ ae as l,
2824
+ jr as m,
2825
+ Ir as n,
2826
+ Br as o,
2827
+ ee as p,
2828
+ Ur as q,
2829
+ Tr as r,
2830
+ ir as s,
2831
+ Rr as t,
2832
+ kr as u,
2833
+ Cr as v,
2834
+ Je as w,
2835
+ Bt as x,
2836
+ He as y,
2837
+ qt as z
2800
2838
  };