document-model 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/browser/document-model.cjs +1 -1
  2. package/dist/browser/document-model.js +8 -7
  3. package/dist/browser/document.cjs +1 -1
  4. package/dist/browser/document.js +13 -9
  5. package/dist/browser/index.cjs +1 -1
  6. package/dist/browser/index.js +13 -8
  7. package/dist/browser/internal/{index-oR1tzXEU.js → index-B-7drCvN.js} +1 -1
  8. package/dist/browser/internal/{index-qiOnVXbI.js → index-BFLtpklA.js} +1 -1
  9. package/dist/browser/internal/index-FwxURTAn.js +39 -0
  10. package/dist/browser/internal/index-_gFM9c3z.js +1 -0
  11. package/dist/browser/internal/{object-P7bHOWu_.js → object-DCxjKS4C.js} +629 -611
  12. package/dist/browser/internal/object-g08kById.js +6 -0
  13. package/dist/browser/src/document/actions/index.d.ts +5 -1
  14. package/dist/browser/src/document/actions/types.d.ts +1 -0
  15. package/dist/browser/src/document/utils/base.d.ts +1 -0
  16. package/dist/node/document-model.cjs +1 -1
  17. package/dist/node/document-model.js +11 -10
  18. package/dist/node/document.cjs +1 -1
  19. package/dist/node/document.js +17 -9
  20. package/dist/node/index.cjs +1 -1
  21. package/dist/node/index.js +17 -8
  22. package/dist/node/internal/{index-r_Cve_NX.js → index-BNOB79wS.js} +1 -1
  23. package/dist/node/internal/index-BevT9mtU.js +1 -0
  24. package/dist/node/internal/{index-uFGJxYP7.js → index-CbWnG-mj.js} +1 -1
  25. package/dist/node/internal/index-JCxY4diP.js +39 -0
  26. package/dist/node/internal/object-DULiHJNK.js +1 -0
  27. package/dist/node/internal/{object-qR4Tf50L.js → object-l76vs_od.js} +229 -211
  28. package/dist/node/src/document/actions/index.d.ts +5 -1
  29. package/dist/node/src/document/actions/types.d.ts +1 -0
  30. package/dist/node/src/document/utils/base.d.ts +1 -0
  31. package/package.json +6 -5
  32. package/dist/browser/internal/index-FBdtB-Z0.js +0 -38
  33. package/dist/browser/internal/index-MQO6aDba.js +0 -1
  34. package/dist/browser/internal/object-RV2GJjkF.js +0 -6
  35. package/dist/node/internal/index-E6Dehju3.js +0 -1
  36. package/dist/node/internal/index-Rc3pWGDQ.js +0 -38
  37. package/dist/node/internal/object-51-uoy0f.js +0 -1
@@ -1,30 +1,30 @@
1
- var ke = Object.defineProperty;
2
- var je = (o, i, p) => i in o ? ke(o, i, { enumerable: !0, configurable: !0, writable: !0, value: p }) : o[i] = p;
3
- var K = (o, i, p) => (je(o, typeof i != "symbol" ? i + "" : i, p), p);
4
- import { produce as X, castDraft as ot, castImmutable as Ie, freeze as Ue } from "immer";
5
- import Te from "json-stringify-deterministic";
1
+ var Be = Object.defineProperty;
2
+ var je = (o, r, p) => r in o ? Be(o, r, { enumerable: !0, configurable: !0, writable: !0, value: p }) : o[r] = p;
3
+ var V = (o, r, p) => (je(o, typeof r != "symbol" ? r + "" : r, p), p);
4
+ import { produce as J, castDraft as ot, castImmutable as Ie, freeze as Oe } from "immer";
5
+ import Ue from "json-stringify-deterministic";
6
6
  import { z as w } from "zod";
7
- import Tt from "jszip";
8
- const Ot = (o) => o != null, Oe = w.any().refine((o) => Ot(o)), Dt = w.enum(["LOAD_STATE"]), Mt = w.enum(["PRUNE"]), Nt = w.enum(["REDO"]), Rt = w.enum(["SET_NAME"]), Ct = w.enum(["UNDO"]);
7
+ import Ut from "jszip";
8
+ const Tt = (o) => o != null, Te = w.any().refine((o) => Tt(o)), Dt = w.enum(["LOAD_STATE"]), Nt = w.enum(["PRUNE"]), Mt = w.enum(["REDO"]), Rt = w.enum(["SET_NAME"]), Ct = w.enum(["UNDO"]);
9
9
  function De() {
10
10
  return w.object({
11
11
  __typename: w.literal("Action").optional(),
12
12
  type: w.string()
13
13
  });
14
14
  }
