document-model 1.0.51 → 1.0.53

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 (98) hide show
  1. package/dist/browser/cjs/document-model.js +1 -1
  2. package/dist/browser/cjs/document.js +1 -1
  3. package/dist/browser/cjs/index.js +1 -1
  4. package/dist/{node/cjs/internal/index-CRjFLQNR.js → browser/cjs/internal/index-BAk-LH-1.js} +1 -1
  5. package/dist/browser/cjs/internal/{index-CPJM383s.js → index-Cb6Xq42D.js} +1 -1
  6. package/dist/browser/cjs/internal/object-D1n8rS0m.js +25 -0
  7. package/dist/browser/es/document-model.js +2 -2
  8. package/dist/browser/es/document.js +2 -2
  9. package/dist/browser/es/index.js +3 -3
  10. package/dist/browser/es/internal/{index-BzIVYv7p.js → index-DeOZH3b_.js} +1 -1
  11. package/dist/browser/es/internal/{index-tEH7iGUj.js → index-DwxnEmzI.js} +1 -1
  12. package/dist/browser/es/internal/{object-Dev4WFVH.js → object-DsqsdDFj.js} +767 -771
  13. package/dist/browser/src/document/object.d.ts +35 -0
  14. package/dist/browser/src/document/types.d.ts +2 -0
  15. package/dist/node/cjs/document-model.js +1 -1
  16. package/dist/node/cjs/document.js +1 -1
  17. package/dist/node/cjs/index.js +1 -1
  18. package/dist/{browser/cjs/internal/index-REU04m7f.js → node/cjs/internal/index-CpjKrifV.js} +1 -1
  19. package/dist/node/cjs/internal/{index-BX95XaQ_.js → index-DzXcygIJ.js} +1 -1
  20. package/dist/node/cjs/internal/object-Cx_c54j_.js +20 -0
  21. package/dist/node/es/document-model.js +2 -2
  22. package/dist/node/es/document.js +2 -2
  23. package/dist/node/es/index.js +3 -3
  24. package/dist/node/es/internal/{index-BzNCX_-9.js → index-CUitPgxf.js} +1 -1
  25. package/dist/node/es/internal/{index-DpH4_29z.js → index-V-nmqbyU.js} +1 -1
  26. package/dist/node/es/internal/{object-BFkXGmt6.js → object-C0WcyLCx.js} +500 -504
  27. package/dist/node/src/document/object.d.ts +35 -0
  28. package/dist/node/src/document/types.d.ts +2 -0
  29. package/package.json +1 -1
  30. package/dist/browser/cjs/internal/object-DkoS83BB.js +0 -25
  31. package/dist/node/cjs/internal/object-CGt7Qacd.js +0 -20
  32. package/dist/src/document/actions/creators.d.ts +0 -47
  33. package/dist/src/document/actions/index.d.ts +0 -14
  34. package/dist/src/document/actions/types.d.ts +0 -15
  35. package/dist/src/document/index.d.ts +0 -6
  36. package/dist/src/document/object.d.ts +0 -1140
  37. package/dist/src/document/reducer.d.ts +0 -32
  38. package/dist/src/document/schema/index.d.ts +0 -2
  39. package/dist/src/document/schema/types.d.ts +0 -176
  40. package/dist/src/document/schema/zod.d.ts +0 -113
  41. package/dist/src/document/signal.d.ts +0 -29
  42. package/dist/src/document/types.d.ts +0 -247
  43. package/dist/src/document/utils/base.d.ts +0 -85
  44. package/dist/src/document/utils/file.d.ts +0 -48
  45. package/dist/src/document/utils/index.d.ts +0 -4
  46. package/dist/src/document/utils/node.d.ts +0 -9
  47. package/dist/src/document/utils/validation.d.ts +0 -2
  48. package/dist/src/document-model/custom/reducers/header.d.ts +0 -2
  49. package/dist/src/document-model/custom/reducers/module.d.ts +0 -2
  50. package/dist/src/document-model/custom/reducers/operation-error.d.ts +0 -2
  51. package/dist/src/document-model/custom/reducers/operation-example.d.ts +0 -2
  52. package/dist/src/document-model/custom/reducers/operation.d.ts +0 -2
  53. package/dist/src/document-model/custom/reducers/state.d.ts +0 -2
  54. package/dist/src/document-model/custom/reducers/versioning.d.ts +0 -7
  55. package/dist/src/document-model/custom/utils.d.ts +0 -7
  56. package/dist/src/document-model/gen/actions.d.ts +0 -15
  57. package/dist/src/document-model/gen/creators.d.ts +0 -7
  58. package/dist/src/document-model/gen/document-model.d.ts +0 -2
  59. package/dist/src/document-model/gen/header/actions.d.ts +0 -9
  60. package/dist/src/document-model/gen/header/creators.d.ts +0 -8
  61. package/dist/src/document-model/gen/header/object.d.ts +0 -12
  62. package/dist/src/document-model/gen/header/operations.d.ts +0 -10
  63. package/dist/src/document-model/gen/index.d.ts +0 -5
  64. package/dist/src/document-model/gen/module/actions.d.ts +0 -8
  65. package/dist/src/document-model/gen/module/creators.d.ts +0 -7
  66. package/dist/src/document-model/gen/module/object.d.ts +0 -11
  67. package/dist/src/document-model/gen/module/operations.d.ts +0 -9
  68. package/dist/src/document-model/gen/object.d.ts +0 -28
  69. package/dist/src/document-model/gen/operation/actions.d.ts +0 -13
  70. package/dist/src/document-model/gen/operation/creators.d.ts +0 -12
  71. package/dist/src/document-model/gen/operation/object.d.ts +0 -16
  72. package/dist/src/document-model/gen/operation/operations.d.ts +0 -14
  73. package/dist/src/document-model/gen/operation-error/actions.d.ts +0 -10
  74. package/dist/src/document-model/gen/operation-error/creators.d.ts +0 -9
  75. package/dist/src/document-model/gen/operation-error/object.d.ts +0 -13
  76. package/dist/src/document-model/gen/operation-error/operations.d.ts +0 -11
  77. package/dist/src/document-model/gen/operation-example/actions.d.ts +0 -7
  78. package/dist/src/document-model/gen/operation-example/creators.d.ts +0 -6
  79. package/dist/src/document-model/gen/operation-example/object.d.ts +0 -10
  80. package/dist/src/document-model/gen/operation-example/operations.d.ts +0 -8
  81. package/dist/src/document-model/gen/reducer.d.ts +0 -5
  82. package/dist/src/document-model/gen/schema/index.d.ts +0 -2
  83. package/dist/src/document-model/gen/schema/types.d.ts +0 -453
  84. package/dist/src/document-model/gen/schema/zod.d.ts +0 -453
  85. package/dist/src/document-model/gen/state/actions.d.ts +0 -9
  86. package/dist/src/document-model/gen/state/creators.d.ts +0 -8
  87. package/dist/src/document-model/gen/state/object.d.ts +0 -12
  88. package/dist/src/document-model/gen/state/operations.d.ts +0 -10
  89. package/dist/src/document-model/gen/types.d.ts +0 -8
  90. package/dist/src/document-model/gen/utils.d.ts +0 -6
  91. package/dist/src/document-model/gen/versioning/actions.d.ts +0 -8
  92. package/dist/src/document-model/gen/versioning/creators.d.ts +0 -7
  93. package/dist/src/document-model/gen/versioning/object.d.ts +0 -11
  94. package/dist/src/document-model/gen/versioning/operations.d.ts +0 -9
  95. package/dist/src/document-model/index.d.ts +0 -80
  96. package/dist/src/index.d.ts +0 -25
  97. package/dist/vite.config.d.ts +0 -2
  98. package/dist/vitest.config.d.ts +0 -2
@@ -2,24 +2,24 @@ var Gt = Object.defineProperty;
2
2
  var Qt = (e, t, i) => t in e ? Gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
3
  var nt = (e, t, i) => (Qt(e, typeof t != "symbol" ? t + "" : t, i), i);
4
4
  import { produce as G, castDraft as pt, castImmutable as Xt, freeze as Yt } from "immer";
5
- import { z as u } from "zod";
5
+ import { z as m } from "zod";
6
6
  import te from "crypto";
7
7
  import ct from "fs";
8
8
  import ee from "https";
9
9
  import { join as ie } from "path";
