document-model 1.0.43 → 1.0.45

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 (33) hide show
  1. package/dist/browser/document-model.cjs +1 -1
  2. package/dist/browser/document-model.js +2 -2
  3. package/dist/browser/document.cjs +1 -1
  4. package/dist/browser/document.js +2 -2
  5. package/dist/browser/index.cjs +1 -1
  6. package/dist/browser/index.js +3 -3
  7. package/dist/browser/internal/{index-CDcO7NCS.js → index-BzIVYv7p.js} +1 -1
  8. package/dist/browser/internal/{index-DhzefrNj.js → index-CPJM383s.js} +1 -1
  9. package/dist/{node/internal/index-fctxJxHD.js → browser/internal/index-REU04m7f.js} +1 -1
  10. package/dist/{node/internal/index-D_LMFQg7.js → browser/internal/index-tEH7iGUj.js} +1 -1
  11. package/dist/browser/internal/{object-CrDRbO7a.js → object-Dev4WFVH.js} +824 -808
  12. package/dist/browser/internal/object-DkoS83BB.js +25 -0
  13. package/dist/browser/src/document/types.d.ts +2 -0
  14. package/dist/browser/src/document/utils/base.d.ts +7 -2
  15. package/dist/browser/src/document/utils/file.d.ts +3 -2
  16. package/dist/node/document-model.cjs +1 -1
  17. package/dist/node/document-model.js +2 -2
  18. package/dist/node/document.cjs +1 -1
  19. package/dist/node/document.js +2 -2
  20. package/dist/node/index.cjs +1 -1
  21. package/dist/node/index.js +3 -3
  22. package/dist/node/internal/{index-BWW7KbVk.js → index-BX95XaQ_.js} +1 -1
  23. package/dist/node/internal/{index-Cz8HaIxu.js → index-BzNCX_-9.js} +1 -1
  24. package/dist/{browser/internal/index-CfgX2mMt.js → node/internal/index-CRjFLQNR.js} +1 -1
  25. package/dist/{browser/internal/index-EdTViyyq.js → node/internal/index-DpH4_29z.js} +1 -1
  26. package/dist/node/internal/{object-BDRv-l-h.js → object-BFkXGmt6.js} +624 -608
  27. package/dist/node/internal/object-CGt7Qacd.js +20 -0
  28. package/dist/node/src/document/types.d.ts +2 -0
  29. package/dist/node/src/document/utils/base.d.ts +7 -2
  30. package/dist/node/src/document/utils/file.d.ts +3 -2
  31. package/package.json +2 -5
  32. package/dist/browser/internal/object-BkewFVld.js +0 -25
  33. package/dist/node/internal/object-Br6jYeW0.js +0 -20