15
- function J() {
15
+ function H() {
16
16
  return w.literal("global").or(w.literal("local"));
17
17
  }
18
18
  function Lt() {
19
19
  return w.union([
20
20
  zt(),
21
- Pt(),
21
+ qt(),
22
22
  $t(),
23
23
  Wt(),
24
24
  Jt()
25
25
  ]);
26
26
  }
27
- function Me() {
27
+ function Ne() {
28
28
  return w.object({
29
29
  __typename: w.literal("DocumentFile").optional(),
30
30
  data: w.string(),
@@ -37,22 +37,22 @@ function zt() {
37
37
  return w.object({
38
38
  input: w.lazy(() => ct()),
39
39
  type: Dt,
40
- scope: J()
40
+ scope: H()
41
41
  });
42
42
  }
43
43
  function ct() {
44
44
  return w.object({
45
45
  operations: w.number(),
46
- state: w.lazy(() => qt())
46
+ state: w.lazy(() => Pt())
47
47
  });
48
48
  }
49
- function qt() {
49
+ function Pt() {
50
50
  return w.object({
51
51
  data: w.unknown().nullish(),
52
52
  name: w.string()
53
53
  });
54
54
  }
55
- function Ne() {
55
+ function Me() {
56
56
  return w.object({
57
57
  __typename: w.literal("Operation").optional(),
58
58
  hash: w.string(),
@@ -61,11 +61,11 @@ function Ne() {
61
61
  type: w.string()
62
62
  });
63
63
  }
64
- function Pt() {
64
+ function qt() {
65
65
  return w.object({
66
66
  input: w.lazy(() => lt()),
67
- type: Mt,
68
- scope: J()
67
+ type: Nt,
68
+ scope: H()
69
69
  });
70
70
  }
71
71
  function lt() {
@@ -78,8 +78,8 @@ const ut = w.number;
78
78
  function $t() {
79
79
  return w.object({
80
80
  input: ut(),
81
- type: Nt,
82
- scope: J()
81
+ type: Mt,
82
+ scope: H()
83
83
  });
84
84
  }
85
85
  const ft = w.string;
@@ -105,26 +105,26 @@ function Jt() {
105
105
  return w.object({
106
106
  input: mt(),
107
107
  type: Ct,
108
- scope: J()
108
+ scope: H()
109
109
  });
110
110
  }
111
- const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
111
+ const Ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
112
112
  __proto__: null,
113
113
  ActionSchema: De,
114
114
  BaseActionSchema: Lt,
115
- DocumentFileSchema: Me,
115
+ DocumentFileSchema: Ne,
116
116
  LoadStateActionInputSchema: ct,
117
117
  LoadStateActionSchema: zt,
118
- LoadStateActionStateInputSchema: qt,
118
+ LoadStateActionStateInputSchema: Pt,
119
119
  Load_StateSchema: Dt,
120
- OperationSchema: Ne,
121
- OperationScopeSchema: J,
120
+ OperationSchema: Me,
121
+ OperationScopeSchema: H,
122
122
  PruneActionInputSchema: lt,
123
- PruneActionSchema: Pt,
124
- PruneSchema: Mt,
123
+ PruneActionSchema: qt,
124
+ PruneSchema: Nt,
125
125
  RedoActionInputSchema: ut,
126
126
  RedoActionSchema: $t,
127
- RedoSchema: Nt,
127
+ RedoSchema: Mt,
128
128
  SetNameActionInputSchema: ft,
129
129
  SetNameActionSchema: Wt,
130
130
  SetNameOperationSchema: Re,
@@ -132,24 +132,34 @@ const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
132
132
  UndoActionInputSchema: mt,
133
133
  UndoActionSchema: Jt,
134
134
  UndoSchema: Ct,
135
- definedNonNullAnySchema: Oe,
136
- isDefinedNonNullAny: Ot
135
+ definedNonNullAnySchema: Te,
136
+ isDefinedNonNullAny: Tt
137
137
  }, Symbol.toStringTag, { value: "Module" }));
138
- function Ce(o, i) {
139
- return { ...o, name: i };
138
+ function Ce(o, r) {
139
+ return { ...o, name: r };
140
140
  }
141
- function Le(o, i, p) {
142
- const { scope: c, input: f } = i;
143
- return X({
141
+ function Le(o, r, p) {
142
+ const c = {
143
+ skip: p,
144
+ document: o
145
+ }, { scope: u } = r;
146
+ return !u || r.skip === void 0 ? c : J(c, (m) => {
147
+ const [l] = m.document.operations[u].slice(-1);
148
+ r.skip && r.skip > 0 && (m.skip = r.skip), l.type === "NOOP" && r.index === l.index && m.skip > l.skip && m.document.operations[u].pop();
149
+ });
150
+ }
151
+ function ze(o, r, p) {
152
+ const { scope: c, input: u } = r;
153
+ return J({
144
154
  document: o,
145
- action: i,
155
+ action: r,
146
156
  skip: p
147
157
  }, (l) => {
148
158
  if (l.document.operations[c].length < 1)
149
159
  throw new Error(
150
160
  `Cannot undo: no operations in history for scope "${c}"`
151
161
  );
152
- if (f < 1)
162
+ if (u < 1)
153
163
  throw new Error(
154
164
  "Invalid UNDO action: input value must be greater than 0"
155
165
  );
@@ -158,12 +168,12 @@ function Le(o, i, p) {
158
168
  "Cannot undo: skip value from reducer cannot be used with UNDO action"
159
169
  );
160
170
  const [a] = l.document.operations[c].slice(-1), x = a.type === "NOOP" && a.skip > 0;
161
- if (l.skip += f, x && (l.skip += a.skip, l.document.operations[c].pop()), l.document.operations[c].length < l.skip)
171
+ if (l.skip += u, x && (l.skip += a.skip, l.document.operations[c].pop()), l.document.operations[c].length < l.skip)
162
172
  throw new Error(
163
173
  "Cannot undo: you can't undo more operations than the ones in the scope history"
164
174
  );
165
175
  const d = l.document.operations[c].length - 1;
166
- let E = f, g = x ? d - a.skip : d;
176
+ let E = u, g = x ? d - a.skip : d;
167
177
  for (; E > 0 && g >= 0; ) {
168
178
  const v = l.document.operations[c][g];
169
179
  v.type === "NOOP" && v.skip > 0 ? (g = g - (v.skip + 1), l.skip += v.skip + 1) : (l.document.clipboard.push({ ...v }), E--, g--);
@@ -171,22 +181,22 @@ function Le(o, i, p) {
171
181
  l.action = wt(c);
172
182
  });
173
183
  }
174
- function ze(o, i, p) {
175
- const { scope: c, input: f } = i;
176
- return X({
184
+ function Pe(o, r, p) {
185
+ const { scope: c, input: u } = r;
186
+ return J({
177
187
  document: o,
178
- action: i,
188
+ action: r,
179
189
  skip: p
180
190
  }, (l) => {
181
191
  if (l.skip > 0)
182
192
  throw new Error(
183
193
  "Cannot redo: skip value from reducer cannot be used with REDO action"
184
194
  );
185
- if (f > 1)
195
+ if (u > 1)
186
196
  throw new Error(
187
197
  "Cannot redo: you can only redo one operation at a time"
188
198
  );
189
- if (f < 1)
199
+ if (u < 1)
190
200
  throw new Error("Invalid REDO action: invalid redo input value");
191
201
  if (l.document.clipboard.length < 1)
192
202
  throw new Error("Cannot redo: no operations in the clipboard");
@@ -205,20 +215,20 @@ function ze(o, i, p) {
205
215
  });
206
216
  });
207
217
  }
208
- function qe(o, i, p) {
209
- const { scope: c } = i, f = o.operations[c];
218
+ function qe(o, r, p) {
219
+ const { scope: c } = r, u = o.operations[c];
210
220
  let {
211
221
  input: { start: m, end: l }
212
- } = i;
213
- m = m || 0, l = l || f.length;
214
- const a = f.slice(m, l), x = f.slice(0, m), d = f.slice(l), E = st(
222
+ } = r;
223
+ m = m || 0, l = l || u.length;
224
+ const a = u.slice(m, l), x = u.slice(0, m), d = u.slice(l), E = st(
215
225
  o.initialState,
216
226
  {
217
227
  ...o.operations,
218
228
  [c]: x.concat(a)
219
229
  },
220
230
  p
221
- ), { name: g, state: v } = E, y = x.length, T = x.length ? x[x.length - 1].timestamp : d.length ? d[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
231
+ ), { name: g, state: v } = E, y = x.length, U = x.length ? x[x.length - 1].timestamp : d.length ? d[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
222
232
  return st(
223
233
  o.initialState,
224
234
  {
@@ -230,7 +240,7 @@ function qe(o, i, p) {
230
240
  { name: g, state: v },
231
241
  a.length
232
242
  ),
233
- timestamp: T,
243
+ timestamp: U,
234
244
  index: y,
235
245
  hash: ee({ state: v }, "global")
236
246
  },
@@ -243,85 +253,89 @@ function qe(o, i, p) {
243
253
  p
244
254
  );
245
255
  }
246
- function Pe(o, i) {
256
+ function $e(o, r) {
247
257
  return {
248
258
  ...o,
249
- name: i.name,
250
- state: i.state ?? { global: {}, local: {} }
259
+ name: r.name,
260
+ state: r.state ?? { global: {}, local: {} }
251
261
  };
252
262
  }
253
- const Ht = "SET_NAME", z = "UNDO", q = "REDO", H = "PRUNE", Zt = "LOAD_STATE";
254
- function $e(o, i) {
255
- const p = o.revision[i.scope];
256
- return [z, q, H].includes(i.type) ? p : p + 1;
263
+ const Ht = "SET_NAME", z = "UNDO", P = "REDO", Z = "PRUNE", Zt = "LOAD_STATE", We = "NOOP";
264
+ function Je(o, r) {
265
+ const p = o.revision[r.scope];
266
+ return [z, P, Z].includes(r.type) ? p : p + 1;
257
267
  }
258
- function We(o, i) {
268
+ function He(o, r) {
259
269
  return {
260
270
  ...o,
261
271
  revision: {
262
272
  ...o.revision,
263
- [i.scope]: $e(o, i)
273
+ [r.scope]: Je(o, r)
264
274
  },
265
275
  lastModified: (/* @__PURE__ */ new Date()).toISOString()
266
276
  };
267
277
  }
268
- function Je(o, i, p = 0) {
269
- if ([z, q, H].includes(i.type))
278
+ function Ze(o, r, p = 0) {
279
+ if ([z, P, Z].includes(r.type))
270
280
  return o;
271
- const { scope: c } = i, f = o.operations[c].slice(
281
+ const { scope: c } = r, u = o.operations[c].slice(
272
282
  0,
273
283
  o.revision[c]
274
284
  );
275
- return f.push({
276
- ...i,
277
- index: f.length,
285
+ return u.push({
286
+ ...r,
287
+ index: u.length,
278
288
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
279
289
  hash: "",
280
290
  scope: c,
281
291
  skip: p
282
292
  }), {
283
293
  ...o,
284
- operations: { ...o.operations, [c]: f }
294
+ operations: { ...o.operations, [c]: u }
285
295
  };
286
296
  }
287
- function He(o, i, p = 0) {
288
- let c = Je(o, i, p);
289
- return c = We(c, i), c;
297
+ function Ye(o, r, p = 0) {
298
+ let c = Ze(o, r, p);
299
+ return c = He(c, r), c;
290
300
  }
291
- function Ze(o, i, p) {
292
- switch (Lt().parse(i), i.type) {
301
+ function Ge(o, r, p) {
302
+ switch (Lt().parse(r), r.type) {
293
303
  case Ht:
294
- return Ce(o, i.input);
295
- case H:
296
- return qe(o, i, p);
304
+ return Ce(o, r.input);
305
+ case Z:
306
+ return qe(o, r, p);
297
307
  case Zt:
298
- return Pe(o, i.input.state);
308
+ return $e(o, r.input.state);
299
309
  default:
300
310
  return o;
301
311
  }
302
312
  }
303
- function Ye(o, i, p) {
304
- switch (i.type) {
313
+ function Ke(o, r, p) {
314
+ switch (r.type) {
305
315
  case z:
306
- return Le(o, i, p);
307
- case q:
308
- return ze(o, i, p);
316
+ return ze(o, r, p);
317
+ case P:
318
+ return Pe(o, r, p);
309
319
  default:
310
- return { document: o, action: i, skip: p };
320
+ return { document: o, action: r, skip: p };
311
321
  }
312
322
  }
313
- function Yt(o, i, p, c, f = {}) {
314
- const { skip: m, ignoreSkipOperations: l = !1 } = f;
315
- let a = { ...i }, x = m || 0, d = o, E = [...o.clipboard];
323
+ function Yt(o, r, p, c, u = {}) {
324
+ const { skip: m, ignoreSkipOperations: l = !1 } = u;
325
+ let a = { ...r }, x = m || 0, d = o, E = [...o.clipboard];
326
+ if (Ei(a)) {
327
+ const { document: g, skip: v } = Le(d, a, x);
328
+ x = v, d = g;
329
+ }
316
330
  if (jt(a)) {
317
331
  const {
318
332
  skip: g,
319
333
  action: v,
320
334
  document: y
321
- } = Ye(o, a, x);
335
+ } = Ke(o, a, x);
322
336
  a = v, x = g, d = y, E = [...d.clipboard];
323
337
  }
324
- return It(a) && (d = Ze(d, a, p)), x > 0 && !l && (d = st(
338
+ return It(a) && (d = Ge(d, a, p)), x > 0 && !l && (d = st(
325
339
  d.initialState,
326
340
  d.operations,
327
341
  p,
@@ -329,12 +343,12 @@ function Yt(o, i, p, c, f = {}) {
329
343
  void 0,
330
344
  void 0,
331
345
  { [a.scope]: x }
332
- )), d = He(d, a, x), d = X(d, (g) => {
346
+ )), d = Ye(d, a, x), d = J(d, (g) => {
333
347
  const v = p(
334
348
  g.state,
335
349
  a,
336
350
  c
337
- ), y = jt(i) ? [...E] : [];
351
+ ), y = jt(r) ? [...E] : [];
338
352
  if (v)
339
353
  return ot({
340
354
  ...d,
@@ -342,94 +356,94 @@ function Yt(o, i, p, c, f = {}) {
342
356
  state: v
343
357
  });
344
358
  g.clipboard = ot([...y]);
345
- }), X(d, (g) => {
346
- if ([z, q, H].includes(a.type))
359
+ }), J(d, (g) => {
360
+ if ([z, P, Z].includes(a.type))
347
361
  return g;
348
362
  const v = a.scope || "global";
349
363
  g.operations[v][g.operations[v].length - 1].hash = ee(g, v), !It(a) && a.attachments && a.attachments.forEach((y) => {
350
- const { hash: T, ...j } = y;
351
- g.attachments[T] = {
364
+ const { hash: U, ...j } = y;
365
+ g.attachments[U] = {
352
366
  ...j
353
367
  };
354
368
  });
355
369
  });
356
370
  }
357
- function Ge(o) {
371
+ function Ve(o) {
358
372
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
359
373
  }
360
374
  var at = { exports: {} };
361
- typeof Object.create == "function" ? at.exports = function(i, p) {
362
- p && (i.super_ = p, i.prototype = Object.create(p.prototype, {
375
+ typeof Object.create == "function" ? at.exports = function(r, p) {
376
+ p && (r.super_ = p, r.prototype = Object.create(p.prototype, {
363
377
  constructor: {
364
- value: i,
378
+ value: r,
365
379
  enumerable: !1,
366
380
  writable: !0,
367
381
  configurable: !0
368
382
  }
369
383
  }));
370
- } : at.exports = function(i, p) {
384
+ } : at.exports = function(r, p) {
371
385
  if (p) {
372
- i.super_ = p;
386
+ r.super_ = p;
373
387
  var c = function() {
374
388
  };
375
- c.prototype = p.prototype, i.prototype = new c(), i.prototype.constructor = i;
389
+ c.prototype = p.prototype, r.prototype = new c(), r.prototype.constructor = r;
376
390
  }
377
391
  };
378
- var Ke = at.exports, pt = { exports: {} }, Gt = {}, Q = {};
379
- Q.byteLength = Qe;
380
- Q.toByteArray = er;
381
- Q.fromByteArray = nr;
382
- var D = [], U = [], Ve = typeof Uint8Array < "u" ? Uint8Array : Array, nt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
383
- for (var C = 0, Xe = nt.length; C < Xe; ++C)
384
- D[C] = nt[C], U[nt.charCodeAt(C)] = C;
385
- U[45] = 62;
386
- U[95] = 63;
392
+ var Xe = at.exports, pt = { exports: {} }, Gt = {}, Q = {};
393
+ Q.byteLength = ei;
394
+ Q.toByteArray = ri;
395
+ Q.fromByteArray = ai;
396
+ var D = [], O = [], Qe = typeof Uint8Array < "u" ? Uint8Array : Array, nt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
397
+ for (var C = 0, ti = nt.length; C < ti; ++C)
398
+ D[C] = nt[C], O[nt.charCodeAt(C)] = C;
399
+ O[45] = 62;
400
+ O[95] = 63;
387
401
  function Kt(o) {
388
- var i = o.length;
389
- if (i % 4 > 0)
402
+ var r = o.length;
403
+ if (r % 4 > 0)
390
404
  throw new Error("Invalid string. Length must be a multiple of 4");
391
405
  var p = o.indexOf("=");
392
- p === -1 && (p = i);
393
- var c = p === i ? 0 : 4 - p % 4;
406
+ p === -1 && (p = r);
407
+ var c = p === r ? 0 : 4 - p % 4;
394
408
  return [p, c];
395
409
  }
396
- function Qe(o) {
397
- var i = Kt(o), p = i[0], c = i[1];
410
+ function ei(o) {
411
+ var r = Kt(o), p = r[0], c = r[1];
398
412
  return (p + c) * 3 / 4 - c;
399
413
  }
400
- function tr(o, i, p) {
401
- return (i + p) * 3 / 4 - p;
414
+ function ii(o, r, p) {
415
+ return (r + p) * 3 / 4 - p;
402
416
  }
403
- function er(o) {
404
- var i, p = Kt(o), c = p[0], f = p[1], m = new Ve(tr(o, c, f)), l = 0, a = f > 0 ? c - 4 : c, x;
417
+ function ri(o) {
418
+ var r, p = Kt(o), c = p[0], u = p[1], m = new Qe(ii(o, c, u)), l = 0, a = u > 0 ? c - 4 : c, x;
405
419
  for (x = 0; x < a; x += 4)
406
- i = U[o.charCodeAt(x)] << 18 | U[o.charCodeAt(x + 1)] << 12 | U[o.charCodeAt(x + 2)] << 6 | U[o.charCodeAt(x + 3)], m[l++] = i >> 16 & 255, m[l++] = i >> 8 & 255, m[l++] = i & 255;
407
- return f === 2 && (i = U[o.charCodeAt(x)] << 2 | U[o.charCodeAt(x + 1)] >> 4, m[l++] = i & 255), f === 1 && (i = U[o.charCodeAt(x)] << 10 | U[o.charCodeAt(x + 1)] << 4 | U[o.charCodeAt(x + 2)] >> 2, m[l++] = i >> 8 & 255, m[l++] = i & 255), m;
420
+ r = O[o.charCodeAt(x)] << 18 | O[o.charCodeAt(x + 1)] << 12 | O[o.charCodeAt(x + 2)] << 6 | O[o.charCodeAt(x + 3)], m[l++] = r >> 16 & 255, m[l++] = r >> 8 & 255, m[l++] = r & 255;
421
+ return u === 2 && (r = O[o.charCodeAt(x)] << 2 | O[o.charCodeAt(x + 1)] >> 4, m[l++] = r & 255), u === 1 && (r = O[o.charCodeAt(x)] << 10 | O[o.charCodeAt(x + 1)] << 4 | O[o.charCodeAt(x + 2)] >> 2, m[l++] = r >> 8 & 255, m[l++] = r & 255), m;
408
422
  }
409
- function rr(o) {
423
+ function ni(o) {
410
424
  return D[o >> 18 & 63] + D[o >> 12 & 63] + D[o >> 6 & 63] + D[o & 63];
411
425
  }
412
- function ir(o, i, p) {
413
- for (var c, f = [], m = i; m < p; m += 3)
414
- c = (o[m] << 16 & 16711680) + (o[m + 1] << 8 & 65280) + (o[m + 2] & 255), f.push(rr(c));
415
- return f.join("");
426
+ function oi(o, r, p) {
427
+ for (var c, u = [], m = r; m < p; m += 3)
428
+ c = (o[m] << 16 & 16711680) + (o[m + 1] << 8 & 65280) + (o[m + 2] & 255), u.push(ni(c));
429
+ return u.join("");
416
430
  }
417
- function nr(o) {
418
- for (var i, p = o.length, c = p % 3, f = [], m = 16383, l = 0, a = p - c; l < a; l += m)
419
- f.push(ir(o, l, l + m > a ? a : l + m));
420
- return c === 1 ? (i = o[p - 1], f.push(
421
- D[i >> 2] + D[i << 4 & 63] + "=="
422
- )) : c === 2 && (i = (o[p - 2] << 8) + o[p - 1], f.push(
423
- D[i >> 10] + D[i >> 4 & 63] + D[i << 2 & 63] + "="
424
- )), f.join("");
431
+ function ai(o) {
432
+ for (var r, p = o.length, c = p % 3, u = [], m = 16383, l = 0, a = p - c; l < a; l += m)
433
+ u.push(oi(o, l, l + m > a ? a : l + m));
434
+ return c === 1 ? (r = o[p - 1], u.push(
435
+ D[r >> 2] + D[r << 4 & 63] + "=="
436
+ )) : c === 2 && (r = (o[p - 2] << 8) + o[p - 1], u.push(
437
+ D[r >> 10] + D[r >> 4 & 63] + D[r << 2 & 63] + "="
438
+ )), u.join("");
425
439
  }
426
440
  var ht = {};
427
441
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
428
- ht.read = function(o, i, p, c, f) {
429
- var m, l, a = f * 8 - c - 1, x = (1 << a) - 1, d = x >> 1, E = -7, g = p ? f - 1 : 0, v = p ? -1 : 1, y = o[i + g];
430
- for (g += v, m = y & (1 << -E) - 1, y >>= -E, E += a; E > 0; m = m * 256 + o[i + g], g += v, E -= 8)
442
+ ht.read = function(o, r, p, c, u) {
443
+ var m, l, a = u * 8 - c - 1, x = (1 << a) - 1, d = x >> 1, E = -7, g = p ? u - 1 : 0, v = p ? -1 : 1, y = o[r + g];
444
+ for (g += v, m = y & (1 << -E) - 1, y >>= -E, E += a; E > 0; m = m * 256 + o[r + g], g += v, E -= 8)
431
445
  ;
432
- for (l = m & (1 << -E) - 1, m >>= -E, E += c; E > 0; l = l * 256 + o[i + g], g += v, E -= 8)
446
+ for (l = m & (1 << -E) - 1, m >>= -E, E += c; E > 0; l = l * 256 + o[r + g], g += v, E -= 8)
433
447
  ;
434
448
  if (m === 0)
435
449
  m = 1 - d;
@@ -440,13 +454,13 @@ ht.read = function(o, i, p, c, f) {
440
454
  }
441
455
  return (y ? -1 : 1) * l * Math.pow(2, m - c);
442
456
  };
443
- ht.write = function(o, i, p, c, f, m) {
444
- var l, a, x, d = m * 8 - f - 1, E = (1 << d) - 1, g = E >> 1, v = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = c ? 0 : m - 1, T = c ? 1 : -1, j = i < 0 || i === 0 && 1 / i < 0 ? 1 : 0;
445
- for (i = Math.abs(i), isNaN(i) || i === 1 / 0 ? (a = isNaN(i) ? 1 : 0, l = E) : (l = Math.floor(Math.log(i) / Math.LN2), i * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + g >= 1 ? i += v / x : i += v * Math.pow(2, 1 - g), i * x >= 2 && (l++, x /= 2), l + g >= E ? (a = 0, l = E) : l + g >= 1 ? (a = (i * x - 1) * Math.pow(2, f), l = l + g) : (a = i * Math.pow(2, g - 1) * Math.pow(2, f), l = 0)); f >= 8; o[p + y] = a & 255, y += T, a /= 256, f -= 8)
457
+ ht.write = function(o, r, p, c, u, m) {
458
+ var l, a, x, d = m * 8 - u - 1, E = (1 << d) - 1, g = E >> 1, v = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = c ? 0 : m - 1, U = c ? 1 : -1, j = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
459
+ for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, l = E) : (l = Math.floor(Math.log(r) / Math.LN2), r * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + g >= 1 ? r += v / x : r += v * Math.pow(2, 1 - g), r * x >= 2 && (l++, x /= 2), l + g >= E ? (a = 0, l = E) : l + g >= 1 ? (a = (r * x - 1) * Math.pow(2, u), l = l + g) : (a = r * Math.pow(2, g - 1) * Math.pow(2, u), l = 0)); u >= 8; o[p + y] = a & 255, y += U, a /= 256, u -= 8)
446
460
  ;
447
- for (l = l << f | a, d += f; d > 0; o[p + y] = l & 255, y += T, l /= 256, d -= 8)
461
+ for (l = l << u | a, d += u; d > 0; o[p + y] = l & 255, y += U, l /= 256, d -= 8)
448
462
  ;
449
- o[p + y - T] |= j * 128;
463
+ o[p + y - U] |= j * 128;
450
464
  };
451
465
  /*!
452
466
  * The buffer module from node.js, for the browser.
@@ -455,18 +469,18 @@ ht.write = function(o, i, p, c, f, m) {
455
469
  * @license MIT
456
470
  */
457
471
  (function(o) {
458
- var i = Q, p = ht, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
472
+ var r = Q, p = ht, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
459
473
  o.Buffer = a, o.SlowBuffer = le, o.INSPECT_MAX_BYTES = 50;
460
- var f = 2147483647;
461
- o.kMaxLength = f, a.TYPED_ARRAY_SUPPORT = m(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
474
+ var u = 2147483647;
475
+ o.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = m(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
462
476
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
463
477
  );
464
478
  function m() {
465
479
  try {
466
- var r = new Uint8Array(1), t = { foo: function() {
480
+ var i = new Uint8Array(1), t = { foo: function() {
467
481
  return 42;
468
482
  } };
469
- return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(r, t), r.foo() === 42;
483
+ return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(i, t), i.foo() === 42;
470
484
  } catch {
471
485
  return !1;
472
486
  }
@@ -484,133 +498,133 @@ ht.write = function(o, i, p, c, f, m) {
484
498
  return this.byteOffset;
485
499
  }
486
500
  });
487
- function l(r) {
488
- if (r > f)
489
- throw new RangeError('The value "' + r + '" is invalid for option "size"');
490
- var t = new Uint8Array(r);
501
+ function l(i) {
502
+ if (i > u)
503
+ throw new RangeError('The value "' + i + '" is invalid for option "size"');
504
+ var t = new Uint8Array(i);
491
505
  return Object.setPrototypeOf(t, a.prototype), t;
492
506
  }
493
- function a(r, t, e) {
494
- if (typeof r == "number") {
507
+ function a(i, t, e) {
508
+ if (typeof i == "number") {
495
509
  if (typeof t == "string")
496
510
  throw new TypeError(
497
511
  'The "string" argument must be of type string. Received type number'
498
512
  );
499
- return g(r);
513
+ return g(i);
500
514
  }
501
- return x(r, t, e);
515
+ return x(i, t, e);
502
516
  }
503
517
  a.poolSize = 8192;
504
- function x(r, t, e) {
505
- if (typeof r == "string")
506
- return v(r, t);
507
- if (ArrayBuffer.isView(r))
508
- return T(r);
509
- if (r == null)
518
+ function x(i, t, e) {
519
+ if (typeof i == "string")
520
+ return v(i, t);
521
+ if (ArrayBuffer.isView(i))
522
+ return U(i);
523
+ if (i == null)
510
524
  throw new TypeError(
511
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
525
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
512
526
  );
513
- if (O(r, ArrayBuffer) || r && O(r.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (O(r, SharedArrayBuffer) || r && O(r.buffer, SharedArrayBuffer)))
514
- return j(r, t, e);
515
- if (typeof r == "number")
527
+ if (T(i, ArrayBuffer) || i && T(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (T(i, SharedArrayBuffer) || i && T(i.buffer, SharedArrayBuffer)))
528
+ return j(i, t, e);
529
+ if (typeof i == "number")
516
530
  throw new TypeError(
517
531
  'The "value" argument must not be of type number. Received type number'
518
532
  );
519
- var n = r.valueOf && r.valueOf();
520
- if (n != null && n !== r)
533
+ var n = i.valueOf && i.valueOf();
534
+ if (n != null && n !== i)
521
535
  return a.from(n, t, e);
522
- var s = $(r);
536
+ var s = $(i);
523
537
  if (s)
524
538
  return s;
525
- if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof r[Symbol.toPrimitive] == "function")
539
+ if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
526
540
  return a.from(
527
- r[Symbol.toPrimitive]("string"),
541
+ i[Symbol.toPrimitive]("string"),
528
542
  t,
529
543
  e
530
544
  );
531
545
  throw new TypeError(
532
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
546
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
533
547
  );
534
548
  }
535
- a.from = function(r, t, e) {
536
- return x(r, t, e);
549
+ a.from = function(i, t, e) {
550
+ return x(i, t, e);
537
551
  }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
538
- function d(r) {
539
- if (typeof r != "number")
552
+ function d(i) {
553
+ if (typeof i != "number")
540
554
  throw new TypeError('"size" argument must be of type number');
541
- if (r < 0)
542
- throw new RangeError('The value "' + r + '" is invalid for option "size"');
555
+ if (i < 0)
556
+ throw new RangeError('The value "' + i + '" is invalid for option "size"');
543
557
  }
544
- function E(r, t, e) {
545
- return d(r), r <= 0 ? l(r) : t !== void 0 ? typeof e == "string" ? l(r).fill(t, e) : l(r).fill(t) : l(r);
558
+ function E(i, t, e) {
559
+ return d(i), i <= 0 ? l(i) : t !== void 0 ? typeof e == "string" ? l(i).fill(t, e) : l(i).fill(t) : l(i);
546
560
  }
547
- a.alloc = function(r, t, e) {
548
- return E(r, t, e);
561
+ a.alloc = function(i, t, e) {
562
+ return E(i, t, e);
549
563
  };
550
- function g(r) {
551
- return d(r), l(r < 0 ? 0 : R(r) | 0);
564
+ function g(i) {
565
+ return d(i), l(i < 0 ? 0 : R(i) | 0);
552
566
  }
553
- a.allocUnsafe = function(r) {
554
- return g(r);
555
- }, a.allocUnsafeSlow = function(r) {
556
- return g(r);
567
+ a.allocUnsafe = function(i) {
568
+ return g(i);
569
+ }, a.allocUnsafeSlow = function(i) {
570
+ return g(i);
557
571
  };
558
- function v(r, t) {
572
+ function v(i, t) {
559
573
  if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
560
574
  throw new TypeError("Unknown encoding: " + t);
561
- var e = gt(r, t) | 0, n = l(e), s = n.write(r, t);
575
+ var e = gt(i, t) | 0, n = l(e), s = n.write(i, t);
562
576
  return s !== e && (n = n.slice(0, s)), n;
563
577
  }
564
- function y(r) {
565
- for (var t = r.length < 0 ? 0 : R(r.length) | 0, e = l(t), n = 0; n < t; n += 1)
566
- e[n] = r[n] & 255;
578
+ function y(i) {
579
+ for (var t = i.length < 0 ? 0 : R(i.length) | 0, e = l(t), n = 0; n < t; n += 1)
580
+ e[n] = i[n] & 255;
567
581
  return e;
568
582
  }
569
- function T(r) {
570
- if (O(r, Uint8Array)) {
571
- var t = new Uint8Array(r);
583
+ function U(i) {
584
+ if (T(i, Uint8Array)) {
585
+ var t = new Uint8Array(i);
572
586
  return j(t.buffer, t.byteOffset, t.byteLength);
573
587
  }
574
- return y(r);
588
+ return y(i);
575
589
  }
576
- function j(r, t, e) {
577
- if (t < 0 || r.byteLength < t)
590
+ function j(i, t, e) {
591
+ if (t < 0 || i.byteLength < t)
578
592
  throw new RangeError('"offset" is outside of buffer bounds');
579
- if (r.byteLength < t + (e || 0))
593
+ if (i.byteLength < t + (e || 0))
580
594
  throw new RangeError('"length" is outside of buffer bounds');
581
595
  var n;
582
- return t === void 0 && e === void 0 ? n = new Uint8Array(r) : e === void 0 ? n = new Uint8Array(r, t) : n = new Uint8Array(r, t, e), Object.setPrototypeOf(n, a.prototype), n;
596
+ return t === void 0 && e === void 0 ? n = new Uint8Array(i) : e === void 0 ? n = new Uint8Array(i, t) : n = new Uint8Array(i, t, e), Object.setPrototypeOf(n, a.prototype), n;
583
597
  }
584
- function $(r) {
585
- if (a.isBuffer(r)) {
586
- var t = R(r.length) | 0, e = l(t);
587
- return e.length === 0 || r.copy(e, 0, 0, t), e;
598
+ function $(i) {
599
+ if (a.isBuffer(i)) {
600
+ var t = R(i.length) | 0, e = l(t);
601
+ return e.length === 0 || i.copy(e, 0, 0, t), e;
588
602
  }
589
- if (r.length !== void 0)
590
- return typeof r.length != "number" || it(r.length) ? l(0) : y(r);
591
- if (r.type === "Buffer" && Array.isArray(r.data))
592
- return y(r.data);
603
+ if (i.length !== void 0)
604
+ return typeof i.length != "number" || rt(i.length) ? l(0) : y(i);
605
+ if (i.type === "Buffer" && Array.isArray(i.data))
606
+ return y(i.data);
593
607
  }
594
- function R(r) {
595
- if (r >= f)
596
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
597
- return r | 0;
608
+ function R(i) {
609
+ if (i >= u)
610
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
611
+ return i | 0;
598
612
  }
599
- function le(r) {
600
- return +r != r && (r = 0), a.alloc(+r);
613
+ function le(i) {
614
+ return +i != i && (i = 0), a.alloc(+i);
601
615
  }
602
616
  a.isBuffer = function(t) {
603
617
  return t != null && t._isBuffer === !0 && t !== a.prototype;
604
618
  }, a.compare = function(t, e) {
605
- if (O(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), O(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
619
+ if (T(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), T(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
606
620
  throw new TypeError(
607
621
  'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
608
622
  );
609
623
  if (t === e)
610
624
  return 0;
611
- for (var n = t.length, s = e.length, u = 0, h = Math.min(n, s); u < h; ++u)
612
- if (t[u] !== e[u]) {
613
- n = t[u], s = e[u];
625
+ for (var n = t.length, s = e.length, f = 0, h = Math.min(n, s); f < h; ++f)
626
+ if (t[f] !== e[f]) {
627
+ n = t[f], s = e[f];
614
628
  break;
615
629
  }
616
630
  return n < s ? -1 : s < n ? 1 : 0;
@@ -640,33 +654,33 @@ ht.write = function(o, i, p, c, f, m) {
640
654
  if (e === void 0)
641
655
  for (e = 0, n = 0; n < t.length; ++n)
642
656
  e += t[n].length;
643
- var s = a.allocUnsafe(e), u = 0;
657
+ var s = a.allocUnsafe(e), f = 0;
644
658
  for (n = 0; n < t.length; ++n) {
645
659
  var h = t[n];
646
- if (O(h, Uint8Array))
647
- u + h.length > s.length ? a.from(h).copy(s, u) : Uint8Array.prototype.set.call(
660
+ if (T(h, Uint8Array))
661
+ f + h.length > s.length ? a.from(h).copy(s, f) : Uint8Array.prototype.set.call(
648
662
  s,
649
663
  h,
650
- u
664
+ f
651
665
  );
652
666
  else if (a.isBuffer(h))
653
- h.copy(s, u);
667
+ h.copy(s, f);
654
668
  else
655
669
  throw new TypeError('"list" argument must be an Array of Buffers');
656
- u += h.length;
670
+ f += h.length;
657
671
  }
658
672
  return s;
659
673
  };
660
- function gt(r, t) {
661
- if (a.isBuffer(r))
662
- return r.length;
663
- if (ArrayBuffer.isView(r) || O(r, ArrayBuffer))
664
- return r.byteLength;
665
- if (typeof r != "string")
674
+ function gt(i, t) {
675
+ if (a.isBuffer(i))
676
+ return i.length;
677
+ if (ArrayBuffer.isView(i) || T(i, ArrayBuffer))
678
+ return i.byteLength;
679
+ if (typeof i != "string")
666
680
  throw new TypeError(
667
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof r
681
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
668
682
  );
669
- var e = r.length, n = arguments.length > 2 && arguments[2] === !0;
683
+ var e = i.length, n = arguments.length > 2 && arguments[2] === !0;
670
684
  if (!n && e === 0)
671
685
  return 0;
672
686
  for (var s = !1; ; )
@@ -677,7 +691,7 @@ ht.write = function(o, i, p, c, f, m) {
677
691
  return e;
678
692
  case "utf8":
679
693
  case "utf-8":
680
- return rt(r).length;
694
+ return it(i).length;
681
695
  case "ucs2":
682
696
  case "ucs-2":
683
697
  case "utf16le":
@@ -686,20 +700,20 @@ ht.write = function(o, i, p, c, f, m) {
686
700
  case "hex":
687
701
  return e >>> 1;
688
702
  case "base64":
689
- return St(r).length;
703
+ return St(i).length;
690
704
  default:
691
705
  if (s)
692
- return n ? -1 : rt(r).length;
706
+ return n ? -1 : it(i).length;
693
707
  t = ("" + t).toLowerCase(), s = !0;
694
708
  }
695
709
  }
696
710
  a.byteLength = gt;
697
- function ue(r, t, e) {
711
+ function ue(i, t, e) {
698
712
  var n = !1;
699
713
  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))
700
714
  return "";
701
- for (r || (r = "utf8"); ; )
702
- switch (r) {
715
+ for (i || (i = "utf8"); ; )
716
+ switch (i) {
703
717
  case "hex":
704
718
  return be(this, t, e);
705
719
  case "utf8":
@@ -719,35 +733,35 @@ ht.write = function(o, i, p, c, f, m) {
719
733
  return Ee(this, t, e);
720
734
  default:
721
735
  if (n)
722
- throw new TypeError("Unknown encoding: " + r);
723
- r = (r + "").toLowerCase(), n = !0;
736
+ throw new TypeError("Unknown encoding: " + i);
737
+ i = (i + "").toLowerCase(), n = !0;
724
738
  }
725
739
  }
726
740
  a.prototype._isBuffer = !0;
727
- function M(r, t, e) {
728
- var n = r[t];
729
- r[t] = r[e], r[e] = n;
741
+ function N(i, t, e) {
742
+ var n = i[t];
743
+ i[t] = i[e], i[e] = n;
730
744
  }
731
745
  a.prototype.swap16 = function() {
732
746
  var t = this.length;
733
747
  if (t % 2 !== 0)
734
748
  throw new RangeError("Buffer size must be a multiple of 16-bits");
735
749
  for (var e = 0; e < t; e += 2)
736
- M(this, e, e + 1);
750
+ N(this, e, e + 1);
737
751
  return this;
738
752
  }, a.prototype.swap32 = function() {
739
753
  var t = this.length;
740
754
  if (t % 4 !== 0)
741
755
  throw new RangeError("Buffer size must be a multiple of 32-bits");
742
756
  for (var e = 0; e < t; e += 4)
743
- M(this, e, e + 3), M(this, e + 1, e + 2);
757
+ N(this, e, e + 3), N(this, e + 1, e + 2);
744
758
  return this;
745
759
  }, a.prototype.swap64 = function() {
746
760
  var t = this.length;
747
761
  if (t % 8 !== 0)
748
762
  throw new RangeError("Buffer size must be a multiple of 64-bits");
749
763
  for (var e = 0; e < t; e += 8)
750
- M(this, e, e + 7), M(this, e + 1, e + 6), M(this, e + 2, e + 5), M(this, e + 3, e + 4);
764
+ N(this, e, e + 7), N(this, e + 1, e + 6), N(this, e + 2, e + 5), N(this, e + 3, e + 4);
751
765
  return this;
752
766
  }, a.prototype.toString = function() {
753
767
  var t = this.length;
@@ -759,69 +773,69 @@ ht.write = function(o, i, p, c, f, m) {
759
773
  }, a.prototype.inspect = function() {
760
774
  var t = "", e = o.INSPECT_MAX_BYTES;
761
775
  return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
762
- }, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e, n, s, u) {
763
- if (O(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
776
+ }, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e, n, s, f) {
777
+ if (T(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
764
778
  throw new TypeError(
765
779
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
766
780
  );
767
- if (e === void 0 && (e = 0), n === void 0 && (n = t ? t.length : 0), s === void 0 && (s = 0), u === void 0 && (u = this.length), e < 0 || n > t.length || s < 0 || u > this.length)
781
+ if (e === void 0 && (e = 0), n === void 0 && (n = t ? t.length : 0), s === void 0 && (s = 0), f === void 0 && (f = this.length), e < 0 || n > t.length || s < 0 || f > this.length)
768
782
  throw new RangeError("out of range index");
769
- if (s >= u && e >= n)
783
+ if (s >= f && e >= n)
770
784
  return 0;
771
- if (s >= u)
785
+ if (s >= f)
772
786
  return -1;
773
787
  if (e >= n)
774
788
  return 1;
775
- if (e >>>= 0, n >>>= 0, s >>>= 0, u >>>= 0, this === t)
789
+ if (e >>>= 0, n >>>= 0, s >>>= 0, f >>>= 0, this === t)
776
790
  return 0;
777
- for (var h = u - s, b = n - e, _ = Math.min(h, b), F = this.slice(s, u), B = t.slice(e, n), A = 0; A < _; ++A)
778
- if (F[A] !== B[A]) {
779
- h = F[A], b = B[A];
791
+ for (var h = f - s, b = n - e, _ = Math.min(h, b), F = this.slice(s, f), k = t.slice(e, n), A = 0; A < _; ++A)
792
+ if (F[A] !== k[A]) {
793
+ h = F[A], b = k[A];
780
794
  break;
781
795
  }
782
796
  return h < b ? -1 : b < h ? 1 : 0;
783
797
  };
784
- function yt(r, t, e, n, s) {
785
- if (r.length === 0)
798
+ function yt(i, t, e, n, s) {
799
+ if (i.length === 0)
786
800
  return -1;
787
- if (typeof e == "string" ? (n = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, it(e) && (e = s ? 0 : r.length - 1), e < 0 && (e = r.length + e), e >= r.length) {
801
+ if (typeof e == "string" ? (n = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, rt(e) && (e = s ? 0 : i.length - 1), e < 0 && (e = i.length + e), e >= i.length) {
788
802
  if (s)
789
803
  return -1;
790
- e = r.length - 1;
804
+ e = i.length - 1;
791
805
  } else if (e < 0)
792
806
  if (s)
793
807
  e = 0;
794
808
  else
795
809
  return -1;
796
810
  if (typeof t == "string" && (t = a.from(t, n)), a.isBuffer(t))
797
- return t.length === 0 ? -1 : vt(r, t, e, n, s);
811
+ return t.length === 0 ? -1 : vt(i, t, e, n, s);
798
812
  if (typeof t == "number")
799
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? s ? Uint8Array.prototype.indexOf.call(r, t, e) : Uint8Array.prototype.lastIndexOf.call(r, t, e) : vt(r, [t], e, n, s);
813
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? s ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : vt(i, [t], e, n, s);
800
814
  throw new TypeError("val must be string, number or Buffer");
801
815
  }
802
- function vt(r, t, e, n, s) {
803
- var u = 1, h = r.length, b = t.length;
816
+ function vt(i, t, e, n, s) {
817
+ var f = 1, h = i.length, b = t.length;
804
818
  if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
805
- if (r.length < 2 || t.length < 2)
819
+ if (i.length < 2 || t.length < 2)
806
820
  return -1;
807
- u = 2, h /= 2, b /= 2, e /= 2;
821
+ f = 2, h /= 2, b /= 2, e /= 2;
808
822
  }
809
- function _(Bt, kt) {
810
- return u === 1 ? Bt[kt] : Bt.readUInt16BE(kt * u);
823
+ function _(kt, Bt) {
824
+ return f === 1 ? kt[Bt] : kt.readUInt16BE(Bt * f);
811
825
  }
812
826
  var F;
813
827
  if (s) {
814
- var B = -1;
828
+ var k = -1;
815
829
  for (F = e; F < h; F++)
816
- if (_(r, F) === _(t, B === -1 ? 0 : F - B)) {
817
- if (B === -1 && (B = F), F - B + 1 === b)
818
- return B * u;
830
+ if (_(i, F) === _(t, k === -1 ? 0 : F - k)) {
831
+ if (k === -1 && (k = F), F - k + 1 === b)
832
+ return k * f;
819
833
  } else
820
- B !== -1 && (F -= F - B), B = -1;
834
+ k !== -1 && (F -= F - k), k = -1;
821
835
  } else
822
836
  for (e + b > h && (e = h - b), F = e; F >= 0; F--) {
823
- for (var A = !0, G = 0; G < b; G++)
824
- if (_(r, F + G) !== _(t, G)) {
837
+ for (var A = !0, K = 0; K < b; K++)
838
+ if (_(i, F + K) !== _(t, K)) {
825
839
  A = !1;
826
840
  break;
827
841
  }
@@ -837,31 +851,31 @@ ht.write = function(o, i, p, c, f, m) {
837
851
  }, a.prototype.lastIndexOf = function(t, e, n) {
838
852
  return yt(this, t, e, n, !1);
839
853
  };
840
- function fe(r, t, e, n) {
854
+ function fe(i, t, e, n) {
841
855
  e = Number(e) || 0;
842
- var s = r.length - e;
856
+ var s = i.length - e;
843
857
  n ? (n = Number(n), n > s && (n = s)) : n = s;
844
- var u = t.length;
845
- n > u / 2 && (n = u / 2);
858
+ var f = t.length;
859
+ n > f / 2 && (n = f / 2);
846
860
  for (var h = 0; h < n; ++h) {
847
861
  var b = parseInt(t.substr(h * 2, 2), 16);
848
- if (it(b))
862
+ if (rt(b))
849
863
  return h;
850
- r[e + h] = b;
864
+ i[e + h] = b;
851
865
  }
852
866
  return h;
853
867
  }
854
- function me(r, t, e, n) {
855
- return Y(rt(t, r.length - e), r, e, n);
868
+ function me(i, t, e, n) {
869
+ return G(it(t, i.length - e), i, e, n);
856
870
  }
857
- function he(r, t, e, n) {
858
- return Y(Ae(t), r, e, n);
871
+ function he(i, t, e, n) {
872
+ return G(Ae(t), i, e, n);
859
873
  }
860
- function xe(r, t, e, n) {
861
- return Y(St(t), r, e, n);
874
+ function xe(i, t, e, n) {
875
+ return G(St(t), i, e, n);
862
876
  }
863
- function de(r, t, e, n) {
864
- return Y(Se(t, r.length - e), r, e, n);
877
+ function de(i, t, e, n) {
878
+ return G(Se(t, i.length - e), i, e, n);
865
879
  }
866
880
  a.prototype.write = function(t, e, n, s) {
867
881
  if (e === void 0)
@@ -874,8 +888,8 @@ ht.write = function(o, i, p, c, f, m) {
874
888
  throw new Error(
875
889
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
876
890
  );
877
- var u = this.length - e;
878
- if ((n === void 0 || n > u) && (n = u), t.length > 0 && (n < 0 || e < 0) || e > this.length)
891
+ var f = this.length - e;
892
+ if ((n === void 0 || n > f) && (n = f), t.length > 0 && (n < 0 || e < 0) || e > this.length)
879
893
  throw new RangeError("Attempt to write outside buffer bounds");
880
894
  s || (s = "utf8");
881
895
  for (var h = !1; ; )
@@ -907,27 +921,27 @@ ht.write = function(o, i, p, c, f, m) {
907
921
  data: Array.prototype.slice.call(this._arr || this, 0)
908
922
  };
909
923
  };
910
- function we(r, t, e) {
911
- return t === 0 && e === r.length ? i.fromByteArray(r) : i.fromByteArray(r.slice(t, e));
924
+ function we(i, t, e) {
925
+ return t === 0 && e === i.length ? r.fromByteArray(i) : r.fromByteArray(i.slice(t, e));
912
926
  }
913
- function bt(r, t, e) {
914
- e = Math.min(r.length, e);
927
+ function bt(i, t, e) {
928
+ e = Math.min(i.length, e);
915
929
  for (var n = [], s = t; s < e; ) {
916
- var u = r[s], h = null, b = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
930
+ var f = i[s], h = null, b = f > 239 ? 4 : f > 223 ? 3 : f > 191 ? 2 : 1;
917
931
  if (s + b <= e) {
918
- var _, F, B, A;
932
+ var _, F, k, A;
919
933
  switch (b) {
920
934
  case 1:
921
- u < 128 && (h = u);
935
+ f < 128 && (h = f);
922
936
  break;
923
937
  case 2:
924
- _ = r[s + 1], (_ & 192) === 128 && (A = (u & 31) << 6 | _ & 63, A > 127 && (h = A));
938
+ _ = i[s + 1], (_ & 192) === 128 && (A = (f & 31) << 6 | _ & 63, A > 127 && (h = A));
925
939
  break;
926
940
  case 3:
927
- _ = r[s + 1], F = r[s + 2], (_ & 192) === 128 && (F & 192) === 128 && (A = (u & 15) << 12 | (_ & 63) << 6 | F & 63, A > 2047 && (A < 55296 || A > 57343) && (h = A));
941
+ _ = i[s + 1], F = i[s + 2], (_ & 192) === 128 && (F & 192) === 128 && (A = (f & 15) << 12 | (_ & 63) << 6 | F & 63, A > 2047 && (A < 55296 || A > 57343) && (h = A));
928
942
  break;
929
943
  case 4:
930
- _ = r[s + 1], F = r[s + 2], B = r[s + 3], (_ & 192) === 128 && (F & 192) === 128 && (B & 192) === 128 && (A = (u & 15) << 18 | (_ & 63) << 12 | (F & 63) << 6 | B & 63, A > 65535 && A < 1114112 && (h = A));
944
+ _ = i[s + 1], F = i[s + 2], k = i[s + 3], (_ & 192) === 128 && (F & 192) === 128 && (k & 192) === 128 && (A = (f & 15) << 18 | (_ & 63) << 12 | (F & 63) << 6 | k & 63, A > 65535 && A < 1114112 && (h = A));
931
945
  }
932
946
  }
933
947
  h === null ? (h = 65533, b = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), n.push(h), s += b;
@@ -935,41 +949,41 @@ ht.write = function(o, i, p, c, f, m) {
935
949
  return ge(n);
936
950
  }
937
951
  var Et = 4096;
938
- function ge(r) {
939
- var t = r.length;
952
+ function ge(i) {
953
+ var t = i.length;
940
954
  if (t <= Et)
941
- return String.fromCharCode.apply(String, r);
955
+ return String.fromCharCode.apply(String, i);
942
956
  for (var e = "", n = 0; n < t; )
943
957
  e += String.fromCharCode.apply(
944
958
  String,
945
- r.slice(n, n += Et)
959
+ i.slice(n, n += Et)
946
960
  );
947
961
  return e;
948
962
  }
949
- function ye(r, t, e) {
963
+ function ye(i, t, e) {
950
964
  var n = "";
951
- e = Math.min(r.length, e);
965
+ e = Math.min(i.length, e);
952
966
  for (var s = t; s < e; ++s)
953
- n += String.fromCharCode(r[s] & 127);
967
+ n += String.fromCharCode(i[s] & 127);
954
968
  return n;
955
969
  }
956
- function ve(r, t, e) {
970
+ function ve(i, t, e) {
957
971
  var n = "";
958
- e = Math.min(r.length, e);
972
+ e = Math.min(i.length, e);
959
973
  for (var s = t; s < e; ++s)
960
- n += String.fromCharCode(r[s]);
974
+ n += String.fromCharCode(i[s]);
961
975
  return n;
962
976
  }
963
- function be(r, t, e) {
964
- var n = r.length;
977
+ function be(i, t, e) {
978
+ var n = i.length;
965
979
  (!t || t < 0) && (t = 0), (!e || e < 0 || e > n) && (e = n);
966
- for (var s = "", u = t; u < e; ++u)
967
- s += Be[r[u]];
980
+ for (var s = "", f = t; f < e; ++f)
981
+ s += ke[i[f]];
968
982
  return s;
969
983
  }
970
- function Ee(r, t, e) {
971
- for (var n = r.slice(t, e), s = "", u = 0; u < n.length - 1; u += 2)
972
- s += String.fromCharCode(n[u] + n[u + 1] * 256);
984
+ function Ee(i, t, e) {
985
+ for (var n = i.slice(t, e), s = "", f = 0; f < n.length - 1; f += 2)
986
+ s += String.fromCharCode(n[f] + n[f + 1] * 256);
973
987
  return s;
974
988
  }
975
989
  a.prototype.slice = function(t, e) {
@@ -978,21 +992,21 @@ ht.write = function(o, i, p, c, f, m) {
978
992
  var s = this.subarray(t, e);
979
993
  return Object.setPrototypeOf(s, a.prototype), s;
980
994
  };
981
- function S(r, t, e) {
982
- if (r % 1 !== 0 || r < 0)
995
+ function S(i, t, e) {
996
+ if (i % 1 !== 0 || i < 0)
983
997
  throw new RangeError("offset is not uint");
984
- if (r + t > e)
998
+ if (i + t > e)
985
999
  throw new RangeError("Trying to access beyond buffer length");
986
1000
  }
987
1001
  a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, n) {
988
1002
  t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
989
- for (var s = this[t], u = 1, h = 0; ++h < e && (u *= 256); )
990
- s += this[t + h] * u;
1003
+ for (var s = this[t], f = 1, h = 0; ++h < e && (f *= 256); )
1004
+ s += this[t + h] * f;
991
1005
  return s;
992
1006
  }, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, n) {
993
1007
  t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
994
- for (var s = this[t + --e], u = 1; e > 0 && (u *= 256); )
995
- s += this[t + --e] * u;
1008
+ for (var s = this[t + --e], f = 1; e > 0 && (f *= 256); )
1009
+ s += this[t + --e] * f;
996
1010
  return s;
997
1011
  }, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
998
1012
  return t = t >>> 0, e || S(t, 1, this.length), this[t];
@@ -1006,14 +1020,14 @@ ht.write = function(o, i, p, c, f, m) {
1006
1020
  return t = t >>> 0, e || S(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1007
1021
  }, a.prototype.readIntLE = function(t, e, n) {
1008
1022
  t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
1009
- for (var s = this[t], u = 1, h = 0; ++h < e && (u *= 256); )
1010
- s += this[t + h] * u;
1011
- return u *= 128, s >= u && (s -= Math.pow(2, 8 * e)), s;
1023
+ for (var s = this[t], f = 1, h = 0; ++h < e && (f *= 256); )
1024
+ s += this[t + h] * f;
1025
+ return f *= 128, s >= f && (s -= Math.pow(2, 8 * e)), s;
1012
1026
  }, a.prototype.readIntBE = function(t, e, n) {
1013
1027
  t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
1014
- for (var s = e, u = 1, h = this[t + --s]; s > 0 && (u *= 256); )
1015
- h += this[t + --s] * u;
1016
- return u *= 128, h >= u && (h -= Math.pow(2, 8 * e)), h;
1028
+ for (var s = e, f = 1, h = this[t + --s]; s > 0 && (f *= 256); )
1029
+ h += this[t + --s] * f;
1030
+ return f *= 128, h >= f && (h -= Math.pow(2, 8 * e)), h;
1017
1031
  }, a.prototype.readInt8 = function(t, e) {
1018
1032
  return t = t >>> 0, e || S(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1019
1033
  }, a.prototype.readInt16LE = function(t, e) {
@@ -1037,18 +1051,18 @@ ht.write = function(o, i, p, c, f, m) {
1037
1051
  }, a.prototype.readDoubleBE = function(t, e) {
1038
1052
  return t = t >>> 0, e || S(t, 8, this.length), p.read(this, t, !1, 52, 8);
1039
1053
  };
1040
- function k(r, t, e, n, s, u) {
1041
- if (!a.isBuffer(r))
1054
+ function B(i, t, e, n, s, f) {
1055
+ if (!a.isBuffer(i))
1042
1056
  throw new TypeError('"buffer" argument must be a Buffer instance');
1043
- if (t > s || t < u)
1057
+ if (t > s || t < f)
1044
1058
  throw new RangeError('"value" argument is out of bounds');
1045
- if (e + n > r.length)
1059
+ if (e + n > i.length)
1046
1060
  throw new RangeError("Index out of range");
1047
1061
  }
1048
1062
  a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, n, s) {
1049
1063
  if (t = +t, e = e >>> 0, n = n >>> 0, !s) {
1050
- var u = Math.pow(2, 8 * n) - 1;
1051
- k(this, t, e, n, u, 0);
1064
+ var f = Math.pow(2, 8 * n) - 1;
1065
+ B(this, t, e, n, f, 0);
1052
1066
  }
1053
1067
  var h = 1, b = 0;
1054
1068
  for (this[e] = t & 255; ++b < n && (h *= 256); )
@@ -1056,27 +1070,27 @@ ht.write = function(o, i, p, c, f, m) {
1056
1070
  return e + n;
1057
1071
  }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, n, s) {
1058
1072
  if (t = +t, e = e >>> 0, n = n >>> 0, !s) {
1059
- var u = Math.pow(2, 8 * n) - 1;
1060
- k(this, t, e, n, u, 0);
1073
+ var f = Math.pow(2, 8 * n) - 1;
1074
+ B(this, t, e, n, f, 0);
1061
1075
  }
1062
1076
  var h = n - 1, b = 1;
1063
1077
  for (this[e + h] = t & 255; --h >= 0 && (b *= 256); )
1064
1078
  this[e + h] = t / b & 255;
1065
1079
  return e + n;
1066
1080
  }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, n) {
1067
- return t = +t, e = e >>> 0, n || k(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1081
+ return t = +t, e = e >>> 0, n || B(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1068
1082
  }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, n) {
1069
- return t = +t, e = e >>> 0, n || k(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1083
+ return t = +t, e = e >>> 0, n || B(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1070
1084
  }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, n) {
1071
- return t = +t, e = e >>> 0, n || k(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1085
+ return t = +t, e = e >>> 0, n || B(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1072
1086
  }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, n) {
1073
- return t = +t, e = e >>> 0, n || k(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;
1087
+ return t = +t, e = e >>> 0, n || B(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;
1074
1088
  }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, n) {
1075
- return t = +t, e = e >>> 0, n || k(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;
1089
+ return t = +t, e = e >>> 0, n || B(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;
1076
1090
  }, a.prototype.writeIntLE = function(t, e, n, s) {
1077
1091
  if (t = +t, e = e >>> 0, !s) {
1078
- var u = Math.pow(2, 8 * n - 1);
1079
- k(this, t, e, n, u - 1, -u);
1092
+ var f = Math.pow(2, 8 * n - 1);
1093
+ B(this, t, e, n, f - 1, -f);
1080
1094
  }
1081
1095
  var h = 0, b = 1, _ = 0;
1082
1096
  for (this[e] = t & 255; ++h < n && (b *= 256); )
@@ -1084,40 +1098,40 @@ ht.write = function(o, i, p, c, f, m) {
1084
1098
  return e + n;
1085
1099
  }, a.prototype.writeIntBE = function(t, e, n, s) {
1086
1100
  if (t = +t, e = e >>> 0, !s) {
1087
- var u = Math.pow(2, 8 * n - 1);
1088
- k(this, t, e, n, u - 1, -u);
1101
+ var f = Math.pow(2, 8 * n - 1);
1102
+ B(this, t, e, n, f - 1, -f);
1089
1103
  }
1090
1104
  var h = n - 1, b = 1, _ = 0;
1091
1105
  for (this[e + h] = t & 255; --h >= 0 && (b *= 256); )
1092
1106
  t < 0 && _ === 0 && this[e + h + 1] !== 0 && (_ = 1), this[e + h] = (t / b >> 0) - _ & 255;
1093
1107
  return e + n;
1094
1108
  }, a.prototype.writeInt8 = function(t, e, n) {
1095
- return t = +t, e = e >>> 0, n || k(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1109
+ return t = +t, e = e >>> 0, n || B(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1096
1110
  }, a.prototype.writeInt16LE = function(t, e, n) {
1097
- return t = +t, e = e >>> 0, n || k(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1111
+ return t = +t, e = e >>> 0, n || B(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1098
1112
  }, a.prototype.writeInt16BE = function(t, e, n) {
1099
- return t = +t, e = e >>> 0, n || k(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1113
+ return t = +t, e = e >>> 0, n || B(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1100
1114
  }, a.prototype.writeInt32LE = function(t, e, n) {
1101
- return t = +t, e = e >>> 0, n || k(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;
1115
+ return t = +t, e = e >>> 0, n || B(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;
1102
1116
  }, a.prototype.writeInt32BE = function(t, e, n) {
1103
- return t = +t, e = e >>> 0, n || k(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;
1117
+ return t = +t, e = e >>> 0, n || B(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;
1104
1118
  };
1105
- function _t(r, t, e, n, s, u) {
1106
- if (e + n > r.length)
1119
+ function _t(i, t, e, n, s, f) {
1120
+ if (e + n > i.length)
1107
1121
  throw new RangeError("Index out of range");
1108
1122
  if (e < 0)
1109
1123
  throw new RangeError("Index out of range");
1110
1124
  }
1111
- function Ft(r, t, e, n, s) {
1112
- return t = +t, e = e >>> 0, s || _t(r, t, e, 4), p.write(r, t, e, n, 23, 4), e + 4;
1125
+ function Ft(i, t, e, n, s) {
1126
+ return t = +t, e = e >>> 0, s || _t(i, t, e, 4), p.write(i, t, e, n, 23, 4), e + 4;
1113
1127
  }
1114
1128
  a.prototype.writeFloatLE = function(t, e, n) {
1115
1129
  return Ft(this, t, e, !0, n);
1116
1130
  }, a.prototype.writeFloatBE = function(t, e, n) {
1117
1131
  return Ft(this, t, e, !1, n);
1118
1132
  };
1119
- function At(r, t, e, n, s) {
1120
- return t = +t, e = e >>> 0, s || _t(r, t, e, 8), p.write(r, t, e, n, 52, 8), e + 8;
1133
+ function At(i, t, e, n, s) {
1134
+ return t = +t, e = e >>> 0, s || _t(i, t, e, 8), p.write(i, t, e, n, 52, 8), e + 8;
1121
1135
  }
1122
1136
  a.prototype.writeDoubleLE = function(t, e, n) {
1123
1137
  return At(this, t, e, !0, n);
@@ -1135,12 +1149,12 @@ ht.write = function(o, i, p, c, f, m) {
1135
1149
  if (s < 0)
1136
1150
  throw new RangeError("sourceEnd out of bounds");
1137
1151
  s > this.length && (s = this.length), t.length - e < s - n && (s = t.length - e + n);
1138
- var u = s - n;
1152
+ var f = s - n;
1139
1153
  return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, n, s) : Uint8Array.prototype.set.call(
1140
1154
  t,
1141
1155
  this.subarray(n, s),
1142
1156
  e
1143
- ), u;
1157
+ ), f;
1144
1158
  }, a.prototype.fill = function(t, e, n, s) {
1145
1159
  if (typeof t == "string") {
1146
1160
  if (typeof e == "string" ? (s = e, e = 0, n = this.length) : typeof n == "string" && (s = n, n = this.length), s !== void 0 && typeof s != "string")
@@ -1148,8 +1162,8 @@ ht.write = function(o, i, p, c, f, m) {
1148
1162
  if (typeof s == "string" && !a.isEncoding(s))
1149
1163
  throw new TypeError("Unknown encoding: " + s);
1150
1164
  if (t.length === 1) {
1151
- var u = t.charCodeAt(0);
1152
- (s === "utf8" && u < 128 || s === "latin1") && (t = u);
1165
+ var f = t.charCodeAt(0);
1166
+ (s === "utf8" && f < 128 || s === "latin1") && (t = f);
1153
1167
  }
1154
1168
  } else
1155
1169
  typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
@@ -1172,50 +1186,50 @@ ht.write = function(o, i, p, c, f, m) {
1172
1186
  return this;
1173
1187
  };
1174
1188
  var _e = /[^+/0-9A-Za-z-_]/g;
1175
- function Fe(r) {
1176
- if (r = r.split("=")[0], r = r.trim().replace(_e, ""), r.length < 2)
1189
+ function Fe(i) {
1190
+ if (i = i.split("=")[0], i = i.trim().replace(_e, ""), i.length < 2)
1177
1191
  return "";
1178
- for (; r.length % 4 !== 0; )
1179
- r = r + "=";
1180
- return r;
1192
+ for (; i.length % 4 !== 0; )
1193
+ i = i + "=";
1194
+ return i;
1181
1195
  }
1182
- function rt(r, t) {
1196
+ function it(i, t) {
1183
1197
  t = t || 1 / 0;
1184
- for (var e, n = r.length, s = null, u = [], h = 0; h < n; ++h) {
1185
- if (e = r.charCodeAt(h), e > 55295 && e < 57344) {
1198
+ for (var e, n = i.length, s = null, f = [], h = 0; h < n; ++h) {
1199
+ if (e = i.charCodeAt(h), e > 55295 && e < 57344) {
1186
1200
  if (!s) {
1187
1201
  if (e > 56319) {
1188
- (t -= 3) > -1 && u.push(239, 191, 189);
1202
+ (t -= 3) > -1 && f.push(239, 191, 189);
1189
1203
  continue;
1190
1204
  } else if (h + 1 === n) {
1191
- (t -= 3) > -1 && u.push(239, 191, 189);
1205
+ (t -= 3) > -1 && f.push(239, 191, 189);
1192
1206
  continue;
1193
1207
  }
1194
1208
  s = e;
1195
1209
  continue;
1196
1210
  }
1197
1211
  if (e < 56320) {
1198
- (t -= 3) > -1 && u.push(239, 191, 189), s = e;
1212
+ (t -= 3) > -1 && f.push(239, 191, 189), s = e;
1199
1213
  continue;
1200
1214
  }
1201
1215
  e = (s - 55296 << 10 | e - 56320) + 65536;
1202
1216
  } else
1203
- s && (t -= 3) > -1 && u.push(239, 191, 189);
1217
+ s && (t -= 3) > -1 && f.push(239, 191, 189);
1204
1218
  if (s = null, e < 128) {
1205
1219
  if ((t -= 1) < 0)
1206
1220
  break;
1207
- u.push(e);
1221
+ f.push(e);
1208
1222
  } else if (e < 2048) {
1209
1223
  if ((t -= 2) < 0)
1210
1224
  break;
1211
- u.push(
1225
+ f.push(
1212
1226
  e >> 6 | 192,
1213
1227
  e & 63 | 128
1214
1228
  );
1215
1229
  } else if (e < 65536) {
1216
1230
  if ((t -= 3) < 0)
1217
1231
  break;
1218
- u.push(
1232
+ f.push(
1219
1233
  e >> 12 | 224,
1220
1234
  e >> 6 & 63 | 128,
1221
1235
  e & 63 | 128
@@ -1223,7 +1237,7 @@ ht.write = function(o, i, p, c, f, m) {
1223
1237
  } else if (e < 1114112) {
1224
1238
  if ((t -= 4) < 0)
1225
1239
  break;
1226
- u.push(
1240
+ f.push(
1227
1241
  e >> 18 | 240,
1228
1242
  e >> 12 & 63 | 128,
1229
1243
  e >> 6 & 63 | 128,
@@ -1232,51 +1246,51 @@ ht.write = function(o, i, p, c, f, m) {
1232
1246
  } else
1233
1247
  throw new Error("Invalid code point");
1234
1248
  }
1235
- return u;
1249
+ return f;
1236
1250
  }
1237
- function Ae(r) {
1238
- for (var t = [], e = 0; e < r.length; ++e)
1239
- t.push(r.charCodeAt(e) & 255);
1251
+ function Ae(i) {
1252
+ for (var t = [], e = 0; e < i.length; ++e)
1253
+ t.push(i.charCodeAt(e) & 255);
1240
1254
  return t;
1241
1255
  }
1242
- function Se(r, t) {
1243
- for (var e, n, s, u = [], h = 0; h < r.length && !((t -= 2) < 0); ++h)
1244
- e = r.charCodeAt(h), n = e >> 8, s = e % 256, u.push(s), u.push(n);
1245
- return u;
1256
+ function Se(i, t) {
1257
+ for (var e, n, s, f = [], h = 0; h < i.length && !((t -= 2) < 0); ++h)
1258
+ e = i.charCodeAt(h), n = e >> 8, s = e % 256, f.push(s), f.push(n);
1259
+ return f;
1246
1260
  }
1247
- function St(r) {
1248
- return i.toByteArray(Fe(r));
1261
+ function St(i) {
1262
+ return r.toByteArray(Fe(i));
1249
1263
  }
1250
- function Y(r, t, e, n) {
1251
- for (var s = 0; s < n && !(s + e >= t.length || s >= r.length); ++s)
1252
- t[s + e] = r[s];
1264
+ function G(i, t, e, n) {
1265
+ for (var s = 0; s < n && !(s + e >= t.length || s >= i.length); ++s)
1266
+ t[s + e] = i[s];
1253
1267
  return s;
1254
1268
  }
1255
- function O(r, t) {
1256
- return r instanceof t || r != null && r.constructor != null && r.constructor.name != null && r.constructor.name === t.name;
1269
+ function T(i, t) {
1270
+ return i instanceof t || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === t.name;
1257
1271
  }
1258
- function it(r) {
1259
- return r !== r;
1272
+ function rt(i) {
1273
+ return i !== i;
1260
1274
  }
1261
- var Be = function() {
1262
- for (var r = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
1275
+ var ke = function() {
1276
+ for (var i = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
1263
1277
  for (var n = e * 16, s = 0; s < 16; ++s)
1264
- t[n + s] = r[e] + r[s];
1278
+ t[n + s] = i[e] + i[s];
1265
1279
  return t;
1266
1280
  }();
1267
1281
  })(Gt);
1268
1282
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1269
- (function(o, i) {
1283
+ (function(o, r) {
1270
1284
  var p = Gt, c = p.Buffer;
1271
- function f(l, a) {
1285
+ function u(l, a) {
1272
1286
  for (var x in l)
1273
1287
  a[x] = l[x];
1274
1288
  }
1275
- c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? o.exports = p : (f(p, i), i.Buffer = m);
1289
+ c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? o.exports = p : (u(p, r), r.Buffer = m);
1276
1290
  function m(l, a, x) {
1277
1291
  return c(l, a, x);
1278
1292
  }
1279
- m.prototype = Object.create(c.prototype), f(c, m), m.from = function(l, a, x) {
1293
+ m.prototype = Object.create(c.prototype), u(c, m), m.from = function(l, a, x) {
1280
1294
  if (typeof l == "number")
1281
1295
  throw new TypeError("Argument must not be a number");
1282
1296
  return c(l, a, x);
@@ -1296,27 +1310,27 @@ ht.write = function(o, i, p, c, f, m) {
1296
1310
  };
1297
1311
  })(pt, pt.exports);
1298
1312
  var Vt = pt.exports, Xt = Vt.Buffer;
1299
- function tt(o, i) {
1300
- this._block = Xt.alloc(o), this._finalSize = i, this._blockSize = o, this._len = 0;
1313
+ function tt(o, r) {
1314
+ this._block = Xt.alloc(o), this._finalSize = r, this._blockSize = o, this._len = 0;
1301
1315
  }
1302
- tt.prototype.update = function(o, i) {
1303
- typeof o == "string" && (i = i || "utf8", o = Xt.from(o, i));
1304
- for (var p = this._block, c = this._blockSize, f = o.length, m = this._len, l = 0; l < f; ) {
1305
- for (var a = m % c, x = Math.min(f - l, c - a), d = 0; d < x; d++)
1316
+ tt.prototype.update = function(o, r) {
1317
+ typeof o == "string" && (r = r || "utf8", o = Xt.from(o, r));
1318
+ for (var p = this._block, c = this._blockSize, u = o.length, m = this._len, l = 0; l < u; ) {
1319
+ for (var a = m % c, x = Math.min(u - l, c - a), d = 0; d < x; d++)
1306
1320
  p[a + d] = o[l + d];
1307
1321
  m += x, l += x, m % c === 0 && this._update(p);
1308
1322
  }
1309
- return this._len += f, this;
1323
+ return this._len += u, this;
1310
1324
  };
1311
1325
  tt.prototype.digest = function(o) {
1312
- var i = this._len % this._blockSize;
1313
- this._block[i] = 128, this._block.fill(0, i + 1), i >= this._finalSize && (this._update(this._block), this._block.fill(0));
1326
+ var r = this._len % this._blockSize;
1327
+ this._block[r] = 128, this._block.fill(0, r + 1), r >= this._finalSize && (this._update(this._block), this._block.fill(0));
1314
1328
  var p = this._len * 8;
1315
1329
  if (p <= 4294967295)
1316
1330
  this._block.writeUInt32BE(p, this._blockSize - 4);
1317
1331
  else {
1318
- var c = (p & 4294967295) >>> 0, f = (p - c) / 4294967296;
1319
- this._block.writeUInt32BE(f, this._blockSize - 8), this._block.writeUInt32BE(c, this._blockSize - 4);
1332
+ var c = (p & 4294967295) >>> 0, u = (p - c) / 4294967296;
1333
+ this._block.writeUInt32BE(u, this._blockSize - 8), this._block.writeUInt32BE(c, this._blockSize - 4);
1320
1334
  }
1321
1335
  this._update(this._block);
1322
1336
  var m = this._hash();
@@ -1325,82 +1339,85 @@ tt.prototype.digest = function(o) {
1325
1339
  tt.prototype._update = function() {
1326
1340
  throw new Error("_update must be implemented by subclass");
1327
1341
  };
1328
- var or = tt, ar = Ke, Qt = or, pr = Vt.Buffer, sr = [
1342
+ var pi = tt, si = Xe, Qt = pi, ci = Vt.Buffer, li = [
1329
1343
  1518500249,
1330
1344
  1859775393,
1331
1345
  -1894007588,
1332
1346
  -899497514
1333
- ], cr = new Array(80);
1334
- function Z() {
1335
- this.init(), this._w = cr, Qt.call(this, 64, 56);
1347
+ ], ui = new Array(80);
1348
+ function Y() {
1349
+ this.init(), this._w = ui, Qt.call(this, 64, 56);
1336
1350
  }
1337
- ar(Z, Qt);
1338
- Z.prototype.init = function() {
1351
+ si(Y, Qt);
1352
+ Y.prototype.init = function() {
1339
1353
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
1340
1354
  };
1341
- function lr(o) {
1355
+ function fi(o) {
1342
1356
  return o << 1 | o >>> 31;
1343
1357
  }
1344
- function ur(o) {
1358
+ function mi(o) {
1345
1359
  return o << 5 | o >>> 27;
1346
1360
  }
1347
- function fr(o) {
1361
+ function hi(o) {
1348
1362
  return o << 30 | o >>> 2;
1349
1363
  }
1350
- function mr(o, i, p, c) {
1351
- return o === 0 ? i & p | ~i & c : o === 2 ? i & p | i & c | p & c : i ^ p ^ c;
1364
+ function xi(o, r, p, c) {
1365
+ return o === 0 ? r & p | ~r & c : o === 2 ? r & p | r & c | p & c : r ^ p ^ c;
1352
1366
  }
1353
- Z.prototype._update = function(o) {
1354
- for (var i = this._w, p = this._a | 0, c = this._b | 0, f = this._c | 0, m = this._d | 0, l = this._e | 0, a = 0; a < 16; ++a)
1355
- i[a] = o.readInt32BE(a * 4);
1367
+ Y.prototype._update = function(o) {
1368
+ for (var r = this._w, p = this._a | 0, c = this._b | 0, u = this._c | 0, m = this._d | 0, l = this._e | 0, a = 0; a < 16; ++a)
1369
+ r[a] = o.readInt32BE(a * 4);
1356
1370
  for (; a < 80; ++a)
1357
- i[a] = lr(i[a - 3] ^ i[a - 8] ^ i[a - 14] ^ i[a - 16]);
1371
+ r[a] = fi(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
1358
1372
  for (var x = 0; x < 80; ++x) {
1359
- var d = ~~(x / 20), E = ur(p) + mr(d, c, f, m) + l + i[x] + sr[d] | 0;
1360
- l = m, m = f, f = fr(c), c = p, p = E;
1373
+ var d = ~~(x / 20), E = mi(p) + xi(d, c, u, m) + l + r[x] + li[d] | 0;
1374
+ l = m, m = u, u = hi(c), c = p, p = E;
1361
1375
  }
1362
- this._a = p + this._a | 0, this._b = c + this._b | 0, this._c = f + this._c | 0, this._d = m + this._d | 0, this._e = l + this._e | 0;
1376
+ this._a = p + this._a | 0, this._b = c + this._b | 0, this._c = u + this._c | 0, this._d = m + this._d | 0, this._e = l + this._e | 0;
1363
1377
  };
1364
- Z.prototype._hash = function() {
1365
- var o = pr.allocUnsafe(20);
1378
+ Y.prototype._hash = function() {
1379
+ var o = ci.allocUnsafe(20);
1366
1380
  return o.writeInt32BE(this._a | 0, 0), o.writeInt32BE(this._b | 0, 4), o.writeInt32BE(this._c | 0, 8), o.writeInt32BE(this._d | 0, 12), o.writeInt32BE(this._e | 0, 16), o;
1367
1381
  };
1368
- var hr = Z;
1369
- const xr = /* @__PURE__ */ Ge(hr), xt = new Error("File system not available.");
1370
- function dr(o, i, p) {
1382
+ var di = Y;
1383
+ const wi = /* @__PURE__ */ Ve(di), xt = new Error("File system not available.");
1384
+ function gi(o, r, p) {
1371
1385
  throw xt;
1372
1386
  }
1373
1387
  function te(o) {
1374
1388
  throw xt;
1375
1389
  }
1376
- function wr(o) {
1390
+ function yi(o) {
1377
1391
  throw xt;
1378
1392
  }
1379
- const gr = async (o) => te();
1380
- function yr(o) {
1381
- let i = "";
1393
+ const vi = async (o) => te();
1394
+ function bi(o) {
1395
+ let r = "";
1382
1396
  for (let p = 0; p < o.length; p += 2)
1383
- i += String.fromCharCode(parseInt(o.substr(p, 2), 16));
1384
- return btoa(i);
1397
+ r += String.fromCharCode(parseInt(o.substr(p, 2), 16));
1398
+ return btoa(r);
1385
1399
  }
1386
- const et = (o, i = "sha1") => {
1387
- if (i !== "sha1")
1400
+ const et = (o, r = "sha1") => {
1401
+ if (r !== "sha1")
1388
1402
  throw new Error("Only sha1 algorithm is available.");
1389
- const p = new xr();
1390
- return yr(p.update(o).digest("hex"));
1403
+ const p = new wi();
1404
+ return bi(p.update(o).digest("hex"));
1391
1405
  };
1406
+ function Ei(o) {
1407
+ return o.type === We && o.skip !== void 0 && o.skip > 0 && o.hash !== void 0;
1408
+ }
1392
1409
  function jt(o) {
1393
- return [z, q].includes(o.type);
1410
+ return [z, P].includes(o.type);
1394
1411
  }
1395
1412
  function It(o) {
1396
- return [Ht, z, q, H, Zt].includes(o.type);
1413
+ return [Ht, z, P, Z, Zt].includes(o.type);
1397
1414
  }
1398
- function P(o, i, p, c, f = "global") {
1415
+ function q(o, r, p, c, u = "global") {
1399
1416
  if (!o)
1400
1417
  throw new Error("Empty action type");
1401
1418
  if (typeof o != "string")
1402
1419
  throw new Error(`Invalid action type: ${o}`);
1403
- const m = { type: o, input: i, scope: f };
1420
+ const m = { type: o, input: r, scope: u };
1404
1421
  p && (m.attachments = p);
1405
1422
  try {
1406
1423
  c == null || c().parse(m.input);
@@ -1409,10 +1426,10 @@ function P(o, i, p, c, f = "global") {
1409
1426
  }
1410
1427
  return m;
1411
1428
  }
1412
- function vr(o, i = Yt) {
1413
- return (p, c, f, m) => i(p, c, o, f, m);
1429
+ function _i(o, r = Yt) {
1430
+ return (p, c, u, m) => r(p, c, o, u, m);
1414
1431
  }
1415
- const br = (o, i) => ({
1432
+ const Fi = (o, r) => ({
1416
1433
  name: "",
1417
1434
  documentType: "",
1418
1435
  revision: {
@@ -1423,11 +1440,11 @@ const br = (o, i) => ({
1423
1440
  lastModified: (/* @__PURE__ */ new Date()).toISOString(),
1424
1441
  attachments: {},
1425
1442
  ...o,
1426
- state: (i == null ? void 0 : i(o == null ? void 0 : o.state)) ?? (o == null ? void 0 : o.state) ?? { global: {}, local: {} }
1427
- }), Er = (o, i) => {
1428
- const p = br(
1443
+ state: (r == null ? void 0 : r(o == null ? void 0 : o.state)) ?? (o == null ? void 0 : o.state) ?? { global: {}, local: {} }
1444
+ }), Ai = (o, r) => {
1445
+ const p = Fi(
1429
1446
  o,
1430
- i
1447
+ r
1431
1448
  );
1432
1449
  return {
1433
1450
  ...p,
@@ -1435,20 +1452,20 @@ const br = (o, i) => ({
1435
1452
  operations: { global: [], local: [] },
1436
1453
  clipboard: []
1437
1454
  };
1438
- }, ee = (o, i = "global") => et(Te(o.state[i])), Nr = (o, i = 1e3) => {
1439
- const p = Math.random() * i;
1455
+ }, ee = (o, r = "global") => et(Ue(o.state[r])), Li = (o, r = 1e3) => {
1456
+ const p = Math.random() * r;
1440
1457
  return et(`${(o ?? /* @__PURE__ */ new Date()).toISOString()}${p}`);
1441
1458
  };
1442
- function V(o) {
1443
- return Ie(Ue(o, !0));
1459
+ function X(o) {
1460
+ return Ie(Oe(o, !0));
1444
1461
  }
1445
- function _r(o, i) {
1462
+ function Si(o, r) {
1446
1463
  const p = [...o];
1447
- let c = i || 0, f = p.length > 0 ? p[p.length - 1].index : 0;
1464
+ let c = r || 0, u = p.length > 0 ? p[p.length - 1].index : 0;
1448
1465
  const m = [];
1449
1466
  for (const l of p.reverse()) {
1450
1467
  if (c > 0) {
1451
- const d = f - l.index;
1468
+ const d = u - l.index;
1452
1469
  c -= d;
1453
1470
  }
1454
1471
  if (c < 0)
@@ -1461,51 +1478,51 @@ function _r(o, i) {
1461
1478
  const d = x - c;
1462
1479
  c = c + d;
1463
1480
  }
1464
- f = l.index, m.push(a);
1481
+ u = l.index, m.push(a);
1465
1482
  }
1466
1483
  return m.reverse();
1467
1484
  }
1468
- function Rr(o) {
1469
- return Object.values(o).flatMap((i) => i).sort(
1470
- (i, p) => new Date(i.timestamp).getTime() - new Date(p.timestamp).getTime()
1485
+ function zi(o) {
1486
+ return Object.values(o).flatMap((r) => r).sort(
1487
+ (r, p) => new Date(r.timestamp).getTime() - new Date(p.timestamp).getTime()
1471
1488
  );
1472
1489
  }
1473
- function Fr(o) {
1474
- return Object.values(o).flatMap((i) => i).sort(
1475
- (i, p) => new Date(i.operation.timestamp).getTime() - new Date(p.operation.timestamp).getTime()
1490
+ function ki(o) {
1491
+ return Object.values(o).flatMap((r) => r).sort(
1492
+ (r, p) => new Date(r.operation.timestamp).getTime() - new Date(p.operation.timestamp).getTime()
1476
1493
  );
1477
1494
  }
1478
- function st(o, i, p, c, f, m = Yt, l = {}) {
1479
- const a = vr(p, m);
1480
- return re(
1495
+ function st(o, r, p, c, u, m = Yt, l = {}) {
1496
+ const a = _i(p, m);
1497
+ return ie(
1481
1498
  o,
1482
- i,
1499
+ r,
1483
1500
  a,
1484
1501
  c,
1485
- f,
1502
+ u,
1486
1503
  l
1487
1504
  );
1488
1505
  }
1489
- function re(o, i, p, c, f, m = {}) {
1490
- const l = Er(o), a = Object.keys(i).reduce((g, v) => {
1506
+ function ie(o, r, p, c, u, m = {}) {
1507
+ const l = Ai(o), a = Object.keys(r).reduce((g, v) => {
1491
1508
  const y = v;
1492
1509
  return {
1493
1510
  ...g,
1494
- [y]: i[y].slice(0, f == null ? void 0 : f.revision[y])
1511
+ [y]: r[y].slice(0, u == null ? void 0 : u.revision[y])
1495
1512
  };
1496
1513
  }, {}), x = Object.keys(a).reduce(
1497
1514
  (g, v) => {
1498
1515
  const y = v;
1499
1516
  return {
1500
1517
  ...g,
1501
- [y]: _r(
1518
+ [y]: Si(
1502
1519
  a[y],
1503
1520
  m[y]
1504
1521
  )
1505
1522
  };
1506
1523
  },
1507
1524
  {}
1508
- ), d = Fr(x).reduce(
1525
+ ), d = ki(x).reduce(
1509
1526
  (g, { ignore: v, operation: y }) => v ? p(g, wt(y.scope), c, {
1510
1527
  skip: y.skip,
1511
1528
  ignoreSkipOperations: !0
@@ -1518,7 +1535,7 @@ function re(o, i, p, c, f, m = {}) {
1518
1535
  d.operations
1519
1536
  ).reduce(
1520
1537
  (g, v) => {
1521
- const y = v, T = f && f.revision[y] < i[y].length ? i[y].slice(f.revision[y]) : [];
1538
+ const y = v, U = u && u.revision[y] < r[y].length ? r[y].slice(u.revision[y]) : [];
1522
1539
  return {
1523
1540
  ...g,
1524
1541
  [y]: [
@@ -1526,10 +1543,10 @@ function re(o, i, p, c, f, m = {}) {
1526
1543
  var R;
1527
1544
  return {
1528
1545
  ...j,
1529
- timestamp: ((R = i[y][$]) == null ? void 0 : R.timestamp) ?? j.timestamp
1546
+ timestamp: ((R = r[y][$]) == null ? void 0 : R.timestamp) ?? j.timestamp
1530
1547
  };
1531
1548
  }),
1532
- ...T
1549
+ ...U
1533
1550
  ]
1534
1551
  };
1535
1552
  },
@@ -1537,64 +1554,64 @@ function re(o, i, p, c, f, m = {}) {
1537
1554
  );
1538
1555
  return { ...d, operations: E };
1539
1556
  }
1540
- const ie = (o) => P(
1557
+ const re = (o) => q(
1541
1558
  "SET_NAME",
1542
1559
  o,
1543
1560
  void 0,
1544
1561
  ft,
1545
1562
  void 0
1546
- ), ne = (o = 1, i = "global") => P(
1563
+ ), ne = (o = 1, r = "global") => q(
1547
1564
  "UNDO",
1548
1565
  o,
1549
1566
  void 0,
1550
1567
  mt,
1551
- i
1552
- ), oe = (o = 1, i = "global") => P(
1568
+ r
1569
+ ), oe = (o = 1, r = "global") => q(
1553
1570
  "REDO",
1554
1571
  o,
1555
1572
  void 0,
1556
1573
  ut,
1557
- i
1558
- ), ae = (o, i, p = "global") => P(
1574
+ r
1575
+ ), ae = (o, r, p = "global") => q(
1559
1576
  "PRUNE",
1560
- { start: o, end: i },
1577
+ { start: o, end: r },
1561
1578
  void 0,
1562
1579
  lt,
1563
1580
  p
1564
- ), dt = (o, i) => P(
1581
+ ), dt = (o, r) => q(
1565
1582
  "LOAD_STATE",
1566
- { state: o, operations: i },
1583
+ { state: o, operations: r },
1567
1584
  void 0,
1568
1585
  ct
1569
- ), wt = (o = "global") => P("NOOP", {}, void 0, void 0, o), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1586
+ ), wt = (o = "global") => q("NOOP", {}, void 0, void 0, o), Pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1570
1587
  __proto__: null,
1571
1588
  loadState: dt,
1572
1589
  noop: wt,
1573
1590
  prune: ae,
1574
1591
  redo: oe,
1575
- setName: ie,
1592
+ setName: re,
1576
1593
  undo: ne
1577
1594
  }, Symbol.toStringTag, { value: "Module" })), pe = { "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"] };
1578
1595
  Object.freeze(pe);
1579
- var I = function(o, i, p, c) {
1596
+ var I = function(o, r, p, c) {
1580
1597
  if (p === "a" && !c)
1581
1598
  throw new TypeError("Private accessor was defined without a getter");
1582
- if (typeof i == "function" ? o !== i || !c : !i.has(o))
1599
+ if (typeof r == "function" ? o !== r || !c : !r.has(o))
1583
1600
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
1584
- return p === "m" ? c : p === "a" ? c.call(o) : c ? c.value : i.get(o);
1585
- }, L, W, N;
1586
- class Ar {
1587
- constructor(...i) {
1588
- L.set(this, /* @__PURE__ */ new Map()), W.set(this, /* @__PURE__ */ new Map()), N.set(this, /* @__PURE__ */ new Map());
1589
- for (const p of i)
1601
+ return p === "m" ? c : p === "a" ? c.call(o) : c ? c.value : r.get(o);
1602
+ }, L, W, M;
1603
+ class Bi {
1604
+ constructor(...r) {
1605
+ L.set(this, /* @__PURE__ */ new Map()), W.set(this, /* @__PURE__ */ new Map()), M.set(this, /* @__PURE__ */ new Map());
1606
+ for (const p of r)
1590
1607
  this.define(p);
1591
1608
  }
1592
- define(i, p = !1) {
1593
- for (let [c, f] of Object.entries(i)) {
1594
- c = c.toLowerCase(), f = f.map((a) => a.toLowerCase()), I(this, N, "f").has(c) || I(this, N, "f").set(c, /* @__PURE__ */ new Set());
1595
- const m = I(this, N, "f").get(c);
1609
+ define(r, p = !1) {
1610
+ for (let [c, u] of Object.entries(r)) {
1611
+ c = c.toLowerCase(), u = u.map((a) => a.toLowerCase()), I(this, M, "f").has(c) || I(this, M, "f").set(c, /* @__PURE__ */ new Set());
1612
+ const m = I(this, M, "f").get(c);
1596
1613
  let l = !0;
1597
- for (let a of f) {
1614
+ for (let a of u) {
1598
1615
  const x = a.startsWith("*");
1599
1616
  if (a = x ? a.slice(1) : a, m == null || m.add(a), l && I(this, W, "f").set(c, a), l = !1, x)
1600
1617
  continue;
@@ -1606,25 +1623,25 @@ class Ar {
1606
1623
  }
1607
1624
  return this;
1608
1625
  }
1609
- getType(i) {
1610
- if (typeof i != "string")
1626
+ getType(r) {
1627
+ if (typeof r != "string")
1611
1628
  return null;
1612
- const p = i.replace(/^.*[/\\]/, "").toLowerCase(), c = p.replace(/^.*\./, "").toLowerCase(), f = p.length < i.length;
1613
- return !(c.length < p.length - 1) && f ? null : I(this, L, "f").get(c) ?? null;
1629
+ const p = r.replace(/^.*[/\\]/, "").toLowerCase(), c = p.replace(/^.*\./, "").toLowerCase(), u = p.length < r.length;
1630
+ return !(c.length < p.length - 1) && u ? null : I(this, L, "f").get(c) ?? null;
1614
1631
  }
1615
- getExtension(i) {
1632
+ getExtension(r) {
1616
1633
  var p;
1617
- return typeof i != "string" ? null : (i = (p = i == null ? void 0 : i.split) == null ? void 0 : p.call(i, ";")[0], (i && I(this, W, "f").get(i.trim().toLowerCase())) ?? null);
1634
+ return typeof r != "string" ? null : (r = (p = r == null ? void 0 : r.split) == null ? void 0 : p.call(r, ";")[0], (r && I(this, W, "f").get(r.trim().toLowerCase())) ?? null);
1618
1635
  }
1619
- getAllExtensions(i) {
1620
- return typeof i != "string" ? null : I(this, N, "f").get(i.toLowerCase()) ?? null;
1636
+ getAllExtensions(r) {
1637
+ return typeof r != "string" ? null : I(this, M, "f").get(r.toLowerCase()) ?? null;
1621
1638
  }
1622
1639
  _freeze() {
1623
1640
  this.define = () => {
1624
1641
  throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
1625
1642
  }, Object.freeze(this);
1626
- for (const i of I(this, N, "f").values())
1627
- Object.freeze(i);
1643
+ for (const r of I(this, M, "f").values())
1644
+ Object.freeze(r);
1628
1645
  return this;
1629
1646
  }
1630
1647
  _getTestState() {
@@ -1634,51 +1651,51 @@ class Ar {
1634
1651
  };
1635
1652
  }
1636
1653
  }
1637
- L = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
1638
- const Sr = new Ar(pe)._freeze(), se = async (o) => {
1639
- const i = new Tt(), { name: p, revision: c, documentType: f, created: m, lastModified: l } = o, a = {
1654
+ L = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
1655
+ const ji = new Bi(pe)._freeze(), se = async (o) => {
1656
+ const r = new Ut(), { name: p, revision: c, documentType: u, created: m, lastModified: l } = o, a = {
1640
1657
  name: p,
1641
1658
  revision: c,
1642
- documentType: f,
1659
+ documentType: u,
1643
1660
  created: m,
1644
1661
  lastModified: l
1645
1662
  };
1646
- return i.file("header.json", JSON.stringify(a, null, 2)), i.file(
1663
+ return r.file("header.json", JSON.stringify(a, null, 2)), r.file(
1647
1664
  "state.json",
1648
1665
  JSON.stringify(o.initialState || {}, null, 2)
1649
- ), i.file("operations.json", JSON.stringify(o.operations, null, 2)), Object.keys(o.attachments).forEach((d) => {
1666
+ ), r.file("operations.json", JSON.stringify(o.operations, null, 2)), Object.keys(o.attachments).forEach((d) => {
1650
1667
  const { data: E, ...g } = o.attachments[d];
1651
- i.file(d, E, {
1668
+ r.file(d, E, {
1652
1669
  base64: !0,
1653
1670
  createFolders: !0,
1654
1671
  comment: JSON.stringify(g)
1655
1672
  });
1656
- }), i;
1657
- }, Br = async (o, i, p, c) => {
1673
+ }), r;
1674
+ }, Ii = async (o, r, p, c) => {
1658
1675
  await (await se(o)).generateAsync({
1659
1676
  type: "uint8array",
1660
1677
  streamFiles: !0
1661
1678
  });
1662
1679
  const m = c ?? o.name, l = `.${p}.zip`;
1663
- return dr(
1664
- i,
1680
+ return gi(
1681
+ r,
1665
1682
  m.endsWith(l) ? m : `${m}${l}`
1666
1683
  );
1667
- }, Lr = async (o, i) => {
1668
- const c = await (await se(o)).generateAsync({ type: "blob" }), f = await i.createWritable();
1669
- await f.write(c), await f.close();
1670
- }, Ut = async (o, i) => {
1684
+ }, qi = async (o, r) => {
1685
+ const c = await (await se(o)).generateAsync({ type: "blob" }), u = await r.createWritable();
1686
+ await u.write(c), await u.close();
1687
+ }, Ot = async (o, r) => {
1671
1688
  const p = te();
1672
- return kr(p, i);
1673
- }, kr = async (o, i) => {
1674
- const p = new Tt();
1675
- return await p.loadAsync(o), jr(p, i);
1689
+ return Oi(p, r);
1690
+ }, Oi = async (o, r) => {
1691
+ const p = new Ut();
1692
+ return await p.loadAsync(o), Ui(p, r);
1676
1693
  };
1677
- async function jr(o, i) {
1694
+ async function Ui(o, r) {
1678
1695
  const p = o.file("state.json");
1679
1696
  if (!p)
1680
1697
  throw new Error("Initial state not found");
1681
- const c = await p.async("string"), f = JSON.parse(c), m = o.file("header.json");
1698
+ const c = await p.async("string"), u = JSON.parse(c), m = o.file("header.json");
1682
1699
  let l;
1683
1700
  m && (l = JSON.parse(await m.async("string")));
1684
1701
  const a = o.file("operations.json");
@@ -1687,10 +1704,10 @@ async function jr(o, i) {
1687
1704
  const x = JSON.parse(
1688
1705
  await a.async("string")
1689
1706
  );
1690
- let d = re(
1691
- f,
1707
+ let d = ie(
1708
+ u,
1692
1709
  x,
1693
- i,
1710
+ r,
1694
1711
  void 0,
1695
1712
  l
1696
1713
  );
@@ -1700,43 +1717,43 @@ async function jr(o, i) {
1700
1717
  }), d;
1701
1718
  }
1702
1719
  function ce(o) {
1703
- const i = o.replace(/^.*\./, "") || void 0, p = o.replace(/^.*[/\\]/, "") || void 0;
1704
- return { extension: i, fileName: p };
1720
+ const r = o.replace(/^.*\./, "") || void 0, p = o.replace(/^.*[/\\]/, "") || void 0;
1721
+ return { extension: r, fileName: p };
1705
1722
  }
1706
- async function zr(o) {
1707
- const { buffer: i, mimeType: p = "application/octet-stream" } = await wr(), c = ce(o), f = i.toString("base64");
1723
+ async function $i(o) {
1724
+ const { buffer: r, mimeType: p = "application/octet-stream" } = await yi(), c = ce(o), u = r.toString("base64");
1708
1725
  return {
1709
- data: f,
1710
- hash: et(f),
1726
+ data: u,
1727
+ hash: et(u),
1711
1728
  mimeType: p,
1712
1729
  ...c
1713
1730
  };
1714
1731
  }
1715
- async function qr(o) {
1716
- const i = await gr(), p = Sr.getType(o) || "application/octet-stream", c = ce(o), f = i.toString("base64");
1717
- return { data: f, hash: et(f), mimeType: p, ...c };
1732
+ async function Wi(o) {
1733
+ const r = await vi(), p = ji.getType(o) || "application/octet-stream", c = ce(o), u = r.toString("base64");
1734
+ return { data: u, hash: et(u), mimeType: p, ...c };
1718
1735
  }
1719
- class Pr {
1736
+ class Ji {
1720
1737
  /**
1721
1738
  * Constructs a BaseDocument instance with an initial state.
1722
1739
  * @param reducer - The reducer function that updates the state.
1723
1740
  * @param document - The initial state of the document.
1724
1741
  */
1725
- constructor(i, p, c) {
1726
- K(this, "_document");
1727
- K(this, "_reducer");
1728
- K(this, "_signalDispatch");
1729
- this._reducer = i, this._document = p, this._signalDispatch = c;
1742
+ constructor(r, p, c) {
1743
+ V(this, "_document");
1744
+ V(this, "_reducer");
1745
+ V(this, "_signalDispatch");
1746
+ this._reducer = r, this._document = p, this._signalDispatch = c;
1730
1747
  }
1731
1748
  /**
1732
1749
  * Dispatches an action to update the state of the document.
1733
1750
  * @param action - The action to dispatch.
1734
1751
  * @returns The Document instance.
1735
1752
  */
1736
- dispatch(i, p) {
1753
+ dispatch(r, p) {
1737
1754
  return this._document = this._reducer(
1738
1755
  this._document,
1739
- i,
1756
+ r,
1740
1757
  this._signalDispatch,
1741
1758
  p
1742
1759
  ), this;
@@ -1747,15 +1764,15 @@ class Pr {
1747
1764
  * @param extension - The file extension to use when saving the state.
1748
1765
  * @returns The file path where the state was saved.
1749
1766
  */
1750
- saveToFile(i, p, c) {
1751
- return Br(this._document, i, p, c);
1767
+ saveToFile(r, p, c) {
1768
+ return Ii(this._document, r, p, c);
1752
1769
  }
1753
1770
  /**
1754
1771
  * Loads the state of the document from a file.
1755
1772
  * @param path - The file path where the state is stored.
1756
1773
  */
1757
- async loadFromFile(i) {
1758
- this._document = await Ut(i, this._reducer);
1774
+ async loadFromFile(r) {
1775
+ this._document = await Ot(r, this._reducer);
1759
1776
  }
1760
1777
  /**
1761
1778
  * Loads the state of the document from a file and returns it.
@@ -1763,20 +1780,20 @@ class Pr {
1763
1780
  * @param reducer - The reducer function that updates the state.
1764
1781
  * @returns The state of the document.
1765
1782
  */
1766
- static async stateFromFile(i, p) {
1767
- return await Ut(i, p);
1783
+ static async stateFromFile(r, p) {
1784
+ return await Ot(r, p);
1768
1785
  }
1769
1786
  /**
1770
1787
  * Gets the current state of the document.
1771
1788
  */
1772
1789
  get state() {
1773
- return V(this._document.state);
1790
+ return X(this._document.state);
1774
1791
  }
1775
1792
  /**
1776
1793
  * Gets the list of operations performed on the document.
1777
1794
  */
1778
1795
  get operations() {
1779
- return V(this._document.operations);
1796
+ return X(this._document.operations);
1780
1797
  }
1781
1798
  /**
1782
1799
  * Gets the name of the document.
@@ -1808,68 +1825,68 @@ class Pr {
1808
1825
  get revision() {
1809
1826
  return this._document.revision.global;
1810
1827
  }
1811
- getRevision(i) {
1812
- return this._document.revision[i];
1828
+ getRevision(r) {
1829
+ return this._document.revision[r];
1813
1830
  }
1814
1831
  /**
1815
1832
  * Gets the initial state of the document.
1816
1833
  */
1817
1834
  get initialState() {
1818
- return V(this._document.initialState);
1835
+ return X(this._document.initialState);
1819
1836
  }
1820
1837
  /**
1821
1838
  * Returns the current document as an object
1822
1839
  */
1823
1840
  toDocument() {
1824
- return V(this._document);
1841
+ return X(this._document);
1825
1842
  }
1826
1843
  /**
1827
1844
  * Gets the attachment associated with the given key.
1828
1845
  * @param attachment - The key of the attachment to retrieve.
1829
1846
  */
1830
- getAttachment(i) {
1831
- return this._document.attachments[i];
1847
+ getAttachment(r) {
1848
+ return this._document.attachments[r];
1832
1849
  }
1833
1850
  /**
1834
1851
  * Sets the name of the document.
1835
1852
  * @param name - The new name of the document.
1836
1853
  */
1837
- setName(i) {
1838
- return this.dispatch(ie(i)), this;
1854
+ setName(r) {
1855
+ return this.dispatch(re(r)), this;
1839
1856
  }
1840
1857
  /**
1841
1858
  * Reverts a number of actions from the document.
1842
1859
  * @param count - The number of actions to revert.
1843
1860
  */
1844
- undo(i) {
1845
- return this.dispatch(ne(i)), this;
1861
+ undo(r) {
1862
+ return this.dispatch(ne(r)), this;
1846
1863
  }
1847
1864
  /**
1848
1865
  * Reapplies a number of actions to the document.
1849
1866
  * @param count - The number of actions to reapply.
1850
1867
  */
1851
- redo(i) {
1852
- return this.dispatch(oe(i)), this;
1868
+ redo(r) {
1869
+ return this.dispatch(oe(r)), this;
1853
1870
  }
1854
1871
  /**
1855
1872
  * Removes a range of operations from the document.
1856
1873
  * @param start - The starting index of the range to remove.
1857
1874
  * @param end - The ending index of the range to remove.
1858
1875
  */
1859
- prune(i, p) {
1860
- return this.dispatch(ae(i, p)), this;
1876
+ prune(r, p) {
1877
+ return this.dispatch(ae(r, p)), this;
1861
1878
  }
1862
1879
  /**
1863
1880
  * Loads a document state and a set of operations.
1864
1881
  * @param state - The state to load.
1865
1882
  * @param operations - The operations to apply to the document.
1866
1883
  */
1867
- loadState(i, p) {
1868
- return this.dispatch(dt(i, p)), this;
1884
+ loadState(r, p) {
1885
+ return this.dispatch(dt(r, p)), this;
1869
1886
  }
1870
1887
  }
1871
- function $r(o, i) {
1872
- i.forEach((p) => {
1888
+ function Hi(o, r) {
1889
+ r.forEach((p) => {
1873
1890
  Object.getOwnPropertyNames(p.prototype).forEach((c) => {
1874
1891
  Object.defineProperty(
1875
1892
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
@@ -1882,31 +1899,32 @@ function $r(o, i) {
1882
1899
  });
1883
1900
  }
1884
1901
  export {
1885
- Pr as B,
1886
- br as a,
1887
- Er as b,
1888
- vr as c,
1889
- Lr as d,
1890
- kr as e,
1891
- P as f,
1892
- $r as g,
1893
- Cr as h,
1902
+ Ci as A,
1903
+ Ji as B,
1904
+ Fi as a,
1905
+ Ai as b,
1906
+ _i as c,
1907
+ qi as d,
1908
+ Oi as e,
1909
+ q as f,
1910
+ Hi as g,
1911
+ Pi as h,
1894
1912
  It as i,
1895
1913
  se as j,
1896
- qr as k,
1897
- Ut as l,
1898
- zr as m,
1914
+ Wi as k,
1915
+ Ot as l,
1916
+ $i as m,
1899
1917
  ee as n,
1900
- Nr as o,
1901
- jt as p,
1902
- _r as q,
1903
- V as r,
1904
- Br as s,
1905
- re as t,
1906
- st as u,
1907
- Fr as v,
1908
- Rr as w,
1909
- Yt as x,
1910
- Ye as y,
1911
- Mr as z
1918
+ Li as o,
1919
+ Ei as p,
1920
+ jt as q,
1921
+ Si as r,
1922
+ Ii as s,
1923
+ X as t,
1924
+ ie as u,
1925
+ st as v,
1926
+ ki as w,
1927
+ zi as x,
1928
+ Yt as y,
1929
+ Ke as z
1912
1930
  };