10
- import St from "jszip";
11
- const $t = (e) => e != null, ne = u.any().refine((e) => $t(e)), Et = u.enum(["LOAD_STATE"]), vt = u.enum(["PRUNE"]), Tt = u.enum(["REDO"]), kt = u.enum(["SET_NAME"]), _t = u.enum(["UNDO"]);
10
+ import Ot from "jszip";
11
+ const $t = (e) => e != null, ne = m.any().refine((e) => $t(e)), Et = m.enum(["LOAD_STATE"]), vt = m.enum(["PRUNE"]), Tt = m.enum(["REDO"]), _t = m.enum(["SET_NAME"]), kt = m.enum(["UNDO"]);
12
12
  function oe() {
13
- return u.object({
14
- __typename: u.literal("Action").optional(),
15
- type: u.string()
13
+ return m.object({
14
+ __typename: m.literal("Action").optional(),
15
+ type: m.string()
16
16
  });
17
17
  }
18
18
  function Q() {
19
- return u.literal("global").or(u.literal("local"));
19
+ return m.literal("global").or(m.literal("local"));
20
20
  }
21
21
  function At() {
22
- return u.union([
22
+ return m.union([
23
23
  Nt(),
24
24
  Mt(),
25
25
  Pt(),
@@ -27,87 +27,87 @@ function At() {
27
27
  zt()
28
28
  ]);
29
29
  }
30
- function se() {
31
- return u.object({
32
- __typename: u.literal("DocumentFile").optional(),
33
- data: u.string(),
34
- extension: u.string().nullable(),
35
- fileName: u.string().nullable(),
36
- mimeType: u.string()
30
+ function re() {
31
+ return m.object({
32
+ __typename: m.literal("DocumentFile").optional(),
33
+ data: m.string(),
34
+ extension: m.string().nullable(),
35
+ fileName: m.string().nullable(),
36
+ mimeType: m.string()
37
37
  });
38
38
  }
39
39
  function Nt() {
40
- return u.object({
41
- input: u.lazy(() => ut()),
40
+ return m.object({
41
+ input: m.lazy(() => ut()),
42
42
  type: Et,
43
43
  scope: Q()
44
44
  });
45
45
  }
46
46
  function ut() {
47
- return u.object({
48
- operations: u.number(),
49
- state: u.lazy(() => Dt())
47
+ return m.object({
48
+ operations: m.number(),
49
+ state: m.lazy(() => Dt())
50
50
  });
51
51
  }
52
52
  function Dt() {
53
- return u.object({
54
- data: u.unknown().nullish(),
55
- name: u.string()
53
+ return m.object({
54
+ data: m.unknown().nullish(),
55
+ name: m.string()
56
56
  });
57
57
  }
58
- function re() {
59
- return u.object({
60
- __typename: u.literal("Operation").optional(),
61
- hash: u.string(),
62
- index: u.number(),
63
- timestamp: u.string().datetime(),
64
- type: u.string()
58
+ function se() {
59
+ return m.object({
60
+ __typename: m.literal("Operation").optional(),
61
+ hash: m.string(),
62
+ index: m.number(),
63
+ timestamp: m.string().datetime(),
64
+ type: m.string()
65
65
  });
66
66
  }
67
67
  function Mt() {
68
- return u.object({
69
- input: u.lazy(() => ft()),
68
+ return m.object({
69
+ input: m.lazy(() => ft()),
70
70
  type: vt,
71
71
  scope: Q()
72
72
  });
73
73
  }
74
74
  function ft() {
75
- return u.object({
76
- end: u.number().nullish(),
77
- start: u.number().nullish()
75
+ return m.object({
76
+ end: m.number().nullish(),
77
+ start: m.number().nullish()
78
78
  });
79
79
  }
80
- const dt = u.number;
80
+ const dt = m.number;
81
81
  function Pt() {
82
- return u.object({
82
+ return m.object({
83
83
  input: dt(),
84
84
  type: Tt,
85
85
  scope: Q()
86
86
  });
87
87
  }
88
- const gt = u.string;
88
+ const gt = m.string;
89
89
  function It() {
90
- return u.object({
90
+ return m.object({
91
91
  input: gt(),
92
- type: kt,
93
- scope: u.literal("global")
92
+ type: _t,
93
+ scope: m.literal("global")
94
94
  });
95
95
  }
96
96
  function ae() {
97
- return u.object({
98
- __typename: u.literal("SetNameOperation").optional(),
99
- hash: u.string(),
100
- index: u.number(),
101
- input: u.string(),
102
- timestamp: u.string().datetime(),
103
- type: u.string()
97
+ return m.object({
98
+ __typename: m.literal("SetNameOperation").optional(),
99
+ hash: m.string(),
100
+ index: m.number(),
101
+ input: m.string(),
102
+ timestamp: m.string().datetime(),
103
+ type: m.string()
104
104
  });
105
105
  }
106
- const ht = u.number;
106
+ const ht = m.number;
107
107
  function zt() {
108
- return u.object({
108
+ return m.object({
109
109
  input: ht(),
110
- type: _t,
110
+ type: kt,
111
111
  scope: Q()
112
112
  });
113
113
  }
@@ -115,12 +115,12 @@ const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
115
115
  __proto__: null,
116
116
  ActionSchema: oe,
117
117
  BaseActionSchema: At,
118
- DocumentFileSchema: se,
118
+ DocumentFileSchema: re,
119
119
  LoadStateActionInputSchema: ut,
120
120
  LoadStateActionSchema: Nt,
121
121
  LoadStateActionStateInputSchema: Dt,
122
122
  Load_StateSchema: Et,
123
- OperationSchema: re,
123
+ OperationSchema: se,
124
124
  OperationScopeSchema: Q,
125
125
  PruneActionInputSchema: ft,
126
126
  PruneActionSchema: Mt,
@@ -131,10 +131,10 @@ const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
131
131
  SetNameActionInputSchema: gt,
132
132
  SetNameActionSchema: It,
133
133
  SetNameOperationSchema: ae,
134
- Set_NameSchema: kt,
134
+ Set_NameSchema: _t,
135
135
  UndoActionInputSchema: ht,
136
136
  UndoActionSchema: zt,
137
- UndoSchema: _t,
137
+ UndoSchema: kt,
138
138
  definedNonNullAnySchema: ne,
139
139
  isDefinedNonNullAny: $t
140
140
  }, Symbol.toStringTag, { value: "Module" }));
@@ -143,23 +143,23 @@ function pe(e) {
143
143
  }
144
144
  var lt = { exports: {} };
145
145
  (function(e, t) {
146
- const { hasOwnProperty: i } = Object.prototype, n = A();
147
- n.configure = A, n.stringify = n, n.default = n, t.stringify = n, t.configure = A, e.exports = n;
146
+ const { hasOwnProperty: i } = Object.prototype, n = E();
147
+ n.configure = E, n.stringify = n, n.default = n, t.stringify = n, t.configure = E, e.exports = n;
148
148
  const a = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
149
- function p(r) {
150
- return r.length < 5e3 && !a.test(r) ? `"${r}"` : JSON.stringify(r);
149
+ function s(c) {
150
+ return c.length < 5e3 && !a.test(c) ? `"${c}"` : JSON.stringify(c);
151
151
  }
152
- function s(r) {
153
- if (r.length > 200)
154
- return r.sort();
155
- for (let m = 1; m < r.length; m++) {
156
- const b = r[m];
157
- let D = m;
158
- for (; D !== 0 && r[D - 1] > b; )
159
- r[D] = r[D - 1], D--;
160
- r[D] = b;
152
+ function r(c) {
153
+ if (c.length > 200)
154
+ return c.sort();
155
+ for (let u = 1; u < c.length; u++) {
156
+ const y = c[u];
157
+ let P = u;
158
+ for (; P !== 0 && c[P - 1] > y; )
159
+ c[P] = c[P - 1], P--;
160
+ c[P] = y;
161
161
  }
162
- return r;
162
+ return c;
163
163
  }
164
164
  const l = Object.getOwnPropertyDescriptor(
165
165
  Object.getPrototypeOf(
@@ -169,25 +169,25 @@ var lt = { exports: {} };
169
169
  ),
170
170
  Symbol.toStringTag
171
171
  ).get;
172
- function c(r) {
173
- return l.call(r) !== void 0 && r.length !== 0;
172
+ function p(c) {
173
+ return l.call(c) !== void 0 && c.length !== 0;
174
174
  }
175
- function x(r, m, b) {
176
- r.length < b && (b = r.length);
177
- const D = m === "," ? "" : " ";
178
- let U = `"0":${D}${r[0]}`;
179
- for (let R = 1; R < b; R++)
180
- U += `${m}"${R}":${D}${r[R]}`;
181
- return U;
175
+ function x(c, u, y) {
176
+ c.length < y && (y = c.length);
177
+ const P = u === "," ? "" : " ";
178
+ let V = `"0":${P}${c[0]}`;
179
+ for (let R = 1; R < y; R++)
180
+ V += `${u}"${R}":${P}${c[R]}`;
181
+ return V;
182
182
  }
183
- function j(r) {
184
- if (i.call(r, "circularValue")) {
185
- const m = r.circularValue;
186
- if (typeof m == "string")
187
- return `"${m}"`;
188
- if (m == null)
189
- return m;
190
- if (m === Error || m === TypeError)
183
+ function b(c) {
184
+ if (i.call(c, "circularValue")) {
185
+ const u = c.circularValue;
186
+ if (typeof u == "string")
187
+ return `"${u}"`;
188
+ if (u == null)
189
+ return u;
190
+ if (u === Error || u === TypeError)
191
191
  return {
192
192
  toString() {
193
193
  throw new TypeError("Converting circular structure to JSON");
@@ -197,83 +197,83 @@ var lt = { exports: {} };
197
197
  }
198
198
  return '"[Circular]"';
199
199
  }
200
- function E(r, m) {
201
- let b;
202
- if (i.call(r, m) && (b = r[m], typeof b != "boolean"))
203
- throw new TypeError(`The "${m}" argument must be of type boolean`);
204
- return b === void 0 ? !0 : b;
200
+ function v(c, u) {
201
+ let y;
202
+ if (i.call(c, u) && (y = c[u], typeof y != "boolean"))
203
+ throw new TypeError(`The "${u}" argument must be of type boolean`);
204
+ return y === void 0 ? !0 : y;
205
205
  }
206
- function g(r, m) {
207
- let b;
208
- if (i.call(r, m)) {
209
- if (b = r[m], typeof b != "number")
210
- throw new TypeError(`The "${m}" argument must be of type number`);
211
- if (!Number.isInteger(b))
212
- throw new TypeError(`The "${m}" argument must be an integer`);
213
- if (b < 1)
214
- throw new RangeError(`The "${m}" argument must be >= 1`);
206
+ function h(c, u) {
207
+ let y;
208
+ if (i.call(c, u)) {
209
+ if (y = c[u], typeof y != "number")
210
+ throw new TypeError(`The "${u}" argument must be of type number`);
211
+ if (!Number.isInteger(y))
212
+ throw new TypeError(`The "${u}" argument must be an integer`);
213
+ if (y < 1)
214
+ throw new RangeError(`The "${u}" argument must be >= 1`);
215
215
  }
216
- return b === void 0 ? 1 / 0 : b;
216
+ return y === void 0 ? 1 / 0 : y;
217
217
  }
218
- function S(r) {
219
- return r === 1 ? "1 item" : `${r} items`;
218
+ function O(c) {
219
+ return c === 1 ? "1 item" : `${c} items`;
220
220
  }
221
- function F(r) {
222
- const m = /* @__PURE__ */ new Set();
223
- for (const b of r)
224
- (typeof b == "string" || typeof b == "number") && m.add(String(b));
225
- return m;
221
+ function $(c) {
222
+ const u = /* @__PURE__ */ new Set();
223
+ for (const y of c)
224
+ (typeof y == "string" || typeof y == "number") && u.add(String(y));
225
+ return u;
226
226
  }
227
- function _(r) {
228
- if (i.call(r, "strict")) {
229
- const m = r.strict;
230
- if (typeof m != "boolean")
227
+ function D(c) {
228
+ if (i.call(c, "strict")) {
229
+ const u = c.strict;
230
+ if (typeof u != "boolean")
231
231
  throw new TypeError('The "strict" argument must be of type boolean');
232
- if (m)
233
- return (b) => {
234
- let D = `Object can not safely be stringified. Received type ${typeof b}`;
235
- throw typeof b != "function" && (D += ` (${b.toString()})`), new Error(D);
232
+ if (u)
233
+ return (y) => {
234
+ let P = `Object can not safely be stringified. Received type ${typeof y}`;
235
+ throw typeof y != "function" && (P += ` (${y.toString()})`), new Error(P);
236
236
  };
237
237
  }
238
238
  }
239
- function A(r) {
240
- r = { ...r };
241
- const m = _(r);
242
- m && (r.bigint === void 0 && (r.bigint = !1), "circularValue" in r || (r.circularValue = Error));
243
- const b = j(r), D = E(r, "bigint"), U = E(r, "deterministic"), R = g(r, "maximumDepth"), T = g(r, "maximumBreadth");
244
- function tt(P, o, f, y, h, O) {
245
- let d = o[P];
246
- switch (typeof d == "object" && d !== null && typeof d.toJSON == "function" && (d = d.toJSON(P)), d = y.call(o, P, d), typeof d) {
239
+ function E(c) {
240
+ c = { ...c };
241
+ const u = D(c);
242
+ u && (c.bigint === void 0 && (c.bigint = !1), "circularValue" in c || (c.circularValue = Error));
243
+ const y = b(c), P = v(c, "bigint"), V = v(c, "deterministic"), R = h(c, "maximumDepth"), k = h(c, "maximumBreadth");
244
+ function tt(I, o, f, w, g, S) {
245
+ let d = o[I];
246
+ switch (typeof d == "object" && d !== null && typeof d.toJSON == "function" && (d = d.toJSON(I)), d = w.call(o, I, d), typeof d) {
247
247
  case "string":
248
- return p(d);
248
+ return s(d);
249
249
  case "object": {
250
250
  if (d === null)
251
251
  return "null";
252
252
  if (f.indexOf(d) !== -1)
253
- return b;
254
- let w = "", v = ",";
255
- const k = O;
253
+ return y;
254
+ let j = "", _ = ",";
255
+ const A = S;
256
256
  if (Array.isArray(d)) {
257
257
  if (d.length === 0)
258
258
  return "[]";
259
259
  if (R < f.length + 1)
260
260
  return '"[Array]"';
261
- f.push(d), h !== "" && (O += h, w += `
262
- ${O}`, v = `,
263
- ${O}`);
264
- const z = Math.min(d.length, T);
261
+ f.push(d), g !== "" && (S += g, j += `
262
+ ${S}`, _ = `,
263
+ ${S}`);
264
+ const F = Math.min(d.length, k);
265
265
  let C = 0;
266
- for (; C < z - 1; C++) {
267
- const it = tt(String(C), d, f, y, h, O);
268
- w += it !== void 0 ? it : "null", w += v;
266
+ for (; C < F - 1; C++) {
267
+ const it = tt(String(C), d, f, w, g, S);
268
+ j += it !== void 0 ? it : "null", j += _;
269
269
  }
270
- const J = tt(String(C), d, f, y, h, O);
271
- if (w += J !== void 0 ? J : "null", d.length - 1 > T) {
272
- const it = d.length - T - 1;
273
- w += `${v}"... ${S(it)} not stringified"`;
270
+ const J = tt(String(C), d, f, w, g, S);
271
+ if (j += J !== void 0 ? J : "null", d.length - 1 > k) {
272
+ const it = d.length - k - 1;
273
+ j += `${_}"... ${O(it)} not stringified"`;
274
274
  }
275
- return h !== "" && (w += `
276
- ${k}`), f.pop(), `[${w}]`;
275
+ return g !== "" && (j += `
276
+ ${A}`), f.pop(), `[${j}]`;
277
277
  }
278
278
  let N = Object.keys(d);
279
279
  const M = N.length;
@@ -281,256 +281,256 @@ ${k}`), f.pop(), `[${w}]`;
281
281
  return "{}";
282
282
  if (R < f.length + 1)
283
283
  return '"[Object]"';
284
- let $ = "", I = "";
285
- h !== "" && (O += h, v = `,
286
- ${O}`, $ = " ");
287
- const q = Math.min(M, T);
288
- U && !c(d) && (N = s(N)), f.push(d);
289
- for (let z = 0; z < q; z++) {
290
- const C = N[z], J = tt(C, d, f, y, h, O);
291
- J !== void 0 && (w += `${I}${p(C)}:${$}${J}`, I = v);
284
+ let T = "", z = "";
285
+ g !== "" && (S += g, _ = `,
286
+ ${S}`, T = " ");
287
+ const q = Math.min(M, k);
288
+ V && !p(d) && (N = r(N)), f.push(d);
289
+ for (let F = 0; F < q; F++) {
290
+ const C = N[F], J = tt(C, d, f, w, g, S);
291
+ J !== void 0 && (j += `${z}${s(C)}:${T}${J}`, z = _);
292
292
  }
293
- if (M > T) {
294
- const z = M - T;
295
- w += `${I}"...":${$}"${S(z)} not stringified"`, I = v;
293
+ if (M > k) {
294
+ const F = M - k;
295
+ j += `${z}"...":${T}"${O(F)} not stringified"`, z = _;
296
296
  }
297
- return h !== "" && I.length > 1 && (w = `
298
- ${O}${w}
299
- ${k}`), f.pop(), `{${w}}`;
297
+ return g !== "" && z.length > 1 && (j = `
298
+ ${S}${j}
299
+ ${A}`), f.pop(), `{${j}}`;
300
300
  }
301
301
  case "number":
302
- return isFinite(d) ? String(d) : m ? m(d) : "null";
302
+ return isFinite(d) ? String(d) : u ? u(d) : "null";
303
303
  case "boolean":
304
304
  return d === !0 ? "true" : "false";
305
305
  case "undefined":
306
306
  return;
307
307
  case "bigint":
308
- if (D)
308
+ if (P)
309
309
  return String(d);
310
310
  default:
311
- return m ? m(d) : void 0;
311
+ return u ? u(d) : void 0;
312
312
  }
313
313
  }
314
- function et(P, o, f, y, h, O) {
315
- switch (typeof o == "object" && o !== null && typeof o.toJSON == "function" && (o = o.toJSON(P)), typeof o) {
314
+ function et(I, o, f, w, g, S) {
315
+ switch (typeof o == "object" && o !== null && typeof o.toJSON == "function" && (o = o.toJSON(I)), typeof o) {
316
316
  case "string":
317
- return p(o);
317
+ return s(o);
318
318
  case "object": {
319
319
  if (o === null)
320
320
  return "null";
321
321
  if (f.indexOf(o) !== -1)
322
- return b;
323
- const d = O;
324
- let w = "", v = ",";
322
+ return y;
323
+ const d = S;
324
+ let j = "", _ = ",";
325
325
  if (Array.isArray(o)) {
326
326
  if (o.length === 0)
327
327
  return "[]";
328
328
  if (R < f.length + 1)
329
329
  return '"[Array]"';
330
- f.push(o), h !== "" && (O += h, w += `
331
- ${O}`, v = `,
332
- ${O}`);
333
- const M = Math.min(o.length, T);
334
- let $ = 0;
335
- for (; $ < M - 1; $++) {
336
- const q = et(String($), o[$], f, y, h, O);
337
- w += q !== void 0 ? q : "null", w += v;
330
+ f.push(o), g !== "" && (S += g, j += `
331
+ ${S}`, _ = `,
332
+ ${S}`);
333
+ const M = Math.min(o.length, k);
334
+ let T = 0;
335
+ for (; T < M - 1; T++) {
336
+ const q = et(String(T), o[T], f, w, g, S);
337
+ j += q !== void 0 ? q : "null", j += _;
338
338
  }
339
- const I = et(String($), o[$], f, y, h, O);
340
- if (w += I !== void 0 ? I : "null", o.length - 1 > T) {
341
- const q = o.length - T - 1;
342
- w += `${v}"... ${S(q)} not stringified"`;
339
+ const z = et(String(T), o[T], f, w, g, S);
340
+ if (j += z !== void 0 ? z : "null", o.length - 1 > k) {
341
+ const q = o.length - k - 1;
342
+ j += `${_}"... ${O(q)} not stringified"`;
343
343
  }
344
- return h !== "" && (w += `
345
- ${d}`), f.pop(), `[${w}]`;
344
+ return g !== "" && (j += `
345
+ ${d}`), f.pop(), `[${j}]`;
346
346
  }
347
347
  f.push(o);
348
- let k = "";
349
- h !== "" && (O += h, v = `,
350
- ${O}`, k = " ");
348
+ let A = "";
349
+ g !== "" && (S += g, _ = `,
350
+ ${S}`, A = " ");
351
351
  let N = "";
352
- for (const M of y) {
353
- const $ = et(M, o[M], f, y, h, O);
354
- $ !== void 0 && (w += `${N}${p(M)}:${k}${$}`, N = v);
352
+ for (const M of w) {
353
+ const T = et(M, o[M], f, w, g, S);
354
+ T !== void 0 && (j += `${N}${s(M)}:${A}${T}`, N = _);
355
355
  }
356
- return h !== "" && N.length > 1 && (w = `
357
- ${O}${w}
358
- ${d}`), f.pop(), `{${w}}`;
356
+ return g !== "" && N.length > 1 && (j = `
357
+ ${S}${j}
358
+ ${d}`), f.pop(), `{${j}}`;
359
359
  }
360
360
  case "number":
361
- return isFinite(o) ? String(o) : m ? m(o) : "null";
361
+ return isFinite(o) ? String(o) : u ? u(o) : "null";
362
362
  case "boolean":
363
363
  return o === !0 ? "true" : "false";
364
364
  case "undefined":
365
365
  return;
366
366
  case "bigint":
367
- if (D)
367
+ if (P)
368
368
  return String(o);
369
369
  default:
370
- return m ? m(o) : void 0;
370
+ return u ? u(o) : void 0;
371
371
  }
372
372
  }
373
- function W(P, o, f, y, h) {
373
+ function W(I, o, f, w, g) {
374
374
  switch (typeof o) {
375
375
  case "string":
376
- return p(o);
376
+ return s(o);
377
377
  case "object": {
378
378
  if (o === null)
379
379
  return "null";
380
380
  if (typeof o.toJSON == "function") {
381
- if (o = o.toJSON(P), typeof o != "object")
382
- return W(P, o, f, y, h);
381
+ if (o = o.toJSON(I), typeof o != "object")
382
+ return W(I, o, f, w, g);
383
383
  if (o === null)
384
384
  return "null";
385
385
  }
386
386
  if (f.indexOf(o) !== -1)
387
- return b;
388
- const O = h;
387
+ return y;
388
+ const S = g;
389
389
  if (Array.isArray(o)) {
390
390
  if (o.length === 0)
391
391
  return "[]";
392
392
  if (R < f.length + 1)
393
393
  return '"[Array]"';
394
- f.push(o), h += y;
395
- let $ = `
396
- ${h}`;
397
- const I = `,
398
- ${h}`, q = Math.min(o.length, T);
399
- let z = 0;
400
- for (; z < q - 1; z++) {
401
- const J = W(String(z), o[z], f, y, h);
402
- $ += J !== void 0 ? J : "null", $ += I;
394
+ f.push(o), g += w;
395
+ let T = `
396
+ ${g}`;
397
+ const z = `,
398
+ ${g}`, q = Math.min(o.length, k);
399
+ let F = 0;
400
+ for (; F < q - 1; F++) {
401
+ const J = W(String(F), o[F], f, w, g);
402
+ T += J !== void 0 ? J : "null", T += z;
403
403
  }
404
- const C = W(String(z), o[z], f, y, h);
405
- if ($ += C !== void 0 ? C : "null", o.length - 1 > T) {
406
- const J = o.length - T - 1;
407
- $ += `${I}"... ${S(J)} not stringified"`;
404
+ const C = W(String(F), o[F], f, w, g);
405
+ if (T += C !== void 0 ? C : "null", o.length - 1 > k) {
406
+ const J = o.length - k - 1;
407
+ T += `${z}"... ${O(J)} not stringified"`;
408
408
  }
409
- return $ += `
410
- ${O}`, f.pop(), `[${$}]`;
409
+ return T += `
410
+ ${S}`, f.pop(), `[${T}]`;
411
411
  }
412
412
  let d = Object.keys(o);
413
- const w = d.length;
414
- if (w === 0)
413
+ const j = d.length;
414
+ if (j === 0)
415
415
  return "{}";
416
416
  if (R < f.length + 1)
417
417
  return '"[Object]"';
418
- h += y;
419
- const v = `,
420
- ${h}`;
421
- let k = "", N = "", M = Math.min(w, T);
422
- c(o) && (k += x(o, v, T), d = d.slice(o.length), M -= o.length, N = v), U && (d = s(d)), f.push(o);
423
- for (let $ = 0; $ < M; $++) {
424
- const I = d[$], q = W(I, o[I], f, y, h);
425
- q !== void 0 && (k += `${N}${p(I)}: ${q}`, N = v);
418
+ g += w;
419
+ const _ = `,
420
+ ${g}`;
421
+ let A = "", N = "", M = Math.min(j, k);
422
+ p(o) && (A += x(o, _, k), d = d.slice(o.length), M -= o.length, N = _), V && (d = r(d)), f.push(o);
423
+ for (let T = 0; T < M; T++) {
424
+ const z = d[T], q = W(z, o[z], f, w, g);
425
+ q !== void 0 && (A += `${N}${s(z)}: ${q}`, N = _);
426
426
  }
427
- if (w > T) {
428
- const $ = w - T;
429
- k += `${N}"...": "${S($)} not stringified"`, N = v;
427
+ if (j > k) {
428
+ const T = j - k;
429
+ A += `${N}"...": "${O(T)} not stringified"`, N = _;
430
430
  }
431
- return N !== "" && (k = `
432
- ${h}${k}
433
- ${O}`), f.pop(), `{${k}}`;
431
+ return N !== "" && (A = `
432
+ ${g}${A}
433
+ ${S}`), f.pop(), `{${A}}`;
434
434
  }
435
435
  case "number":
436
- return isFinite(o) ? String(o) : m ? m(o) : "null";
436
+ return isFinite(o) ? String(o) : u ? u(o) : "null";
437
437
  case "boolean":
438
438
  return o === !0 ? "true" : "false";
439
439
  case "undefined":
440
440
  return;
441
441
  case "bigint":
442
- if (D)
442
+ if (P)
443
443
  return String(o);
444
444
  default:
445
- return m ? m(o) : void 0;
445
+ return u ? u(o) : void 0;
446
446
  }
447
447
  }
448
- function B(P, o, f) {
448
+ function B(I, o, f) {
449
449
  switch (typeof o) {
450
450
  case "string":
451
- return p(o);
451
+ return s(o);
452
452
  case "object": {
453
453
  if (o === null)
454
454
  return "null";
455
455
  if (typeof o.toJSON == "function") {
456
- if (o = o.toJSON(P), typeof o != "object")
457
- return B(P, o, f);
456
+ if (o = o.toJSON(I), typeof o != "object")
457
+ return B(I, o, f);
458
458
  if (o === null)
459
459
  return "null";
460
460
  }
461
461
  if (f.indexOf(o) !== -1)
462
- return b;
463
- let y = "";
462
+ return y;
463
+ let w = "";
464
464
  if (Array.isArray(o)) {
465
465
  if (o.length === 0)
466
466
  return "[]";
467
467
  if (R < f.length + 1)
468
468
  return '"[Array]"';
469
469
  f.push(o);
470
- const v = Math.min(o.length, T);
471
- let k = 0;
472
- for (; k < v - 1; k++) {
473
- const M = B(String(k), o[k], f);
474
- y += M !== void 0 ? M : "null", y += ",";
470
+ const _ = Math.min(o.length, k);
471
+ let A = 0;
472
+ for (; A < _ - 1; A++) {
473
+ const M = B(String(A), o[A], f);
474
+ w += M !== void 0 ? M : "null", w += ",";
475
475
  }
476
- const N = B(String(k), o[k], f);
477
- if (y += N !== void 0 ? N : "null", o.length - 1 > T) {
478
- const M = o.length - T - 1;
479
- y += `,"... ${S(M)} not stringified"`;
476
+ const N = B(String(A), o[A], f);
477
+ if (w += N !== void 0 ? N : "null", o.length - 1 > k) {
478
+ const M = o.length - k - 1;
479
+ w += `,"... ${O(M)} not stringified"`;
480
480
  }
481
- return f.pop(), `[${y}]`;
481
+ return f.pop(), `[${w}]`;
482
482
  }
483
- let h = Object.keys(o);
484
- const O = h.length;
485
- if (O === 0)
483
+ let g = Object.keys(o);
484
+ const S = g.length;
485
+ if (S === 0)
486
486
  return "{}";
487
487
  if (R < f.length + 1)
488
488
  return '"[Object]"';
489
- let d = "", w = Math.min(O, T);
490
- c(o) && (y += x(o, ",", T), h = h.slice(o.length), w -= o.length, d = ","), U && (h = s(h)), f.push(o);
491
- for (let v = 0; v < w; v++) {
492
- const k = h[v], N = B(k, o[k], f);
493
- N !== void 0 && (y += `${d}${p(k)}:${N}`, d = ",");
489
+ let d = "", j = Math.min(S, k);
490
+ p(o) && (w += x(o, ",", k), g = g.slice(o.length), j -= o.length, d = ","), V && (g = r(g)), f.push(o);
491
+ for (let _ = 0; _ < j; _++) {
492
+ const A = g[_], N = B(A, o[A], f);
493
+ N !== void 0 && (w += `${d}${s(A)}:${N}`, d = ",");
494
494
  }
495
- if (O > T) {
496
- const v = O - T;
497
- y += `${d}"...":"${S(v)} not stringified"`;
495
+ if (S > k) {
496
+ const _ = S - k;
497
+ w += `${d}"...":"${O(_)} not stringified"`;
498
498
  }
499
- return f.pop(), `{${y}}`;
499
+ return f.pop(), `{${w}}`;
500
500
  }
501
501
  case "number":
502
- return isFinite(o) ? String(o) : m ? m(o) : "null";
502
+ return isFinite(o) ? String(o) : u ? u(o) : "null";
503
503
  case "boolean":
504
504
  return o === !0 ? "true" : "false";
505
505
  case "undefined":
506
506
  return;
507
507
  case "bigint":
508
- if (D)
508
+ if (P)
509
509
  return String(o);
510
510
  default:
511
- return m ? m(o) : void 0;
511
+ return u ? u(o) : void 0;
512
512
  }
513
513
  }
514
- function Zt(P, o, f) {
514
+ function Zt(I, o, f) {
515
515
  if (arguments.length > 1) {
516
- let y = "";
517
- if (typeof f == "number" ? y = " ".repeat(Math.min(f, 10)) : typeof f == "string" && (y = f.slice(0, 10)), o != null) {
516
+ let w = "";
517
+ if (typeof f == "number" ? w = " ".repeat(Math.min(f, 10)) : typeof f == "string" && (w = f.slice(0, 10)), o != null) {
518
518
  if (typeof o == "function")
519
- return tt("", { "": P }, [], o, y, "");
519
+ return tt("", { "": I }, [], o, w, "");
520
520
  if (Array.isArray(o))
521
- return et("", P, [], F(o), y, "");
521
+ return et("", I, [], $(o), w, "");
522
522
  }
523
- if (y.length !== 0)
524
- return W("", P, [], y, "");
523
+ if (w.length !== 0)
524
+ return W("", I, [], w, "");
525
525
  }
526
- return B("", P, []);
526
+ return B("", I, []);
527
527
  }
528
528
  return Zt;
529
529
  }
530
530
  })(lt, lt.exports);
531
531
  var ce = lt.exports;
532
- const st = /* @__PURE__ */ pe(ce);
533
- st.configure;
532
+ const rt = /* @__PURE__ */ pe(ce);
533
+ rt.configure;
534
534
  function le(e, t) {
535
535
  return { ...e, name: t };
536
536
  }
@@ -539,9 +539,9 @@ function me(e, t, i) {
539
539
  skip: i,
540
540
  document: e
541
541
  }, { scope: a } = t;
542
- return !a || t.skip === void 0 ? n : G(n, (p) => {
543
- const [s] = p.document.operations[a].slice(-1);
544
- t.skip && t.skip > 0 && (p.skip = t.skip), s.type === "NOOP" && t.index === s.index && p.skip > s.skip && p.document.operations[a].pop();
542
+ return !a || t.skip === void 0 ? n : G(n, (s) => {
543
+ const [r] = s.document.operations[a].slice(-1);
544
+ t.skip && t.skip > 0 && (s.skip = t.skip), r.type === "NOOP" && t.index === r.index && s.skip > r.skip && s.document.operations[a].pop();
545
545
  });
546
546
  }
547
547
  function ue(e, t, i) {
@@ -550,8 +550,8 @@ function ue(e, t, i) {
550
550
  document: e,
551
551
  action: t,
552
552
  skip: i
553
- }, (s) => {
554
- if (s.document.operations[n].length < 1)
553
+ }, (r) => {
554
+ if (r.document.operations[n].length < 1)
555
555
  throw new Error(
556
556
  `Cannot undo: no operations in history for scope "${n}"`
557
557
  );
@@ -559,31 +559,31 @@ function ue(e, t, i) {
559
559
  throw new Error(
560
560
  "Invalid UNDO action: input value must be greater than 0"
561
561
  );
562
- if (s.skip > 0)
562
+ if (r.skip > 0)
563
563
  throw new Error(
564
564
  "Cannot undo: skip value from reducer cannot be used with UNDO action"
565
565
  );
566
- const [l] = s.document.operations[n].slice(-1), c = l.type === "NOOP" && l.skip > 0;
567
- if (s.skip += a, c) {
568
- s.skip += l.skip;
569
- const g = s.document.operations[n][s.document.operations[n].length - 2];
570
- g && l.index - g.index === 1 && s.document.operations[n].pop();
566
+ const [l] = r.document.operations[n].slice(-1), p = l.type === "NOOP" && l.skip > 0;
567
+ if (r.skip += a, p) {
568
+ r.skip += l.skip;
569
+ const h = r.document.operations[n][r.document.operations[n].length - 2];
570
+ h && l.index - h.index === 1 && r.document.operations[n].pop();
571
571
  }
572
- if (s.document.operations[n].length < s.skip)
572
+ if (r.document.operations[n].length < r.skip)
573
573
  throw new Error(
574
574
  "Cannot undo: you can't undo more operations than the ones in the scope history"
575
575
  );
576
- const x = s.document.operations[n].length - 1;
577
- let j = a, E = c ? x - l.skip : x;
578
- for (; j > 0 && E >= 0; ) {
579
- const g = s.document.operations[n][E];
580
- if (!g) {
581
- j--, E--;
576
+ const x = r.document.operations[n].length - 1;
577
+ let b = a, v = p ? x - l.skip : x;
578
+ for (; b > 0 && v >= 0; ) {
579
+ const h = r.document.operations[n][v];
580
+ if (!h) {
581
+ b--, v--;
582
582
  continue;
583
583
  }
584
- g.type === "NOOP" && g.skip > 0 ? (E = E - (g.skip + 1), s.skip += g.skip + 1) : (s.document.clipboard.push({ ...g }), j--, E--);
584
+ h.type === "NOOP" && h.skip > 0 ? (v = v - (h.skip + 1), r.skip += h.skip + 1) : (r.document.clipboard.push({ ...h }), b--, v--);
585
585
  }
586
- s.action = yt(n);
586
+ r.action = yt(n);
587
587
  });
588
588
  }
589
589
  function fe(e, t, i) {
@@ -592,8 +592,8 @@ function fe(e, t, i) {
592
592
  document: e,
593
593
  action: t,
594
594
  skip: i
595
- }, (s) => {
596
- if (s.skip > 0)
595
+ }, (r) => {
596
+ if (r.skip > 0)
597
597
  throw new Error(
598
598
  "Cannot redo: skip value from reducer cannot be used with REDO action"
599
599
  );
@@ -603,55 +603,55 @@ function fe(e, t, i) {
603
603
  );
604
604
  if (a < 1)
605
605
  throw new Error("Invalid REDO action: invalid redo input value");
606
- if (s.document.clipboard.length < 1)
606
+ if (r.document.clipboard.length < 1)
607
607
  throw new Error("Cannot redo: no operations in the clipboard");
608
- const l = s.document.clipboard.findLastIndex(
608
+ const l = r.document.clipboard.findLastIndex(
609
609
  (x) => x.scope === n
610
610
  );
611
611
  if (l < 0)
612
612
  throw new Error(
613
613
  `Cannot redo: no operations in clipboard for scope "${n}"`
614
614
  );
615
- const c = s.document.clipboard.splice(l, 1)[0];
616
- s.action = pt({
617
- type: c.type,
618
- scope: c.scope,
619
- input: c.input
615
+ const p = r.document.clipboard.splice(l, 1)[0];
616
+ r.action = pt({
617
+ type: p.type,
618
+ scope: p.scope,
619
+ input: p.input
620
620
  });
621
621
  });
622
622
  }
623
623
  function de(e, t, i) {
624
624
  const { scope: n } = t, a = e.operations[n];
625
625
  let {
626
- input: { start: p, end: s }
626
+ input: { start: s, end: r }
627
627
  } = t;
628
- p = p || 0, s = s || a.length;
629
- const l = a.slice(p, s), c = a.slice(0, p), x = a.slice(s), j = mt(
628
+ s = s || 0, r = r || a.length;
629
+ const l = a.slice(s, r), p = a.slice(0, s), x = a.slice(r), b = mt(
630
630
  e.initialState,
631
631
  {
632
632
  ...e.operations,
633
- [n]: c.concat(l)
633
+ [n]: p.concat(l)
634
634
  },
635
635
  i
636
- ), { name: E, state: g } = j, S = c.length, F = c.length ? c[c.length - 1].timestamp : x.length ? x[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
636
+ ), { name: v, state: h } = b, O = p.length, $ = p.length ? p[p.length - 1].timestamp : x.length ? x[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
637
637
  return mt(
638
638
  e.initialState,
639
639
  {
640
640
  ...e.operations,
641
641
  [n]: [
642
- ...c,
642
+ ...p,
643
643
  {
644
644
  ...bt(
645
- { name: E, state: g },
645
+ { name: v, state: h },
646
646
  l.length
647
647
  ),
648
- timestamp: F,
649
- index: S,
650
- hash: xt({ state: g }, "global")
648
+ timestamp: $,
649
+ index: O,
650
+ hash: xt({ state: h }, "global")
651
651
  },
652
- ...x.map((_, A) => ({
653
- ..._,
654
- index: S + A + 1
652
+ ...x.map((D, E) => ({
653
+ ...D,
654
+ index: O + E + 1
655
655
  }))
656
656
  ]
657
657
  },
@@ -665,7 +665,7 @@ function ge(e, t) {
665
665
  state: t.state ?? { global: {}, local: {} }
666
666
  };
667
667
  }
668
- const Ft = "SET_NAME", X = "UNDO", Y = "REDO", rt = "PRUNE", Rt = "LOAD_STATE", he = "NOOP";
668
+ const Ft = "SET_NAME", X = "UNDO", Y = "REDO", st = "PRUNE", Rt = "LOAD_STATE", he = "NOOP";
669
669
  function xe(e, t) {
670
670
  let i;
671
671
  return "index" in t ? i = { ...t } : i = e.operations[t.scope].slice(-1)[0], ((i == null ? void 0 : i.index) ?? -1) + 1;
@@ -681,27 +681,28 @@ function be(e, t) {
681
681
  };
682
682
  }
683
683
  function ye(e, t, i = 0) {
684
- if ([X, Y, rt].includes(t.type))
684
+ if ([X, Y, st].includes(t.type))
685
685
  return e;
686
686
  const { scope: n } = t, a = e.operations[n].slice(
687
687
  0,
688
688
  e.revision[n]
689
- ), p = [...a].pop();
690
- let s = ((p == null ? void 0 : p.index) ?? -1) + 1;
689
+ ), s = [...a].pop();
690
+ let r = ((s == null ? void 0 : s.index) ?? -1) + 1;
691
691
  if ("index" in t) {
692
- if (t.index > s + i)
692
+ if (t.index > r + i)
693
693
  throw new Error(
694
- `Missing operations: expected ${s} with skip 0 or equivalent, got index ${t.index} with skip ${i}`
694
+ `Missing operations: expected ${r} with skip 0 or equivalent, got index ${t.index} with skip ${i}`
695
695
  );
696
- s = t.index;
696
+ r = t.index;
697
697
  }
698
698
  return a.push({
699
699
  ...t,
700
- index: s,
700
+ index: r,
701
701
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
702
702
  hash: "",
703
703
  scope: n,
704
- skip: i
704
+ skip: i,
705
+ error: void 0
705
706
  }), {
706
707
  ...e,
707
708
  operations: { ...e.operations, [n]: a }
@@ -715,7 +716,7 @@ function je(e, t, i) {
715
716
  switch (At().parse(t), t.type) {
716
717
  case Ft:
717
718
  return le(e, t.input);
718
- case rt:
719
+ case st:
719
720
  return de(e, t, i);
720
721
  case Rt:
721
722
  return ge(e, t.input.state);
@@ -723,7 +724,7 @@ function je(e, t, i) {
723
724
  return e;
724
725
  }
725
726
  }
726
- function Oe(e, t, i) {
727
+ function Se(e, t, i) {
727
728
  switch (t.type) {
728
729
  case X:
729
730
  return ue(e, t, i);
@@ -734,71 +735,76 @@ function Oe(e, t, i) {
734
735
  }
735
736
  }
736
737
  function Lt(e, t, i, n, a = {}) {
737
- const { skip: p, ignoreSkipOperations: s = !1, reuseHash: l = !1 } = a;
738
- let c = { ...t }, x = p || 0, j = e, E = [...e.clipboard];
739
- if (ve(c)) {
740
- const { document: g, skip: S } = me(j, c, x);
741
- x = S, j = g;
738
+ const { skip: s, ignoreSkipOperations: r = !1, reuseHash: l = !1 } = a;
739
+ let p = { ...t }, x = s || 0, b = e, v = [...e.clipboard];
740
+ if (ve(p)) {
741
+ const { document: h, skip: O } = me(b, p, x);
742
+ x = O, b = h;
742
743
  }
743
- if (wt(c)) {
744
+ if (wt(p)) {
744
745
  const {
745
- skip: g,
746
- action: S,
747
- document: F
748
- } = Oe(e, c, x);
749
- c = S, x = g, j = F, E = [...j.clipboard];
746
+ skip: h,
747
+ action: O,
748
+ document: $
749
+ } = Se(e, p, x);
750
+ p = O, x = h, b = $, v = [...b.clipboard];
750
751
  }
751
- if (jt(c) && (j = je(j, c, i)), x > 0 && !s) {
752
- let g = x;
753
- "index" in c && (g = Ne(
754
- j.operations[c.scope],
755
- c.index,
752
+ if (jt(p) && (b = je(b, p, i)), x > 0 && !r) {
753
+ let h = x;
754
+ "index" in p && (h = Ne(
755
+ b.operations[p.scope],
756
+ p.index,
756
757
  x
757
- )), j = mt(
758
- j.initialState,
759
- j.operations,
758
+ )), b = mt(
759
+ b.initialState,
760
+ b.operations,
760
761
  i,
761
762
  void 0,
762
763
  void 0,
763
764
  void 0,
764
- { [c.scope]: g }
765
+ { [p.scope]: h }
765
766
  // TODO reuse hash?
766
767
  );
767
768
  }
768
- return j = we(j, c, x), j = G(j, (g) => {
769
- const S = i(
770
- g.state,
771
- c,
772
- n
773
- ), F = wt(t) ? [...E] : [];
774
- if (S)
775
- return pt({
776
- ...j,
777
- clipboard: [...F],
778
- state: S
779
- });
780
- g.clipboard = pt([...F]);
781
- }), G(j, (g) => {
782
- if ([X, Y, rt].includes(c.type))
783
- return g;
784
- const S = c.scope || "global", F = l && Object.prototype.hasOwnProperty.call(c, "hash") ? c.hash : xt(g, S);
785
- g.operations[S][g.operations[S].length - 1].hash = F, !jt(c) && c.attachments && c.attachments.forEach((_) => {
786
- const { hash: A, ...r } = _;
787
- g.attachments[A] = {
788
- ...r
769
+ return b = we(b, p, x), b = G(b, (h) => {
770
+ try {
771
+ const O = i(
772
+ h.state,
773
+ p,
774
+ n
775
+ ), $ = wt(t) ? [...v] : [];
776
+ if (O)
777
+ return pt({
778
+ ...b,
779
+ clipboard: [...$],
780
+ state: O
781
+ });
782
+ h.clipboard = pt([...$]);
783
+ } catch (O) {
784
+ const $ = b.operations[p.scope].length - 1;
785
+ h.operations[p.scope][$].error = O.message;
786
+ }
787
+ }), G(b, (h) => {
788
+ if ([X, Y, st].includes(p.type))
789
+ return h;
790
+ const O = p.scope || "global", $ = l && Object.prototype.hasOwnProperty.call(p, "hash") ? p.hash : xt(h, O);
791
+ h.operations[O][h.operations[O].length - 1].hash = $, !jt(p) && p.attachments && p.attachments.forEach((D) => {
792
+ const { hash: E, ...c } = D;
793
+ h.attachments[E] = {
794
+ ...c
789
795
  };
790
796
  });
791
797
  });
792
798
  }
793
- function Se(e, t, i) {
799
+ function Oe(e, t, i) {
794
800
  const n = ie(e, t);
795
- return ct.mkdirSync(e, { recursive: !0 }), new Promise((a, p) => {
801
+ return ct.mkdirSync(e, { recursive: !0 }), new Promise((a, s) => {
796
802
  try {
797
- ct.writeFile(n, i, {}, (s) => {
798
- s ? p(s) : a(n);
803
+ ct.writeFile(n, i, {}, (r) => {
804
+ r ? s(r) : a(n);
799
805
  });
800
- } catch (s) {
801
- p(s);
806
+ } catch (r) {
807
+ s(r);
802
808
  }
803
809
  });
804
810
  }
@@ -808,11 +814,11 @@ function qt(e) {
808
814
  function $e(e) {
809
815
  return new Promise((t, i) => {
810
816
  ee.get(e, (n) => {
811
- const a = [], p = n.headers["content-type"];
812
- n.on("data", (s) => {
813
- a.push(s);
817
+ const a = [], s = n.headers["content-type"];
818
+ n.on("data", (r) => {
819
+ a.push(r);
814
820
  }), n.on("end", () => {
815
- t({ buffer: Buffer.concat(a), mimeType: p });
821
+ t({ buffer: Buffer.concat(a), mimeType: s });
816
822
  });
817
823
  }).on("error", (n) => {
818
824
  i(n);
@@ -827,26 +833,26 @@ function wt(e) {
827
833
  return [X, Y].includes(e.type);
828
834
  }
829
835
  function jt(e) {
830
- return [Ft, X, Y, rt, Rt].includes(e.type);
836
+ return [Ft, X, Y, st, Rt].includes(e.type);
831
837
  }
832
838
  function H(e, t, i, n, a = "global") {
833
839
  if (!e)
834
840
  throw new Error("Empty action type");
835
841
  if (typeof e != "string")
836
842
  throw new Error(`Invalid action type: ${JSON.stringify(e)}`);
837
- const p = { type: e, input: t, scope: a };
838
- i && (p.attachments = i);
843
+ const s = { type: e, input: t, scope: a };
844
+ i && (s.attachments = i);
839
845
  try {
840
- n == null || n().parse(p.input);
841
- } catch (s) {
842
- throw new Error(`Invalid action input: ${s}`);
846
+ n == null || n().parse(s.input);
847
+ } catch (r) {
848
+ throw new Error(`Invalid action input: ${r}`);
843
849
  }
844
- return p;
850
+ return s;
845
851
  }
846
852
  function Te(e, t = Lt) {
847
- return (i, n, a, p) => t(i, n, e, a, p);
853
+ return (i, n, a, s) => t(i, n, e, a, s);
848
854
  }
849
- const ke = (e, t) => ({
855
+ const _e = (e, t) => ({
850
856
  name: "",
851
857
  documentType: "",
852
858
  revision: {
@@ -858,8 +864,8 @@ const ke = (e, t) => ({
858
864
  attachments: {},
859
865
  ...e,
860
866
  state: (t == null ? void 0 : t(e == null ? void 0 : e.state)) ?? (e == null ? void 0 : e.state) ?? { global: {}, local: {} }
861
- }), _e = (e, t) => {
862
- const i = ke(
867
+ }), ke = (e, t) => {
868
+ const i = _e(
863
869
  e,
864
870
  t
865
871
  );
@@ -869,7 +875,7 @@ const ke = (e, t) => ({
869
875
  operations: { global: [], local: [] },
870
876
  clipboard: []
871
877
  };
872
- }, xt = (e, t = "global") => at(st(e.state[t] || "")), Be = (e, t = 1e3) => {
878
+ }, xt = (e, t = "global") => at(rt(e.state[t] || "")), Be = (e, t = 1e3) => {
873
879
  const i = Math.random() * t;
874
880
  return at(`${(e ?? /* @__PURE__ */ new Date()).toISOString()}${i}`);
875
881
  };
@@ -879,37 +885,37 @@ function ot(e) {
879
885
  function Ae(e, t) {
880
886
  const i = [...e];
881
887
  let n = t || 0, a = i.length > 0 ? i[i.length - 1].index : 0;
882
- const p = [];
883
- for (const s of i.reverse()) {
888
+ const s = [];
889
+ for (const r of i.reverse()) {
884
890
  if (n > 0) {
885
- const x = a - s.index;
891
+ const x = a - r.index;
886
892
  n -= x;
887
893
  }
888
894
  if (n < 0)
889
895
  throw new Error("Invalid operation index, missing operations");
890
896
  const l = {
891
897
  ignore: n > 0,
892
- operation: s
893
- }, c = s.skip > 0 ? s.skip + 1 : 0;
894
- if (c > 0 && c > n) {
895
- const x = c - n;
898
+ operation: r
899
+ }, p = r.skip > 0 ? r.skip + 1 : 0;
900
+ if (p > 0 && p > n) {
901
+ const x = p - n;
896
902
  n = n + x;
897
903
  }
898
- a = s.index, p.push(l);
904
+ a = r.index, s.push(l);
899
905
  }
900
- return p.reverse();
906
+ return s.reverse();
901
907
  }
902
908
  function Ne(e, t, i) {
903
- const n = e.slice().sort((l, c) => l.skip - c.skip).sort((l, c) => l.index - c.index);
904
- let a = i, p = 0, s = t;
909
+ const n = e.slice().sort((l, p) => l.skip - p.skip).sort((l, p) => l.index - p.index);
910
+ let a = i, s = 0, r = t;
905
911
  for (const l of n.reverse()) {
906
- const c = s - l.index;
907
- if (a = a - c, a > -1)
908
- p++, s = l.index;
912
+ const p = r - l.index;
913
+ if (a = a - p, a > -1)
914
+ s++, r = l.index;
909
915
  else
910
916
  break;
911
917
  }
912
- return p;
918
+ return s;
913
919
  }
914
920
  function Ze(e) {
915
921
  return Object.values(e).flatMap((t) => t).sort(
@@ -921,87 +927,77 @@ function De(e) {
921
927
  (t, i) => new Date(t.operation.timestamp).getTime() - new Date(i.operation.timestamp).getTime()
922
928
  );
923
929
  }
924
- function mt(e, t, i, n, a, p = Lt, s = {}, l) {
925
- const c = Te(i, p);
930
+ function mt(e, t, i, n, a, s = Lt, r = {}, l) {
931
+ const p = Te(i, s);
926
932
  return Ct(
927
933
  e,
928
934
  t,
929
- c,
935
+ p,
930
936
  n,
931
937
  a,
932
- s,
938
+ r,
933
939
  l
934
940
  );
935
941
  }
936
- function Ct(e, t, i, n, a, p = {}, s) {
937
- const l = (s == null ? void 0 : s.checkHashes) ?? !0, c = _e(e), x = Object.keys(t).reduce((_, A) => {
938
- const r = A;
942
+ function Ct(e, t, i, n, a, s = {}, r) {
943
+ const l = (r == null ? void 0 : r.checkHashes) ?? !0, p = ke(e), x = Object.keys(t).reduce(($, D) => {
944
+ const E = D;
939
945
  return {
940
- ..._,
941
- [r]: t[r].slice(0, a == null ? void 0 : a.revision[r])
946
+ ...$,
947
+ [E]: Ae(
948
+ t[E],
949
+ s[E]
950
+ )
942
951
  };
943
- }, {}), j = Object.keys(x).reduce(
944
- (_, A) => {
945
- const r = A;
946
- return {
947
- ..._,
948
- [r]: Ae(
949
- x[r],
950
- p[r]
951
- )
952
- };
953
- },
954
- {}
955
- ), E = De(j), g = E.reduce(
956
- (_, { ignore: A, operation: r }, m, b) => A ? i(_, yt(r.scope), n, {
957
- skip: r.skip,
952
+ }, {}), b = De(x), v = b.reduce(
953
+ ($, { ignore: D, operation: E }) => D ? i($, yt(E.scope), n, {
954
+ skip: E.skip,
958
955
  ignoreSkipOperations: !0
959
956
  // TODO: reuse hash?
960
- }) : i(_, r, n, {
961
- skip: r.skip,
957
+ }) : i($, E, n, {
958
+ skip: E.skip,
962
959
  ignoreSkipOperations: !0,
963
960
  reuseHash: !l
964
961
  }),
965
- c
962
+ p
966
963
  );
967
- if (!l) {
968
- for (const _ of Object.keys(g.state))
969
- for (let A = E.length - 1; A >= 0; A--)
970
- if (E[A].operation.scope === _) {
971
- if (E[A].operation.hash !== xt(g, _))
972
- throw new Error(`Hash mismatch for scope ${_}`);
964
+ if (!l)
965
+ for (const $ of Object.keys(v.state))
966
+ for (let D = b.length - 1; D >= 0; D--) {
967
+ const { ignore: E, operation: c } = b[D];
968
+ if (!(E || c.scope !== $)) {
969
+ if (c.hash !== xt(v, $))
970
+ throw new Error(`Hash mismatch for scope ${$}`);
973
971
  break;
974
972
  }
975
- }
976
- const S = Object.keys(
977
- g.operations
973
+ }
974
+ const h = Object.keys(
975
+ v.operations
978
976
  ).reduce(
979
- (_, A) => {
980
- const r = A, m = a && a.revision[r] < t[r].length ? t[r].slice(a.revision[r]) : [];
977
+ ($, D) => {
978
+ const E = D;
981
979
  return {
982
- ..._,
983
- [r]: [
984
- ...g.operations[r].map((b, D) => {
985
- var U;
980
+ ...$,
981
+ [E]: [
982
+ ...v.operations[E].map((c, u) => {
983
+ var y;
986
984
  return {
987
- ...b,
988
- timestamp: ((U = t[r][D]) == null ? void 0 : U.timestamp) ?? b.timestamp
985
+ ...c,
986
+ timestamp: ((y = t[E][u]) == null ? void 0 : y.timestamp) ?? c.timestamp
989
987
  };
990
- }),
991
- ...m
988
+ })
992
989
  ]
993
990
  };
994
991
  },
995
992
  { global: [], local: [] }
996
- ), F = Object.values(S).reduce((_, A) => {
997
- for (const r of A)
998
- r.timestamp > _ && (_ = r.timestamp);
999
- return _;
993
+ ), O = Object.values(h).reduce(($, D) => {
994
+ const E = D[D.length - 1];
995
+ return (E == null ? void 0 : E.timestamp) > $ && ($ = E.timestamp), $;
1000
996
  }, e.lastModified);
1001
- return { ...g, operations: S, lastModified: F };
997
+ return { ...v, operations: h, lastModified: O };
1002
998
  }
1003
999
  function Ge(e, t) {
1004
- return st(e) === st(t);
1000
+ return rt(e) === rt(t);
1005
1001
  }
1006
1002
  const Jt = (e) => H(
1007
1003
  "SET_NAME",
@@ -1048,21 +1044,21 @@ var L = function(e, t, i, n) {
1048
1044
  if (typeof t == "function" ? e !== t || !n : !t.has(e))
1049
1045
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
1050
1046
  return i === "m" ? n : i === "a" ? n.call(e) : n ? n.value : t.get(e);
1051
- }, K, Z, V;
1047
+ }, K, Z, U;
1052
1048
  class Me {
1053
1049
  constructor(...t) {
1054
- K.set(this, /* @__PURE__ */ new Map()), Z.set(this, /* @__PURE__ */ new Map()), V.set(this, /* @__PURE__ */ new Map());
1050
+ K.set(this, /* @__PURE__ */ new Map()), Z.set(this, /* @__PURE__ */ new Map()), U.set(this, /* @__PURE__ */ new Map());
1055
1051
  for (const i of t)
1056
1052
  this.define(i);
1057
1053
  }
1058
1054
  define(t, i = !1) {
1059
1055
  for (let [n, a] of Object.entries(t)) {
1060
- n = n.toLowerCase(), a = a.map((l) => l.toLowerCase()), L(this, V, "f").has(n) || L(this, V, "f").set(n, /* @__PURE__ */ new Set());
1061
- const p = L(this, V, "f").get(n);
1062
- let s = !0;
1056
+ n = n.toLowerCase(), a = a.map((l) => l.toLowerCase()), L(this, U, "f").has(n) || L(this, U, "f").set(n, /* @__PURE__ */ new Set());
1057
+ const s = L(this, U, "f").get(n);
1058
+ let r = !0;
1063
1059
  for (let l of a) {
1064
- const c = l.startsWith("*");
1065
- if (l = c ? l.slice(1) : l, p == null || p.add(l), s && L(this, Z, "f").set(n, l), s = !1, c)
1060
+ const p = l.startsWith("*");
1061
+ if (l = p ? l.slice(1) : l, s == null || s.add(l), r && L(this, Z, "f").set(n, l), r = !1, p)
1066
1062
  continue;
1067
1063
  const x = L(this, K, "f").get(l);
1068
1064
  if (x && x != n && !i)
@@ -1083,13 +1079,13 @@ class Me {
1083
1079
  return typeof t != "string" ? null : (t = (i = t == null ? void 0 : t.split) == null ? void 0 : i.call(t, ";")[0], (t && L(this, Z, "f").get(t.trim().toLowerCase())) ?? null);
1084
1080
  }
1085
1081
  getAllExtensions(t) {
1086
- return typeof t != "string" ? null : L(this, V, "f").get(t.toLowerCase()) ?? null;
1082
+ return typeof t != "string" ? null : L(this, U, "f").get(t.toLowerCase()) ?? null;
1087
1083
  }
1088
1084
  _freeze() {
1089
1085
  this.define = () => {
1090
1086
  throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
1091
1087
  }, Object.freeze(this);
1092
- for (const t of L(this, V, "f").values())
1088
+ for (const t of L(this, U, "f").values())
1093
1089
  Object.freeze(t);
1094
1090
  return this;
1095
1091
  }
@@ -1100,83 +1096,83 @@ class Me {
1100
1096
  };
1101
1097
  }
1102
1098
  }
1103
- K = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap();
1099
+ K = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap();
1104
1100
  const Pe = new Me(Ht)._freeze();
1105
1101
  function Ie(e) {
1106
1102
  const t = [], i = Object.keys(e);
1107
1103
  for (const n of i) {
1108
- const a = e[n].sort((p, s) => p.index - s.index);
1109
- for (let p = 0; p < a.length; p++)
1110
- a[p].index !== p && t.push({
1111
- message: `Invalid operation index ${a[p].index} at position ${p}`,
1104
+ const a = e[n].sort((s, r) => s.index - r.index);
1105
+ for (let s = 0; s < a.length; s++)
1106
+ a[s].index !== s && t.push({
1107
+ message: `Invalid operation index ${a[s].index} at position ${s}`,
1112
1108
  details: {
1113
- position: p,
1114
- operation: a[p],
1115
- scope: a[p].scope
1109
+ position: s,
1110
+ operation: a[s],
1111
+ scope: a[s].scope
1116
1112
  }
1117
1113
  });
1118
1114
  }
1119
1115
  return t;
1120
1116
  }
1121
1117
  const Wt = async (e) => {
1122
- const t = new St(), { name: i, revision: n, documentType: a, created: p, lastModified: s } = e, l = {
1118
+ const t = new Ot(), { name: i, revision: n, documentType: a, created: s, lastModified: r } = e, l = {
1123
1119
  name: i,
1124
1120
  revision: n,
1125
1121
  documentType: a,
1126
- created: p,
1127
- lastModified: s
1122
+ created: s,
1123
+ lastModified: r
1128
1124
  };
1129
1125
  return t.file("header.json", JSON.stringify(l, null, 2)), t.file(
1130
1126
  "state.json",
1131
1127
  JSON.stringify(e.initialState || {}, null, 2)
1132
1128
  ), t.file("operations.json", JSON.stringify(e.operations, null, 2)), Object.keys(e.attachments).forEach((x) => {
1133
- const { data: j, ...E } = e.attachments[x];
1134
- t.file(x, j, {
1129
+ const { data: b, ...v } = e.attachments[x];
1130
+ t.file(x, b, {
1135
1131
  base64: !0,
1136
1132
  createFolders: !0,
1137
- comment: JSON.stringify(E)
1133
+ comment: JSON.stringify(v)
1138
1134
  });
1139
1135
  }), t;
1140
1136
  }, ze = async (e, t, i, n) => {
1141
- const p = await (await Wt(e)).generateAsync({
1137
+ const s = await (await Wt(e)).generateAsync({
1142
1138
  type: "uint8array",
1143
1139
  streamFiles: !0
1144
- }), s = n ?? e.name, l = `.${i}.zip`;
1145
- return Se(
1140
+ }), r = n ?? e.name, l = `.${i}.zip`;
1141
+ return Oe(
1146
1142
  t,
1147
- s.endsWith(l) ? s : `${s}${l}`,
1148
- p
1143
+ r.endsWith(l) ? r : `${r}${l}`,
1144
+ s
1149
1145
  );
1150
1146
  }, Xe = async (e, t) => {
1151
1147
  const n = await (await Wt(e)).generateAsync({ type: "blob" }), a = await t.createWritable();
1152
1148
  await a.write(n), await a.close();
1153
- }, Ot = async (e, t, i) => {
1149
+ }, St = async (e, t, i) => {
1154
1150
  const n = qt(e);
1155
1151
  return Fe(n, t, i);
1156
1152
  }, Fe = async (e, t, i) => {
1157
- const n = new St();
1153
+ const n = new Ot();
1158
1154
  return await n.loadAsync(e), Re(n, t, i);
1159
1155
  };
1160
1156
  async function Re(e, t, i) {
1161
1157
  const n = e.file("state.json");
1162
1158
  if (!n)
1163
1159
  throw new Error("Initial state not found");
1164
- const a = await n.async("string"), p = JSON.parse(a), s = e.file("header.json");
1160
+ const a = await n.async("string"), s = JSON.parse(a), r = e.file("header.json");
1165
1161
  let l;
1166
- s && (l = JSON.parse(await s.async("string")));
1167
- const c = e.file("operations.json");
1168
- if (!c)
1162
+ r && (l = JSON.parse(await r.async("string")));
1163
+ const p = e.file("operations.json");
1164
+ if (!p)
1169
1165
  throw new Error("Operations history not found");
1170
1166
  const x = JSON.parse(
1171
- await c.async("string")
1172
- ), j = Ie(x);
1173
- if (j.length) {
1174
- const g = j.map((S) => S.message);
1175
- throw new Error(g.join(`
1167
+ await p.async("string")
1168
+ ), b = Ie(x);
1169
+ if (b.length) {
1170
+ const h = b.map((O) => O.message);
1171
+ throw new Error(h.join(`
1176
1172
  `));
1177
1173
  }
1178
- let E = Ct(
1179
- p,
1174
+ let v = Ct(
1175
+ s,
1180
1176
  x,
1181
1177
  t,
1182
1178
  void 0,
@@ -1184,10 +1180,10 @@ async function Re(e, t, i) {
1184
1180
  {},
1185
1181
  i
1186
1182
  );
1187
- return l && (E = {
1188
- ...E,
1183
+ return l && (v = {
1184
+ ...v,
1189
1185
  ...l
1190
- }), E;
1186
+ }), v;
1191
1187
  }
1192
1188
  function Bt(e) {
1193
1189
  const t = e.replace(/^.*\./, "") || void 0, i = e.replace(/^.*[/\\]/, "") || void 0;
@@ -1245,7 +1241,7 @@ class ei {
1245
1241
  * @param path - The file path where the state is stored.
1246
1242
  */
1247
1243
  async loadFromFile(t) {
1248
- this._document = await Ot(t, this._reducer);
1244
+ this._document = await St(t, this._reducer);
1249
1245
  }
1250
1246
  /**
1251
1247
  * Loads the state of the document from a file and returns it.
@@ -1254,7 +1250,7 @@ class ei {
1254
1250
  * @returns The state of the document.
1255
1251
  */
1256
1252
  static async stateFromFile(t, i) {
1257
- return await Ot(t, i);
1253
+ return await St(t, i);
1258
1254
  }
1259
1255
  /**
1260
1256
  * Gets the current state of the document.
@@ -1375,10 +1371,10 @@ export {
1375
1371
  Ie as A,
1376
1372
  ei as B,
1377
1373
  Lt as C,
1378
- Oe as D,
1374
+ Se as D,
1379
1375
  We as E,
1380
- ke as a,
1381
- _e as b,
1376
+ _e as a,
1377
+ ke as b,
1382
1378
  Te as c,
1383
1379
  Xe as d,
1384
1380
  Fe as e,
@@ -1388,7 +1384,7 @@ export {
1388
1384
  jt as i,
1389
1385
  Ne as j,
1390
1386
  Wt as k,
1391
- Ot as l,
1387
+ St as l,
1392
1388
  ti as m,
1393
1389
  Ye as n,
1394
1390
  xt as o,