@@ -1,161 +1,161 @@
1
- var $e = Object.defineProperty;
2
- var Ce = (i, r, s) => r in i ? $e(i, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[r] = s;
1
+ var De = Object.defineProperty;
2
+ var Ce = (i, r, s) => r in i ? De(i, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[r] = s;
3
3
  var At = (i, r, s) => (Ce(i, typeof r != "symbol" ? r + "" : r, s), s);
4
- import { produce as xt, castDraft as Ut, castImmutable as Me, freeze as Ne } from "immer";
5
- import { z as _ } from "zod";
6
- import te from "jszip";
7
- const ee = (i) => i != null, Re = _.any().refine((i) => ee(i)), re = _.enum(["LOAD_STATE"]), ie = _.enum(["PRUNE"]), ne = _.enum(["REDO"]), oe = _.enum(["SET_NAME"]), ae = _.enum(["UNDO"]);
4
+ import { produce as xt, castDraft as Ut, castImmutable as Ne, freeze as Me } from "immer";
5
+ import { z as A } from "zod";
6
+ import ee from "jszip";
7
+ const re = (i) => i != null, Re = A.any().refine((i) => re(i)), ie = A.enum(["LOAD_STATE"]), ne = A.enum(["PRUNE"]), oe = A.enum(["REDO"]), ae = A.enum(["SET_NAME"]), se = A.enum(["UNDO"]);
8
8
  function Le() {
9
- return _.object({
10
- __typename: _.literal("Action").optional(),
11
- type: _.string()
9
+ return A.object({
10
+ __typename: A.literal("Action").optional(),
11
+ type: A.string()
12
12
  });
13
13
  }
14
14
  function dt() {
15
- return _.literal("global").or(_.literal("local"));
15
+ return A.literal("global").or(A.literal("local"));
16
16
  }
17
- function se() {
18
- return _.union([
19
- pe(),
20
- le(),
17
+ function pe() {
18
+ return A.union([
19
+ ce(),
21
20
  ue(),
22
21
  fe(),
23
- he()
22
+ he(),
23
+ me()
24
24
  ]);
25
25
  }
26
26
  function ze() {
27
- return _.object({
28
- __typename: _.literal("DocumentFile").optional(),
29
- data: _.string(),
30
- extension: _.string().nullable(),
31
- fileName: _.string().nullable(),
32
- mimeType: _.string()
27
+ return A.object({
28
+ __typename: A.literal("DocumentFile").optional(),
29
+ data: A.string(),
30
+ extension: A.string().nullable(),
31
+ fileName: A.string().nullable(),
32
+ mimeType: A.string()
33
33
  });
34
34
  }
35
- function pe() {
36
- return _.object({
37
- input: _.lazy(() => Nt()),
38
- type: re,
35
+ function ce() {
36
+ return A.object({
37
+ input: A.lazy(() => Mt()),
38
+ type: ie,
39
39
  scope: dt()
40
40
  });
41
41
  }
42
- function Nt() {
43
- return _.object({
44
- operations: _.number(),
45
- state: _.lazy(() => ce())
42
+ function Mt() {
43
+ return A.object({
44
+ operations: A.number(),
45
+ state: A.lazy(() => le())
46
46
  });
47
47
  }
48
- function ce() {
49
- return _.object({
50
- data: _.unknown().nullish(),
51
- name: _.string()
48
+ function le() {
49
+ return A.object({
50
+ data: A.unknown().nullish(),
51
+ name: A.string()
52
52
  });
53
53
  }
54
54
  function Pe() {
55
- return _.object({
56
- __typename: _.literal("Operation").optional(),
57
- hash: _.string(),
58
- index: _.number(),
59
- timestamp: _.string().datetime(),
60
- type: _.string()
55
+ return A.object({
56
+ __typename: A.literal("Operation").optional(),
57
+ hash: A.string(),
58
+ index: A.number(),
59
+ timestamp: A.string().datetime(),
60
+ type: A.string()
61
61
  });
62
62
  }
63
- function le() {
64
- return _.object({
65
- input: _.lazy(() => Rt()),
66
- type: ie,
63
+ function ue() {
64
+ return A.object({
65
+ input: A.lazy(() => Rt()),
66
+ type: ne,
67
67
  scope: dt()
68
68
  });
69
69
  }
70
70
  function Rt() {
71
- return _.object({
72
- end: _.number().nullish(),
73
- start: _.number().nullish()
71
+ return A.object({
72
+ end: A.number().nullish(),
73
+ start: A.number().nullish()
74
74
  });
75
75
  }
76
- const Lt = _.number;
77
- function ue() {
78
- return _.object({
76
+ const Lt = A.number;
77
+ function fe() {
78
+ return A.object({
79
79
  input: Lt(),
80
- type: ne,
80
+ type: oe,
81
81
  scope: dt()
82
82
  });
83
83
  }
84
- const zt = _.string;
85
- function fe() {
86
- return _.object({
84
+ const zt = A.string;
85
+ function he() {
86
+ return A.object({
87
87
  input: zt(),
88
- type: oe,
89
- scope: _.literal("global")
88
+ type: ae,
89
+ scope: A.literal("global")
90
90
  });
91
91
  }
92
92
  function qe() {
93
- return _.object({
94
- __typename: _.literal("SetNameOperation").optional(),
95
- hash: _.string(),
96
- index: _.number(),
97
- input: _.string(),
98
- timestamp: _.string().datetime(),
99
- type: _.string()
93
+ return A.object({
94
+ __typename: A.literal("SetNameOperation").optional(),
95
+ hash: A.string(),
96
+ index: A.number(),
97
+ input: A.string(),
98
+ timestamp: A.string().datetime(),
99
+ type: A.string()
100
100
  });
101
101
  }
102
- const Pt = _.number;
103
- function he() {
104
- return _.object({
102
+ const Pt = A.number;
103
+ function me() {
104
+ return A.object({
105
105
  input: Pt(),
106
- type: ae,
106
+ type: se,
107
107
  scope: dt()
108
108
  });
109
109
  }
110
110
  const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
111
111
  __proto__: null,
112
112
  ActionSchema: Le,
113
- BaseActionSchema: se,
113
+ BaseActionSchema: pe,
114
114
  DocumentFileSchema: ze,
115
- LoadStateActionInputSchema: Nt,
116
- LoadStateActionSchema: pe,
117
- LoadStateActionStateInputSchema: ce,
118
- Load_StateSchema: re,
115
+ LoadStateActionInputSchema: Mt,
116
+ LoadStateActionSchema: ce,
117
+ LoadStateActionStateInputSchema: le,
118
+ Load_StateSchema: ie,
119
119
  OperationSchema: Pe,
120
120
  OperationScopeSchema: dt,
121
121
  PruneActionInputSchema: Rt,
122
- PruneActionSchema: le,
123
- PruneSchema: ie,
122
+ PruneActionSchema: ue,
123
+ PruneSchema: ne,
124
124
  RedoActionInputSchema: Lt,
125
- RedoActionSchema: ue,
126
- RedoSchema: ne,
125
+ RedoActionSchema: fe,
126
+ RedoSchema: oe,
127
127
  SetNameActionInputSchema: zt,
128
- SetNameActionSchema: fe,
128
+ SetNameActionSchema: he,
129
129
  SetNameOperationSchema: qe,
130
- Set_NameSchema: oe,
130
+ Set_NameSchema: ae,
131
131
  UndoActionInputSchema: Pt,
132
- UndoActionSchema: he,
133
- UndoSchema: ae,
132
+ UndoActionSchema: me,
133
+ UndoSchema: se,
134
134
  definedNonNullAnySchema: Re,
135
- isDefinedNonNullAny: ee
135
+ isDefinedNonNullAny: re
136
136
  }, Symbol.toStringTag, { value: "Module" }));
137
137
  function qt(i) {
138
138
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
139
139
  }
140
- var Dt = { exports: {} };
140
+ var $t = { exports: {} };
141
141
  (function(i, r) {
142
- const { hasOwnProperty: s } = Object.prototype, p = rt();
143
- p.configure = rt, p.stringify = p, p.default = p, r.stringify = p, r.configure = rt, i.exports = p;
142
+ const { hasOwnProperty: s } = Object.prototype, p = R();
143
+ p.configure = R, p.stringify = p, p.default = p, r.stringify = p, r.configure = R, i.exports = p;
144
144
  const f = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
145
- function u(y) {
146
- return y.length < 5e3 && !f.test(y) ? `"${y}"` : JSON.stringify(y);
147
- }
148
- function l(y) {
149
- if (y.length > 200)
150
- return y.sort();
151
- for (let E = 1; E < y.length; E++) {
152
- const k = y[E];
153
- let q = E;
154
- for (; q !== 0 && y[q - 1] > k; )
155
- y[q] = y[q - 1], q--;
156
- y[q] = k;
145
+ function u(g) {
146
+ return g.length < 5e3 && !f.test(g) ? `"${g}"` : JSON.stringify(g);
147
+ }
148
+ function l(g) {
149
+ if (g.length > 200)
150
+ return g.sort();
151
+ for (let b = 1; b < g.length; b++) {
152
+ const O = g[b];
153
+ let P = b;
154
+ for (; P !== 0 && g[P - 1] > O; )
155
+ g[P] = g[P - 1], P--;
156
+ g[P] = O;
157
157
  }
158
- return y;
158
+ return g;
159
159
  }
160
160
  const a = Object.getOwnPropertyDescriptor(
161
161
  Object.getPrototypeOf(
@@ -165,25 +165,25 @@ var Dt = { exports: {} };
165
165
  ),
166
166
  Symbol.toStringTag
167
167
  ).get;
168
- function x(y) {
169
- return a.call(y) !== void 0 && y.length !== 0;
170
- }
171
- function g(y, E, k) {
172
- y.length < k && (k = y.length);
173
- const q = E === "," ? "" : " ";
174
- let Z = `"0":${q}${y[0]}`;
175
- for (let H = 1; H < k; H++)
176
- Z += `${E}"${H}":${q}${y[H]}`;
177
- return Z;
178
- }
179
- function A(y) {
180
- if (s.call(y, "circularValue")) {
181
- const E = y.circularValue;
182
- if (typeof E == "string")
183
- return `"${E}"`;
184
- if (E == null)
185
- return E;
186
- if (E === Error || E === TypeError)
168
+ function h(g) {
169
+ return a.call(g) !== void 0 && g.length !== 0;
170
+ }
171
+ function y(g, b, O) {
172
+ g.length < O && (O = g.length);
173
+ const P = b === "," ? "" : " ";
174
+ let K = `"0":${P}${g[0]}`;
175
+ for (let Y = 1; Y < O; Y++)
176
+ K += `${b}"${Y}":${P}${g[Y]}`;
177
+ return K;
178
+ }
179
+ function w(g) {
180
+ if (s.call(g, "circularValue")) {
181
+ const b = g.circularValue;
182
+ if (typeof b == "string")
183
+ return `"${b}"`;
184
+ if (b == null)
185
+ return b;
186
+ if (b === Error || b === TypeError)
187
187
  return {
188
188
  toString() {
189
189
  throw new TypeError("Converting circular structure to JSON");
@@ -193,338 +193,338 @@ var Dt = { exports: {} };
193
193
  }
194
194
  return '"[Circular]"';
195
195
  }
196
- function w(y, E) {
197
- let k;
198
- if (s.call(y, E) && (k = y[E], typeof k != "boolean"))
199
- throw new TypeError(`The "${E}" argument must be of type boolean`);
200
- return k === void 0 ? !0 : k;
201
- }
202
- function b(y, E) {
203
- let k;
204
- if (s.call(y, E)) {
205
- if (k = y[E], typeof k != "number")
206
- throw new TypeError(`The "${E}" argument must be of type number`);
207
- if (!Number.isInteger(k))
208
- throw new TypeError(`The "${E}" argument must be an integer`);
209
- if (k < 1)
210
- throw new RangeError(`The "${E}" argument must be >= 1`);
196
+ function _(g, b) {
197
+ let O;
198
+ if (s.call(g, b) && (O = g[b], typeof O != "boolean"))
199
+ throw new TypeError(`The "${b}" argument must be of type boolean`);
200
+ return O === void 0 ? !0 : O;
201
+ }
202
+ function v(g, b) {
203
+ let O;
204
+ if (s.call(g, b)) {
205
+ if (O = g[b], typeof O != "number")
206
+ throw new TypeError(`The "${b}" argument must be of type number`);
207
+ if (!Number.isInteger(O))
208
+ throw new TypeError(`The "${b}" argument must be an integer`);
209
+ if (O < 1)
210
+ throw new RangeError(`The "${b}" argument must be >= 1`);
211
211
  }
212
- return k === void 0 ? 1 / 0 : k;
212
+ return O === void 0 ? 1 / 0 : O;
213
213
  }
214
- function F(y) {
215
- return y === 1 ? "1 item" : `${y} items`;
214
+ function B(g) {
215
+ return g === 1 ? "1 item" : `${g} items`;
216
216
  }
217
- function I(y) {
218
- const E = /* @__PURE__ */ new Set();
219
- for (const k of y)
220
- (typeof k == "string" || typeof k == "number") && E.add(String(k));
221
- return E;
217
+ function W(g) {
218
+ const b = /* @__PURE__ */ new Set();
219
+ for (const O of g)
220
+ (typeof O == "string" || typeof O == "number") && b.add(String(O));
221
+ return b;
222
222
  }
223
- function G(y) {
224
- if (s.call(y, "strict")) {
225
- const E = y.strict;
226
- if (typeof E != "boolean")
223
+ function C(g) {
224
+ if (s.call(g, "strict")) {
225
+ const b = g.strict;
226
+ if (typeof b != "boolean")
227
227
  throw new TypeError('The "strict" argument must be of type boolean');
228
- if (E)
229
- return (k) => {
230
- let q = `Object can not safely be stringified. Received type ${typeof k}`;
231
- throw typeof k != "function" && (q += ` (${k.toString()})`), new Error(q);
228
+ if (b)
229
+ return (O) => {
230
+ let P = `Object can not safely be stringified. Received type ${typeof O}`;
231
+ throw typeof O != "function" && (P += ` (${O.toString()})`), new Error(P);
232
232
  };
233
233
  }
234
234
  }
235
- function rt(y) {
236
- y = { ...y };
237
- const E = G(y);
238
- E && (y.bigint === void 0 && (y.bigint = !1), "circularValue" in y || (y.circularValue = Error));
239
- const k = A(y), q = w(y, "bigint"), Z = w(y, "deterministic"), H = b(y, "maximumDepth"), N = b(y, "maximumBreadth");
240
- function ct(J, h, v, T, j, $) {
241
- let S = h[J];
242
- switch (typeof S == "object" && S !== null && typeof S.toJSON == "function" && (S = S.toJSON(J)), S = T.call(h, J, S), typeof S) {
235
+ function R(g) {
236
+ g = { ...g };
237
+ const b = C(g);
238
+ b && (g.bigint === void 0 && (g.bigint = !1), "circularValue" in g || (g.circularValue = Error));
239
+ const O = w(g), P = _(g, "bigint"), K = _(g, "deterministic"), Y = v(g, "maximumDepth"), M = v(g, "maximumBreadth");
240
+ function ct(V, m, E, T, j, $) {
241
+ let S = m[V];
242
+ switch (typeof S == "object" && S !== null && typeof S.toJSON == "function" && (S = S.toJSON(V)), S = T.call(m, V, S), typeof S) {
243
243
  case "string":
244
244
  return u(S);
245
245
  case "object": {
246
246
  if (S === null)
247
247
  return "null";
248
- if (v.indexOf(S) !== -1)
249
- return k;
250
- let U = "", B = ",";
251
- const O = $;
248
+ if (E.indexOf(S) !== -1)
249
+ return O;
250
+ let k = "", F = ",";
251
+ const I = $;
252
252
  if (Array.isArray(S)) {
253
253
  if (S.length === 0)
254
254
  return "[]";
255
- if (H < v.length + 1)
255
+ if (Y < E.length + 1)
256
256
  return '"[Array]"';
257
- v.push(S), j !== "" && ($ += j, U += `
258
- ${$}`, B = `,
257
+ E.push(S), j !== "" && ($ += j, k += `
258
+ ${$}`, F = `,
259
259
  ${$}`);
260
- const W = Math.min(S.length, N);
261
- let X = 0;
262
- for (; X < W - 1; X++) {
263
- const st = ct(String(X), S, v, T, j, $);
264
- U += st !== void 0 ? st : "null", U += B;
260
+ const H = Math.min(S.length, M);
261
+ let Q = 0;
262
+ for (; Q < H - 1; Q++) {
263
+ const st = ct(String(Q), S, E, T, j, $);
264
+ k += st !== void 0 ? st : "null", k += F;
265
265
  }
266
- const Q = ct(String(X), S, v, T, j, $);
267
- if (U += Q !== void 0 ? Q : "null", S.length - 1 > N) {
268
- const st = S.length - N - 1;
269
- U += `${B}"... ${F(st)} not stringified"`;
266
+ const tt = ct(String(Q), S, E, T, j, $);
267
+ if (k += tt !== void 0 ? tt : "null", S.length - 1 > M) {
268
+ const st = S.length - M - 1;
269
+ k += `${F}"... ${B(st)} not stringified"`;
270
270
  }
271
- return j !== "" && (U += `
272
- ${O}`), v.pop(), `[${U}]`;
271
+ return j !== "" && (k += `
272
+ ${I}`), E.pop(), `[${k}]`;
273
273
  }
274
- let R = Object.keys(S);
275
- const P = R.length;
276
- if (P === 0)
274
+ let L = Object.keys(S);
275
+ const J = L.length;
276
+ if (J === 0)
277
277
  return "{}";
278
- if (H < v.length + 1)
278
+ if (Y < E.length + 1)
279
279
  return '"[Object]"';
280
- let C = "", V = "";
281
- j !== "" && ($ += j, B = `,
282
- ${$}`, C = " ");
283
- const Y = Math.min(P, N);
284
- Z && !x(S) && (R = l(R)), v.push(S);
285
- for (let W = 0; W < Y; W++) {
286
- const X = R[W], Q = ct(X, S, v, T, j, $);
287
- Q !== void 0 && (U += `${V}${u(X)}:${C}${Q}`, V = B);
280
+ let D = "", Z = "";
281
+ j !== "" && ($ += j, F = `,
282
+ ${$}`, D = " ");
283
+ const X = Math.min(J, M);
284
+ K && !h(S) && (L = l(L)), E.push(S);
285
+ for (let H = 0; H < X; H++) {
286
+ const Q = L[H], tt = ct(Q, S, E, T, j, $);
287
+ tt !== void 0 && (k += `${Z}${u(Q)}:${D}${tt}`, Z = F);
288
288
  }
289
- if (P > N) {
290
- const W = P - N;
291
- U += `${V}"...":${C}"${F(W)} not stringified"`, V = B;
289
+ if (J > M) {
290
+ const H = J - M;
291
+ k += `${Z}"...":${D}"${B(H)} not stringified"`, Z = F;
292
292
  }
293
- return j !== "" && V.length > 1 && (U = `
294
- ${$}${U}
295
- ${O}`), v.pop(), `{${U}}`;
293
+ return j !== "" && Z.length > 1 && (k = `
294
+ ${$}${k}
295
+ ${I}`), E.pop(), `{${k}}`;
296
296
  }
297
297
  case "number":
298
- return isFinite(S) ? String(S) : E ? E(S) : "null";
298
+ return isFinite(S) ? String(S) : b ? b(S) : "null";
299
299
  case "boolean":
300
300
  return S === !0 ? "true" : "false";
301
301
  case "undefined":
302
302
  return;
303
303
  case "bigint":
304
- if (q)
304
+ if (P)
305
305
  return String(S);
306
306
  default:
307
- return E ? E(S) : void 0;
307
+ return b ? b(S) : void 0;
308
308
  }
309
309
  }
310
- function lt(J, h, v, T, j, $) {
311
- switch (typeof h == "object" && h !== null && typeof h.toJSON == "function" && (h = h.toJSON(J)), typeof h) {
310
+ function lt(V, m, E, T, j, $) {
311
+ switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(V)), typeof m) {
312
312
  case "string":
313
- return u(h);
313
+ return u(m);
314
314
  case "object": {
315
- if (h === null)
315
+ if (m === null)
316
316
  return "null";
317
- if (v.indexOf(h) !== -1)
318
- return k;
317
+ if (E.indexOf(m) !== -1)
318
+ return O;
319
319
  const S = $;
320
- let U = "", B = ",";
321
- if (Array.isArray(h)) {
322
- if (h.length === 0)
320
+ let k = "", F = ",";
321
+ if (Array.isArray(m)) {
322
+ if (m.length === 0)
323
323
  return "[]";
324
- if (H < v.length + 1)
324
+ if (Y < E.length + 1)
325
325
  return '"[Array]"';
326
- v.push(h), j !== "" && ($ += j, U += `
327
- ${$}`, B = `,
326
+ E.push(m), j !== "" && ($ += j, k += `
327
+ ${$}`, F = `,
328
328
  ${$}`);
329
- const P = Math.min(h.length, N);
330
- let C = 0;
331
- for (; C < P - 1; C++) {
332
- const Y = lt(String(C), h[C], v, T, j, $);
333
- U += Y !== void 0 ? Y : "null", U += B;
329
+ const J = Math.min(m.length, M);
330
+ let D = 0;
331
+ for (; D < J - 1; D++) {
332
+ const X = lt(String(D), m[D], E, T, j, $);
333
+ k += X !== void 0 ? X : "null", k += F;
334
334
  }
335
- const V = lt(String(C), h[C], v, T, j, $);
336
- if (U += V !== void 0 ? V : "null", h.length - 1 > N) {
337
- const Y = h.length - N - 1;
338
- U += `${B}"... ${F(Y)} not stringified"`;
335
+ const Z = lt(String(D), m[D], E, T, j, $);
336
+ if (k += Z !== void 0 ? Z : "null", m.length - 1 > M) {
337
+ const X = m.length - M - 1;
338
+ k += `${F}"... ${B(X)} not stringified"`;
339
339
  }
340
- return j !== "" && (U += `
341
- ${S}`), v.pop(), `[${U}]`;
340
+ return j !== "" && (k += `
341
+ ${S}`), E.pop(), `[${k}]`;
342
342
  }
343
- v.push(h);
344
- let O = "";
345
- j !== "" && ($ += j, B = `,
346
- ${$}`, O = " ");
347
- let R = "";
348
- for (const P of T) {
349
- const C = lt(P, h[P], v, T, j, $);
350
- C !== void 0 && (U += `${R}${u(P)}:${O}${C}`, R = B);
343
+ E.push(m);
344
+ let I = "";
345
+ j !== "" && ($ += j, F = `,
346
+ ${$}`, I = " ");
347
+ let L = "";
348
+ for (const J of T) {
349
+ const D = lt(J, m[J], E, T, j, $);
350
+ D !== void 0 && (k += `${L}${u(J)}:${I}${D}`, L = F);
351
351
  }
352
- return j !== "" && R.length > 1 && (U = `
353
- ${$}${U}
354
- ${S}`), v.pop(), `{${U}}`;
352
+ return j !== "" && L.length > 1 && (k = `
353
+ ${$}${k}
354
+ ${S}`), E.pop(), `{${k}}`;
355
355
  }
356
356
  case "number":
357
- return isFinite(h) ? String(h) : E ? E(h) : "null";
357
+ return isFinite(m) ? String(m) : b ? b(m) : "null";
358
358
  case "boolean":
359
- return h === !0 ? "true" : "false";
359
+ return m === !0 ? "true" : "false";
360
360
  case "undefined":
361
361
  return;
362
362
  case "bigint":
363
- if (q)
364
- return String(h);
363
+ if (P)
364
+ return String(m);
365
365
  default:
366
- return E ? E(h) : void 0;
366
+ return b ? b(m) : void 0;
367
367
  }
368
368
  }
369
- function ot(J, h, v, T, j) {
370
- switch (typeof h) {
369
+ function ot(V, m, E, T, j) {
370
+ switch (typeof m) {
371
371
  case "string":
372
- return u(h);
372
+ return u(m);
373
373
  case "object": {
374
- if (h === null)
374
+ if (m === null)
375
375
  return "null";
376
- if (typeof h.toJSON == "function") {
377
- if (h = h.toJSON(J), typeof h != "object")
378
- return ot(J, h, v, T, j);
379
- if (h === null)
376
+ if (typeof m.toJSON == "function") {
377
+ if (m = m.toJSON(V), typeof m != "object")
378
+ return ot(V, m, E, T, j);
379
+ if (m === null)
380
380
  return "null";
381
381
  }
382
- if (v.indexOf(h) !== -1)
383
- return k;
382
+ if (E.indexOf(m) !== -1)
383
+ return O;
384
384
  const $ = j;
385
- if (Array.isArray(h)) {
386
- if (h.length === 0)
385
+ if (Array.isArray(m)) {
386
+ if (m.length === 0)
387
387
  return "[]";
388
- if (H < v.length + 1)
388
+ if (Y < E.length + 1)
389
389
  return '"[Array]"';
390
- v.push(h), j += T;
391
- let C = `
390
+ E.push(m), j += T;
391
+ let D = `
392
392
  ${j}`;
393
- const V = `,
394
- ${j}`, Y = Math.min(h.length, N);
395
- let W = 0;
396
- for (; W < Y - 1; W++) {
397
- const Q = ot(String(W), h[W], v, T, j);
398
- C += Q !== void 0 ? Q : "null", C += V;
393
+ const Z = `,
394
+ ${j}`, X = Math.min(m.length, M);
395
+ let H = 0;
396
+ for (; H < X - 1; H++) {
397
+ const tt = ot(String(H), m[H], E, T, j);
398
+ D += tt !== void 0 ? tt : "null", D += Z;
399
399
  }
400
- const X = ot(String(W), h[W], v, T, j);
401
- if (C += X !== void 0 ? X : "null", h.length - 1 > N) {
402
- const Q = h.length - N - 1;
403
- C += `${V}"... ${F(Q)} not stringified"`;
400
+ const Q = ot(String(H), m[H], E, T, j);
401
+ if (D += Q !== void 0 ? Q : "null", m.length - 1 > M) {
402
+ const tt = m.length - M - 1;
403
+ D += `${Z}"... ${B(tt)} not stringified"`;
404
404
  }
405
- return C += `
406
- ${$}`, v.pop(), `[${C}]`;
405
+ return D += `
406
+ ${$}`, E.pop(), `[${D}]`;
407
407
  }
408
- let S = Object.keys(h);
409
- const U = S.length;
410
- if (U === 0)
408
+ let S = Object.keys(m);
409
+ const k = S.length;
410
+ if (k === 0)
411
411
  return "{}";
412
- if (H < v.length + 1)
412
+ if (Y < E.length + 1)
413
413
  return '"[Object]"';
414
414
  j += T;
415
- const B = `,
415
+ const F = `,
416
416
  ${j}`;
417
- let O = "", R = "", P = Math.min(U, N);
418
- x(h) && (O += g(h, B, N), S = S.slice(h.length), P -= h.length, R = B), Z && (S = l(S)), v.push(h);
419
- for (let C = 0; C < P; C++) {
420
- const V = S[C], Y = ot(V, h[V], v, T, j);
421
- Y !== void 0 && (O += `${R}${u(V)}: ${Y}`, R = B);
417
+ let I = "", L = "", J = Math.min(k, M);
418
+ h(m) && (I += y(m, F, M), S = S.slice(m.length), J -= m.length, L = F), K && (S = l(S)), E.push(m);
419
+ for (let D = 0; D < J; D++) {
420
+ const Z = S[D], X = ot(Z, m[Z], E, T, j);
421
+ X !== void 0 && (I += `${L}${u(Z)}: ${X}`, L = F);
422
422
  }
423
- if (U > N) {
424
- const C = U - N;
425
- O += `${R}"...": "${F(C)} not stringified"`, R = B;
423
+ if (k > M) {
424
+ const D = k - M;
425
+ I += `${L}"...": "${B(D)} not stringified"`, L = F;
426
426
  }
427
- return R !== "" && (O = `
428
- ${j}${O}
429
- ${$}`), v.pop(), `{${O}}`;
427
+ return L !== "" && (I = `
428
+ ${j}${I}
429
+ ${$}`), E.pop(), `{${I}}`;
430
430
  }
431
431
  case "number":
432
- return isFinite(h) ? String(h) : E ? E(h) : "null";
432
+ return isFinite(m) ? String(m) : b ? b(m) : "null";
433
433
  case "boolean":
434
- return h === !0 ? "true" : "false";
434
+ return m === !0 ? "true" : "false";
435
435
  case "undefined":
436
436
  return;
437
437
  case "bigint":
438
- if (q)
439
- return String(h);
438
+ if (P)
439
+ return String(m);
440
440
  default:
441
- return E ? E(h) : void 0;
441
+ return b ? b(m) : void 0;
442
442
  }
443
443
  }
444
- function at(J, h, v) {
445
- switch (typeof h) {
444
+ function at(V, m, E) {
445
+ switch (typeof m) {
446
446
  case "string":
447
- return u(h);
447
+ return u(m);
448
448
  case "object": {
449
- if (h === null)
449
+ if (m === null)
450
450
  return "null";
451
- if (typeof h.toJSON == "function") {
452
- if (h = h.toJSON(J), typeof h != "object")
453
- return at(J, h, v);
454
- if (h === null)
451
+ if (typeof m.toJSON == "function") {
452
+ if (m = m.toJSON(V), typeof m != "object")
453
+ return at(V, m, E);
454
+ if (m === null)
455
455
  return "null";
456
456
  }
457
- if (v.indexOf(h) !== -1)
458
- return k;
457
+ if (E.indexOf(m) !== -1)
458
+ return O;
459
459
  let T = "";
460
- if (Array.isArray(h)) {
461
- if (h.length === 0)
460
+ if (Array.isArray(m)) {
461
+ if (m.length === 0)
462
462
  return "[]";
463
- if (H < v.length + 1)
463
+ if (Y < E.length + 1)
464
464
  return '"[Array]"';
465
- v.push(h);
466
- const B = Math.min(h.length, N);
467
- let O = 0;
468
- for (; O < B - 1; O++) {
469
- const P = at(String(O), h[O], v);
470
- T += P !== void 0 ? P : "null", T += ",";
465
+ E.push(m);
466
+ const F = Math.min(m.length, M);
467
+ let I = 0;
468
+ for (; I < F - 1; I++) {
469
+ const J = at(String(I), m[I], E);
470
+ T += J !== void 0 ? J : "null", T += ",";
471
471
  }
472
- const R = at(String(O), h[O], v);
473
- if (T += R !== void 0 ? R : "null", h.length - 1 > N) {
474
- const P = h.length - N - 1;
475
- T += `,"... ${F(P)} not stringified"`;
472
+ const L = at(String(I), m[I], E);
473
+ if (T += L !== void 0 ? L : "null", m.length - 1 > M) {
474
+ const J = m.length - M - 1;
475
+ T += `,"... ${B(J)} not stringified"`;
476
476
  }
477
- return v.pop(), `[${T}]`;
477
+ return E.pop(), `[${T}]`;
478
478
  }
479
- let j = Object.keys(h);
479
+ let j = Object.keys(m);
480
480
  const $ = j.length;
481
481
  if ($ === 0)
482
482
  return "{}";
483
- if (H < v.length + 1)
483
+ if (Y < E.length + 1)
484
484
  return '"[Object]"';
485
- let S = "", U = Math.min($, N);
486
- x(h) && (T += g(h, ",", N), j = j.slice(h.length), U -= h.length, S = ","), Z && (j = l(j)), v.push(h);
487
- for (let B = 0; B < U; B++) {
488
- const O = j[B], R = at(O, h[O], v);
489
- R !== void 0 && (T += `${S}${u(O)}:${R}`, S = ",");
485
+ let S = "", k = Math.min($, M);
486
+ h(m) && (T += y(m, ",", M), j = j.slice(m.length), k -= m.length, S = ","), K && (j = l(j)), E.push(m);
487
+ for (let F = 0; F < k; F++) {
488
+ const I = j[F], L = at(I, m[I], E);
489
+ L !== void 0 && (T += `${S}${u(I)}:${L}`, S = ",");
490
490
  }
491
- if ($ > N) {
492
- const B = $ - N;
493
- T += `${S}"...":"${F(B)} not stringified"`;
491
+ if ($ > M) {
492
+ const F = $ - M;
493
+ T += `${S}"...":"${B(F)} not stringified"`;
494
494
  }
495
- return v.pop(), `{${T}}`;
495
+ return E.pop(), `{${T}}`;
496
496
  }
497
497
  case "number":
498
- return isFinite(h) ? String(h) : E ? E(h) : "null";
498
+ return isFinite(m) ? String(m) : b ? b(m) : "null";
499
499
  case "boolean":
500
- return h === !0 ? "true" : "false";
500
+ return m === !0 ? "true" : "false";
501
501
  case "undefined":
502
502
  return;
503
503
  case "bigint":
504
- if (q)
505
- return String(h);
504
+ if (P)
505
+ return String(m);
506
506
  default:
507
- return E ? E(h) : void 0;
507
+ return b ? b(m) : void 0;
508
508
  }
509
509
  }
510
- function It(J, h, v) {
510
+ function It(V, m, E) {
511
511
  if (arguments.length > 1) {
512
512
  let T = "";
513
- if (typeof v == "number" ? T = " ".repeat(Math.min(v, 10)) : typeof v == "string" && (T = v.slice(0, 10)), h != null) {
514
- if (typeof h == "function")
515
- return ct("", { "": J }, [], h, T, "");
516
- if (Array.isArray(h))
517
- return lt("", J, [], I(h), T, "");
513
+ if (typeof E == "number" ? T = " ".repeat(Math.min(E, 10)) : typeof E == "string" && (T = E.slice(0, 10)), m != null) {
514
+ if (typeof m == "function")
515
+ return ct("", { "": V }, [], m, T, "");
516
+ if (Array.isArray(m))
517
+ return lt("", V, [], W(m), T, "");
518
518
  }
519
519
  if (T.length !== 0)
520
- return ot("", J, [], T, "");
520
+ return ot("", V, [], T, "");
521
521
  }
522
- return at("", J, []);
522
+ return at("", V, []);
523
523
  }
524
524
  return It;
525
525
  }
526
- })(Dt, Dt.exports);
527
- var Je = Dt.exports;
526
+ })($t, $t.exports);
527
+ var Je = $t.exports;
528
528
  const St = /* @__PURE__ */ qt(Je);
529
529
  St.configure;
530
530
  function We(i, r) {
@@ -540,7 +540,7 @@ function Ve(i, r, s) {
540
540
  r.skip && r.skip > 0 && (u.skip = r.skip), l.type === "NOOP" && r.index === l.index && u.skip > l.skip && u.document.operations[f].pop();
541
541
  });
542
542
  }
543
- function Ke(i, r, s) {
543
+ function He(i, r, s) {
544
544
  const { scope: p, input: f } = r;
545
545
  return xt({
546
546
  document: i,
@@ -559,30 +559,30 @@ function Ke(i, r, s) {
559
559
  throw new Error(
560
560
  "Cannot undo: skip value from reducer cannot be used with UNDO action"
561
561
  );
562
- const [a] = l.document.operations[p].slice(-1), x = a.type === "NOOP" && a.skip > 0;
563
- if (l.skip += f, x) {
562
+ const [a] = l.document.operations[p].slice(-1), h = a.type === "NOOP" && a.skip > 0;
563
+ if (l.skip += f, h) {
564
564
  l.skip += a.skip;
565
- const b = l.document.operations[p][l.document.operations[p].length - 2];
566
- b && a.index - b.index === 1 && l.document.operations[p].pop();
565
+ const v = l.document.operations[p][l.document.operations[p].length - 2];
566
+ v && a.index - v.index === 1 && l.document.operations[p].pop();
567
567
  }
568
568
  if (l.document.operations[p].length < l.skip)
569
569
  throw new Error(
570
570
  "Cannot undo: you can't undo more operations than the ones in the scope history"
571
571
  );
572
- const g = l.document.operations[p].length - 1;
573
- let A = f, w = x ? g - a.skip : g;
574
- for (; A > 0 && w >= 0; ) {
575
- const b = l.document.operations[p][w];
576
- if (!b) {
577
- A--, w--;
572
+ const y = l.document.operations[p].length - 1;
573
+ let w = f, _ = h ? y - a.skip : y;
574
+ for (; w > 0 && _ >= 0; ) {
575
+ const v = l.document.operations[p][_];
576
+ if (!v) {
577
+ w--, _--;
578
578
  continue;
579
579
  }
580
- b.type === "NOOP" && b.skip > 0 ? (w = w - (b.skip + 1), l.skip += b.skip + 1) : (l.document.clipboard.push({ ...b }), A--, w--);
580
+ v.type === "NOOP" && v.skip > 0 ? (_ = _ - (v.skip + 1), l.skip += v.skip + 1) : (l.document.clipboard.push({ ...v }), w--, _--);
581
581
  }
582
- l.action = Ht(p);
582
+ l.action = Zt(p);
583
583
  });
584
584
  }
585
- function He(i, r, s) {
585
+ function Ke(i, r, s) {
586
586
  const { scope: p, input: f } = r;
587
587
  return xt({
588
588
  document: i,
@@ -602,17 +602,17 @@ function He(i, r, s) {
602
602
  if (l.document.clipboard.length < 1)
603
603
  throw new Error("Cannot redo: no operations in the clipboard");
604
604
  const a = l.document.clipboard.findLastIndex(
605
- (g) => g.scope === p
605
+ (y) => y.scope === p
606
606
  );
607
607
  if (a < 0)
608
608
  throw new Error(
609
609
  `Cannot redo: no operations in clipboard for scope "${p}"`
610
610
  );
611
- const x = l.document.clipboard.splice(a, 1)[0];
611
+ const h = l.document.clipboard.splice(a, 1)[0];
612
612
  l.action = Ut({
613
- type: x.type,
614
- scope: x.scope,
615
- input: x.input
613
+ type: h.type,
614
+ scope: h.scope,
615
+ input: h.input
616
616
  });
617
617
  });
618
618
  }
@@ -622,32 +622,32 @@ function Ze(i, r, s) {
622
622
  input: { start: u, end: l }
623
623
  } = r;
624
624
  u = u || 0, l = l || f.length;
625
- const a = f.slice(u, l), x = f.slice(0, u), g = f.slice(l), A = Mt(
625
+ const a = f.slice(u, l), h = f.slice(0, u), y = f.slice(l), w = Nt(
626
626
  i.initialState,
627
627
  {
628
628
  ...i.operations,
629
- [p]: x.concat(a)
629
+ [p]: h.concat(a)
630
630
  },
631
631
  s
632
- ), { name: w, state: b } = A, F = x.length, I = x.length ? x[x.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
633
- return Mt(
632
+ ), { name: _, state: v } = w, B = h.length, W = h.length ? h[h.length - 1].timestamp : y.length ? y[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
633
+ return Nt(
634
634
  i.initialState,
635
635
  {
636
636
  ...i.operations,
637
637
  [p]: [
638
- ...x,
638
+ ...h,
639
639
  {
640
640
  ...Kt(
641
- { name: w, state: b },
641
+ { name: _, state: v },
642
642
  a.length
643
643
  ),
644
- timestamp: I,
645
- index: F,
646
- hash: Se({ state: b }, "global")
644
+ timestamp: W,
645
+ index: B,
646
+ hash: Ht({ state: v }, "global")
647
647
  },
648
- ...g.map((G, rt) => ({
649
- ...G,
650
- index: F + rt + 1
648
+ ...y.map((C, R) => ({
649
+ ...C,
650
+ index: B + R + 1
651
651
  }))
652
652
  ]
653
653
  },
@@ -661,7 +661,7 @@ function Ge(i, r) {
661
661
  state: r.state ?? { global: {}, local: {} }
662
662
  };
663
663
  }
664
- const me = "SET_NAME", gt = "UNDO", yt = "REDO", Ft = "PRUNE", xe = "LOAD_STATE", Ye = "NOOP";
664
+ const xe = "SET_NAME", gt = "UNDO", yt = "REDO", Ft = "PRUNE", de = "LOAD_STATE", Ye = "NOOP";
665
665
  function Xe(i, r) {
666
666
  let s;
667
667
  return "index" in r ? s = { ...r } : s = i.operations[r.scope].slice(-1)[0], ((s == null ? void 0 : s.index) ?? -1) + 1;
@@ -708,12 +708,12 @@ function er(i, r, s = 0) {
708
708
  return p = Qe(p, r), p;
709
709
  }
710
710
  function rr(i, r, s) {
711
- switch (se().parse(r), r.type) {
712
- case me:
711
+ switch (pe().parse(r), r.type) {
712
+ case xe:
713
713
  return We(i, r.input);
714
714
  case Ft:
715
715
  return Ze(i, r, s);
716
- case xe:
716
+ case de:
717
717
  return Ge(i, r.input.state);
718
718
  default:
719
719
  return i;
@@ -722,71 +722,72 @@ function rr(i, r, s) {
722
722
  function ir(i, r, s) {
723
723
  switch (r.type) {
724
724
  case gt:
725
- return Ke(i, r, s);
726
- case yt:
727
725
  return He(i, r, s);
726
+ case yt:
727
+ return Ke(i, r, s);
728
728
  default:
729
729
  return { document: i, action: r, skip: s };
730
730
  }
731
731
  }
732
- function de(i, r, s, p, f = {}) {
733
- const { skip: u, ignoreSkipOperations: l = !1 } = f;
734
- let a = { ...r }, x = u || 0, g = i, A = [...i.clipboard];
735
- if (Nr(a)) {
736
- const { document: w, skip: b } = Ve(g, a, x);
737
- x = b, g = w;
732
+ function ge(i, r, s, p, f = {}) {
733
+ const { skip: u, ignoreSkipOperations: l = !1, reuseHash: a = !1 } = f;
734
+ let h = { ...r }, y = u || 0, w = i, _ = [...i.clipboard];
735
+ if (Mr(h)) {
736
+ const { document: v, skip: B } = Ve(w, h, y);
737
+ y = B, w = v;
738
738
  }
739
- if (Yt(a)) {
739
+ if (Xt(h)) {
740
740
  const {
741
- skip: w,
742
- action: b,
743
- document: F
744
- } = ir(i, a, x);
745
- a = b, x = w, g = F, A = [...g.clipboard];
746
- }
747
- if (Xt(a) && (g = rr(g, a, s)), x > 0 && !l) {
748
- let w = x;
749
- "index" in a && (w = qr(
750
- g.operations[a.scope],
751
- a.index,
752
- x
753
- )), g = Mt(
754
- g.initialState,
755
- g.operations,
741
+ skip: v,
742
+ action: B,
743
+ document: W
744
+ } = ir(i, h, y);
745
+ h = B, y = v, w = W, _ = [...w.clipboard];
746
+ }
747
+ if (Qt(h) && (w = rr(w, h, s)), y > 0 && !l) {
748
+ let v = y;
749
+ "index" in h && (v = qr(
750
+ w.operations[h.scope],
751
+ h.index,
752
+ y
753
+ )), w = Nt(
754
+ w.initialState,
755
+ w.operations,
756
756
  s,
757
757
  void 0,
758
758
  void 0,
759
759
  void 0,
760
- { [a.scope]: w }
760
+ { [h.scope]: v }
761
+ // TODO reuse hash?
761
762
  );
762
763
  }
763
- return g = er(g, a, x), g = xt(g, (w) => {
764
- const b = s(
765
- w.state,
766
- a,
764
+ return w = er(w, h, y), w = xt(w, (v) => {
765
+ const B = s(
766
+ v.state,
767
+ h,
767
768
  p
768
- ), F = Yt(r) ? [...A] : [];
769
- if (b)
769
+ ), W = Xt(r) ? [..._] : [];
770
+ if (B)
770
771
  return Ut({
771
- ...g,
772
- clipboard: [...F],
773
- state: b
772
+ ...w,
773
+ clipboard: [...W],
774
+ state: B
774
775
  });
775
- w.clipboard = Ut([...F]);
776
- }), xt(g, (w) => {
777
- if ([gt, yt, Ft].includes(a.type))
778
- return w;
779
- const b = a.scope || "global";
780
- w.operations[b][w.operations[b].length - 1].hash = Se(w, b), !Xt(a) && a.attachments && a.attachments.forEach((F) => {
781
- const { hash: I, ...G } = F;
782
- w.attachments[I] = {
783
- ...G
776
+ v.clipboard = Ut([...W]);
777
+ }), xt(w, (v) => {
778
+ if ([gt, yt, Ft].includes(h.type))
779
+ return v;
780
+ const B = h.scope || "global", W = a && Object.prototype.hasOwnProperty.call(h, "hash") ? h.hash : Ht(v, B);
781
+ v.operations[B][v.operations[B].length - 1].hash = W, !Qt(h) && h.attachments && h.attachments.forEach((C) => {
782
+ const { hash: R, ...g } = C;
783
+ v.attachments[R] = {
784
+ ...g
784
785
  };
785
786
  });
786
787
  });
787
788
  }
788
- var $t = { exports: {} };
789
- typeof Object.create == "function" ? $t.exports = function(r, s) {
789
+ var Dt = { exports: {} };
790
+ typeof Object.create == "function" ? Dt.exports = function(r, s) {
790
791
  s && (r.super_ = s, r.prototype = Object.create(s.prototype, {
791
792
  constructor: {
792
793
  value: r,
@@ -795,7 +796,7 @@ typeof Object.create == "function" ? $t.exports = function(r, s) {
795
796
  configurable: !0
796
797
  }
797
798
  }));
798
- } : $t.exports = function(r, s) {
799
+ } : Dt.exports = function(r, s) {
799
800
  if (s) {
800
801
  r.super_ = s;
801
802
  var p = function() {
@@ -803,16 +804,16 @@ typeof Object.create == "function" ? $t.exports = function(r, s) {
803
804
  p.prototype = s.prototype, r.prototype = new p(), r.prototype.constructor = r;
804
805
  }
805
806
  };
806
- var ge = $t.exports, Ct = { exports: {} }, ye = {}, Bt = {};
807
+ var ye = Dt.exports, Ct = { exports: {} }, we = {}, Bt = {};
807
808
  Bt.byteLength = ar;
808
809
  Bt.toByteArray = pr;
809
810
  Bt.fromByteArray = ur;
810
- var nt = [], et = [], nr = typeof Uint8Array < "u" ? Uint8Array : Array, kt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
811
+ var nt = [], rt = [], nr = typeof Uint8Array < "u" ? Uint8Array : Array, kt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
811
812
  for (var ut = 0, or = kt.length; ut < or; ++ut)
812
- nt[ut] = kt[ut], et[kt.charCodeAt(ut)] = ut;
813
- et[45] = 62;
814
- et[95] = 63;
815
- function we(i) {
813
+ nt[ut] = kt[ut], rt[kt.charCodeAt(ut)] = ut;
814
+ rt[45] = 62;
815
+ rt[95] = 63;
816
+ function be(i) {
816
817
  var r = i.length;
817
818
  if (r % 4 > 0)
818
819
  throw new Error("Invalid string. Length must be a multiple of 4");
@@ -822,17 +823,17 @@ function we(i) {
822
823
  return [s, p];
823
824
  }
824
825
  function ar(i) {
825
- var r = we(i), s = r[0], p = r[1];
826
+ var r = be(i), s = r[0], p = r[1];
826
827
  return (s + p) * 3 / 4 - p;
827
828
  }
828
829
  function sr(i, r, s) {
829
830
  return (r + s) * 3 / 4 - s;
830
831
  }
831
832
  function pr(i) {
832
- var r, s = we(i), p = s[0], f = s[1], u = new nr(sr(i, p, f)), l = 0, a = f > 0 ? p - 4 : p, x;
833
- for (x = 0; x < a; x += 4)
834
- r = et[i.charCodeAt(x)] << 18 | et[i.charCodeAt(x + 1)] << 12 | et[i.charCodeAt(x + 2)] << 6 | et[i.charCodeAt(x + 3)], u[l++] = r >> 16 & 255, u[l++] = r >> 8 & 255, u[l++] = r & 255;
835
- return f === 2 && (r = et[i.charCodeAt(x)] << 2 | et[i.charCodeAt(x + 1)] >> 4, u[l++] = r & 255), f === 1 && (r = et[i.charCodeAt(x)] << 10 | et[i.charCodeAt(x + 1)] << 4 | et[i.charCodeAt(x + 2)] >> 2, u[l++] = r >> 8 & 255, u[l++] = r & 255), u;
833
+ var r, s = be(i), p = s[0], f = s[1], u = new nr(sr(i, p, f)), l = 0, a = f > 0 ? p - 4 : p, h;
834
+ for (h = 0; h < a; h += 4)
835
+ r = rt[i.charCodeAt(h)] << 18 | rt[i.charCodeAt(h + 1)] << 12 | rt[i.charCodeAt(h + 2)] << 6 | rt[i.charCodeAt(h + 3)], u[l++] = r >> 16 & 255, u[l++] = r >> 8 & 255, u[l++] = r & 255;
836
+ return f === 2 && (r = rt[i.charCodeAt(h)] << 2 | rt[i.charCodeAt(h + 1)] >> 4, u[l++] = r & 255), f === 1 && (r = rt[i.charCodeAt(h)] << 10 | rt[i.charCodeAt(h + 1)] << 4 | rt[i.charCodeAt(h + 2)] >> 2, u[l++] = r >> 8 & 255, u[l++] = r & 255), u;
836
837
  }
837
838
  function cr(i) {
838
839
  return nt[i >> 18 & 63] + nt[i >> 12 & 63] + nt[i >> 6 & 63] + nt[i & 63];
@@ -854,27 +855,27 @@ function ur(i) {
854
855
  var Jt = {};
855
856
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
856
857
  Jt.read = function(i, r, s, p, f) {
857
- var u, l, a = f * 8 - p - 1, x = (1 << a) - 1, g = x >> 1, A = -7, w = s ? f - 1 : 0, b = s ? -1 : 1, F = i[r + w];
858
- for (w += b, u = F & (1 << -A) - 1, F >>= -A, A += a; A > 0; u = u * 256 + i[r + w], w += b, A -= 8)
858
+ var u, l, a = f * 8 - p - 1, h = (1 << a) - 1, y = h >> 1, w = -7, _ = s ? f - 1 : 0, v = s ? -1 : 1, B = i[r + _];
859
+ for (_ += v, u = B & (1 << -w) - 1, B >>= -w, w += a; w > 0; u = u * 256 + i[r + _], _ += v, w -= 8)
859
860
  ;
860
- for (l = u & (1 << -A) - 1, u >>= -A, A += p; A > 0; l = l * 256 + i[r + w], w += b, A -= 8)
861
+ for (l = u & (1 << -w) - 1, u >>= -w, w += p; w > 0; l = l * 256 + i[r + _], _ += v, w -= 8)
861
862
  ;
862
863
  if (u === 0)
863
- u = 1 - g;
864
+ u = 1 - y;
864
865
  else {
865
- if (u === x)
866
- return l ? NaN : (F ? -1 : 1) * (1 / 0);
867
- l = l + Math.pow(2, p), u = u - g;
866
+ if (u === h)
867
+ return l ? NaN : (B ? -1 : 1) * (1 / 0);
868
+ l = l + Math.pow(2, p), u = u - y;
868
869
  }
869
- return (F ? -1 : 1) * l * Math.pow(2, u - p);
870
+ return (B ? -1 : 1) * l * Math.pow(2, u - p);
870
871
  };
871
872
  Jt.write = function(i, r, s, p, f, u) {
872
- var l, a, x, g = u * 8 - f - 1, A = (1 << g) - 1, w = A >> 1, b = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = p ? 0 : u - 1, I = p ? 1 : -1, G = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
873
- for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, l = A) : (l = Math.floor(Math.log(r) / Math.LN2), r * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + w >= 1 ? r += b / x : r += b * Math.pow(2, 1 - w), r * x >= 2 && (l++, x /= 2), l + w >= A ? (a = 0, l = A) : l + w >= 1 ? (a = (r * x - 1) * Math.pow(2, f), l = l + w) : (a = r * Math.pow(2, w - 1) * Math.pow(2, f), l = 0)); f >= 8; i[s + F] = a & 255, F += I, a /= 256, f -= 8)
873
+ var l, a, h, y = u * 8 - f - 1, w = (1 << y) - 1, _ = w >> 1, v = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, B = p ? 0 : u - 1, W = p ? 1 : -1, C = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
874
+ for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, l = w) : (l = Math.floor(Math.log(r) / Math.LN2), r * (h = Math.pow(2, -l)) < 1 && (l--, h *= 2), l + _ >= 1 ? r += v / h : r += v * Math.pow(2, 1 - _), r * h >= 2 && (l++, h /= 2), l + _ >= w ? (a = 0, l = w) : l + _ >= 1 ? (a = (r * h - 1) * Math.pow(2, f), l = l + _) : (a = r * Math.pow(2, _ - 1) * Math.pow(2, f), l = 0)); f >= 8; i[s + B] = a & 255, B += W, a /= 256, f -= 8)
874
875
  ;
875
- for (l = l << f | a, g += f; g > 0; i[s + F] = l & 255, F += I, l /= 256, g -= 8)
876
+ for (l = l << f | a, y += f; y > 0; i[s + B] = l & 255, B += W, l /= 256, y -= 8)
876
877
  ;
877
- i[s + F - I] |= G * 128;
878
+ i[s + B - W] |= C * 128;
878
879
  };
879
880
  /*!
880
881
  * The buffer module from node.js, for the browser.
@@ -884,7 +885,7 @@ Jt.write = function(i, r, s, p, f, u) {
884
885
  */
885
886
  (function(i) {
886
887
  var r = Bt, s = Jt, p = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
887
- i.Buffer = a, i.SlowBuffer = E, i.INSPECT_MAX_BYTES = 50;
888
+ i.Buffer = a, i.SlowBuffer = b, i.INSPECT_MAX_BYTES = 50;
888
889
  var f = 2147483647;
889
890
  i.kMaxLength = f, a.TYPED_ARRAY_SUPPORT = u(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
890
891
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
@@ -924,22 +925,22 @@ Jt.write = function(i, r, s, p, f, u) {
924
925
  throw new TypeError(
925
926
  'The "string" argument must be of type string. Received type number'
926
927
  );
927
- return w(n);
928
+ return _(n);
928
929
  }
929
- return x(n, t, e);
930
+ return h(n, t, e);
930
931
  }
931
932
  a.poolSize = 8192;
932
- function x(n, t, e) {
933
+ function h(n, t, e) {
933
934
  if (typeof n == "string")
934
- return b(n, t);
935
+ return v(n, t);
935
936
  if (ArrayBuffer.isView(n))
936
- return I(n);
937
+ return W(n);
937
938
  if (n == null)
938
939
  throw new TypeError(
939
940
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof n
940
941
  );
941
942
  if (it(n, ArrayBuffer) || n && it(n.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (it(n, SharedArrayBuffer) || n && it(n.buffer, SharedArrayBuffer)))
942
- return G(n, t, e);
943
+ return C(n, t, e);
943
944
  if (typeof n == "number")
944
945
  throw new TypeError(
945
946
  'The "value" argument must not be of type number. Received type number'
@@ -947,7 +948,7 @@ Jt.write = function(i, r, s, p, f, u) {
947
948
  var o = n.valueOf && n.valueOf();
948
949
  if (o != null && o !== n)
949
950
  return a.from(o, t, e);
950
- var c = rt(n);
951
+ var c = R(n);
951
952
  if (c)
952
953
  return c;
953
954
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof n[Symbol.toPrimitive] == "function")
@@ -961,47 +962,47 @@ Jt.write = function(i, r, s, p, f, u) {
961
962
  );
962
963
  }
963
964
  a.from = function(n, t, e) {
964
- return x(n, t, e);
965
+ return h(n, t, e);
965
966
  }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
966
- function g(n) {
967
+ function y(n) {
967
968
  if (typeof n != "number")
968
969
  throw new TypeError('"size" argument must be of type number');
969
970
  if (n < 0)
970
971
  throw new RangeError('The value "' + n + '" is invalid for option "size"');
971
972
  }
972
- function A(n, t, e) {
973
- return g(n), n <= 0 ? l(n) : t !== void 0 ? typeof e == "string" ? l(n).fill(t, e) : l(n).fill(t) : l(n);
973
+ function w(n, t, e) {
974
+ return y(n), n <= 0 ? l(n) : t !== void 0 ? typeof e == "string" ? l(n).fill(t, e) : l(n).fill(t) : l(n);
974
975
  }
975
976
  a.alloc = function(n, t, e) {
976
- return A(n, t, e);
977
+ return w(n, t, e);
977
978
  };
978
- function w(n) {
979
- return g(n), l(n < 0 ? 0 : y(n) | 0);
979
+ function _(n) {
980
+ return y(n), l(n < 0 ? 0 : g(n) | 0);
980
981
  }
981
982
  a.allocUnsafe = function(n) {
982
- return w(n);
983
+ return _(n);
983
984
  }, a.allocUnsafeSlow = function(n) {
984
- return w(n);
985
+ return _(n);
985
986
  };
986
- function b(n, t) {
987
+ function v(n, t) {
987
988
  if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
988
989
  throw new TypeError("Unknown encoding: " + t);
989
- var e = k(n, t) | 0, o = l(e), c = o.write(n, t);
990
+ var e = O(n, t) | 0, o = l(e), c = o.write(n, t);
990
991
  return c !== e && (o = o.slice(0, c)), o;
991
992
  }
992
- function F(n) {
993
- for (var t = n.length < 0 ? 0 : y(n.length) | 0, e = l(t), o = 0; o < t; o += 1)
993
+ function B(n) {
994
+ for (var t = n.length < 0 ? 0 : g(n.length) | 0, e = l(t), o = 0; o < t; o += 1)
994
995
  e[o] = n[o] & 255;
995
996
  return e;
996
997
  }
997
- function I(n) {
998
+ function W(n) {
998
999
  if (it(n, Uint8Array)) {
999
1000
  var t = new Uint8Array(n);
1000
- return G(t.buffer, t.byteOffset, t.byteLength);
1001
+ return C(t.buffer, t.byteOffset, t.byteLength);
1001
1002
  }
1002
- return F(n);
1003
+ return B(n);
1003
1004
  }
1004
- function G(n, t, e) {
1005
+ function C(n, t, e) {
1005
1006
  if (t < 0 || n.byteLength < t)
1006
1007
  throw new RangeError('"offset" is outside of buffer bounds');
1007
1008
  if (n.byteLength < t + (e || 0))
@@ -1009,22 +1010,22 @@ Jt.write = function(i, r, s, p, f, u) {
1009
1010
  var o;
1010
1011
  return t === void 0 && e === void 0 ? o = new Uint8Array(n) : e === void 0 ? o = new Uint8Array(n, t) : o = new Uint8Array(n, t, e), Object.setPrototypeOf(o, a.prototype), o;
1011
1012
  }
1012
- function rt(n) {
1013
+ function R(n) {
1013
1014
  if (a.isBuffer(n)) {
1014
- var t = y(n.length) | 0, e = l(t);
1015
+ var t = g(n.length) | 0, e = l(t);
1015
1016
  return e.length === 0 || n.copy(e, 0, 0, t), e;
1016
1017
  }
1017
1018
  if (n.length !== void 0)
1018
- return typeof n.length != "number" || Tt(n.length) ? l(0) : F(n);
1019
+ return typeof n.length != "number" || Tt(n.length) ? l(0) : B(n);
1019
1020
  if (n.type === "Buffer" && Array.isArray(n.data))
1020
- return F(n.data);
1021
+ return B(n.data);
1021
1022
  }
1022
- function y(n) {
1023
+ function g(n) {
1023
1024
  if (n >= f)
1024
1025
  throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
1025
1026
  return n | 0;
1026
1027
  }
1027
- function E(n) {
1028
+ function b(n) {
1028
1029
  return +n != n && (n = 0), a.alloc(+n);
1029
1030
  }
1030
1031
  a.isBuffer = function(t) {
@@ -1036,9 +1037,9 @@ Jt.write = function(i, r, s, p, f, u) {
1036
1037
  );
1037
1038
  if (t === e)
1038
1039
  return 0;
1039
- for (var o = t.length, c = e.length, m = 0, d = Math.min(o, c); m < d; ++m)
1040
- if (t[m] !== e[m]) {
1041
- o = t[m], c = e[m];
1040
+ for (var o = t.length, c = e.length, x = 0, d = Math.min(o, c); x < d; ++x)
1041
+ if (t[x] !== e[x]) {
1042
+ o = t[x], c = e[x];
1042
1043
  break;
1043
1044
  }
1044
1045
  return o < c ? -1 : c < o ? 1 : 0;
@@ -1068,24 +1069,24 @@ Jt.write = function(i, r, s, p, f, u) {
1068
1069
  if (e === void 0)
1069
1070
  for (e = 0, o = 0; o < t.length; ++o)
1070
1071
  e += t[o].length;
1071
- var c = a.allocUnsafe(e), m = 0;
1072
+ var c = a.allocUnsafe(e), x = 0;
1072
1073
  for (o = 0; o < t.length; ++o) {
1073
1074
  var d = t[o];
1074
1075
  if (it(d, Uint8Array))
1075
- m + d.length > c.length ? a.from(d).copy(c, m) : Uint8Array.prototype.set.call(
1076
+ x + d.length > c.length ? a.from(d).copy(c, x) : Uint8Array.prototype.set.call(
1076
1077
  c,
1077
1078
  d,
1078
- m
1079
+ x
1079
1080
  );
1080
1081
  else if (a.isBuffer(d))
1081
- d.copy(c, m);
1082
+ d.copy(c, x);
1082
1083
  else
1083
1084
  throw new TypeError('"list" argument must be an Array of Buffers');
1084
- m += d.length;
1085
+ x += d.length;
1085
1086
  }
1086
1087
  return c;
1087
1088
  };
1088
- function k(n, t) {
1089
+ function O(n, t) {
1089
1090
  if (a.isBuffer(n))
1090
1091
  return n.length;
1091
1092
  if (ArrayBuffer.isView(n) || it(n, ArrayBuffer))
@@ -1105,7 +1106,7 @@ Jt.write = function(i, r, s, p, f, u) {
1105
1106
  return e;
1106
1107
  case "utf8":
1107
1108
  case "utf-8":
1108
- return W(n).length;
1109
+ return H(n).length;
1109
1110
  case "ucs2":
1110
1111
  case "ucs-2":
1111
1112
  case "utf16le":
@@ -1117,12 +1118,12 @@ Jt.write = function(i, r, s, p, f, u) {
1117
1118
  return st(n).length;
1118
1119
  default:
1119
1120
  if (c)
1120
- return o ? -1 : W(n).length;
1121
+ return o ? -1 : H(n).length;
1121
1122
  t = ("" + t).toLowerCase(), c = !0;
1122
1123
  }
1123
1124
  }
1124
- a.byteLength = k;
1125
- function q(n, t, e) {
1125
+ a.byteLength = O;
1126
+ function P(n, t, e) {
1126
1127
  var o = !1;
1127
1128
  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))
1128
1129
  return "";
@@ -1132,19 +1133,19 @@ Jt.write = function(i, r, s, p, f, u) {
1132
1133
  return S(this, t, e);
1133
1134
  case "utf8":
1134
1135
  case "utf-8":
1135
- return h(this, t, e);
1136
+ return m(this, t, e);
1136
1137
  case "ascii":
1137
1138
  return j(this, t, e);
1138
1139
  case "latin1":
1139
1140
  case "binary":
1140
1141
  return $(this, t, e);
1141
1142
  case "base64":
1142
- return J(this, t, e);
1143
+ return V(this, t, e);
1143
1144
  case "ucs2":
1144
1145
  case "ucs-2":
1145
1146
  case "utf16le":
1146
1147
  case "utf-16le":
1147
- return U(this, t, e);
1148
+ return k(this, t, e);
1148
1149
  default:
1149
1150
  if (o)
1150
1151
  throw new TypeError("Unknown encoding: " + n);
@@ -1152,7 +1153,7 @@ Jt.write = function(i, r, s, p, f, u) {
1152
1153
  }
1153
1154
  }
1154
1155
  a.prototype._isBuffer = !0;
1155
- function Z(n, t, e) {
1156
+ function K(n, t, e) {
1156
1157
  var o = n[t];
1157
1158
  n[t] = n[e], n[e] = o;
1158
1159
  }
@@ -1161,25 +1162,25 @@ Jt.write = function(i, r, s, p, f, u) {
1161
1162
  if (t % 2 !== 0)
1162
1163
  throw new RangeError("Buffer size must be a multiple of 16-bits");
1163
1164
  for (var e = 0; e < t; e += 2)
1164
- Z(this, e, e + 1);
1165
+ K(this, e, e + 1);
1165
1166
  return this;
1166
1167
  }, a.prototype.swap32 = function() {
1167
1168
  var t = this.length;
1168
1169
  if (t % 4 !== 0)
1169
1170
  throw new RangeError("Buffer size must be a multiple of 32-bits");
1170
1171
  for (var e = 0; e < t; e += 4)
1171
- Z(this, e, e + 3), Z(this, e + 1, e + 2);
1172
+ K(this, e, e + 3), K(this, e + 1, e + 2);
1172
1173
  return this;
1173
1174
  }, a.prototype.swap64 = function() {
1174
1175
  var t = this.length;
1175
1176
  if (t % 8 !== 0)
1176
1177
  throw new RangeError("Buffer size must be a multiple of 64-bits");
1177
1178
  for (var e = 0; e < t; e += 8)
1178
- Z(this, e, e + 7), Z(this, e + 1, e + 6), Z(this, e + 2, e + 5), Z(this, e + 3, e + 4);
1179
+ K(this, e, e + 7), K(this, e + 1, e + 6), K(this, e + 2, e + 5), K(this, e + 3, e + 4);
1179
1180
  return this;
1180
1181
  }, a.prototype.toString = function() {
1181
1182
  var t = this.length;
1182
- return t === 0 ? "" : arguments.length === 0 ? h(this, 0, t) : q.apply(this, arguments);
1183
+ return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) : P.apply(this, arguments);
1183
1184
  }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
1184
1185
  if (!a.isBuffer(t))
1185
1186
  throw new TypeError("Argument must be a Buffer");
@@ -1187,29 +1188,29 @@ Jt.write = function(i, r, s, p, f, u) {
1187
1188
  }, a.prototype.inspect = function() {
1188
1189
  var t = "", e = i.INSPECT_MAX_BYTES;
1189
1190
  return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
1190
- }, p && (a.prototype[p] = a.prototype.inspect), a.prototype.compare = function(t, e, o, c, m) {
1191
+ }, p && (a.prototype[p] = a.prototype.inspect), a.prototype.compare = function(t, e, o, c, x) {
1191
1192
  if (it(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
1192
1193
  throw new TypeError(
1193
1194
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
1194
1195
  );
1195
- if (e === void 0 && (e = 0), o === void 0 && (o = t ? t.length : 0), c === void 0 && (c = 0), m === void 0 && (m = this.length), e < 0 || o > t.length || c < 0 || m > this.length)
1196
+ if (e === void 0 && (e = 0), o === void 0 && (o = t ? t.length : 0), c === void 0 && (c = 0), x === void 0 && (x = this.length), e < 0 || o > t.length || c < 0 || x > this.length)
1196
1197
  throw new RangeError("out of range index");
1197
- if (c >= m && e >= o)
1198
+ if (c >= x && e >= o)
1198
1199
  return 0;
1199
- if (c >= m)
1200
+ if (c >= x)
1200
1201
  return -1;
1201
1202
  if (e >= o)
1202
1203
  return 1;
1203
- if (e >>>= 0, o >>>= 0, c >>>= 0, m >>>= 0, this === t)
1204
+ if (e >>>= 0, o >>>= 0, c >>>= 0, x >>>= 0, this === t)
1204
1205
  return 0;
1205
- for (var d = m - c, D = o - e, M = Math.min(d, D), L = this.slice(c, m), K = t.slice(e, o), z = 0; z < M; ++z)
1206
- if (L[z] !== K[z]) {
1207
- d = L[z], D = K[z];
1206
+ for (var d = x - c, U = o - e, N = Math.min(d, U), z = this.slice(c, x), G = t.slice(e, o), q = 0; q < N; ++q)
1207
+ if (z[q] !== G[q]) {
1208
+ d = z[q], U = G[q];
1208
1209
  break;
1209
1210
  }
1210
- return d < D ? -1 : D < d ? 1 : 0;
1211
+ return d < U ? -1 : U < d ? 1 : 0;
1211
1212
  };
1212
- function H(n, t, e, o, c) {
1213
+ function Y(n, t, e, o, c) {
1213
1214
  if (n.length === 0)
1214
1215
  return -1;
1215
1216
  if (typeof e == "string" ? (o = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, Tt(e) && (e = c ? 0 : n.length - 1), e < 0 && (e = n.length + e), e >= n.length) {
@@ -1222,74 +1223,74 @@ Jt.write = function(i, r, s, p, f, u) {
1222
1223
  else
1223
1224
  return -1;
1224
1225
  if (typeof t == "string" && (t = a.from(t, o)), a.isBuffer(t))
1225
- return t.length === 0 ? -1 : N(n, t, e, o, c);
1226
+ return t.length === 0 ? -1 : M(n, t, e, o, c);
1226
1227
  if (typeof t == "number")
1227
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? c ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) : N(n, [t], e, o, c);
1228
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? c ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) : M(n, [t], e, o, c);
1228
1229
  throw new TypeError("val must be string, number or Buffer");
1229
1230
  }
1230
- function N(n, t, e, o, c) {
1231
- var m = 1, d = n.length, D = t.length;
1231
+ function M(n, t, e, o, c) {
1232
+ var x = 1, d = n.length, U = t.length;
1232
1233
  if (o !== void 0 && (o = String(o).toLowerCase(), o === "ucs2" || o === "ucs-2" || o === "utf16le" || o === "utf-16le")) {
1233
1234
  if (n.length < 2 || t.length < 2)
1234
1235
  return -1;
1235
- m = 2, d /= 2, D /= 2, e /= 2;
1236
+ x = 2, d /= 2, U /= 2, e /= 2;
1236
1237
  }
1237
- function M(Zt, Gt) {
1238
- return m === 1 ? Zt[Gt] : Zt.readUInt16BE(Gt * m);
1238
+ function N(Gt, Yt) {
1239
+ return x === 1 ? Gt[Yt] : Gt.readUInt16BE(Yt * x);
1239
1240
  }
1240
- var L;
1241
+ var z;
1241
1242
  if (c) {
1242
- var K = -1;
1243
- for (L = e; L < d; L++)
1244
- if (M(n, L) === M(t, K === -1 ? 0 : L - K)) {
1245
- if (K === -1 && (K = L), L - K + 1 === D)
1246
- return K * m;
1243
+ var G = -1;
1244
+ for (z = e; z < d; z++)
1245
+ if (N(n, z) === N(t, G === -1 ? 0 : z - G)) {
1246
+ if (G === -1 && (G = z), z - G + 1 === U)
1247
+ return G * x;
1247
1248
  } else
1248
- K !== -1 && (L -= L - K), K = -1;
1249
+ G !== -1 && (z -= z - G), G = -1;
1249
1250
  } else
1250
- for (e + D > d && (e = d - D), L = e; L >= 0; L--) {
1251
- for (var z = !0, vt = 0; vt < D; vt++)
1252
- if (M(n, L + vt) !== M(t, vt)) {
1253
- z = !1;
1251
+ for (e + U > d && (e = d - U), z = e; z >= 0; z--) {
1252
+ for (var q = !0, vt = 0; vt < U; vt++)
1253
+ if (N(n, z + vt) !== N(t, vt)) {
1254
+ q = !1;
1254
1255
  break;
1255
1256
  }
1256
- if (z)
1257
- return L;
1257
+ if (q)
1258
+ return z;
1258
1259
  }
1259
1260
  return -1;
1260
1261
  }
1261
1262
  a.prototype.includes = function(t, e, o) {
1262
1263
  return this.indexOf(t, e, o) !== -1;
1263
1264
  }, a.prototype.indexOf = function(t, e, o) {
1264
- return H(this, t, e, o, !0);
1265
+ return Y(this, t, e, o, !0);
1265
1266
  }, a.prototype.lastIndexOf = function(t, e, o) {
1266
- return H(this, t, e, o, !1);
1267
+ return Y(this, t, e, o, !1);
1267
1268
  };
1268
1269
  function ct(n, t, e, o) {
1269
1270
  e = Number(e) || 0;
1270
1271
  var c = n.length - e;
1271
1272
  o ? (o = Number(o), o > c && (o = c)) : o = c;
1272
- var m = t.length;
1273
- o > m / 2 && (o = m / 2);
1273
+ var x = t.length;
1274
+ o > x / 2 && (o = x / 2);
1274
1275
  for (var d = 0; d < o; ++d) {
1275
- var D = parseInt(t.substr(d * 2, 2), 16);
1276
- if (Tt(D))
1276
+ var U = parseInt(t.substr(d * 2, 2), 16);
1277
+ if (Tt(U))
1277
1278
  return d;
1278
- n[e + d] = D;
1279
+ n[e + d] = U;
1279
1280
  }
1280
1281
  return d;
1281
1282
  }
1282
1283
  function lt(n, t, e, o) {
1283
- return Et(W(t, n.length - e), n, e, o);
1284
+ return Et(H(t, n.length - e), n, e, o);
1284
1285
  }
1285
1286
  function ot(n, t, e, o) {
1286
- return Et(X(t), n, e, o);
1287
+ return Et(Q(t), n, e, o);
1287
1288
  }
1288
1289
  function at(n, t, e, o) {
1289
1290
  return Et(st(t), n, e, o);
1290
1291
  }
1291
1292
  function It(n, t, e, o) {
1292
- return Et(Q(t, n.length - e), n, e, o);
1293
+ return Et(tt(t, n.length - e), n, e, o);
1293
1294
  }
1294
1295
  a.prototype.write = function(t, e, o, c) {
1295
1296
  if (e === void 0)
@@ -1302,8 +1303,8 @@ Jt.write = function(i, r, s, p, f, u) {
1302
1303
  throw new Error(
1303
1304
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
1304
1305
  );
1305
- var m = this.length - e;
1306
- if ((o === void 0 || o > m) && (o = m), t.length > 0 && (o < 0 || e < 0) || e > this.length)
1306
+ var x = this.length - e;
1307
+ if ((o === void 0 || o > x) && (o = x), t.length > 0 && (o < 0 || e < 0) || e > this.length)
1307
1308
  throw new RangeError("Attempt to write outside buffer bounds");
1308
1309
  c || (c = "utf8");
1309
1310
  for (var d = !1; ; )
@@ -1335,42 +1336,42 @@ Jt.write = function(i, r, s, p, f, u) {
1335
1336
  data: Array.prototype.slice.call(this._arr || this, 0)
1336
1337
  };
1337
1338
  };
1338
- function J(n, t, e) {
1339
+ function V(n, t, e) {
1339
1340
  return t === 0 && e === n.length ? r.fromByteArray(n) : r.fromByteArray(n.slice(t, e));
1340
1341
  }
1341
- function h(n, t, e) {
1342
+ function m(n, t, e) {
1342
1343
  e = Math.min(n.length, e);
1343
1344
  for (var o = [], c = t; c < e; ) {
1344
- var m = n[c], d = null, D = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
1345
- if (c + D <= e) {
1346
- var M, L, K, z;
1347
- switch (D) {
1345
+ var x = n[c], d = null, U = x > 239 ? 4 : x > 223 ? 3 : x > 191 ? 2 : 1;
1346
+ if (c + U <= e) {
1347
+ var N, z, G, q;
1348
+ switch (U) {
1348
1349
  case 1:
1349
- m < 128 && (d = m);
1350
+ x < 128 && (d = x);
1350
1351
  break;
1351
1352
  case 2:
1352
- M = n[c + 1], (M & 192) === 128 && (z = (m & 31) << 6 | M & 63, z > 127 && (d = z));
1353
+ N = n[c + 1], (N & 192) === 128 && (q = (x & 31) << 6 | N & 63, q > 127 && (d = q));
1353
1354
  break;
1354
1355
  case 3:
1355
- M = n[c + 1], L = n[c + 2], (M & 192) === 128 && (L & 192) === 128 && (z = (m & 15) << 12 | (M & 63) << 6 | L & 63, z > 2047 && (z < 55296 || z > 57343) && (d = z));
1356
+ N = n[c + 1], z = n[c + 2], (N & 192) === 128 && (z & 192) === 128 && (q = (x & 15) << 12 | (N & 63) << 6 | z & 63, q > 2047 && (q < 55296 || q > 57343) && (d = q));
1356
1357
  break;
1357
1358
  case 4:
1358
- M = n[c + 1], L = n[c + 2], K = n[c + 3], (M & 192) === 128 && (L & 192) === 128 && (K & 192) === 128 && (z = (m & 15) << 18 | (M & 63) << 12 | (L & 63) << 6 | K & 63, z > 65535 && z < 1114112 && (d = z));
1359
+ N = n[c + 1], z = n[c + 2], G = n[c + 3], (N & 192) === 128 && (z & 192) === 128 && (G & 192) === 128 && (q = (x & 15) << 18 | (N & 63) << 12 | (z & 63) << 6 | G & 63, q > 65535 && q < 1114112 && (d = q));
1359
1360
  }
1360
1361
  }
1361
- d === null ? (d = 65533, D = 1) : d > 65535 && (d -= 65536, o.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), o.push(d), c += D;
1362
+ d === null ? (d = 65533, U = 1) : d > 65535 && (d -= 65536, o.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), o.push(d), c += U;
1362
1363
  }
1363
1364
  return T(o);
1364
1365
  }
1365
- var v = 4096;
1366
+ var E = 4096;
1366
1367
  function T(n) {
1367
1368
  var t = n.length;
1368
- if (t <= v)
1369
+ if (t <= E)
1369
1370
  return String.fromCharCode.apply(String, n);
1370
1371
  for (var e = "", o = 0; o < t; )
1371
1372
  e += String.fromCharCode.apply(
1372
1373
  String,
1373
- n.slice(o, o += v)
1374
+ n.slice(o, o += E)
1374
1375
  );
1375
1376
  return e;
1376
1377
  }
@@ -1391,13 +1392,13 @@ Jt.write = function(i, r, s, p, f, u) {
1391
1392
  function S(n, t, e) {
1392
1393
  var o = n.length;
1393
1394
  (!t || t < 0) && (t = 0), (!e || e < 0 || e > o) && (e = o);
1394
- for (var c = "", m = t; m < e; ++m)
1395
- c += De[n[m]];
1395
+ for (var c = "", x = t; x < e; ++x)
1396
+ c += $e[n[x]];
1396
1397
  return c;
1397
1398
  }
1398
- function U(n, t, e) {
1399
- for (var o = n.slice(t, e), c = "", m = 0; m < o.length - 1; m += 2)
1400
- c += String.fromCharCode(o[m] + o[m + 1] * 256);
1399
+ function k(n, t, e) {
1400
+ for (var o = n.slice(t, e), c = "", x = 0; x < o.length - 1; x += 2)
1401
+ c += String.fromCharCode(o[x] + o[x + 1] * 256);
1401
1402
  return c;
1402
1403
  }
1403
1404
  a.prototype.slice = function(t, e) {
@@ -1406,151 +1407,151 @@ Jt.write = function(i, r, s, p, f, u) {
1406
1407
  var c = this.subarray(t, e);
1407
1408
  return Object.setPrototypeOf(c, a.prototype), c;
1408
1409
  };
1409
- function B(n, t, e) {
1410
+ function F(n, t, e) {
1410
1411
  if (n % 1 !== 0 || n < 0)
1411
1412
  throw new RangeError("offset is not uint");
1412
1413
  if (n + t > e)
1413
1414
  throw new RangeError("Trying to access beyond buffer length");
1414
1415
  }
1415
1416
  a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, o) {
1416
- t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
1417
- for (var c = this[t], m = 1, d = 0; ++d < e && (m *= 256); )
1418
- c += this[t + d] * m;
1417
+ t = t >>> 0, e = e >>> 0, o || F(t, e, this.length);
1418
+ for (var c = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
1419
+ c += this[t + d] * x;
1419
1420
  return c;
1420
1421
  }, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, o) {
1421
- t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
1422
- for (var c = this[t + --e], m = 1; e > 0 && (m *= 256); )
1423
- c += this[t + --e] * m;
1422
+ t = t >>> 0, e = e >>> 0, o || F(t, e, this.length);
1423
+ for (var c = this[t + --e], x = 1; e > 0 && (x *= 256); )
1424
+ c += this[t + --e] * x;
1424
1425
  return c;
1425
1426
  }, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
1426
- return t = t >>> 0, e || B(t, 1, this.length), this[t];
1427
+ return t = t >>> 0, e || F(t, 1, this.length), this[t];
1427
1428
  }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(t, e) {
1428
- return t = t >>> 0, e || B(t, 2, this.length), this[t] | this[t + 1] << 8;
1429
+ return t = t >>> 0, e || F(t, 2, this.length), this[t] | this[t + 1] << 8;
1429
1430
  }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(t, e) {
1430
- return t = t >>> 0, e || B(t, 2, this.length), this[t] << 8 | this[t + 1];
1431
+ return t = t >>> 0, e || F(t, 2, this.length), this[t] << 8 | this[t + 1];
1431
1432
  }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(t, e) {
1432
- return t = t >>> 0, e || B(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1433
+ return t = t >>> 0, e || F(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1433
1434
  }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(t, e) {
1434
- return t = t >>> 0, e || B(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1435
+ return t = t >>> 0, e || F(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1435
1436
  }, a.prototype.readIntLE = function(t, e, o) {
1436
- t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
1437
- for (var c = this[t], m = 1, d = 0; ++d < e && (m *= 256); )
1438
- c += this[t + d] * m;
1439
- return m *= 128, c >= m && (c -= Math.pow(2, 8 * e)), c;
1437
+ t = t >>> 0, e = e >>> 0, o || F(t, e, this.length);
1438
+ for (var c = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
1439
+ c += this[t + d] * x;
1440
+ return x *= 128, c >= x && (c -= Math.pow(2, 8 * e)), c;
1440
1441
  }, a.prototype.readIntBE = function(t, e, o) {
1441
- t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
1442
- for (var c = e, m = 1, d = this[t + --c]; c > 0 && (m *= 256); )
1443
- d += this[t + --c] * m;
1444
- return m *= 128, d >= m && (d -= Math.pow(2, 8 * e)), d;
1442
+ t = t >>> 0, e = e >>> 0, o || F(t, e, this.length);
1443
+ for (var c = e, x = 1, d = this[t + --c]; c > 0 && (x *= 256); )
1444
+ d += this[t + --c] * x;
1445
+ return x *= 128, d >= x && (d -= Math.pow(2, 8 * e)), d;
1445
1446
  }, a.prototype.readInt8 = function(t, e) {
1446
- return t = t >>> 0, e || B(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1447
+ return t = t >>> 0, e || F(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1447
1448
  }, a.prototype.readInt16LE = function(t, e) {
1448
- t = t >>> 0, e || B(t, 2, this.length);
1449
+ t = t >>> 0, e || F(t, 2, this.length);
1449
1450
  var o = this[t] | this[t + 1] << 8;
1450
1451
  return o & 32768 ? o | 4294901760 : o;
1451
1452
  }, a.prototype.readInt16BE = function(t, e) {
1452
- t = t >>> 0, e || B(t, 2, this.length);
1453
+ t = t >>> 0, e || F(t, 2, this.length);
1453
1454
  var o = this[t + 1] | this[t] << 8;
1454
1455
  return o & 32768 ? o | 4294901760 : o;
1455
1456
  }, a.prototype.readInt32LE = function(t, e) {
1456
- return t = t >>> 0, e || B(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1457
+ return t = t >>> 0, e || F(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1457
1458
  }, a.prototype.readInt32BE = function(t, e) {
1458
- return t = t >>> 0, e || B(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1459
+ return t = t >>> 0, e || F(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1459
1460
  }, a.prototype.readFloatLE = function(t, e) {
1460
- return t = t >>> 0, e || B(t, 4, this.length), s.read(this, t, !0, 23, 4);
1461
+ return t = t >>> 0, e || F(t, 4, this.length), s.read(this, t, !0, 23, 4);
1461
1462
  }, a.prototype.readFloatBE = function(t, e) {
1462
- return t = t >>> 0, e || B(t, 4, this.length), s.read(this, t, !1, 23, 4);
1463
+ return t = t >>> 0, e || F(t, 4, this.length), s.read(this, t, !1, 23, 4);
1463
1464
  }, a.prototype.readDoubleLE = function(t, e) {
1464
- return t = t >>> 0, e || B(t, 8, this.length), s.read(this, t, !0, 52, 8);
1465
+ return t = t >>> 0, e || F(t, 8, this.length), s.read(this, t, !0, 52, 8);
1465
1466
  }, a.prototype.readDoubleBE = function(t, e) {
1466
- return t = t >>> 0, e || B(t, 8, this.length), s.read(this, t, !1, 52, 8);
1467
+ return t = t >>> 0, e || F(t, 8, this.length), s.read(this, t, !1, 52, 8);
1467
1468
  };
1468
- function O(n, t, e, o, c, m) {
1469
+ function I(n, t, e, o, c, x) {
1469
1470
  if (!a.isBuffer(n))
1470
1471
  throw new TypeError('"buffer" argument must be a Buffer instance');
1471
- if (t > c || t < m)
1472
+ if (t > c || t < x)
1472
1473
  throw new RangeError('"value" argument is out of bounds');
1473
1474
  if (e + o > n.length)
1474
1475
  throw new RangeError("Index out of range");
1475
1476
  }
1476
1477
  a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, o, c) {
1477
1478
  if (t = +t, e = e >>> 0, o = o >>> 0, !c) {
1478
- var m = Math.pow(2, 8 * o) - 1;
1479
- O(this, t, e, o, m, 0);
1479
+ var x = Math.pow(2, 8 * o) - 1;
1480
+ I(this, t, e, o, x, 0);
1480
1481
  }
1481
- var d = 1, D = 0;
1482
- for (this[e] = t & 255; ++D < o && (d *= 256); )
1483
- this[e + D] = t / d & 255;
1482
+ var d = 1, U = 0;
1483
+ for (this[e] = t & 255; ++U < o && (d *= 256); )
1484
+ this[e + U] = t / d & 255;
1484
1485
  return e + o;
1485
1486
  }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, o, c) {
1486
1487
  if (t = +t, e = e >>> 0, o = o >>> 0, !c) {
1487
- var m = Math.pow(2, 8 * o) - 1;
1488
- O(this, t, e, o, m, 0);
1488
+ var x = Math.pow(2, 8 * o) - 1;
1489
+ I(this, t, e, o, x, 0);
1489
1490
  }
1490
- var d = o - 1, D = 1;
1491
- for (this[e + d] = t & 255; --d >= 0 && (D *= 256); )
1492
- this[e + d] = t / D & 255;
1491
+ var d = o - 1, U = 1;
1492
+ for (this[e + d] = t & 255; --d >= 0 && (U *= 256); )
1493
+ this[e + d] = t / U & 255;
1493
1494
  return e + o;
1494
1495
  }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, o) {
1495
- return t = +t, e = e >>> 0, o || O(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1496
+ return t = +t, e = e >>> 0, o || I(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1496
1497
  }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, o) {
1497
- return t = +t, e = e >>> 0, o || O(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1498
+ return t = +t, e = e >>> 0, o || I(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1498
1499
  }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, o) {
1499
- return t = +t, e = e >>> 0, o || O(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1500
+ return t = +t, e = e >>> 0, o || I(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1500
1501
  }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, o) {
1501
- return t = +t, e = e >>> 0, o || O(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;
1502
+ return t = +t, e = e >>> 0, o || 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;
1502
1503
  }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, o) {
1503
- return t = +t, e = e >>> 0, o || O(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;
1504
+ return t = +t, e = e >>> 0, o || 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;
1504
1505
  }, a.prototype.writeIntLE = function(t, e, o, c) {
1505
1506
  if (t = +t, e = e >>> 0, !c) {
1506
- var m = Math.pow(2, 8 * o - 1);
1507
- O(this, t, e, o, m - 1, -m);
1507
+ var x = Math.pow(2, 8 * o - 1);
1508
+ I(this, t, e, o, x - 1, -x);
1508
1509
  }
1509
- var d = 0, D = 1, M = 0;
1510
- for (this[e] = t & 255; ++d < o && (D *= 256); )
1511
- t < 0 && M === 0 && this[e + d - 1] !== 0 && (M = 1), this[e + d] = (t / D >> 0) - M & 255;
1510
+ var d = 0, U = 1, N = 0;
1511
+ for (this[e] = t & 255; ++d < o && (U *= 256); )
1512
+ t < 0 && N === 0 && this[e + d - 1] !== 0 && (N = 1), this[e + d] = (t / U >> 0) - N & 255;
1512
1513
  return e + o;
1513
1514
  }, a.prototype.writeIntBE = function(t, e, o, c) {
1514
1515
  if (t = +t, e = e >>> 0, !c) {
1515
- var m = Math.pow(2, 8 * o - 1);
1516
- O(this, t, e, o, m - 1, -m);
1516
+ var x = Math.pow(2, 8 * o - 1);
1517
+ I(this, t, e, o, x - 1, -x);
1517
1518
  }
1518
- var d = o - 1, D = 1, M = 0;
1519
- for (this[e + d] = t & 255; --d >= 0 && (D *= 256); )
1520
- t < 0 && M === 0 && this[e + d + 1] !== 0 && (M = 1), this[e + d] = (t / D >> 0) - M & 255;
1519
+ var d = o - 1, U = 1, N = 0;
1520
+ for (this[e + d] = t & 255; --d >= 0 && (U *= 256); )
1521
+ t < 0 && N === 0 && this[e + d + 1] !== 0 && (N = 1), this[e + d] = (t / U >> 0) - N & 255;
1521
1522
  return e + o;
1522
1523
  }, a.prototype.writeInt8 = function(t, e, o) {
1523
- return t = +t, e = e >>> 0, o || O(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1524
+ return t = +t, e = e >>> 0, o || I(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1524
1525
  }, a.prototype.writeInt16LE = function(t, e, o) {
1525
- return t = +t, e = e >>> 0, o || O(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1526
+ return t = +t, e = e >>> 0, o || I(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1526
1527
  }, a.prototype.writeInt16BE = function(t, e, o) {
1527
- return t = +t, e = e >>> 0, o || O(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1528
+ return t = +t, e = e >>> 0, o || I(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1528
1529
  }, a.prototype.writeInt32LE = function(t, e, o) {
1529
- return t = +t, e = e >>> 0, o || O(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
1530
+ return t = +t, e = e >>> 0, o || I(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
1530
1531
  }, a.prototype.writeInt32BE = function(t, e, o) {
1531
- return t = +t, e = e >>> 0, o || O(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;
1532
+ return t = +t, e = e >>> 0, o || 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;
1532
1533
  };
1533
- function R(n, t, e, o, c, m) {
1534
+ function L(n, t, e, o, c, x) {
1534
1535
  if (e + o > n.length)
1535
1536
  throw new RangeError("Index out of range");
1536
1537
  if (e < 0)
1537
1538
  throw new RangeError("Index out of range");
1538
1539
  }
1539
- function P(n, t, e, o, c) {
1540
- return t = +t, e = e >>> 0, c || R(n, t, e, 4), s.write(n, t, e, o, 23, 4), e + 4;
1540
+ function J(n, t, e, o, c) {
1541
+ return t = +t, e = e >>> 0, c || L(n, t, e, 4), s.write(n, t, e, o, 23, 4), e + 4;
1541
1542
  }
1542
1543
  a.prototype.writeFloatLE = function(t, e, o) {
1543
- return P(this, t, e, !0, o);
1544
+ return J(this, t, e, !0, o);
1544
1545
  }, a.prototype.writeFloatBE = function(t, e, o) {
1545
- return P(this, t, e, !1, o);
1546
+ return J(this, t, e, !1, o);
1546
1547
  };
1547
- function C(n, t, e, o, c) {
1548
- return t = +t, e = e >>> 0, c || R(n, t, e, 8), s.write(n, t, e, o, 52, 8), e + 8;
1548
+ function D(n, t, e, o, c) {
1549
+ return t = +t, e = e >>> 0, c || L(n, t, e, 8), s.write(n, t, e, o, 52, 8), e + 8;
1549
1550
  }
1550
1551
  a.prototype.writeDoubleLE = function(t, e, o) {
1551
- return C(this, t, e, !0, o);
1552
+ return D(this, t, e, !0, o);
1552
1553
  }, a.prototype.writeDoubleBE = function(t, e, o) {
1553
- return C(this, t, e, !1, o);
1554
+ return D(this, t, e, !1, o);
1554
1555
  }, a.prototype.copy = function(t, e, o, c) {
1555
1556
  if (!a.isBuffer(t))
1556
1557
  throw new TypeError("argument should be a Buffer");
@@ -1563,12 +1564,12 @@ Jt.write = function(i, r, s, p, f, u) {
1563
1564
  if (c < 0)
1564
1565
  throw new RangeError("sourceEnd out of bounds");
1565
1566
  c > this.length && (c = this.length), t.length - e < c - o && (c = t.length - e + o);
1566
- var m = c - o;
1567
+ var x = c - o;
1567
1568
  return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, o, c) : Uint8Array.prototype.set.call(
1568
1569
  t,
1569
1570
  this.subarray(o, c),
1570
1571
  e
1571
- ), m;
1572
+ ), x;
1572
1573
  }, a.prototype.fill = function(t, e, o, c) {
1573
1574
  if (typeof t == "string") {
1574
1575
  if (typeof e == "string" ? (c = e, e = 0, o = this.length) : typeof o == "string" && (c = o, o = this.length), c !== void 0 && typeof c != "string")
@@ -1576,8 +1577,8 @@ Jt.write = function(i, r, s, p, f, u) {
1576
1577
  if (typeof c == "string" && !a.isEncoding(c))
1577
1578
  throw new TypeError("Unknown encoding: " + c);
1578
1579
  if (t.length === 1) {
1579
- var m = t.charCodeAt(0);
1580
- (c === "utf8" && m < 128 || c === "latin1") && (t = m);
1580
+ var x = t.charCodeAt(0);
1581
+ (c === "utf8" && x < 128 || c === "latin1") && (t = x);
1581
1582
  }
1582
1583
  } else
1583
1584
  typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
@@ -1591,59 +1592,59 @@ Jt.write = function(i, r, s, p, f, u) {
1591
1592
  for (d = e; d < o; ++d)
1592
1593
  this[d] = t;
1593
1594
  else {
1594
- var D = a.isBuffer(t) ? t : a.from(t, c), M = D.length;
1595
- if (M === 0)
1595
+ var U = a.isBuffer(t) ? t : a.from(t, c), N = U.length;
1596
+ if (N === 0)
1596
1597
  throw new TypeError('The value "' + t + '" is invalid for argument "value"');
1597
1598
  for (d = 0; d < o - e; ++d)
1598
- this[d + e] = D[d % M];
1599
+ this[d + e] = U[d % N];
1599
1600
  }
1600
1601
  return this;
1601
1602
  };
1602
- var V = /[^+/0-9A-Za-z-_]/g;
1603
- function Y(n) {
1604
- if (n = n.split("=")[0], n = n.trim().replace(V, ""), n.length < 2)
1603
+ var Z = /[^+/0-9A-Za-z-_]/g;
1604
+ function X(n) {
1605
+ if (n = n.split("=")[0], n = n.trim().replace(Z, ""), n.length < 2)
1605
1606
  return "";
1606
1607
  for (; n.length % 4 !== 0; )
1607
1608
  n = n + "=";
1608
1609
  return n;
1609
1610
  }
1610
- function W(n, t) {
1611
+ function H(n, t) {
1611
1612
  t = t || 1 / 0;
1612
- for (var e, o = n.length, c = null, m = [], d = 0; d < o; ++d) {
1613
+ for (var e, o = n.length, c = null, x = [], d = 0; d < o; ++d) {
1613
1614
  if (e = n.charCodeAt(d), e > 55295 && e < 57344) {
1614
1615
  if (!c) {
1615
1616
  if (e > 56319) {
1616
- (t -= 3) > -1 && m.push(239, 191, 189);
1617
+ (t -= 3) > -1 && x.push(239, 191, 189);
1617
1618
  continue;
1618
1619
  } else if (d + 1 === o) {
1619
- (t -= 3) > -1 && m.push(239, 191, 189);
1620
+ (t -= 3) > -1 && x.push(239, 191, 189);
1620
1621
  continue;
1621
1622
  }
1622
1623
  c = e;
1623
1624
  continue;
1624
1625
  }
1625
1626
  if (e < 56320) {
1626
- (t -= 3) > -1 && m.push(239, 191, 189), c = e;
1627
+ (t -= 3) > -1 && x.push(239, 191, 189), c = e;
1627
1628
  continue;
1628
1629
  }
1629
1630
  e = (c - 55296 << 10 | e - 56320) + 65536;
1630
1631
  } else
1631
- c && (t -= 3) > -1 && m.push(239, 191, 189);
1632
+ c && (t -= 3) > -1 && x.push(239, 191, 189);
1632
1633
  if (c = null, e < 128) {
1633
1634
  if ((t -= 1) < 0)
1634
1635
  break;
1635
- m.push(e);
1636
+ x.push(e);
1636
1637
  } else if (e < 2048) {
1637
1638
  if ((t -= 2) < 0)
1638
1639
  break;
1639
- m.push(
1640
+ x.push(
1640
1641
  e >> 6 | 192,
1641
1642
  e & 63 | 128
1642
1643
  );
1643
1644
  } else if (e < 65536) {
1644
1645
  if ((t -= 3) < 0)
1645
1646
  break;
1646
- m.push(
1647
+ x.push(
1647
1648
  e >> 12 | 224,
1648
1649
  e >> 6 & 63 | 128,
1649
1650
  e & 63 | 128
@@ -1651,7 +1652,7 @@ Jt.write = function(i, r, s, p, f, u) {
1651
1652
  } else if (e < 1114112) {
1652
1653
  if ((t -= 4) < 0)
1653
1654
  break;
1654
- m.push(
1655
+ x.push(
1655
1656
  e >> 18 | 240,
1656
1657
  e >> 12 & 63 | 128,
1657
1658
  e >> 6 & 63 | 128,
@@ -1660,20 +1661,20 @@ Jt.write = function(i, r, s, p, f, u) {
1660
1661
  } else
1661
1662
  throw new Error("Invalid code point");
1662
1663
  }
1663
- return m;
1664
+ return x;
1664
1665
  }
1665
- function X(n) {
1666
+ function Q(n) {
1666
1667
  for (var t = [], e = 0; e < n.length; ++e)
1667
1668
  t.push(n.charCodeAt(e) & 255);
1668
1669
  return t;
1669
1670
  }
1670
- function Q(n, t) {
1671
- for (var e, o, c, m = [], d = 0; d < n.length && !((t -= 2) < 0); ++d)
1672
- e = n.charCodeAt(d), o = e >> 8, c = e % 256, m.push(c), m.push(o);
1673
- return m;
1671
+ function tt(n, t) {
1672
+ for (var e, o, c, x = [], d = 0; d < n.length && !((t -= 2) < 0); ++d)
1673
+ e = n.charCodeAt(d), o = e >> 8, c = e % 256, x.push(c), x.push(o);
1674
+ return x;
1674
1675
  }
1675
1676
  function st(n) {
1676
- return r.toByteArray(Y(n));
1677
+ return r.toByteArray(X(n));
1677
1678
  }
1678
1679
  function Et(n, t, e, o) {
1679
1680
  for (var c = 0; c < o && !(c + e >= t.length || c >= n.length); ++c)
@@ -1686,33 +1687,33 @@ Jt.write = function(i, r, s, p, f, u) {
1686
1687
  function Tt(n) {
1687
1688
  return n !== n;
1688
1689
  }
1689
- var De = function() {
1690
+ var $e = function() {
1690
1691
  for (var n = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
1691
1692
  for (var o = e * 16, c = 0; c < 16; ++c)
1692
1693
  t[o + c] = n[e] + n[c];
1693
1694
  return t;
1694
1695
  }();
1695
- })(ye);
1696
+ })(we);
1696
1697
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1697
1698
  (function(i, r) {
1698
- var s = ye, p = s.Buffer;
1699
+ var s = we, p = s.Buffer;
1699
1700
  function f(l, a) {
1700
- for (var x in l)
1701
- a[x] = l[x];
1701
+ for (var h in l)
1702
+ a[h] = l[h];
1702
1703
  }
1703
1704
  p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ? i.exports = s : (f(s, r), r.Buffer = u);
1704
- function u(l, a, x) {
1705
- return p(l, a, x);
1705
+ function u(l, a, h) {
1706
+ return p(l, a, h);
1706
1707
  }
1707
- u.prototype = Object.create(p.prototype), f(p, u), u.from = function(l, a, x) {
1708
+ u.prototype = Object.create(p.prototype), f(p, u), u.from = function(l, a, h) {
1708
1709
  if (typeof l == "number")
1709
1710
  throw new TypeError("Argument must not be a number");
1710
- return p(l, a, x);
1711
- }, u.alloc = function(l, a, x) {
1711
+ return p(l, a, h);
1712
+ }, u.alloc = function(l, a, h) {
1712
1713
  if (typeof l != "number")
1713
1714
  throw new TypeError("Argument must be a number");
1714
- var g = p(l);
1715
- return a !== void 0 ? typeof x == "string" ? g.fill(a, x) : g.fill(a) : g.fill(0), g;
1715
+ var y = p(l);
1716
+ return a !== void 0 ? typeof h == "string" ? y.fill(a, h) : y.fill(a) : y.fill(0), y;
1716
1717
  }, u.allocUnsafe = function(l) {
1717
1718
  if (typeof l != "number")
1718
1719
  throw new TypeError("Argument must be a number");
@@ -1723,16 +1724,16 @@ Jt.write = function(i, r, s, p, f, u) {
1723
1724
  return s.SlowBuffer(l);
1724
1725
  };
1725
1726
  })(Ct, Ct.exports);
1726
- var Wt = Ct.exports, be = Wt.Buffer;
1727
+ var Wt = Ct.exports, Ee = Wt.Buffer;
1727
1728
  function jt(i, r) {
1728
- this._block = be.alloc(i), this._finalSize = r, this._blockSize = i, this._len = 0;
1729
+ this._block = Ee.alloc(i), this._finalSize = r, this._blockSize = i, this._len = 0;
1729
1730
  }
1730
1731
  jt.prototype.update = function(i, r) {
1731
- typeof i == "string" && (r = r || "utf8", i = be.from(i, r));
1732
+ typeof i == "string" && (r = r || "utf8", i = Ee.from(i, r));
1732
1733
  for (var s = this._block, p = this._blockSize, f = i.length, u = this._len, l = 0; l < f; ) {
1733
- for (var a = u % p, x = Math.min(f - l, p - a), g = 0; g < x; g++)
1734
- s[a + g] = i[l + g];
1735
- u += x, l += x, u % p === 0 && this._update(s);
1734
+ for (var a = u % p, h = Math.min(f - l, p - a), y = 0; y < h; y++)
1735
+ s[a + y] = i[l + y];
1736
+ u += h, l += h, u % p === 0 && this._update(s);
1736
1737
  }
1737
1738
  return this._len += f, this;
1738
1739
  };
@@ -1753,16 +1754,16 @@ jt.prototype.digest = function(i) {
1753
1754
  jt.prototype._update = function() {
1754
1755
  throw new Error("_update must be implemented by subclass");
1755
1756
  };
1756
- var Ee = jt, fr = ge, ve = Ee, hr = Wt.Buffer, mr = [
1757
+ var ve = jt, fr = ye, Ae = ve, hr = Wt.Buffer, mr = [
1757
1758
  1518500249,
1758
1759
  1859775393,
1759
1760
  -1894007588,
1760
1761
  -899497514
1761
1762
  ], xr = new Array(80);
1762
1763
  function wt() {
1763
- this.init(), this._w = xr, ve.call(this, 64, 56);
1764
+ this.init(), this._w = xr, Ae.call(this, 64, 56);
1764
1765
  }
1765
- fr(wt, ve);
1766
+ fr(wt, Ae);
1766
1767
  wt.prototype.init = function() {
1767
1768
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
1768
1769
  };
@@ -1783,9 +1784,9 @@ wt.prototype._update = function(i) {
1783
1784
  r[a] = i.readInt32BE(a * 4);
1784
1785
  for (; a < 80; ++a)
1785
1786
  r[a] = dr(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
1786
- for (var x = 0; x < 80; ++x) {
1787
- var g = ~~(x / 20), A = gr(s) + wr(g, p, f, u) + l + r[x] + mr[g] | 0;
1788
- l = u, u = f, f = yr(p), p = s, s = A;
1787
+ for (var h = 0; h < 80; ++h) {
1788
+ var y = ~~(h / 20), w = gr(s) + wr(y, p, f, u) + l + r[h] + mr[y] | 0;
1789
+ l = u, u = f, f = yr(p), p = s, s = w;
1789
1790
  }
1790
1791
  this._a = s + this._a | 0, this._b = p + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0;
1791
1792
  };
@@ -1795,7 +1796,7 @@ wt.prototype._hash = function() {
1795
1796
  };
1796
1797
  var br = wt;
1797
1798
  const Er = /* @__PURE__ */ qt(br);
1798
- var vr = ge, Ae = Ee, Ar = Wt.Buffer, _r = [
1799
+ var vr = ye, _e = ve, Ar = Wt.Buffer, _r = [
1799
1800
  1116352408,
1800
1801
  1899447441,
1801
1802
  3049323471,
@@ -1862,9 +1863,9 @@ var vr = ge, Ae = Ee, Ar = Wt.Buffer, _r = [
1862
1863
  3329325298
1863
1864
  ], Sr = new Array(64);
1864
1865
  function bt() {
1865
- this.init(), this._w = Sr, Ae.call(this, 64, 56);
1866
+ this.init(), this._w = Sr, _e.call(this, 64, 56);
1866
1867
  }
1867
- vr(bt, Ae);
1868
+ vr(bt, _e);
1868
1869
  bt.prototype.init = function() {
1869
1870
  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;
1870
1871
  };
@@ -1887,15 +1888,15 @@ function Tr(i) {
1887
1888
  return (i >>> 17 | i << 15) ^ (i >>> 19 | i << 13) ^ i >>> 10;
1888
1889
  }
1889
1890
  bt.prototype._update = function(i) {
1890
- for (var r = this._w, s = this._a | 0, p = this._b | 0, f = this._c | 0, u = this._d | 0, l = this._e | 0, a = this._f | 0, x = this._g | 0, g = this._h | 0, A = 0; A < 16; ++A)
1891
- r[A] = i.readInt32BE(A * 4);
1892
- for (; A < 64; ++A)
1893
- r[A] = Tr(r[A - 2]) + r[A - 7] + Ir(r[A - 15]) + r[A - 16] | 0;
1894
- for (var w = 0; w < 64; ++w) {
1895
- var b = g + Or(l) + Fr(l, a, x) + _r[w] + r[w] | 0, F = jr(s) + Br(s, p, f) | 0;
1896
- g = x, x = a, a = l, l = u + b | 0, u = f, f = p, p = s, s = b + F | 0;
1897
- }
1898
- this._a = s + this._a | 0, this._b = p + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0, this._f = a + this._f | 0, this._g = x + this._g | 0, this._h = g + this._h | 0;
1891
+ for (var r = this._w, s = this._a | 0, p = this._b | 0, f = this._c | 0, u = this._d | 0, l = this._e | 0, a = this._f | 0, h = this._g | 0, y = this._h | 0, w = 0; w < 16; ++w)
1892
+ r[w] = i.readInt32BE(w * 4);
1893
+ for (; w < 64; ++w)
1894
+ r[w] = Tr(r[w - 2]) + r[w - 7] + Ir(r[w - 15]) + r[w - 16] | 0;
1895
+ for (var _ = 0; _ < 64; ++_) {
1896
+ var v = y + Or(l) + Fr(l, a, h) + _r[_] + r[_] | 0, B = jr(s) + Br(s, p, f) | 0;
1897
+ y = h, h = a, a = l, l = u + v | 0, u = f, f = p, p = s, s = v + B | 0;
1898
+ }
1899
+ this._a = s + this._a | 0, this._b = p + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0, this._f = a + this._f | 0, this._g = h + this._g | 0, this._h = y + this._h | 0;
1899
1900
  };
1900
1901
  bt.prototype._hash = function() {
1901
1902
  var i = Ar.allocUnsafe(32);
@@ -1903,38 +1904,38 @@ bt.prototype._hash = function() {
1903
1904
  };
1904
1905
  var kr = bt;
1905
1906
  const Ur = /* @__PURE__ */ qt(kr), Vt = new Error("File system not available.");
1906
- function Dr(i, r, s) {
1907
+ function $r(i, r, s) {
1907
1908
  throw Vt;
1908
1909
  }
1909
- function _e(i) {
1910
+ function Se(i) {
1910
1911
  throw Vt;
1911
1912
  }
1912
- function $r(i) {
1913
+ function Dr(i) {
1913
1914
  throw Vt;
1914
1915
  }
1915
- const Cr = async (i) => _e(), Mr = {
1916
+ const Cr = async (i) => Se(), Nr = {
1916
1917
  sha1: Er,
1917
1918
  sha256: Ur
1918
1919
  }, Ot = (i, r = "sha1") => {
1919
1920
  if (!["sha1", "sha256"].includes(r))
1920
1921
  throw new Error("Hashing algorithm not supported: Available: sha1, sha256");
1921
- const s = Mr[r];
1922
+ const s = Nr[r];
1922
1923
  return new s().update(i).digest("base64");
1923
1924
  };
1924
- function Nr(i) {
1925
+ function Mr(i) {
1925
1926
  return i.type === Ye && i.skip !== void 0 && i.skip > 0 && i.hash !== void 0;
1926
1927
  }
1927
- function Yt(i) {
1928
+ function Xt(i) {
1928
1929
  return [gt, yt].includes(i.type);
1929
1930
  }
1930
- function Xt(i) {
1931
- return [me, gt, yt, Ft, xe].includes(i.type);
1931
+ function Qt(i) {
1932
+ return [xe, gt, yt, Ft, de].includes(i.type);
1932
1933
  }
1933
1934
  function ht(i, r, s, p, f = "global") {
1934
1935
  if (!i)
1935
1936
  throw new Error("Empty action type");
1936
1937
  if (typeof i != "string")
1937
- throw new Error(`Invalid action type: ${i}`);
1938
+ throw new Error(`Invalid action type: ${JSON.stringify(i)}`);
1938
1939
  const u = { type: i, input: r, scope: f };
1939
1940
  s && (u.attachments = s);
1940
1941
  try {
@@ -1944,7 +1945,7 @@ function ht(i, r, s, p, f = "global") {
1944
1945
  }
1945
1946
  return u;
1946
1947
  }
1947
- function Rr(i, r = de) {
1948
+ function Rr(i, r = ge) {
1948
1949
  return (s, p, f, u) => r(s, p, i, f, u);
1949
1950
  }
1950
1951
  const Lr = (i, r) => ({
@@ -1970,12 +1971,12 @@ const Lr = (i, r) => ({
1970
1971
  operations: { global: [], local: [] },
1971
1972
  clipboard: []
1972
1973
  };
1973
- }, Se = (i, r = "global") => Ot(St(i.state[r] || "")), ri = (i, r = 1e3) => {
1974
+ }, Ht = (i, r = "global") => Ot(St(i.state[r] || "")), ri = (i, r = 1e3) => {
1974
1975
  const s = Math.random() * r;
1975
1976
  return Ot(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${s}`);
1976
1977
  };
1977
1978
  function _t(i) {
1978
- return Me(Ne(i, !0));
1979
+ return Ne(Me(i, !0));
1979
1980
  }
1980
1981
  function Pr(i, r) {
1981
1982
  const s = [...i];
@@ -1983,29 +1984,29 @@ function Pr(i, r) {
1983
1984
  const u = [];
1984
1985
  for (const l of s.reverse()) {
1985
1986
  if (p > 0) {
1986
- const g = f - l.index;
1987
- p -= g;
1987
+ const y = f - l.index;
1988
+ p -= y;
1988
1989
  }
1989
1990
  if (p < 0)
1990
1991
  throw new Error("Invalid operation index, missing operations");
1991
1992
  const a = {
1992
1993
  ignore: p > 0,
1993
1994
  operation: l
1994
- }, x = l.skip > 0 ? l.skip + 1 : 0;
1995
- if (x > 0 && x > p) {
1996
- const g = x - p;
1997
- p = p + g;
1995
+ }, h = l.skip > 0 ? l.skip + 1 : 0;
1996
+ if (h > 0 && h > p) {
1997
+ const y = h - p;
1998
+ p = p + y;
1998
1999
  }
1999
2000
  f = l.index, u.push(a);
2000
2001
  }
2001
2002
  return u.reverse();
2002
2003
  }
2003
2004
  function qr(i, r, s) {
2004
- const p = i.slice().sort((a, x) => a.skip - x.skip).sort((a, x) => a.index - x.index);
2005
+ const p = i.slice().sort((a, h) => a.skip - h.skip).sort((a, h) => a.index - h.index);
2005
2006
  let f = s, u = 0, l = r;
2006
2007
  for (const a of p.reverse()) {
2007
- const x = l - a.index;
2008
- if (f = f - x, f > -1)
2008
+ const h = l - a.index;
2009
+ if (f = f - h, f > -1)
2009
2010
  u++, l = a.index;
2010
2011
  else
2011
2012
  break;
@@ -2022,71 +2023,84 @@ function Jr(i) {
2022
2023
  (r, s) => new Date(r.operation.timestamp).getTime() - new Date(s.operation.timestamp).getTime()
2023
2024
  );
2024
2025
  }
2025
- function Mt(i, r, s, p, f, u = de, l = {}) {
2026
- const a = Rr(s, u);
2026
+ function Nt(i, r, s, p, f, u = ge, l = {}, a) {
2027
+ const h = Rr(s, u);
2027
2028
  return Fe(
2028
2029
  i,
2029
2030
  r,
2030
- a,
2031
+ h,
2031
2032
  p,
2032
2033
  f,
2033
- l
2034
+ l,
2035
+ a
2034
2036
  );
2035
2037
  }
2036
- function Fe(i, r, s, p, f, u = {}) {
2037
- const l = zr(i), a = Object.keys(r).reduce((b, F) => {
2038
- const I = F;
2038
+ function Fe(i, r, s, p, f, u = {}, l) {
2039
+ const a = (l == null ? void 0 : l.checkHashes) ?? !0, h = zr(i), y = Object.keys(r).reduce((C, R) => {
2040
+ const g = R;
2039
2041
  return {
2040
- ...b,
2041
- [I]: r[I].slice(0, f == null ? void 0 : f.revision[I])
2042
+ ...C,
2043
+ [g]: r[g].slice(0, f == null ? void 0 : f.revision[g])
2042
2044
  };
2043
- }, {}), x = Object.keys(a).reduce(
2044
- (b, F) => {
2045
- const I = F;
2045
+ }, {}), w = Object.keys(y).reduce(
2046
+ (C, R) => {
2047
+ const g = R;
2046
2048
  return {
2047
- ...b,
2048
- [I]: Pr(
2049
- a[I],
2050
- u[I]
2049
+ ...C,
2050
+ [g]: Pr(
2051
+ y[g],
2052
+ u[g]
2051
2053
  )
2052
2054
  };
2053
2055
  },
2054
2056
  {}
2055
- ), g = Jr(x).reduce(
2056
- (b, { ignore: F, operation: I }) => F ? s(b, Ht(I.scope), p, {
2057
- skip: I.skip,
2058
- ignoreSkipOperations: !0
2059
- }) : s(b, I, p, {
2060
- skip: I.skip,
2057
+ ), _ = Jr(w), v = _.reduce(
2058
+ (C, { ignore: R, operation: g }, b, O) => R ? s(C, Zt(g.scope), p, {
2059
+ skip: g.skip,
2061
2060
  ignoreSkipOperations: !0
2061
+ // TODO: reuse hash?
2062
+ }) : s(C, g, p, {
2063
+ skip: g.skip,
2064
+ ignoreSkipOperations: !0,
2065
+ reuseHash: !a
2062
2066
  }),
2063
- l
2064
- ), A = Object.keys(
2065
- g.operations
2067
+ h
2068
+ );
2069
+ if (!a) {
2070
+ for (const C of Object.keys(v.state))
2071
+ for (let R = _.length - 1; R >= 0; R--)
2072
+ if (_[R].operation.scope === C) {
2073
+ if (_[R].operation.hash !== Ht(v, C))
2074
+ throw new Error(`Hash mismatch for scope ${C}`);
2075
+ break;
2076
+ }
2077
+ }
2078
+ const B = Object.keys(
2079
+ v.operations
2066
2080
  ).reduce(
2067
- (b, F) => {
2068
- const I = F, G = f && f.revision[I] < r[I].length ? r[I].slice(f.revision[I]) : [];
2081
+ (C, R) => {
2082
+ const g = R, b = f && f.revision[g] < r[g].length ? r[g].slice(f.revision[g]) : [];
2069
2083
  return {
2070
- ...b,
2071
- [I]: [
2072
- ...g.operations[I].map((rt, y) => {
2073
- var E;
2084
+ ...C,
2085
+ [g]: [
2086
+ ...v.operations[g].map((O, P) => {
2087
+ var K;
2074
2088
  return {
2075
- ...rt,
2076
- timestamp: ((E = r[I][y]) == null ? void 0 : E.timestamp) ?? rt.timestamp
2089
+ ...O,
2090
+ timestamp: ((K = r[g][P]) == null ? void 0 : K.timestamp) ?? O.timestamp
2077
2091
  };
2078
2092
  }),
2079
- ...G
2093
+ ...b
2080
2094
  ]
2081
2095
  };
2082
2096
  },
2083
2097
  { global: [], local: [] }
2084
- ), w = Object.values(A).reduce((b, F) => {
2085
- for (const I of F)
2086
- I.timestamp > b && (b = I.timestamp);
2087
- return b;
2098
+ ), W = Object.values(B).reduce((C, R) => {
2099
+ for (const g of R)
2100
+ g.timestamp > C && (C = g.timestamp);
2101
+ return C;
2088
2102
  }, i.lastModified);
2089
- return { ...g, operations: A, lastModified: w };
2103
+ return { ...v, operations: B, lastModified: W };
2090
2104
  }
2091
2105
  function ni(i, r) {
2092
2106
  return St(i) === St(r);
@@ -2119,18 +2133,18 @@ const Be = (i) => ht(
2119
2133
  "LOAD_STATE",
2120
2134
  { state: i, operations: r },
2121
2135
  void 0,
2122
- Nt
2123
- ), Ht = (i = "global") => ht("NOOP", {}, void 0, void 0, i), oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2136
+ Mt
2137
+ ), Zt = (i = "global") => ht("NOOP", {}, void 0, void 0, i), oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2124
2138
  __proto__: null,
2125
2139
  loadState: Kt,
2126
- noop: Ht,
2140
+ noop: Zt,
2127
2141
  prune: Ie,
2128
2142
  redo: Oe,
2129
2143
  setName: Be,
2130
2144
  undo: je
2131
2145
  }, Symbol.toStringTag, { value: "Module" })), Te = { "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"] };
2132
2146
  Object.freeze(Te);
2133
- var tt = function(i, r, s, p) {
2147
+ var et = function(i, r, s, p) {
2134
2148
  if (s === "a" && !p)
2135
2149
  throw new TypeError("Private accessor was defined without a getter");
2136
2150
  if (typeof r == "function" ? i !== r || !p : !r.has(i))
@@ -2145,17 +2159,17 @@ class Wr {
2145
2159
  }
2146
2160
  define(r, s = !1) {
2147
2161
  for (let [p, f] of Object.entries(r)) {
2148
- p = p.toLowerCase(), f = f.map((a) => a.toLowerCase()), tt(this, pt, "f").has(p) || tt(this, pt, "f").set(p, /* @__PURE__ */ new Set());
2149
- const u = tt(this, pt, "f").get(p);
2162
+ p = p.toLowerCase(), f = f.map((a) => a.toLowerCase()), et(this, pt, "f").has(p) || et(this, pt, "f").set(p, /* @__PURE__ */ new Set());
2163
+ const u = et(this, pt, "f").get(p);
2150
2164
  let l = !0;
2151
2165
  for (let a of f) {
2152
- const x = a.startsWith("*");
2153
- if (a = x ? a.slice(1) : a, u == null || u.add(a), l && tt(this, mt, "f").set(p, a), l = !1, x)
2166
+ const h = a.startsWith("*");
2167
+ if (a = h ? a.slice(1) : a, u == null || u.add(a), l && et(this, mt, "f").set(p, a), l = !1, h)
2154
2168
  continue;
2155
- const g = tt(this, ft, "f").get(a);
2156
- if (g && g != p && !s)
2157
- throw new Error(`"${p} -> ${a}" conflicts with "${g} -> ${a}". Pass \`force=true\` to override this definition.`);
2158
- tt(this, ft, "f").set(a, p);
2169
+ const y = et(this, ft, "f").get(a);
2170
+ if (y && y != p && !s)
2171
+ throw new Error(`"${p} -> ${a}" conflicts with "${y} -> ${a}". Pass \`force=true\` to override this definition.`);
2172
+ et(this, ft, "f").set(a, p);
2159
2173
  }
2160
2174
  }
2161
2175
  return this;
@@ -2164,33 +2178,33 @@ class Wr {
2164
2178
  if (typeof r != "string")
2165
2179
  return null;
2166
2180
  const s = r.replace(/^.*[/\\]/, "").toLowerCase(), p = s.replace(/^.*\./, "").toLowerCase(), f = s.length < r.length;
2167
- return !(p.length < s.length - 1) && f ? null : tt(this, ft, "f").get(p) ?? null;
2181
+ return !(p.length < s.length - 1) && f ? null : et(this, ft, "f").get(p) ?? null;
2168
2182
  }
2169
2183
  getExtension(r) {
2170
2184
  var s;
2171
- return typeof r != "string" ? null : (r = (s = r == null ? void 0 : r.split) == null ? void 0 : s.call(r, ";")[0], (r && tt(this, mt, "f").get(r.trim().toLowerCase())) ?? null);
2185
+ return typeof r != "string" ? null : (r = (s = r == null ? void 0 : r.split) == null ? void 0 : s.call(r, ";")[0], (r && et(this, mt, "f").get(r.trim().toLowerCase())) ?? null);
2172
2186
  }
2173
2187
  getAllExtensions(r) {
2174
- return typeof r != "string" ? null : tt(this, pt, "f").get(r.toLowerCase()) ?? null;
2188
+ return typeof r != "string" ? null : et(this, pt, "f").get(r.toLowerCase()) ?? null;
2175
2189
  }
2176
2190
  _freeze() {
2177
2191
  this.define = () => {
2178
2192
  throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
2179
2193
  }, Object.freeze(this);
2180
- for (const r of tt(this, pt, "f").values())
2194
+ for (const r of et(this, pt, "f").values())
2181
2195
  Object.freeze(r);
2182
2196
  return this;
2183
2197
  }
2184
2198
  _getTestState() {
2185
2199
  return {
2186
- types: tt(this, ft, "f"),
2187
- extensions: tt(this, mt, "f")
2200
+ types: et(this, ft, "f"),
2201
+ extensions: et(this, mt, "f")
2188
2202
  };
2189
2203
  }
2190
2204
  }
2191
2205
  ft = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap();
2192
2206
  const Vr = new Wr(Te)._freeze();
2193
- function Kr(i) {
2207
+ function Hr(i) {
2194
2208
  const r = [], s = Object.keys(i);
2195
2209
  for (const p of s) {
2196
2210
  const f = i[p].sort((u, l) => u.index - l.index);
@@ -2207,7 +2221,7 @@ function Kr(i) {
2207
2221
  return r;
2208
2222
  }
2209
2223
  const ke = async (i) => {
2210
- const r = new te(), { name: s, revision: p, documentType: f, created: u, lastModified: l } = i, a = {
2224
+ const r = new ee(), { name: s, revision: p, documentType: f, created: u, lastModified: l } = i, a = {
2211
2225
  name: s,
2212
2226
  revision: p,
2213
2227
  documentType: f,
@@ -2217,70 +2231,72 @@ const ke = async (i) => {
2217
2231
  return r.file("header.json", JSON.stringify(a, null, 2)), r.file(
2218
2232
  "state.json",
2219
2233
  JSON.stringify(i.initialState || {}, null, 2)
2220
- ), r.file("operations.json", JSON.stringify(i.operations, null, 2)), Object.keys(i.attachments).forEach((g) => {
2221
- const { data: A, ...w } = i.attachments[g];
2222
- r.file(g, A, {
2234
+ ), r.file("operations.json", JSON.stringify(i.operations, null, 2)), Object.keys(i.attachments).forEach((y) => {
2235
+ const { data: w, ..._ } = i.attachments[y];
2236
+ r.file(y, w, {
2223
2237
  base64: !0,
2224
2238
  createFolders: !0,
2225
- comment: JSON.stringify(w)
2239
+ comment: JSON.stringify(_)
2226
2240
  });
2227
2241
  }), r;
2228
- }, Hr = async (i, r, s, p) => {
2242
+ }, Kr = async (i, r, s, p) => {
2229
2243
  await (await ke(i)).generateAsync({
2230
2244
  type: "uint8array",
2231
2245
  streamFiles: !0
2232
2246
  });
2233
2247
  const u = p ?? i.name, l = `.${s}.zip`;
2234
- return Dr(
2248
+ return $r(
2235
2249
  r,
2236
2250
  u.endsWith(l) ? u : `${u}${l}`
2237
2251
  );
2238
2252
  }, ai = async (i, r) => {
2239
2253
  const p = await (await ke(i)).generateAsync({ type: "blob" }), f = await r.createWritable();
2240
2254
  await f.write(p), await f.close();
2241
- }, Qt = async (i, r) => {
2242
- const s = _e();
2243
- return Zr(s, r);
2244
- }, Zr = async (i, r) => {
2245
- const s = new te();
2246
- return await s.loadAsync(i), Gr(s, r);
2255
+ }, te = async (i, r, s) => {
2256
+ const p = Se();
2257
+ return Zr(p, r, s);
2258
+ }, Zr = async (i, r, s) => {
2259
+ const p = new ee();
2260
+ return await p.loadAsync(i), Gr(p, r, s);
2247
2261
  };
2248
- async function Gr(i, r) {
2249
- const s = i.file("state.json");
2250
- if (!s)
2262
+ async function Gr(i, r, s) {
2263
+ const p = i.file("state.json");
2264
+ if (!p)
2251
2265
  throw new Error("Initial state not found");
2252
- const p = await s.async("string"), f = JSON.parse(p), u = i.file("header.json");
2253
- let l;
2254
- u && (l = JSON.parse(await u.async("string")));
2255
- const a = i.file("operations.json");
2256
- if (!a)
2266
+ const f = await p.async("string"), u = JSON.parse(f), l = i.file("header.json");
2267
+ let a;
2268
+ l && (a = JSON.parse(await l.async("string")));
2269
+ const h = i.file("operations.json");
2270
+ if (!h)
2257
2271
  throw new Error("Operations history not found");
2258
- const x = JSON.parse(
2259
- await a.async("string")
2260
- ), g = Kr(x);
2261
- if (g.length) {
2262
- const w = g.map((b) => b.message);
2263
- throw new Error(w.join(`
2272
+ const y = JSON.parse(
2273
+ await h.async("string")
2274
+ ), w = Hr(y);
2275
+ if (w.length) {
2276
+ const v = w.map((B) => B.message);
2277
+ throw new Error(v.join(`
2264
2278
  `));
2265
2279
  }
2266
- let A = Fe(
2267
- f,
2268
- x,
2280
+ let _ = Fe(
2281
+ u,
2282
+ y,
2269
2283
  r,
2270
2284
  void 0,
2271
- l
2285
+ a,
2286
+ {},
2287
+ s
2272
2288
  );
2273
- return l && (A = {
2274
- ...A,
2275
- ...l
2276
- }), A;
2289
+ return a && (_ = {
2290
+ ..._,
2291
+ ...a
2292
+ }), _;
2277
2293
  }
2278
2294
  function Ue(i) {
2279
2295
  const r = i.replace(/^.*\./, "") || void 0, s = i.replace(/^.*[/\\]/, "") || void 0;
2280
2296
  return { extension: r, fileName: s };
2281
2297
  }
2282
2298
  async function si(i) {
2283
- const { buffer: r, mimeType: s = "application/octet-stream" } = await $r(), p = Ue(i), f = r.toString("base64");
2299
+ const { buffer: r, mimeType: s = "application/octet-stream" } = await Dr(), p = Ue(i), f = r.toString("base64");
2284
2300
  return {
2285
2301
  data: f,
2286
2302
  hash: Ot(f),
@@ -2324,14 +2340,14 @@ class ci {
2324
2340
  * @returns The file path where the state was saved.
2325
2341
  */
2326
2342
  saveToFile(r, s, p) {
2327
- return Hr(this._document, r, s, p);
2343
+ return Kr(this._document, r, s, p);
2328
2344
  }
2329
2345
  /**
2330
2346
  * Loads the state of the document from a file.
2331
2347
  * @param path - The file path where the state is stored.
2332
2348
  */
2333
2349
  async loadFromFile(r) {
2334
- this._document = await Qt(r, this._reducer);
2350
+ this._document = await te(r, this._reducer);
2335
2351
  }
2336
2352
  /**
2337
2353
  * Loads the state of the document from a file and returns it.
@@ -2340,7 +2356,7 @@ class ci {
2340
2356
  * @returns The state of the document.
2341
2357
  */
2342
2358
  static async stateFromFile(r, s) {
2343
- return await Qt(r, s);
2359
+ return await te(r, s);
2344
2360
  }
2345
2361
  /**
2346
2362
  * Gets the current state of the document.
@@ -2458,9 +2474,9 @@ function li(i, r) {
2458
2474
  });
2459
2475
  }
2460
2476
  export {
2461
- Kr as A,
2477
+ Hr as A,
2462
2478
  ci as B,
2463
- de as C,
2479
+ ge as C,
2464
2480
  ir as D,
2465
2481
  ei as E,
2466
2482
  Lr as a,
@@ -2471,22 +2487,22 @@ export {
2471
2487
  ht as f,
2472
2488
  li as g,
2473
2489
  oi as h,
2474
- Xt as i,
2490
+ Qt as i,
2475
2491
  qr as j,
2476
2492
  ke as k,
2477
- Qt as l,
2493
+ te as l,
2478
2494
  pi as m,
2479
2495
  si as n,
2480
- Se as o,
2496
+ Ht as o,
2481
2497
  ri as p,
2482
- Nr as q,
2498
+ Mr as q,
2483
2499
  ni as r,
2484
- Hr as s,
2485
- Yt as t,
2500
+ Kr as s,
2501
+ Xt as t,
2486
2502
  Pr as u,
2487
2503
  _t as v,
2488
2504
  Fe as w,
2489
- Mt as x,
2505
+ Nt as x,
2490
2506
  Jr as y,
2491
2507
  ii as z
2492
2508
  };