document-model 1.0.14 → 1.0.16

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 (53) hide show
  1. package/dist/browser/document/actions/creators.d.ts +1 -1
  2. package/dist/browser/document/actions/index.d.ts +8 -8
  3. package/dist/browser/document/object.d.ts +123 -99
  4. package/dist/browser/document/reducer.d.ts +1 -1
  5. package/dist/browser/document/schema/types.d.ts +5 -0
  6. package/dist/browser/document/schema/zod.d.ts +15 -0
  7. package/dist/browser/document/signal.d.ts +3 -2
  8. package/dist/browser/document/types.d.ts +36 -27
  9. package/dist/browser/document/utils/base.d.ts +5 -5
  10. package/dist/browser/document/utils/file.d.ts +2 -2
  11. package/dist/browser/document-model/gen/reducer.d.ts +1 -1
  12. package/dist/browser/document-model/gen/schema/types.d.ts +5 -2
  13. package/dist/browser/document-model/index.d.ts +8 -8
  14. package/dist/browser/document-model.cjs +1 -1
  15. package/dist/browser/document-model.js +2 -2
  16. package/dist/browser/document.cjs +1 -1
  17. package/dist/browser/document.js +2 -2
  18. package/dist/browser/index.cjs +1 -1
  19. package/dist/browser/index.js +3 -3
  20. package/dist/browser/internal/{index-8142b58e.js → index-37753e74.js} +1 -1
  21. package/dist/{node/internal/index-0b0cb8c2.js → browser/internal/index-9b4d67fc.js} +1 -1
  22. package/dist/browser/internal/{index-cbe39f72.js → index-a5150e7e.js} +1 -1
  23. package/dist/{node/internal/index-c9d178be.js → browser/internal/index-f5587600.js} +1 -1
  24. package/dist/browser/internal/{object-4ec03a36.js → object-17aee7a9.js} +693 -659
  25. package/dist/browser/internal/object-28a1a8bf.js +6 -0
  26. package/dist/node/document/actions/creators.d.ts +1 -1
  27. package/dist/node/document/actions/index.d.ts +8 -8
  28. package/dist/node/document/object.d.ts +123 -99
  29. package/dist/node/document/reducer.d.ts +1 -1
  30. package/dist/node/document/schema/types.d.ts +5 -0
  31. package/dist/node/document/schema/zod.d.ts +15 -0
  32. package/dist/node/document/signal.d.ts +3 -2
  33. package/dist/node/document/types.d.ts +36 -27
  34. package/dist/node/document/utils/base.d.ts +5 -5
  35. package/dist/node/document/utils/file.d.ts +2 -2
  36. package/dist/node/document-model/gen/reducer.d.ts +1 -1
  37. package/dist/node/document-model/gen/schema/types.d.ts +5 -2
  38. package/dist/node/document-model/index.d.ts +8 -8
  39. package/dist/node/document-model.cjs +1 -1
  40. package/dist/node/document-model.js +2 -2
  41. package/dist/node/document.cjs +1 -1
  42. package/dist/node/document.js +2 -2
  43. package/dist/node/index.cjs +1 -1
  44. package/dist/node/index.js +3 -3
  45. package/dist/{browser/internal/index-cb990484.js → node/internal/index-0e7af6c6.js} +1 -1
  46. package/dist/{browser/internal/index-9f1cf811.js → node/internal/index-124bda95.js} +1 -1
  47. package/dist/node/internal/{index-63db4708.js → index-417115f1.js} +1 -1
  48. package/dist/node/internal/{index-0c87fbed.js → index-9037f83a.js} +1 -1
  49. package/dist/node/internal/object-f3dd289e.js +1 -0
  50. package/dist/node/internal/{object-89d9b82f.js → object-f7cd4777.js} +369 -337
  51. package/package.json +3 -3
  52. package/dist/browser/internal/object-5f03095e.js +0 -6
  53. package/dist/node/internal/object-397a9b23.js +0 -1
@@ -1,19 +1,19 @@
1
- var xr = Object.defineProperty;
2
- var dr = (n, a, s) => a in n ? xr(n, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[a] = s;
3
- var q = (n, a, s) => (dr(n, typeof a != "symbol" ? a + "" : a, s), s);
1
+ var gr = Object.defineProperty;
2
+ var dr = (e, a, s) => a in e ? gr(e, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[a] = s;
3
+ var q = (e, a, s) => (dr(e, typeof a != "symbol" ? a + "" : a, s), s);
4
4
  import wr from "json-stringify-deterministic";
5
- import { produce as Et, castDraft as yr, castImmutable as gr, freeze as vr } from "immer";
6
- import Ft from "jszip";
7
- import { z as d } from "zod";
8
- const At = (n) => n != null, Er = d.any().refine((n) => At(n)), Bt = d.enum(["LOAD_STATE"]), St = d.enum(["PRUNE"]), jt = d.enum(["REDO"]), Ut = d.enum(["SET_NAME"]), It = d.enum(["UNDO"]);
9
- function br() {
10
- return d.object({
11
- __typename: d.literal("Action").optional(),
12
- type: d.string()
5
+ import { produce as bt, castDraft as yr, castImmutable as vr, freeze as br } from "immer";
6
+ import At from "jszip";
7
+ import { z as g } from "zod";
8
+ const Bt = (e) => e != null, Er = g.any().refine((e) => Bt(e)), St = g.enum(["LOAD_STATE"]), jt = g.enum(["PRUNE"]), Ut = g.enum(["REDO"]), It = g.enum(["SET_NAME"]), kt = g.enum(["UNDO"]);
9
+ function _r() {
10
+ return g.object({
11
+ __typename: g.literal("Action").optional(),
12
+ type: g.string()
13
13
  });
14
14
  }
15
- function kt() {
16
- return d.union([
15
+ function Tt() {
16
+ return g.union([
17
17
  it(),
18
18
  et(),
19
19
  nt(),
@@ -21,122 +21,127 @@ function kt() {
21
21
  ot()
22
22
  ]);
23
23
  }
24
- function _r() {
25
- return d.object({
26
- __typename: d.literal("DocumentFile").optional(),
27
- data: d.string(),
28
- extension: d.string().nullable(),
29
- fileName: d.string().nullable(),
30
- mimeType: d.string()
24
+ function Fr() {
25
+ return g.object({
26
+ __typename: g.literal("DocumentFile").optional(),
27
+ data: g.string(),
28
+ extension: g.string().nullable(),
29
+ fileName: g.string().nullable(),
30
+ mimeType: g.string()
31
31
  });
32
32
  }
33
33
  function it() {
34
- return d.object({
35
- input: d.lazy(() => Tt()),
36
- type: Bt
34
+ return g.object({
35
+ input: g.lazy(() => Dt()),
36
+ type: St,
37
+ scope: g.literal("global")
37
38
  });
38
39
  }
39
- function Tt() {
40
- return d.object({
41
- operations: d.number(),
42
- state: d.lazy(() => Dt())
40
+ function Dt() {
41
+ return g.object({
42
+ operations: g.number(),
43
+ state: g.lazy(() => Ot())
43
44
  });
44
45
  }
45
- function Dt() {
46
- return d.object({
47
- data: d.unknown().nullish(),
48
- name: d.string()
46
+ function Ot() {
47
+ return g.object({
48
+ data: g.unknown().nullish(),
49
+ name: g.string()
49
50
  });
50
51
  }
51
- function Fr() {
52
- return d.object({
53
- __typename: d.literal("Operation").optional(),
54
- hash: d.string(),
55
- index: d.number(),
56
- timestamp: d.string().datetime(),
57
- type: d.string()
52
+ function Ar() {
53
+ return g.object({
54
+ __typename: g.literal("Operation").optional(),
55
+ hash: g.string(),
56
+ index: g.number(),
57
+ timestamp: g.string().datetime(),
58
+ type: g.string()
58
59
  });
59
60
  }
60
61
  function et() {
61
- return d.object({
62
- input: d.lazy(() => Ot()),
63
- type: St
62
+ return g.object({
63
+ input: g.lazy(() => Nt()),
64
+ type: jt,
65
+ scope: g.literal("global")
64
66
  });
65
67
  }
66
- function Ot() {
67
- return d.object({
68
- end: d.number().nullish(),
69
- start: d.number().nullish()
68
+ function Nt() {
69
+ return g.object({
70
+ end: g.number().nullish(),
71
+ start: g.number().nullish()
70
72
  });
71
73
  }
72
74
  function nt() {
73
- return d.object({
74
- input: d.number(),
75
- type: jt
75
+ return g.object({
76
+ input: g.number(),
77
+ type: Ut,
78
+ scope: g.literal("global")
76
79
  });
77
80
  }
78
81
  function at() {
79
- return d.object({
80
- input: d.string(),
81
- type: Ut
82
+ return g.object({
83
+ input: g.string(),
84
+ type: It,
85
+ scope: g.literal("global")
82
86
  });
83
87
  }
84
- function Ar() {
85
- return d.object({
86
- __typename: d.literal("SetNameOperation").optional(),
87
- hash: d.string(),
88
- index: d.number(),
89
- input: d.string(),
90
- timestamp: d.string().datetime(),
91
- type: d.string()
88
+ function Br() {
89
+ return g.object({
90
+ __typename: g.literal("SetNameOperation").optional(),
91
+ hash: g.string(),
92
+ index: g.number(),
93
+ input: g.string(),
94
+ timestamp: g.string().datetime(),
95
+ type: g.string()
92
96
  });
93
97
  }
94
98
  function ot() {
95
- return d.object({
96
- input: d.number(),
97
- type: It
99
+ return g.object({
100
+ input: g.number(),
101
+ type: kt,
102
+ scope: g.literal("global")
98
103
  });
99
104
  }
100
105
  const Fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
106
  __proto__: null,
102
- ActionSchema: br,
103
- BaseActionSchema: kt,
104
- DocumentFileSchema: _r,
105
- LoadStateActionInputSchema: Tt,
107
+ ActionSchema: _r,
108
+ BaseActionSchema: Tt,
109
+ DocumentFileSchema: Fr,
110
+ LoadStateActionInputSchema: Dt,
106
111
  LoadStateActionSchema: it,
107
- LoadStateActionStateInputSchema: Dt,
108
- Load_StateSchema: Bt,
109
- OperationSchema: Fr,
110
- PruneActionInputSchema: Ot,
112
+ LoadStateActionStateInputSchema: Ot,
113
+ Load_StateSchema: St,
114
+ OperationSchema: Ar,
115
+ PruneActionInputSchema: Nt,
111
116
  PruneActionSchema: et,
112
- PruneSchema: St,
117
+ PruneSchema: jt,
113
118
  RedoActionSchema: nt,
114
- RedoSchema: jt,
119
+ RedoSchema: Ut,
115
120
  SetNameActionSchema: at,
116
- SetNameOperationSchema: Ar,
117
- Set_NameSchema: Ut,
121
+ SetNameOperationSchema: Br,
122
+ Set_NameSchema: It,
118
123
  UndoActionSchema: ot,
119
- UndoSchema: It,
124
+ UndoSchema: kt,
120
125
  definedNonNullAnySchema: Er,
121
- isDefinedNonNullAny: At
126
+ isDefinedNonNullAny: Bt
122
127
  }, Symbol.toStringTag, { value: "Module" }));
123
- function Nt(n) {
124
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
128
+ function Mt(e) {
129
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
125
130
  }
126
131
  function P() {
127
132
  this._types = /* @__PURE__ */ Object.create(null), this._extensions = /* @__PURE__ */ Object.create(null);
128
- for (let n = 0; n < arguments.length; n++)
129
- this.define(arguments[n]);
133
+ for (let e = 0; e < arguments.length; e++)
134
+ this.define(arguments[e]);
130
135
  this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
131
136
  }
132
- P.prototype.define = function(n, a) {
133
- for (let s in n) {
134
- let c = n[s].map(function(f) {
137
+ P.prototype.define = function(e, a) {
138
+ for (let s in e) {
139
+ let l = e[s].map(function(f) {
135
140
  return f.toLowerCase();
136
141
  });
137
142
  s = s.toLowerCase();
138
- for (let f = 0; f < c.length; f++) {
139
- const h = c[f];
143
+ for (let f = 0; f < l.length; f++) {
144
+ const h = l[f];
140
145
  if (h[0] !== "*") {
141
146
  if (!a && h in this._types)
142
147
  throw new Error(
@@ -146,23 +151,23 @@ P.prototype.define = function(n, a) {
146
151
  }
147
152
  }
148
153
  if (a || !this._extensions[s]) {
149
- const f = c[0];
154
+ const f = l[0];
150
155
  this._extensions[s] = f[0] !== "*" ? f : f.substr(1);
151
156
  }
152
157
  }
153
158
  };
154
- P.prototype.getType = function(n) {
155
- n = String(n);
156
- let a = n.replace(/^.*[/\\]/, "").toLowerCase(), s = a.replace(/^.*\./, "").toLowerCase(), c = a.length < n.length;
157
- return (s.length < a.length - 1 || !c) && this._types[s] || null;
159
+ P.prototype.getType = function(e) {
160
+ e = String(e);
161
+ let a = e.replace(/^.*[/\\]/, "").toLowerCase(), s = a.replace(/^.*\./, "").toLowerCase(), l = a.length < e.length;
162
+ return (s.length < a.length - 1 || !l) && this._types[s] || null;
158
163
  };
159
- P.prototype.getExtension = function(n) {
160
- return n = /^\s*([^;\s]*)/.test(n) && RegExp.$1, n && this._extensions[n.toLowerCase()] || null;
164
+ P.prototype.getExtension = function(e) {
165
+ return e = /^\s*([^;\s]*)/.test(e) && RegExp.$1, e && this._extensions[e.toLowerCase()] || null;
161
166
  };
162
- var Br = P, Sr = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "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/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/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "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", "mjs"], "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/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": ["mp4s", "m4p"], "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-signature": ["asc", "sig"], "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/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/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/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/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/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "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"], "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/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "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/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "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/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"] };
163
- let jr = Br;
164
- var Ur = new jr(Sr);
165
- const Ir = /* @__PURE__ */ Nt(Ur);
167
+ var Sr = P, jr = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "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/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/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "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", "mjs"], "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/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": ["mp4s", "m4p"], "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-signature": ["asc", "sig"], "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/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/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/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/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/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "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"], "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/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "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/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "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/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"] };
168
+ let Ur = Sr;
169
+ var Ir = new Ur(jr);
170
+ const kr = /* @__PURE__ */ Mt(Ir);
166
171
  var tt = { exports: {} };
167
172
  typeof Object.create == "function" ? tt.exports = function(a, s) {
168
173
  s && (a.super_ = s, a.prototype = Object.create(s.prototype, {
@@ -176,83 +181,83 @@ typeof Object.create == "function" ? tt.exports = function(a, s) {
176
181
  } : tt.exports = function(a, s) {
177
182
  if (s) {
178
183
  a.super_ = s;
179
- var c = function() {
184
+ var l = function() {
180
185
  };
181
- c.prototype = s.prototype, a.prototype = new c(), a.prototype.constructor = a;
186
+ l.prototype = s.prototype, a.prototype = new l(), a.prototype.constructor = a;
182
187
  }
183
188
  };
184
- var kr = tt.exports, rt = { exports: {} }, Mt = {}, W = {};
185
- W.byteLength = Or;
186
- W.toByteArray = Mr;
187
- W.fromByteArray = Lr;
188
- var k = [], j = [], Tr = typeof Uint8Array < "u" ? Uint8Array : Array, Q = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
189
- for (var D = 0, Dr = Q.length; D < Dr; ++D)
189
+ var Tr = tt.exports, rt = { exports: {} }, Ct = {}, W = {};
190
+ W.byteLength = Nr;
191
+ W.toByteArray = Cr;
192
+ W.fromByteArray = zr;
193
+ var k = [], j = [], Dr = typeof Uint8Array < "u" ? Uint8Array : Array, Q = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
194
+ for (var D = 0, Or = Q.length; D < Or; ++D)
190
195
  k[D] = Q[D], j[Q.charCodeAt(D)] = D;
191
196
  j["-".charCodeAt(0)] = 62;
192
197
  j["_".charCodeAt(0)] = 63;
193
- function Ct(n) {
194
- var a = n.length;
198
+ function Rt(e) {
199
+ var a = e.length;
195
200
  if (a % 4 > 0)
196
201
  throw new Error("Invalid string. Length must be a multiple of 4");
197
- var s = n.indexOf("=");
202
+ var s = e.indexOf("=");
198
203
  s === -1 && (s = a);
199
- var c = s === a ? 0 : 4 - s % 4;
200
- return [s, c];
204
+ var l = s === a ? 0 : 4 - s % 4;
205
+ return [s, l];
201
206
  }
202
- function Or(n) {
203
- var a = Ct(n), s = a[0], c = a[1];
204
- return (s + c) * 3 / 4 - c;
207
+ function Nr(e) {
208
+ var a = Rt(e), s = a[0], l = a[1];
209
+ return (s + l) * 3 / 4 - l;
205
210
  }
206
- function Nr(n, a, s) {
211
+ function Mr(e, a, s) {
207
212
  return (a + s) * 3 / 4 - s;
208
213
  }
209
- function Mr(n) {
210
- var a, s = Ct(n), c = s[0], f = s[1], h = new Tr(Nr(n, c, f)), u = 0, o = f > 0 ? c - 4 : c, x;
214
+ function Cr(e) {
215
+ var a, s = Rt(e), l = s[0], f = s[1], h = new Dr(Mr(e, l, f)), u = 0, o = f > 0 ? l - 4 : l, x;
211
216
  for (x = 0; x < o; x += 4)
212
- a = j[n.charCodeAt(x)] << 18 | j[n.charCodeAt(x + 1)] << 12 | j[n.charCodeAt(x + 2)] << 6 | j[n.charCodeAt(x + 3)], h[u++] = a >> 16 & 255, h[u++] = a >> 8 & 255, h[u++] = a & 255;
213
- return f === 2 && (a = j[n.charCodeAt(x)] << 2 | j[n.charCodeAt(x + 1)] >> 4, h[u++] = a & 255), f === 1 && (a = j[n.charCodeAt(x)] << 10 | j[n.charCodeAt(x + 1)] << 4 | j[n.charCodeAt(x + 2)] >> 2, h[u++] = a >> 8 & 255, h[u++] = a & 255), h;
217
+ a = j[e.charCodeAt(x)] << 18 | j[e.charCodeAt(x + 1)] << 12 | j[e.charCodeAt(x + 2)] << 6 | j[e.charCodeAt(x + 3)], h[u++] = a >> 16 & 255, h[u++] = a >> 8 & 255, h[u++] = a & 255;
218
+ return f === 2 && (a = j[e.charCodeAt(x)] << 2 | j[e.charCodeAt(x + 1)] >> 4, h[u++] = a & 255), f === 1 && (a = j[e.charCodeAt(x)] << 10 | j[e.charCodeAt(x + 1)] << 4 | j[e.charCodeAt(x + 2)] >> 2, h[u++] = a >> 8 & 255, h[u++] = a & 255), h;
214
219
  }
215
- function Cr(n) {
216
- return k[n >> 18 & 63] + k[n >> 12 & 63] + k[n >> 6 & 63] + k[n & 63];
220
+ function Rr(e) {
221
+ return k[e >> 18 & 63] + k[e >> 12 & 63] + k[e >> 6 & 63] + k[e & 63];
217
222
  }
218
- function Rr(n, a, s) {
219
- for (var c, f = [], h = a; h < s; h += 3)
220
- c = (n[h] << 16 & 16711680) + (n[h + 1] << 8 & 65280) + (n[h + 2] & 255), f.push(Cr(c));
223
+ function Lr(e, a, s) {
224
+ for (var l, f = [], h = a; h < s; h += 3)
225
+ l = (e[h] << 16 & 16711680) + (e[h + 1] << 8 & 65280) + (e[h + 2] & 255), f.push(Rr(l));
221
226
  return f.join("");
222
227
  }
223
- function Lr(n) {
224
- for (var a, s = n.length, c = s % 3, f = [], h = 16383, u = 0, o = s - c; u < o; u += h)
225
- f.push(Rr(n, u, u + h > o ? o : u + h));
226
- return c === 1 ? (a = n[s - 1], f.push(
228
+ function zr(e) {
229
+ for (var a, s = e.length, l = s % 3, f = [], h = 16383, u = 0, o = s - l; u < o; u += h)
230
+ f.push(Lr(e, u, u + h > o ? o : u + h));
231
+ return l === 1 ? (a = e[s - 1], f.push(
227
232
  k[a >> 2] + k[a << 4 & 63] + "=="
228
- )) : c === 2 && (a = (n[s - 2] << 8) + n[s - 1], f.push(
233
+ )) : l === 2 && (a = (e[s - 2] << 8) + e[s - 1], f.push(
229
234
  k[a >> 10] + k[a >> 4 & 63] + k[a << 2 & 63] + "="
230
235
  )), f.join("");
231
236
  }
232
237
  var pt = {};
233
238
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
234
- pt.read = function(n, a, s, c, f) {
235
- var h, u, o = f * 8 - c - 1, x = (1 << o) - 1, y = x >> 1, v = -7, _ = s ? f - 1 : 0, U = s ? -1 : 1, B = n[a + _];
236
- for (_ += U, h = B & (1 << -v) - 1, B >>= -v, v += o; v > 0; h = h * 256 + n[a + _], _ += U, v -= 8)
239
+ pt.read = function(e, a, s, l, f) {
240
+ var h, u, o = f * 8 - l - 1, x = (1 << o) - 1, w = x >> 1, y = -7, _ = s ? f - 1 : 0, U = s ? -1 : 1, B = e[a + _];
241
+ for (_ += U, h = B & (1 << -y) - 1, B >>= -y, y += o; y > 0; h = h * 256 + e[a + _], _ += U, y -= 8)
237
242
  ;
238
- for (u = h & (1 << -v) - 1, h >>= -v, v += c; v > 0; u = u * 256 + n[a + _], _ += U, v -= 8)
243
+ for (u = h & (1 << -y) - 1, h >>= -y, y += l; y > 0; u = u * 256 + e[a + _], _ += U, y -= 8)
239
244
  ;
240
245
  if (h === 0)
241
- h = 1 - y;
246
+ h = 1 - w;
242
247
  else {
243
248
  if (h === x)
244
249
  return u ? NaN : (B ? -1 : 1) * (1 / 0);
245
- u = u + Math.pow(2, c), h = h - y;
250
+ u = u + Math.pow(2, l), h = h - w;
246
251
  }
247
- return (B ? -1 : 1) * u * Math.pow(2, h - c);
252
+ return (B ? -1 : 1) * u * Math.pow(2, h - l);
248
253
  };
249
- pt.write = function(n, a, s, c, f, h) {
250
- var u, o, x, y = h * 8 - f - 1, v = (1 << y) - 1, _ = v >> 1, U = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, B = c ? 0 : h - 1, O = c ? 1 : -1, N = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
251
- for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (o = isNaN(a) ? 1 : 0, u = v) : (u = Math.floor(Math.log(a) / Math.LN2), a * (x = Math.pow(2, -u)) < 1 && (u--, x *= 2), u + _ >= 1 ? a += U / x : a += U * Math.pow(2, 1 - _), a * x >= 2 && (u++, x /= 2), u + _ >= v ? (o = 0, u = v) : u + _ >= 1 ? (o = (a * x - 1) * Math.pow(2, f), u = u + _) : (o = a * Math.pow(2, _ - 1) * Math.pow(2, f), u = 0)); f >= 8; n[s + B] = o & 255, B += O, o /= 256, f -= 8)
254
+ pt.write = function(e, a, s, l, f, h) {
255
+ var u, o, x, w = h * 8 - f - 1, y = (1 << w) - 1, _ = y >> 1, U = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, B = l ? 0 : h - 1, O = l ? 1 : -1, N = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
256
+ for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (o = isNaN(a) ? 1 : 0, u = y) : (u = Math.floor(Math.log(a) / Math.LN2), a * (x = Math.pow(2, -u)) < 1 && (u--, x *= 2), u + _ >= 1 ? a += U / x : a += U * Math.pow(2, 1 - _), a * x >= 2 && (u++, x /= 2), u + _ >= y ? (o = 0, u = y) : u + _ >= 1 ? (o = (a * x - 1) * Math.pow(2, f), u = u + _) : (o = a * Math.pow(2, _ - 1) * Math.pow(2, f), u = 0)); f >= 8; e[s + B] = o & 255, B += O, o /= 256, f -= 8)
252
257
  ;
253
- for (u = u << f | o, y += f; y > 0; n[s + B] = u & 255, B += O, u /= 256, y -= 8)
258
+ for (u = u << f | o, w += f; w > 0; e[s + B] = u & 255, B += O, u /= 256, w -= 8)
254
259
  ;
255
- n[s + B - O] |= N * 128;
260
+ e[s + B - O] |= N * 128;
256
261
  };
257
262
  /*!
258
263
  * The buffer module from node.js, for the browser.
@@ -260,11 +265,11 @@ pt.write = function(n, a, s, c, f, h) {
260
265
  * @author Feross Aboukhadijeh <https://feross.org>
261
266
  * @license MIT
262
267
  */
263
- (function(n) {
264
- var a = W, s = pt, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
265
- n.Buffer = o, n.SlowBuffer = Gt, n.INSPECT_MAX_BYTES = 50;
268
+ (function(e) {
269
+ var a = W, s = pt, l = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
270
+ e.Buffer = o, e.SlowBuffer = Vt, e.INSPECT_MAX_BYTES = 50;
266
271
  var f = 2147483647;
267
- n.kMaxLength = f, o.TYPED_ARRAY_SUPPORT = h(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
272
+ e.kMaxLength = f, o.TYPED_ARRAY_SUPPORT = h(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
268
273
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
269
274
  );
270
275
  function h() {
@@ -322,10 +327,10 @@ pt.write = function(n, a, s, c, f, h) {
322
327
  throw new TypeError(
323
328
  'The "value" argument must not be of type number. Received type number'
324
329
  );
325
- var e = i.valueOf && i.valueOf();
326
- if (e != null && e !== i)
327
- return o.from(e, t, r);
328
- var p = Xt(i);
330
+ var n = i.valueOf && i.valueOf();
331
+ if (n != null && n !== i)
332
+ return o.from(n, t, r);
333
+ var p = Gt(i);
329
334
  if (p)
330
335
  return p;
331
336
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
@@ -341,20 +346,20 @@ pt.write = function(n, a, s, c, f, h) {
341
346
  o.from = function(i, t, r) {
342
347
  return x(i, t, r);
343
348
  }, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
344
- function y(i) {
349
+ function w(i) {
345
350
  if (typeof i != "number")
346
351
  throw new TypeError('"size" argument must be of type number');
347
352
  if (i < 0)
348
353
  throw new RangeError('The value "' + i + '" is invalid for option "size"');
349
354
  }
350
- function v(i, t, r) {
351
- return y(i), i <= 0 ? u(i) : t !== void 0 ? typeof r == "string" ? u(i).fill(t, r) : u(i).fill(t) : u(i);
355
+ function y(i, t, r) {
356
+ return w(i), i <= 0 ? u(i) : t !== void 0 ? typeof r == "string" ? u(i).fill(t, r) : u(i).fill(t) : u(i);
352
357
  }
353
358
  o.alloc = function(i, t, r) {
354
- return v(i, t, r);
359
+ return y(i, t, r);
355
360
  };
356
361
  function _(i) {
357
- return y(i), u(i < 0 ? 0 : X(i) | 0);
362
+ return w(i), u(i < 0 ? 0 : X(i) | 0);
358
363
  }
359
364
  o.allocUnsafe = function(i) {
360
365
  return _(i);
@@ -364,12 +369,12 @@ pt.write = function(n, a, s, c, f, h) {
364
369
  function U(i, t) {
365
370
  if ((typeof t != "string" || t === "") && (t = "utf8"), !o.isEncoding(t))
366
371
  throw new TypeError("Unknown encoding: " + t);
367
- var r = lt(i, t) | 0, e = u(r), p = e.write(i, t);
368
- return p !== r && (e = e.slice(0, p)), e;
372
+ var r = ct(i, t) | 0, n = u(r), p = n.write(i, t);
373
+ return p !== r && (n = n.slice(0, p)), n;
369
374
  }
370
375
  function B(i) {
371
- for (var t = i.length < 0 ? 0 : X(i.length) | 0, r = u(t), e = 0; e < t; e += 1)
372
- r[e] = i[e] & 255;
376
+ for (var t = i.length < 0 ? 0 : X(i.length) | 0, r = u(t), n = 0; n < t; n += 1)
377
+ r[n] = i[n] & 255;
373
378
  return r;
374
379
  }
375
380
  function O(i) {
@@ -384,10 +389,10 @@ pt.write = function(n, a, s, c, f, h) {
384
389
  throw new RangeError('"offset" is outside of buffer bounds');
385
390
  if (i.byteLength < t + (r || 0))
386
391
  throw new RangeError('"length" is outside of buffer bounds');
387
- var e;
388
- return t === void 0 && r === void 0 ? e = new Uint8Array(i) : r === void 0 ? e = new Uint8Array(i, t) : e = new Uint8Array(i, t, r), Object.setPrototypeOf(e, o.prototype), e;
392
+ var n;
393
+ return t === void 0 && r === void 0 ? n = new Uint8Array(i) : r === void 0 ? n = new Uint8Array(i, t) : n = new Uint8Array(i, t, r), Object.setPrototypeOf(n, o.prototype), n;
389
394
  }
390
- function Xt(i) {
395
+ function Gt(i) {
391
396
  if (o.isBuffer(i)) {
392
397
  var t = X(i.length) | 0, r = u(t);
393
398
  return r.length === 0 || i.copy(r, 0, 0, t), r;
@@ -402,7 +407,7 @@ pt.write = function(n, a, s, c, f, h) {
402
407
  throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
403
408
  return i | 0;
404
409
  }
405
- function Gt(i) {
410
+ function Vt(i) {
406
411
  return +i != i && (i = 0), o.alloc(+i);
407
412
  }
408
413
  o.isBuffer = function(t) {
@@ -414,12 +419,12 @@ pt.write = function(n, a, s, c, f, h) {
414
419
  );
415
420
  if (t === r)
416
421
  return 0;
417
- for (var e = t.length, p = r.length, l = 0, m = Math.min(e, p); l < m; ++l)
418
- if (t[l] !== r[l]) {
419
- e = t[l], p = r[l];
422
+ for (var n = t.length, p = r.length, c = 0, m = Math.min(n, p); c < m; ++c)
423
+ if (t[c] !== r[c]) {
424
+ n = t[c], p = r[c];
420
425
  break;
421
426
  }
422
- return e < p ? -1 : p < e ? 1 : 0;
427
+ return n < p ? -1 : p < n ? 1 : 0;
423
428
  }, o.isEncoding = function(t) {
424
429
  switch (String(t).toLowerCase()) {
425
430
  case "hex":
@@ -442,28 +447,28 @@ pt.write = function(n, a, s, c, f, h) {
442
447
  throw new TypeError('"list" argument must be an Array of Buffers');
443
448
  if (t.length === 0)
444
449
  return o.alloc(0);
445
- var e;
450
+ var n;
446
451
  if (r === void 0)
447
- for (r = 0, e = 0; e < t.length; ++e)
448
- r += t[e].length;
449
- var p = o.allocUnsafe(r), l = 0;
450
- for (e = 0; e < t.length; ++e) {
451
- var m = t[e];
452
+ for (r = 0, n = 0; n < t.length; ++n)
453
+ r += t[n].length;
454
+ var p = o.allocUnsafe(r), c = 0;
455
+ for (n = 0; n < t.length; ++n) {
456
+ var m = t[n];
452
457
  if (I(m, Uint8Array))
453
- l + m.length > p.length ? o.from(m).copy(p, l) : Uint8Array.prototype.set.call(
458
+ c + m.length > p.length ? o.from(m).copy(p, c) : Uint8Array.prototype.set.call(
454
459
  p,
455
460
  m,
456
- l
461
+ c
457
462
  );
458
463
  else if (o.isBuffer(m))
459
- m.copy(p, l);
464
+ m.copy(p, c);
460
465
  else
461
466
  throw new TypeError('"list" argument must be an Array of Buffers');
462
- l += m.length;
467
+ c += m.length;
463
468
  }
464
469
  return p;
465
470
  };
466
- function lt(i, t) {
471
+ function ct(i, t) {
467
472
  if (o.isBuffer(i))
468
473
  return i.length;
469
474
  if (ArrayBuffer.isView(i) || I(i, ArrayBuffer))
@@ -472,8 +477,8 @@ pt.write = function(n, a, s, c, f, h) {
472
477
  throw new TypeError(
473
478
  'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
474
479
  );
475
- var r = i.length, e = arguments.length > 2 && arguments[2] === !0;
476
- if (!e && r === 0)
480
+ var r = i.length, n = arguments.length > 2 && arguments[2] === !0;
481
+ if (!n && r === 0)
477
482
  return 0;
478
483
  for (var p = !1; ; )
479
484
  switch (t) {
@@ -492,47 +497,47 @@ pt.write = function(n, a, s, c, f, h) {
492
497
  case "hex":
493
498
  return r >>> 1;
494
499
  case "base64":
495
- return yt(i).length;
500
+ return wt(i).length;
496
501
  default:
497
502
  if (p)
498
- return e ? -1 : G(i).length;
503
+ return n ? -1 : G(i).length;
499
504
  t = ("" + t).toLowerCase(), p = !0;
500
505
  }
501
506
  }
502
- o.byteLength = lt;
503
- function Vt(i, t, r) {
504
- var e = !1;
507
+ o.byteLength = ct;
508
+ function Qt(i, t, r) {
509
+ var n = !1;
505
510
  if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, t >>>= 0, r <= t))
506
511
  return "";
507
512
  for (i || (i = "utf8"); ; )
508
513
  switch (i) {
509
514
  case "hex":
510
- return sr(this, t, r);
515
+ return lr(this, t, r);
511
516
  case "utf8":
512
517
  case "utf-8":
513
518
  return ht(this, t, r);
514
519
  case "ascii":
515
- return or(this, t, r);
520
+ return pr(this, t, r);
516
521
  case "latin1":
517
522
  case "binary":
518
- return pr(this, t, r);
523
+ return sr(this, t, r);
519
524
  case "base64":
520
- return nr(this, t, r);
525
+ return ar(this, t, r);
521
526
  case "ucs2":
522
527
  case "ucs-2":
523
528
  case "utf16le":
524
529
  case "utf-16le":
525
530
  return cr(this, t, r);
526
531
  default:
527
- if (e)
532
+ if (n)
528
533
  throw new TypeError("Unknown encoding: " + i);
529
- i = (i + "").toLowerCase(), e = !0;
534
+ i = (i + "").toLowerCase(), n = !0;
530
535
  }
531
536
  }
532
537
  o.prototype._isBuffer = !0;
533
538
  function T(i, t, r) {
534
- var e = i[t];
535
- i[t] = i[r], i[r] = e;
539
+ var n = i[t];
540
+ i[t] = i[r], i[r] = n;
536
541
  }
537
542
  o.prototype.swap16 = function() {
538
543
  var t = this.length;
@@ -557,40 +562,40 @@ pt.write = function(n, a, s, c, f, h) {
557
562
  return this;
558
563
  }, o.prototype.toString = function() {
559
564
  var t = this.length;
560
- return t === 0 ? "" : arguments.length === 0 ? ht(this, 0, t) : Vt.apply(this, arguments);
565
+ return t === 0 ? "" : arguments.length === 0 ? ht(this, 0, t) : Qt.apply(this, arguments);
561
566
  }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(t) {
562
567
  if (!o.isBuffer(t))
563
568
  throw new TypeError("Argument must be a Buffer");
564
569
  return this === t ? !0 : o.compare(this, t) === 0;
565
570
  }, o.prototype.inspect = function() {
566
- var t = "", r = n.INSPECT_MAX_BYTES;
571
+ var t = "", r = e.INSPECT_MAX_BYTES;
567
572
  return t = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (t += " ... "), "<Buffer " + t + ">";
568
- }, c && (o.prototype[c] = o.prototype.inspect), o.prototype.compare = function(t, r, e, p, l) {
573
+ }, l && (o.prototype[l] = o.prototype.inspect), o.prototype.compare = function(t, r, n, p, c) {
569
574
  if (I(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(t))
570
575
  throw new TypeError(
571
576
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
572
577
  );
573
- if (r === void 0 && (r = 0), e === void 0 && (e = t ? t.length : 0), p === void 0 && (p = 0), l === void 0 && (l = this.length), r < 0 || e > t.length || p < 0 || l > this.length)
578
+ if (r === void 0 && (r = 0), n === void 0 && (n = t ? t.length : 0), p === void 0 && (p = 0), c === void 0 && (c = this.length), r < 0 || n > t.length || p < 0 || c > this.length)
574
579
  throw new RangeError("out of range index");
575
- if (p >= l && r >= e)
580
+ if (p >= c && r >= n)
576
581
  return 0;
577
- if (p >= l)
582
+ if (p >= c)
578
583
  return -1;
579
- if (r >= e)
584
+ if (r >= n)
580
585
  return 1;
581
- if (r >>>= 0, e >>>= 0, p >>>= 0, l >>>= 0, this === t)
586
+ if (r >>>= 0, n >>>= 0, p >>>= 0, c >>>= 0, this === t)
582
587
  return 0;
583
- for (var m = l - p, w = e - r, g = Math.min(m, w), E = this.slice(p, l), A = t.slice(r, e), b = 0; b < g; ++b)
584
- if (E[b] !== A[b]) {
585
- m = E[b], w = A[b];
588
+ for (var m = c - p, d = n - r, v = Math.min(m, d), b = this.slice(p, c), A = t.slice(r, n), E = 0; E < v; ++E)
589
+ if (b[E] !== A[E]) {
590
+ m = b[E], d = A[E];
586
591
  break;
587
592
  }
588
- return m < w ? -1 : w < m ? 1 : 0;
593
+ return m < d ? -1 : d < m ? 1 : 0;
589
594
  };
590
- function ut(i, t, r, e, p) {
595
+ function ut(i, t, r, n, p) {
591
596
  if (i.length === 0)
592
597
  return -1;
593
- if (typeof r == "string" ? (e = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, V(r) && (r = p ? 0 : i.length - 1), r < 0 && (r = i.length + r), r >= i.length) {
598
+ if (typeof r == "string" ? (n = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, V(r) && (r = p ? 0 : i.length - 1), r < 0 && (r = i.length + r), r >= i.length) {
594
599
  if (p)
595
600
  return -1;
596
601
  r = i.length - 1;
@@ -599,109 +604,109 @@ pt.write = function(n, a, s, c, f, h) {
599
604
  r = 0;
600
605
  else
601
606
  return -1;
602
- if (typeof t == "string" && (t = o.from(t, e)), o.isBuffer(t))
603
- return t.length === 0 ? -1 : ft(i, t, r, e, p);
607
+ if (typeof t == "string" && (t = o.from(t, n)), o.isBuffer(t))
608
+ return t.length === 0 ? -1 : ft(i, t, r, n, p);
604
609
  if (typeof t == "number")
605
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? p ? Uint8Array.prototype.indexOf.call(i, t, r) : Uint8Array.prototype.lastIndexOf.call(i, t, r) : ft(i, [t], r, e, p);
610
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? p ? Uint8Array.prototype.indexOf.call(i, t, r) : Uint8Array.prototype.lastIndexOf.call(i, t, r) : ft(i, [t], r, n, p);
606
611
  throw new TypeError("val must be string, number or Buffer");
607
612
  }
608
- function ft(i, t, r, e, p) {
609
- var l = 1, m = i.length, w = t.length;
610
- if (e !== void 0 && (e = String(e).toLowerCase(), e === "ucs2" || e === "ucs-2" || e === "utf16le" || e === "utf-16le")) {
613
+ function ft(i, t, r, n, p) {
614
+ var c = 1, m = i.length, d = t.length;
615
+ if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
611
616
  if (i.length < 2 || t.length < 2)
612
617
  return -1;
613
- l = 2, m /= 2, w /= 2, r /= 2;
618
+ c = 2, m /= 2, d /= 2, r /= 2;
614
619
  }
615
- function g(gt, vt) {
616
- return l === 1 ? gt[vt] : gt.readUInt16BE(vt * l);
620
+ function v(yt, vt) {
621
+ return c === 1 ? yt[vt] : yt.readUInt16BE(vt * c);
617
622
  }
618
- var E;
623
+ var b;
619
624
  if (p) {
620
625
  var A = -1;
621
- for (E = r; E < m; E++)
622
- if (g(i, E) === g(t, A === -1 ? 0 : E - A)) {
623
- if (A === -1 && (A = E), E - A + 1 === w)
624
- return A * l;
626
+ for (b = r; b < m; b++)
627
+ if (v(i, b) === v(t, A === -1 ? 0 : b - A)) {
628
+ if (A === -1 && (A = b), b - A + 1 === d)
629
+ return A * c;
625
630
  } else
626
- A !== -1 && (E -= E - A), A = -1;
631
+ A !== -1 && (b -= b - A), A = -1;
627
632
  } else
628
- for (r + w > m && (r = m - w), E = r; E >= 0; E--) {
629
- for (var b = !0, z = 0; z < w; z++)
630
- if (g(i, E + z) !== g(t, z)) {
631
- b = !1;
633
+ for (r + d > m && (r = m - d), b = r; b >= 0; b--) {
634
+ for (var E = !0, z = 0; z < d; z++)
635
+ if (v(i, b + z) !== v(t, z)) {
636
+ E = !1;
632
637
  break;
633
638
  }
634
- if (b)
635
- return E;
639
+ if (E)
640
+ return b;
636
641
  }
637
642
  return -1;
638
643
  }
639
- o.prototype.includes = function(t, r, e) {
640
- return this.indexOf(t, r, e) !== -1;
641
- }, o.prototype.indexOf = function(t, r, e) {
642
- return ut(this, t, r, e, !0);
643
- }, o.prototype.lastIndexOf = function(t, r, e) {
644
- return ut(this, t, r, e, !1);
644
+ o.prototype.includes = function(t, r, n) {
645
+ return this.indexOf(t, r, n) !== -1;
646
+ }, o.prototype.indexOf = function(t, r, n) {
647
+ return ut(this, t, r, n, !0);
648
+ }, o.prototype.lastIndexOf = function(t, r, n) {
649
+ return ut(this, t, r, n, !1);
645
650
  };
646
- function Qt(i, t, r, e) {
651
+ function tr(i, t, r, n) {
647
652
  r = Number(r) || 0;
648
653
  var p = i.length - r;
649
- e ? (e = Number(e), e > p && (e = p)) : e = p;
650
- var l = t.length;
651
- e > l / 2 && (e = l / 2);
652
- for (var m = 0; m < e; ++m) {
653
- var w = parseInt(t.substr(m * 2, 2), 16);
654
- if (V(w))
654
+ n ? (n = Number(n), n > p && (n = p)) : n = p;
655
+ var c = t.length;
656
+ n > c / 2 && (n = c / 2);
657
+ for (var m = 0; m < n; ++m) {
658
+ var d = parseInt(t.substr(m * 2, 2), 16);
659
+ if (V(d))
655
660
  return m;
656
- i[r + m] = w;
661
+ i[r + m] = d;
657
662
  }
658
663
  return m;
659
664
  }
660
- function tr(i, t, r, e) {
661
- return L(G(t, i.length - r), i, r, e);
665
+ function rr(i, t, r, n) {
666
+ return L(G(t, i.length - r), i, r, n);
662
667
  }
663
- function rr(i, t, r, e) {
664
- return L(fr(t), i, r, e);
668
+ function ir(i, t, r, n) {
669
+ return L(hr(t), i, r, n);
665
670
  }
666
- function ir(i, t, r, e) {
667
- return L(yt(t), i, r, e);
671
+ function er(i, t, r, n) {
672
+ return L(wt(t), i, r, n);
668
673
  }
669
- function er(i, t, r, e) {
670
- return L(hr(t, i.length - r), i, r, e);
674
+ function nr(i, t, r, n) {
675
+ return L(mr(t, i.length - r), i, r, n);
671
676
  }
672
- o.prototype.write = function(t, r, e, p) {
677
+ o.prototype.write = function(t, r, n, p) {
673
678
  if (r === void 0)
674
- p = "utf8", e = this.length, r = 0;
675
- else if (e === void 0 && typeof r == "string")
676
- p = r, e = this.length, r = 0;
679
+ p = "utf8", n = this.length, r = 0;
680
+ else if (n === void 0 && typeof r == "string")
681
+ p = r, n = this.length, r = 0;
677
682
  else if (isFinite(r))
678
- r = r >>> 0, isFinite(e) ? (e = e >>> 0, p === void 0 && (p = "utf8")) : (p = e, e = void 0);
683
+ r = r >>> 0, isFinite(n) ? (n = n >>> 0, p === void 0 && (p = "utf8")) : (p = n, n = void 0);
679
684
  else
680
685
  throw new Error(
681
686
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
682
687
  );
683
- var l = this.length - r;
684
- if ((e === void 0 || e > l) && (e = l), t.length > 0 && (e < 0 || r < 0) || r > this.length)
688
+ var c = this.length - r;
689
+ if ((n === void 0 || n > c) && (n = c), t.length > 0 && (n < 0 || r < 0) || r > this.length)
685
690
  throw new RangeError("Attempt to write outside buffer bounds");
686
691
  p || (p = "utf8");
687
692
  for (var m = !1; ; )
688
693
  switch (p) {
689
694
  case "hex":
690
- return Qt(this, t, r, e);
695
+ return tr(this, t, r, n);
691
696
  case "utf8":
692
697
  case "utf-8":
693
- return tr(this, t, r, e);
698
+ return rr(this, t, r, n);
694
699
  case "ascii":
695
700
  case "latin1":
696
701
  case "binary":
697
- return rr(this, t, r, e);
702
+ return ir(this, t, r, n);
698
703
  case "base64":
699
- return ir(this, t, r, e);
704
+ return er(this, t, r, n);
700
705
  case "ucs2":
701
706
  case "ucs-2":
702
707
  case "utf16le":
703
708
  case "utf-16le":
704
- return er(this, t, r, e);
709
+ return nr(this, t, r, n);
705
710
  default:
706
711
  if (m)
707
712
  throw new TypeError("Unknown encoding: " + p);
@@ -713,74 +718,74 @@ pt.write = function(n, a, s, c, f, h) {
713
718
  data: Array.prototype.slice.call(this._arr || this, 0)
714
719
  };
715
720
  };
716
- function nr(i, t, r) {
721
+ function ar(i, t, r) {
717
722
  return t === 0 && r === i.length ? a.fromByteArray(i) : a.fromByteArray(i.slice(t, r));
718
723
  }
719
724
  function ht(i, t, r) {
720
725
  r = Math.min(i.length, r);
721
- for (var e = [], p = t; p < r; ) {
722
- var l = i[p], m = null, w = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
723
- if (p + w <= r) {
724
- var g, E, A, b;
725
- switch (w) {
726
+ for (var n = [], p = t; p < r; ) {
727
+ var c = i[p], m = null, d = c > 239 ? 4 : c > 223 ? 3 : c > 191 ? 2 : 1;
728
+ if (p + d <= r) {
729
+ var v, b, A, E;
730
+ switch (d) {
726
731
  case 1:
727
- l < 128 && (m = l);
732
+ c < 128 && (m = c);
728
733
  break;
729
734
  case 2:
730
- g = i[p + 1], (g & 192) === 128 && (b = (l & 31) << 6 | g & 63, b > 127 && (m = b));
735
+ v = i[p + 1], (v & 192) === 128 && (E = (c & 31) << 6 | v & 63, E > 127 && (m = E));
731
736
  break;
732
737
  case 3:
733
- g = i[p + 1], E = i[p + 2], (g & 192) === 128 && (E & 192) === 128 && (b = (l & 15) << 12 | (g & 63) << 6 | E & 63, b > 2047 && (b < 55296 || b > 57343) && (m = b));
738
+ v = i[p + 1], b = i[p + 2], (v & 192) === 128 && (b & 192) === 128 && (E = (c & 15) << 12 | (v & 63) << 6 | b & 63, E > 2047 && (E < 55296 || E > 57343) && (m = E));
734
739
  break;
735
740
  case 4:
736
- g = i[p + 1], E = i[p + 2], A = i[p + 3], (g & 192) === 128 && (E & 192) === 128 && (A & 192) === 128 && (b = (l & 15) << 18 | (g & 63) << 12 | (E & 63) << 6 | A & 63, b > 65535 && b < 1114112 && (m = b));
741
+ v = i[p + 1], b = i[p + 2], A = i[p + 3], (v & 192) === 128 && (b & 192) === 128 && (A & 192) === 128 && (E = (c & 15) << 18 | (v & 63) << 12 | (b & 63) << 6 | A & 63, E > 65535 && E < 1114112 && (m = E));
737
742
  }
738
743
  }
739
- m === null ? (m = 65533, w = 1) : m > 65535 && (m -= 65536, e.push(m >>> 10 & 1023 | 55296), m = 56320 | m & 1023), e.push(m), p += w;
744
+ m === null ? (m = 65533, d = 1) : m > 65535 && (m -= 65536, n.push(m >>> 10 & 1023 | 55296), m = 56320 | m & 1023), n.push(m), p += d;
740
745
  }
741
- return ar(e);
746
+ return or(n);
742
747
  }
743
748
  var mt = 4096;
744
- function ar(i) {
749
+ function or(i) {
745
750
  var t = i.length;
746
751
  if (t <= mt)
747
752
  return String.fromCharCode.apply(String, i);
748
- for (var r = "", e = 0; e < t; )
753
+ for (var r = "", n = 0; n < t; )
749
754
  r += String.fromCharCode.apply(
750
755
  String,
751
- i.slice(e, e += mt)
756
+ i.slice(n, n += mt)
752
757
  );
753
758
  return r;
754
759
  }
755
- function or(i, t, r) {
756
- var e = "";
760
+ function pr(i, t, r) {
761
+ var n = "";
757
762
  r = Math.min(i.length, r);
758
763
  for (var p = t; p < r; ++p)
759
- e += String.fromCharCode(i[p] & 127);
760
- return e;
764
+ n += String.fromCharCode(i[p] & 127);
765
+ return n;
761
766
  }
762
- function pr(i, t, r) {
763
- var e = "";
767
+ function sr(i, t, r) {
768
+ var n = "";
764
769
  r = Math.min(i.length, r);
765
770
  for (var p = t; p < r; ++p)
766
- e += String.fromCharCode(i[p]);
767
- return e;
771
+ n += String.fromCharCode(i[p]);
772
+ return n;
768
773
  }
769
- function sr(i, t, r) {
770
- var e = i.length;
771
- (!t || t < 0) && (t = 0), (!r || r < 0 || r > e) && (r = e);
772
- for (var p = "", l = t; l < r; ++l)
773
- p += mr[i[l]];
774
+ function lr(i, t, r) {
775
+ var n = i.length;
776
+ (!t || t < 0) && (t = 0), (!r || r < 0 || r > n) && (r = n);
777
+ for (var p = "", c = t; c < r; ++c)
778
+ p += xr[i[c]];
774
779
  return p;
775
780
  }
776
781
  function cr(i, t, r) {
777
- for (var e = i.slice(t, r), p = "", l = 0; l < e.length - 1; l += 2)
778
- p += String.fromCharCode(e[l] + e[l + 1] * 256);
782
+ for (var n = i.slice(t, r), p = "", c = 0; c < n.length - 1; c += 2)
783
+ p += String.fromCharCode(n[c] + n[c + 1] * 256);
779
784
  return p;
780
785
  }
781
786
  o.prototype.slice = function(t, r) {
782
- var e = this.length;
783
- t = ~~t, r = r === void 0 ? e : ~~r, t < 0 ? (t += e, t < 0 && (t = 0)) : t > e && (t = e), r < 0 ? (r += e, r < 0 && (r = 0)) : r > e && (r = e), r < t && (r = t);
787
+ var n = this.length;
788
+ t = ~~t, r = r === void 0 ? n : ~~r, t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), r < 0 ? (r += n, r < 0 && (r = 0)) : r > n && (r = n), r < t && (r = t);
784
789
  var p = this.subarray(t, r);
785
790
  return Object.setPrototypeOf(p, o.prototype), p;
786
791
  };
@@ -790,15 +795,15 @@ pt.write = function(n, a, s, c, f, h) {
790
795
  if (i + t > r)
791
796
  throw new RangeError("Trying to access beyond buffer length");
792
797
  }
793
- o.prototype.readUintLE = o.prototype.readUIntLE = function(t, r, e) {
794
- t = t >>> 0, r = r >>> 0, e || F(t, r, this.length);
795
- for (var p = this[t], l = 1, m = 0; ++m < r && (l *= 256); )
796
- p += this[t + m] * l;
798
+ o.prototype.readUintLE = o.prototype.readUIntLE = function(t, r, n) {
799
+ t = t >>> 0, r = r >>> 0, n || F(t, r, this.length);
800
+ for (var p = this[t], c = 1, m = 0; ++m < r && (c *= 256); )
801
+ p += this[t + m] * c;
797
802
  return p;
798
- }, o.prototype.readUintBE = o.prototype.readUIntBE = function(t, r, e) {
799
- t = t >>> 0, r = r >>> 0, e || F(t, r, this.length);
800
- for (var p = this[t + --r], l = 1; r > 0 && (l *= 256); )
801
- p += this[t + --r] * l;
803
+ }, o.prototype.readUintBE = o.prototype.readUIntBE = function(t, r, n) {
804
+ t = t >>> 0, r = r >>> 0, n || F(t, r, this.length);
805
+ for (var p = this[t + --r], c = 1; r > 0 && (c *= 256); )
806
+ p += this[t + --r] * c;
802
807
  return p;
803
808
  }, o.prototype.readUint8 = o.prototype.readUInt8 = function(t, r) {
804
809
  return t = t >>> 0, r || F(t, 1, this.length), this[t];
@@ -810,26 +815,26 @@ pt.write = function(n, a, s, c, f, h) {
810
815
  return t = t >>> 0, r || F(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
811
816
  }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(t, r) {
812
817
  return t = t >>> 0, r || F(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
813
- }, o.prototype.readIntLE = function(t, r, e) {
814
- t = t >>> 0, r = r >>> 0, e || F(t, r, this.length);
815
- for (var p = this[t], l = 1, m = 0; ++m < r && (l *= 256); )
816
- p += this[t + m] * l;
817
- return l *= 128, p >= l && (p -= Math.pow(2, 8 * r)), p;
818
- }, o.prototype.readIntBE = function(t, r, e) {
819
- t = t >>> 0, r = r >>> 0, e || F(t, r, this.length);
820
- for (var p = r, l = 1, m = this[t + --p]; p > 0 && (l *= 256); )
821
- m += this[t + --p] * l;
822
- return l *= 128, m >= l && (m -= Math.pow(2, 8 * r)), m;
818
+ }, o.prototype.readIntLE = function(t, r, n) {
819
+ t = t >>> 0, r = r >>> 0, n || F(t, r, this.length);
820
+ for (var p = this[t], c = 1, m = 0; ++m < r && (c *= 256); )
821
+ p += this[t + m] * c;
822
+ return c *= 128, p >= c && (p -= Math.pow(2, 8 * r)), p;
823
+ }, o.prototype.readIntBE = function(t, r, n) {
824
+ t = t >>> 0, r = r >>> 0, n || F(t, r, this.length);
825
+ for (var p = r, c = 1, m = this[t + --p]; p > 0 && (c *= 256); )
826
+ m += this[t + --p] * c;
827
+ return c *= 128, m >= c && (m -= Math.pow(2, 8 * r)), m;
823
828
  }, o.prototype.readInt8 = function(t, r) {
824
829
  return t = t >>> 0, r || F(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
825
830
  }, o.prototype.readInt16LE = function(t, r) {
826
831
  t = t >>> 0, r || F(t, 2, this.length);
827
- var e = this[t] | this[t + 1] << 8;
828
- return e & 32768 ? e | 4294901760 : e;
832
+ var n = this[t] | this[t + 1] << 8;
833
+ return n & 32768 ? n | 4294901760 : n;
829
834
  }, o.prototype.readInt16BE = function(t, r) {
830
835
  t = t >>> 0, r || F(t, 2, this.length);
831
- var e = this[t + 1] | this[t] << 8;
832
- return e & 32768 ? e | 4294901760 : e;
836
+ var n = this[t + 1] | this[t] << 8;
837
+ return n & 32768 ? n | 4294901760 : n;
833
838
  }, o.prototype.readInt32LE = function(t, r) {
834
839
  return t = t >>> 0, r || F(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
835
840
  }, o.prototype.readInt32BE = function(t, r) {
@@ -843,143 +848,143 @@ pt.write = function(n, a, s, c, f, h) {
843
848
  }, o.prototype.readDoubleBE = function(t, r) {
844
849
  return t = t >>> 0, r || F(t, 8, this.length), s.read(this, t, !1, 52, 8);
845
850
  };
846
- function S(i, t, r, e, p, l) {
851
+ function S(i, t, r, n, p, c) {
847
852
  if (!o.isBuffer(i))
848
853
  throw new TypeError('"buffer" argument must be a Buffer instance');
849
- if (t > p || t < l)
854
+ if (t > p || t < c)
850
855
  throw new RangeError('"value" argument is out of bounds');
851
- if (r + e > i.length)
856
+ if (r + n > i.length)
852
857
  throw new RangeError("Index out of range");
853
858
  }
854
- o.prototype.writeUintLE = o.prototype.writeUIntLE = function(t, r, e, p) {
855
- if (t = +t, r = r >>> 0, e = e >>> 0, !p) {
856
- var l = Math.pow(2, 8 * e) - 1;
857
- S(this, t, r, e, l, 0);
859
+ o.prototype.writeUintLE = o.prototype.writeUIntLE = function(t, r, n, p) {
860
+ if (t = +t, r = r >>> 0, n = n >>> 0, !p) {
861
+ var c = Math.pow(2, 8 * n) - 1;
862
+ S(this, t, r, n, c, 0);
858
863
  }
859
- var m = 1, w = 0;
860
- for (this[r] = t & 255; ++w < e && (m *= 256); )
861
- this[r + w] = t / m & 255;
862
- return r + e;
863
- }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(t, r, e, p) {
864
- if (t = +t, r = r >>> 0, e = e >>> 0, !p) {
865
- var l = Math.pow(2, 8 * e) - 1;
866
- S(this, t, r, e, l, 0);
864
+ var m = 1, d = 0;
865
+ for (this[r] = t & 255; ++d < n && (m *= 256); )
866
+ this[r + d] = t / m & 255;
867
+ return r + n;
868
+ }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(t, r, n, p) {
869
+ if (t = +t, r = r >>> 0, n = n >>> 0, !p) {
870
+ var c = Math.pow(2, 8 * n) - 1;
871
+ S(this, t, r, n, c, 0);
867
872
  }
868
- var m = e - 1, w = 1;
869
- for (this[r + m] = t & 255; --m >= 0 && (w *= 256); )
870
- this[r + m] = t / w & 255;
871
- return r + e;
872
- }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(t, r, e) {
873
- return t = +t, r = r >>> 0, e || S(this, t, r, 1, 255, 0), this[r] = t & 255, r + 1;
874
- }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(t, r, e) {
875
- return t = +t, r = r >>> 0, e || S(this, t, r, 2, 65535, 0), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
876
- }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(t, r, e) {
877
- return t = +t, r = r >>> 0, e || S(this, t, r, 2, 65535, 0), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
878
- }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(t, r, e) {
879
- return t = +t, r = r >>> 0, e || S(this, t, r, 4, 4294967295, 0), this[r + 3] = t >>> 24, this[r + 2] = t >>> 16, this[r + 1] = t >>> 8, this[r] = t & 255, r + 4;
880
- }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(t, r, e) {
881
- return t = +t, r = r >>> 0, e || S(this, t, r, 4, 4294967295, 0), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
882
- }, o.prototype.writeIntLE = function(t, r, e, p) {
873
+ var m = n - 1, d = 1;
874
+ for (this[r + m] = t & 255; --m >= 0 && (d *= 256); )
875
+ this[r + m] = t / d & 255;
876
+ return r + n;
877
+ }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(t, r, n) {
878
+ return t = +t, r = r >>> 0, n || S(this, t, r, 1, 255, 0), this[r] = t & 255, r + 1;
879
+ }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(t, r, n) {
880
+ return t = +t, r = r >>> 0, n || S(this, t, r, 2, 65535, 0), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
881
+ }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(t, r, n) {
882
+ return t = +t, r = r >>> 0, n || S(this, t, r, 2, 65535, 0), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
883
+ }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(t, r, n) {
884
+ return t = +t, r = r >>> 0, n || S(this, t, r, 4, 4294967295, 0), this[r + 3] = t >>> 24, this[r + 2] = t >>> 16, this[r + 1] = t >>> 8, this[r] = t & 255, r + 4;
885
+ }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(t, r, n) {
886
+ return t = +t, r = r >>> 0, n || S(this, t, r, 4, 4294967295, 0), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
887
+ }, o.prototype.writeIntLE = function(t, r, n, p) {
883
888
  if (t = +t, r = r >>> 0, !p) {
884
- var l = Math.pow(2, 8 * e - 1);
885
- S(this, t, r, e, l - 1, -l);
889
+ var c = Math.pow(2, 8 * n - 1);
890
+ S(this, t, r, n, c - 1, -c);
886
891
  }
887
- var m = 0, w = 1, g = 0;
888
- for (this[r] = t & 255; ++m < e && (w *= 256); )
889
- t < 0 && g === 0 && this[r + m - 1] !== 0 && (g = 1), this[r + m] = (t / w >> 0) - g & 255;
890
- return r + e;
891
- }, o.prototype.writeIntBE = function(t, r, e, p) {
892
+ var m = 0, d = 1, v = 0;
893
+ for (this[r] = t & 255; ++m < n && (d *= 256); )
894
+ t < 0 && v === 0 && this[r + m - 1] !== 0 && (v = 1), this[r + m] = (t / d >> 0) - v & 255;
895
+ return r + n;
896
+ }, o.prototype.writeIntBE = function(t, r, n, p) {
892
897
  if (t = +t, r = r >>> 0, !p) {
893
- var l = Math.pow(2, 8 * e - 1);
894
- S(this, t, r, e, l - 1, -l);
898
+ var c = Math.pow(2, 8 * n - 1);
899
+ S(this, t, r, n, c - 1, -c);
895
900
  }
896
- var m = e - 1, w = 1, g = 0;
897
- for (this[r + m] = t & 255; --m >= 0 && (w *= 256); )
898
- t < 0 && g === 0 && this[r + m + 1] !== 0 && (g = 1), this[r + m] = (t / w >> 0) - g & 255;
899
- return r + e;
900
- }, o.prototype.writeInt8 = function(t, r, e) {
901
- return t = +t, r = r >>> 0, e || S(this, t, r, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[r] = t & 255, r + 1;
902
- }, o.prototype.writeInt16LE = function(t, r, e) {
903
- return t = +t, r = r >>> 0, e || S(this, t, r, 2, 32767, -32768), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
904
- }, o.prototype.writeInt16BE = function(t, r, e) {
905
- return t = +t, r = r >>> 0, e || S(this, t, r, 2, 32767, -32768), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
906
- }, o.prototype.writeInt32LE = function(t, r, e) {
907
- return t = +t, r = r >>> 0, e || S(this, t, r, 4, 2147483647, -2147483648), this[r] = t & 255, this[r + 1] = t >>> 8, this[r + 2] = t >>> 16, this[r + 3] = t >>> 24, r + 4;
908
- }, o.prototype.writeInt32BE = function(t, r, e) {
909
- return t = +t, r = r >>> 0, e || S(this, t, r, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
901
+ var m = n - 1, d = 1, v = 0;
902
+ for (this[r + m] = t & 255; --m >= 0 && (d *= 256); )
903
+ t < 0 && v === 0 && this[r + m + 1] !== 0 && (v = 1), this[r + m] = (t / d >> 0) - v & 255;
904
+ return r + n;
905
+ }, o.prototype.writeInt8 = function(t, r, n) {
906
+ return t = +t, r = r >>> 0, n || S(this, t, r, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[r] = t & 255, r + 1;
907
+ }, o.prototype.writeInt16LE = function(t, r, n) {
908
+ return t = +t, r = r >>> 0, n || S(this, t, r, 2, 32767, -32768), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
909
+ }, o.prototype.writeInt16BE = function(t, r, n) {
910
+ return t = +t, r = r >>> 0, n || S(this, t, r, 2, 32767, -32768), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
911
+ }, o.prototype.writeInt32LE = function(t, r, n) {
912
+ return t = +t, r = r >>> 0, n || S(this, t, r, 4, 2147483647, -2147483648), this[r] = t & 255, this[r + 1] = t >>> 8, this[r + 2] = t >>> 16, this[r + 3] = t >>> 24, r + 4;
913
+ }, o.prototype.writeInt32BE = function(t, r, n) {
914
+ return t = +t, r = r >>> 0, n || S(this, t, r, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
910
915
  };
911
- function xt(i, t, r, e, p, l) {
912
- if (r + e > i.length)
916
+ function xt(i, t, r, n, p, c) {
917
+ if (r + n > i.length)
913
918
  throw new RangeError("Index out of range");
914
919
  if (r < 0)
915
920
  throw new RangeError("Index out of range");
916
921
  }
917
- function dt(i, t, r, e, p) {
918
- return t = +t, r = r >>> 0, p || xt(i, t, r, 4), s.write(i, t, r, e, 23, 4), r + 4;
922
+ function gt(i, t, r, n, p) {
923
+ return t = +t, r = r >>> 0, p || xt(i, t, r, 4), s.write(i, t, r, n, 23, 4), r + 4;
919
924
  }
920
- o.prototype.writeFloatLE = function(t, r, e) {
921
- return dt(this, t, r, !0, e);
922
- }, o.prototype.writeFloatBE = function(t, r, e) {
923
- return dt(this, t, r, !1, e);
925
+ o.prototype.writeFloatLE = function(t, r, n) {
926
+ return gt(this, t, r, !0, n);
927
+ }, o.prototype.writeFloatBE = function(t, r, n) {
928
+ return gt(this, t, r, !1, n);
924
929
  };
925
- function wt(i, t, r, e, p) {
926
- return t = +t, r = r >>> 0, p || xt(i, t, r, 8), s.write(i, t, r, e, 52, 8), r + 8;
927
- }
928
- o.prototype.writeDoubleLE = function(t, r, e) {
929
- return wt(this, t, r, !0, e);
930
- }, o.prototype.writeDoubleBE = function(t, r, e) {
931
- return wt(this, t, r, !1, e);
932
- }, o.prototype.copy = function(t, r, e, p) {
930
+ function dt(i, t, r, n, p) {
931
+ return t = +t, r = r >>> 0, p || xt(i, t, r, 8), s.write(i, t, r, n, 52, 8), r + 8;
932
+ }
933
+ o.prototype.writeDoubleLE = function(t, r, n) {
934
+ return dt(this, t, r, !0, n);
935
+ }, o.prototype.writeDoubleBE = function(t, r, n) {
936
+ return dt(this, t, r, !1, n);
937
+ }, o.prototype.copy = function(t, r, n, p) {
933
938
  if (!o.isBuffer(t))
934
939
  throw new TypeError("argument should be a Buffer");
935
- if (e || (e = 0), !p && p !== 0 && (p = this.length), r >= t.length && (r = t.length), r || (r = 0), p > 0 && p < e && (p = e), p === e || t.length === 0 || this.length === 0)
940
+ if (n || (n = 0), !p && p !== 0 && (p = this.length), r >= t.length && (r = t.length), r || (r = 0), p > 0 && p < n && (p = n), p === n || t.length === 0 || this.length === 0)
936
941
  return 0;
937
942
  if (r < 0)
938
943
  throw new RangeError("targetStart out of bounds");
939
- if (e < 0 || e >= this.length)
944
+ if (n < 0 || n >= this.length)
940
945
  throw new RangeError("Index out of range");
941
946
  if (p < 0)
942
947
  throw new RangeError("sourceEnd out of bounds");
943
- p > this.length && (p = this.length), t.length - r < p - e && (p = t.length - r + e);
944
- var l = p - e;
945
- return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(r, e, p) : Uint8Array.prototype.set.call(
948
+ p > this.length && (p = this.length), t.length - r < p - n && (p = t.length - r + n);
949
+ var c = p - n;
950
+ return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(r, n, p) : Uint8Array.prototype.set.call(
946
951
  t,
947
- this.subarray(e, p),
952
+ this.subarray(n, p),
948
953
  r
949
- ), l;
950
- }, o.prototype.fill = function(t, r, e, p) {
954
+ ), c;
955
+ }, o.prototype.fill = function(t, r, n, p) {
951
956
  if (typeof t == "string") {
952
- if (typeof r == "string" ? (p = r, r = 0, e = this.length) : typeof e == "string" && (p = e, e = this.length), p !== void 0 && typeof p != "string")
957
+ if (typeof r == "string" ? (p = r, r = 0, n = this.length) : typeof n == "string" && (p = n, n = this.length), p !== void 0 && typeof p != "string")
953
958
  throw new TypeError("encoding must be a string");
954
959
  if (typeof p == "string" && !o.isEncoding(p))
955
960
  throw new TypeError("Unknown encoding: " + p);
956
961
  if (t.length === 1) {
957
- var l = t.charCodeAt(0);
958
- (p === "utf8" && l < 128 || p === "latin1") && (t = l);
962
+ var c = t.charCodeAt(0);
963
+ (p === "utf8" && c < 128 || p === "latin1") && (t = c);
959
964
  }
960
965
  } else
961
966
  typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
962
- if (r < 0 || this.length < r || this.length < e)
967
+ if (r < 0 || this.length < r || this.length < n)
963
968
  throw new RangeError("Out of range index");
964
- if (e <= r)
969
+ if (n <= r)
965
970
  return this;
966
- r = r >>> 0, e = e === void 0 ? this.length : e >>> 0, t || (t = 0);
971
+ r = r >>> 0, n = n === void 0 ? this.length : n >>> 0, t || (t = 0);
967
972
  var m;
968
973
  if (typeof t == "number")
969
- for (m = r; m < e; ++m)
974
+ for (m = r; m < n; ++m)
970
975
  this[m] = t;
971
976
  else {
972
- var w = o.isBuffer(t) ? t : o.from(t, p), g = w.length;
973
- if (g === 0)
977
+ var d = o.isBuffer(t) ? t : o.from(t, p), v = d.length;
978
+ if (v === 0)
974
979
  throw new TypeError('The value "' + t + '" is invalid for argument "value"');
975
- for (m = 0; m < e - r; ++m)
976
- this[m + r] = w[m % g];
980
+ for (m = 0; m < n - r; ++m)
981
+ this[m + r] = d[m % v];
977
982
  }
978
983
  return this;
979
984
  };
980
- var lr = /[^+/0-9A-Za-z-_]/g;
981
- function ur(i) {
982
- if (i = i.split("=")[0], i = i.trim().replace(lr, ""), i.length < 2)
985
+ var ur = /[^+/0-9A-Za-z-_]/g;
986
+ function fr(i) {
987
+ if (i = i.split("=")[0], i = i.trim().replace(ur, ""), i.length < 2)
983
988
  return "";
984
989
  for (; i.length % 4 !== 0; )
985
990
  i = i + "=";
@@ -987,41 +992,41 @@ pt.write = function(n, a, s, c, f, h) {
987
992
  }
988
993
  function G(i, t) {
989
994
  t = t || 1 / 0;
990
- for (var r, e = i.length, p = null, l = [], m = 0; m < e; ++m) {
995
+ for (var r, n = i.length, p = null, c = [], m = 0; m < n; ++m) {
991
996
  if (r = i.charCodeAt(m), r > 55295 && r < 57344) {
992
997
  if (!p) {
993
998
  if (r > 56319) {
994
- (t -= 3) > -1 && l.push(239, 191, 189);
999
+ (t -= 3) > -1 && c.push(239, 191, 189);
995
1000
  continue;
996
- } else if (m + 1 === e) {
997
- (t -= 3) > -1 && l.push(239, 191, 189);
1001
+ } else if (m + 1 === n) {
1002
+ (t -= 3) > -1 && c.push(239, 191, 189);
998
1003
  continue;
999
1004
  }
1000
1005
  p = r;
1001
1006
  continue;
1002
1007
  }
1003
1008
  if (r < 56320) {
1004
- (t -= 3) > -1 && l.push(239, 191, 189), p = r;
1009
+ (t -= 3) > -1 && c.push(239, 191, 189), p = r;
1005
1010
  continue;
1006
1011
  }
1007
1012
  r = (p - 55296 << 10 | r - 56320) + 65536;
1008
1013
  } else
1009
- p && (t -= 3) > -1 && l.push(239, 191, 189);
1014
+ p && (t -= 3) > -1 && c.push(239, 191, 189);
1010
1015
  if (p = null, r < 128) {
1011
1016
  if ((t -= 1) < 0)
1012
1017
  break;
1013
- l.push(r);
1018
+ c.push(r);
1014
1019
  } else if (r < 2048) {
1015
1020
  if ((t -= 2) < 0)
1016
1021
  break;
1017
- l.push(
1022
+ c.push(
1018
1023
  r >> 6 | 192,
1019
1024
  r & 63 | 128
1020
1025
  );
1021
1026
  } else if (r < 65536) {
1022
1027
  if ((t -= 3) < 0)
1023
1028
  break;
1024
- l.push(
1029
+ c.push(
1025
1030
  r >> 12 | 224,
1026
1031
  r >> 6 & 63 | 128,
1027
1032
  r & 63 | 128
@@ -1029,7 +1034,7 @@ pt.write = function(n, a, s, c, f, h) {
1029
1034
  } else if (r < 1114112) {
1030
1035
  if ((t -= 4) < 0)
1031
1036
  break;
1032
- l.push(
1037
+ c.push(
1033
1038
  r >> 18 | 240,
1034
1039
  r >> 12 & 63 | 128,
1035
1040
  r >> 6 & 63 | 128,
@@ -1038,23 +1043,23 @@ pt.write = function(n, a, s, c, f, h) {
1038
1043
  } else
1039
1044
  throw new Error("Invalid code point");
1040
1045
  }
1041
- return l;
1046
+ return c;
1042
1047
  }
1043
- function fr(i) {
1048
+ function hr(i) {
1044
1049
  for (var t = [], r = 0; r < i.length; ++r)
1045
1050
  t.push(i.charCodeAt(r) & 255);
1046
1051
  return t;
1047
1052
  }
1048
- function hr(i, t) {
1049
- for (var r, e, p, l = [], m = 0; m < i.length && !((t -= 2) < 0); ++m)
1050
- r = i.charCodeAt(m), e = r >> 8, p = r % 256, l.push(p), l.push(e);
1051
- return l;
1053
+ function mr(i, t) {
1054
+ for (var r, n, p, c = [], m = 0; m < i.length && !((t -= 2) < 0); ++m)
1055
+ r = i.charCodeAt(m), n = r >> 8, p = r % 256, c.push(p), c.push(n);
1056
+ return c;
1052
1057
  }
1053
- function yt(i) {
1054
- return a.toByteArray(ur(i));
1058
+ function wt(i) {
1059
+ return a.toByteArray(fr(i));
1055
1060
  }
1056
- function L(i, t, r, e) {
1057
- for (var p = 0; p < e && !(p + r >= t.length || p >= i.length); ++p)
1061
+ function L(i, t, r, n) {
1062
+ for (var p = 0; p < n && !(p + r >= t.length || p >= i.length); ++p)
1058
1063
  t[p + r] = i[p];
1059
1064
  return p;
1060
1065
  }
@@ -1064,355 +1069,380 @@ pt.write = function(n, a, s, c, f, h) {
1064
1069
  function V(i) {
1065
1070
  return i !== i;
1066
1071
  }
1067
- var mr = function() {
1072
+ var xr = function() {
1068
1073
  for (var i = "0123456789abcdef", t = new Array(256), r = 0; r < 16; ++r)
1069
- for (var e = r * 16, p = 0; p < 16; ++p)
1070
- t[e + p] = i[r] + i[p];
1074
+ for (var n = r * 16, p = 0; p < 16; ++p)
1075
+ t[n + p] = i[r] + i[p];
1071
1076
  return t;
1072
1077
  }();
1073
- })(Mt);
1078
+ })(Ct);
1074
1079
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1075
- (function(n, a) {
1076
- var s = Mt, c = s.Buffer;
1080
+ (function(e, a) {
1081
+ var s = Ct, l = s.Buffer;
1077
1082
  function f(u, o) {
1078
1083
  for (var x in u)
1079
1084
  o[x] = u[x];
1080
1085
  }
1081
- c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? n.exports = s : (f(s, a), a.Buffer = h);
1086
+ l.from && l.alloc && l.allocUnsafe && l.allocUnsafeSlow ? e.exports = s : (f(s, a), a.Buffer = h);
1082
1087
  function h(u, o, x) {
1083
- return c(u, o, x);
1088
+ return l(u, o, x);
1084
1089
  }
1085
- h.prototype = Object.create(c.prototype), f(c, h), h.from = function(u, o, x) {
1090
+ h.prototype = Object.create(l.prototype), f(l, h), h.from = function(u, o, x) {
1086
1091
  if (typeof u == "number")
1087
1092
  throw new TypeError("Argument must not be a number");
1088
- return c(u, o, x);
1093
+ return l(u, o, x);
1089
1094
  }, h.alloc = function(u, o, x) {
1090
1095
  if (typeof u != "number")
1091
1096
  throw new TypeError("Argument must be a number");
1092
- var y = c(u);
1093
- return o !== void 0 ? typeof x == "string" ? y.fill(o, x) : y.fill(o) : y.fill(0), y;
1097
+ var w = l(u);
1098
+ return o !== void 0 ? typeof x == "string" ? w.fill(o, x) : w.fill(o) : w.fill(0), w;
1094
1099
  }, h.allocUnsafe = function(u) {
1095
1100
  if (typeof u != "number")
1096
1101
  throw new TypeError("Argument must be a number");
1097
- return c(u);
1102
+ return l(u);
1098
1103
  }, h.allocUnsafeSlow = function(u) {
1099
1104
  if (typeof u != "number")
1100
1105
  throw new TypeError("Argument must be a number");
1101
1106
  return s.SlowBuffer(u);
1102
1107
  };
1103
1108
  })(rt, rt.exports);
1104
- var Rt = rt.exports, Lt = Rt.Buffer;
1105
- function H(n, a) {
1106
- this._block = Lt.alloc(n), this._finalSize = a, this._blockSize = n, this._len = 0;
1109
+ var Lt = rt.exports, zt = Lt.Buffer;
1110
+ function H(e, a) {
1111
+ this._block = zt.alloc(e), this._finalSize = a, this._blockSize = e, this._len = 0;
1107
1112
  }
1108
- H.prototype.update = function(n, a) {
1109
- typeof n == "string" && (a = a || "utf8", n = Lt.from(n, a));
1110
- for (var s = this._block, c = this._blockSize, f = n.length, h = this._len, u = 0; u < f; ) {
1111
- for (var o = h % c, x = Math.min(f - u, c - o), y = 0; y < x; y++)
1112
- s[o + y] = n[u + y];
1113
- h += x, u += x, h % c === 0 && this._update(s);
1113
+ H.prototype.update = function(e, a) {
1114
+ typeof e == "string" && (a = a || "utf8", e = zt.from(e, a));
1115
+ for (var s = this._block, l = this._blockSize, f = e.length, h = this._len, u = 0; u < f; ) {
1116
+ for (var o = h % l, x = Math.min(f - u, l - o), w = 0; w < x; w++)
1117
+ s[o + w] = e[u + w];
1118
+ h += x, u += x, h % l === 0 && this._update(s);
1114
1119
  }
1115
1120
  return this._len += f, this;
1116
1121
  };
1117
- H.prototype.digest = function(n) {
1122
+ H.prototype.digest = function(e) {
1118
1123
  var a = this._len % this._blockSize;
1119
1124
  this._block[a] = 128, this._block.fill(0, a + 1), a >= this._finalSize && (this._update(this._block), this._block.fill(0));
1120
1125
  var s = this._len * 8;
1121
1126
  if (s <= 4294967295)
1122
1127
  this._block.writeUInt32BE(s, this._blockSize - 4);
1123
1128
  else {
1124
- var c = (s & 4294967295) >>> 0, f = (s - c) / 4294967296;
1125
- this._block.writeUInt32BE(f, this._blockSize - 8), this._block.writeUInt32BE(c, this._blockSize - 4);
1129
+ var l = (s & 4294967295) >>> 0, f = (s - l) / 4294967296;
1130
+ this._block.writeUInt32BE(f, this._blockSize - 8), this._block.writeUInt32BE(l, this._blockSize - 4);
1126
1131
  }
1127
1132
  this._update(this._block);
1128
1133
  var h = this._hash();
1129
- return n ? h.toString(n) : h;
1134
+ return e ? h.toString(e) : h;
1130
1135
  };
1131
1136
  H.prototype._update = function() {
1132
1137
  throw new Error("_update must be implemented by subclass");
1133
1138
  };
1134
- var zr = H, qr = kr, zt = zr, $r = Rt.Buffer, Jr = [
1139
+ var qr = H, $r = Tr, qt = qr, Jr = Lt.Buffer, Pr = [
1135
1140
  1518500249,
1136
1141
  1859775393,
1137
1142
  -1894007588,
1138
1143
  -899497514
1139
- ], Pr = new Array(80);
1144
+ ], Wr = new Array(80);
1140
1145
  function C() {
1141
- this.init(), this._w = Pr, zt.call(this, 64, 56);
1146
+ this.init(), this._w = Wr, qt.call(this, 64, 56);
1142
1147
  }
1143
- qr(C, zt);
1148
+ $r(C, qt);
1144
1149
  C.prototype.init = function() {
1145
1150
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
1146
1151
  };
1147
- function Wr(n) {
1148
- return n << 1 | n >>> 31;
1152
+ function Hr(e) {
1153
+ return e << 1 | e >>> 31;
1149
1154
  }
1150
- function Hr(n) {
1151
- return n << 5 | n >>> 27;
1155
+ function Zr(e) {
1156
+ return e << 5 | e >>> 27;
1152
1157
  }
1153
- function Zr(n) {
1154
- return n << 30 | n >>> 2;
1158
+ function Yr(e) {
1159
+ return e << 30 | e >>> 2;
1155
1160
  }
1156
- function Yr(n, a, s, c) {
1157
- return n === 0 ? a & s | ~a & c : n === 2 ? a & s | a & c | s & c : a ^ s ^ c;
1161
+ function Kr(e, a, s, l) {
1162
+ return e === 0 ? a & s | ~a & l : e === 2 ? a & s | a & l | s & l : a ^ s ^ l;
1158
1163
  }
1159
- C.prototype._update = function(n) {
1160
- for (var a = this._w, s = this._a | 0, c = this._b | 0, f = this._c | 0, h = this._d | 0, u = this._e | 0, o = 0; o < 16; ++o)
1161
- a[o] = n.readInt32BE(o * 4);
1164
+ C.prototype._update = function(e) {
1165
+ for (var a = this._w, s = this._a | 0, l = this._b | 0, f = this._c | 0, h = this._d | 0, u = this._e | 0, o = 0; o < 16; ++o)
1166
+ a[o] = e.readInt32BE(o * 4);
1162
1167
  for (; o < 80; ++o)
1163
- a[o] = Wr(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16]);
1168
+ a[o] = Hr(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16]);
1164
1169
  for (var x = 0; x < 80; ++x) {
1165
- var y = ~~(x / 20), v = Hr(s) + Yr(y, c, f, h) + u + a[x] + Jr[y] | 0;
1166
- u = h, h = f, f = Zr(c), c = s, s = v;
1170
+ var w = ~~(x / 20), y = Zr(s) + Kr(w, l, f, h) + u + a[x] + Pr[w] | 0;
1171
+ u = h, h = f, f = Yr(l), l = s, s = y;
1167
1172
  }
1168
- this._a = s + this._a | 0, this._b = c + this._b | 0, this._c = f + this._c | 0, this._d = h + this._d | 0, this._e = u + this._e | 0;
1173
+ this._a = s + this._a | 0, this._b = l + this._b | 0, this._c = f + this._c | 0, this._d = h + this._d | 0, this._e = u + this._e | 0;
1169
1174
  };
1170
1175
  C.prototype._hash = function() {
1171
- var n = $r.allocUnsafe(20);
1172
- return n.writeInt32BE(this._a | 0, 0), n.writeInt32BE(this._b | 0, 4), n.writeInt32BE(this._c | 0, 8), n.writeInt32BE(this._d | 0, 12), n.writeInt32BE(this._e | 0, 16), n;
1176
+ var e = Jr.allocUnsafe(20);
1177
+ return e.writeInt32BE(this._a | 0, 0), e.writeInt32BE(this._b | 0, 4), e.writeInt32BE(this._c | 0, 8), e.writeInt32BE(this._d | 0, 12), e.writeInt32BE(this._e | 0, 16), e;
1173
1178
  };
1174
- var Kr = C;
1175
- const Xr = /* @__PURE__ */ Nt(Kr), st = new Error("File system not available.");
1176
- function Gr(n, a, s) {
1179
+ var Xr = C;
1180
+ const Gr = /* @__PURE__ */ Mt(Xr), st = new Error("File system not available.");
1181
+ function Vr(e, a, s) {
1177
1182
  throw st;
1178
1183
  }
1179
- function qt(n) {
1184
+ function $t(e) {
1180
1185
  throw st;
1181
1186
  }
1182
- function Vr(n) {
1187
+ function Qr(e) {
1183
1188
  throw st;
1184
1189
  }
1185
- const Qr = async (n) => qt();
1186
- function ti(n) {
1190
+ const ti = async (e) => $t();
1191
+ function ri(e) {
1187
1192
  let a = "";
1188
- for (let s = 0; s < n.length; s += 2)
1189
- a += String.fromCharCode(parseInt(n.substr(s, 2), 16));
1193
+ for (let s = 0; s < e.length; s += 2)
1194
+ a += String.fromCharCode(parseInt(e.substr(s, 2), 16));
1190
1195
  return btoa(a);
1191
1196
  }
1192
- const Z = (n, a = "sha1") => {
1197
+ const Z = (e, a = "sha1") => {
1193
1198
  if (a !== "sha1")
1194
1199
  throw new Error("Only sha1 algorithm is available.");
1195
- const s = new Xr();
1196
- return ti(s.update(n).digest("hex"));
1197
- }, $t = async (n) => {
1198
- const a = new Ft(), { name: s, revision: c, documentType: f, created: h, lastModified: u } = n, o = {
1200
+ const s = new Gr();
1201
+ return ri(s.update(e).digest("hex"));
1202
+ }, Jt = async (e) => {
1203
+ const a = new At(), { name: s, revision: l, documentType: f, created: h, lastModified: u } = e, o = {
1199
1204
  name: s,
1200
- revision: c,
1205
+ revision: l,
1201
1206
  documentType: f,
1202
1207
  created: h,
1203
1208
  lastModified: u
1204
1209
  };
1205
1210
  return a.file("header.json", JSON.stringify(o, null, 2)), a.file(
1206
1211
  "state.json",
1207
- JSON.stringify(n.initialState || {}, null, 2)
1208
- ), a.file("operations.json", JSON.stringify(n.operations, null, 2)), Object.keys(n.attachments).forEach((y) => {
1209
- const { data: v, ..._ } = n.attachments[y];
1210
- a.file(y, v, {
1212
+ JSON.stringify(e.initialState || {}, null, 2)
1213
+ ), a.file("operations.json", JSON.stringify(e.operations, null, 2)), Object.keys(e.attachments).forEach((w) => {
1214
+ const { data: y, ..._ } = e.attachments[w];
1215
+ a.file(w, y, {
1211
1216
  base64: !0,
1212
1217
  createFolders: !0,
1213
1218
  comment: JSON.stringify(_)
1214
1219
  });
1215
1220
  }), a;
1216
- }, ri = async (n, a, s, c) => {
1217
- await (await $t(n)).generateAsync({
1221
+ }, ii = async (e, a, s, l) => {
1222
+ await (await Jt(e)).generateAsync({
1218
1223
  type: "uint8array",
1219
1224
  streamFiles: !0
1220
1225
  });
1221
- const h = c ?? n.name, u = `.${s}.zip`;
1222
- return Gr(
1226
+ const h = l ?? e.name, u = `.${s}.zip`;
1227
+ return Vr(
1223
1228
  a,
1224
1229
  h.endsWith(u) ? h : `${h}${u}`
1225
1230
  );
1226
- }, Ai = async (n, a) => {
1227
- const c = await (await $t(n)).generateAsync({ type: "blob" }), f = await a.createWritable();
1228
- await f.write(c), await f.close();
1229
- }, bt = async (n, a) => {
1230
- const s = qt();
1231
- return ii(s, a);
1232
- }, ii = async (n, a) => {
1233
- const s = new Ft();
1234
- return await s.loadAsync(n), ei(s, a);
1231
+ }, Ai = async (e, a) => {
1232
+ const l = await (await Jt(e)).generateAsync({ type: "blob" }), f = await a.createWritable();
1233
+ await f.write(l), await f.close();
1234
+ }, Et = async (e, a) => {
1235
+ const s = $t();
1236
+ return ei(s, a);
1237
+ }, ei = async (e, a) => {
1238
+ const s = new At();
1239
+ return await s.loadAsync(e), ni(s, a);
1235
1240
  };
1236
- async function ei(n, a) {
1237
- const s = n.file("state.json");
1241
+ async function ni(e, a) {
1242
+ const s = e.file("state.json");
1238
1243
  if (!s)
1239
1244
  throw new Error("Initial state not found");
1240
- const c = await s.async("string"), f = JSON.parse(c), h = n.file("header.json");
1245
+ const l = await s.async("string"), f = JSON.parse(l), h = e.file("header.json");
1241
1246
  let u = null;
1242
1247
  h && (u = JSON.parse(await h.async("string")));
1243
- const o = n.file("operations.json");
1248
+ const o = e.file("operations.json");
1244
1249
  if (!o)
1245
1250
  throw new Error("Operations history not found");
1246
1251
  const x = JSON.parse(
1247
1252
  await o.async("string")
1248
- ), y = {
1253
+ ), w = {
1249
1254
  ...f,
1250
1255
  ...u,
1251
1256
  initialState: f,
1252
- operations: [],
1257
+ operations: { global: [], local: [] },
1253
1258
  attachments: { ...f.attachments }
1254
1259
  };
1255
- let v = x.slice(0, u == null ? void 0 : u.revision).reduce(
1260
+ let y = x.global.concat(x.local).slice(0, u == null ? void 0 : u.revision).reduce(
1256
1261
  (_, U) => a(_, U),
1257
- y
1262
+ w
1258
1263
  );
1259
- return u && (v = {
1260
- ...v,
1264
+ return u && (y = {
1265
+ ...y,
1261
1266
  ...u,
1262
- operations: [
1263
- ...v.operations,
1264
- ...x.slice(u.revision)
1265
- ]
1266
- }), v;
1267
+ operations: {
1268
+ global: [
1269
+ ...y.operations.global,
1270
+ ...x.global.slice(u.revision)
1271
+ ],
1272
+ local: y.operations.local
1273
+ }
1274
+ }), y;
1267
1275
  }
1268
- function Jt(n) {
1269
- const a = n.replace(/^.*\./, "") || void 0, s = n.replace(/^.*[/\\]/, "") || void 0;
1276
+ function Pt(e) {
1277
+ const a = e.replace(/^.*\./, "") || void 0, s = e.replace(/^.*[/\\]/, "") || void 0;
1270
1278
  return { extension: a, fileName: s };
1271
1279
  }
1272
- async function Bi(n) {
1273
- const { buffer: a, mimeType: s = "application/octet-stream" } = await Vr(), c = Jt(n), f = a.toString("base64");
1280
+ async function Bi(e) {
1281
+ const { buffer: a, mimeType: s = "application/octet-stream" } = await Qr(), l = Pt(e), f = a.toString("base64");
1274
1282
  return {
1275
1283
  data: f,
1276
1284
  hash: Z(f),
1277
1285
  mimeType: s,
1278
- ...c
1286
+ ...l
1279
1287
  };
1280
1288
  }
1281
- async function Si(n) {
1282
- const a = await Qr(), s = Ir.getType(n) || "application/octet-stream", c = Jt(n), f = a.toString("base64");
1283
- return { data: f, hash: Z(f), mimeType: s, ...c };
1289
+ async function Si(e) {
1290
+ const a = await ti(), s = kr.getType(e) || "application/octet-stream", l = Pt(e), f = a.toString("base64");
1291
+ return { data: f, hash: Z(f), mimeType: s, ...l };
1284
1292
  }
1285
- function J(n, a, s, c) {
1286
- const f = wi(n), h = xi(s);
1287
- return a.reduce(
1288
- (u, o) => h(u, o, c),
1293
+ function J(e, a, s, l) {
1294
+ const f = wi(e), h = gi(s);
1295
+ return a.global.concat(a.local).reduce(
1296
+ (u, o) => h(u, o, l),
1289
1297
  f
1290
1298
  );
1291
1299
  }
1292
- function ni(n, a) {
1293
- return { ...n, name: a };
1300
+ function ai(e, a) {
1301
+ return { ...e, name: a };
1294
1302
  }
1295
- function ai(n, a, s) {
1296
- const c = Math.min(a, n.revision), f = n.operations.slice(
1303
+ function oi(e, a, s) {
1304
+ const l = Math.min(a, e.revision), f = e.operations.global.slice(
1297
1305
  0,
1298
- n.revision - c
1306
+ e.revision - l
1299
1307
  );
1300
1308
  return {
1301
1309
  ...J(
1302
- n.initialState,
1303
- f,
1310
+ e.initialState,
1311
+ {
1312
+ global: f,
1313
+ local: e.operations.local
1314
+ },
1304
1315
  s
1305
1316
  ),
1306
- operations: n.operations,
1307
- revision: n.revision - c
1317
+ operations: e.operations,
1318
+ revision: e.revision - l
1308
1319
  };
1309
1320
  }
1310
- function oi(n, a, s) {
1311
- const c = n.operations.length - n.revision;
1312
- if (!c)
1321
+ function pi(e, a, s) {
1322
+ const l = e.operations.global.length - e.revision;
1323
+ if (!l)
1313
1324
  throw new Error("There is no UNDO operation to REDO");
1314
- const f = a < c ? a : c, h = n.operations.slice(
1325
+ const f = a < l ? a : l, h = e.operations.global.slice(
1315
1326
  0,
1316
- n.revision + f
1327
+ e.revision + f
1317
1328
  );
1318
1329
  return {
1319
1330
  ...J(
1320
- n.initialState,
1321
- h,
1331
+ e.initialState,
1332
+ {
1333
+ global: h,
1334
+ local: e.operations.local
1335
+ },
1322
1336
  s
1323
1337
  ),
1324
- operations: n.operations,
1325
- revision: n.revision + f
1338
+ operations: e.operations,
1339
+ revision: e.revision + f
1326
1340
  };
1327
1341
  }
1328
- function pi(n, a, s, c) {
1329
- a = a || 0, s = s || n.operations.length;
1330
- const f = n.operations.slice(a, s), h = n.operations.slice(0, a), u = n.operations.slice(s), o = J(
1331
- n.initialState,
1332
- h.concat(f),
1333
- c
1334
- ), { name: x, state: y } = o;
1342
+ function si(e, a, s, l) {
1343
+ a = a || 0, s = s || e.operations.global.length;
1344
+ const f = e.operations.global.slice(a, s), h = e.operations.global.slice(0, a), u = e.operations.global.slice(s), o = J(
1345
+ e.initialState,
1346
+ {
1347
+ global: h.concat(f),
1348
+ local: e.operations.local
1349
+ },
1350
+ l
1351
+ ), { name: x, state: w } = o;
1335
1352
  return J(
1336
- n.initialState,
1337
- [
1338
- ...h,
1339
- ct({ name: x, state: y }, f.length),
1340
- ...u
1341
- ],
1342
- c
1353
+ e.initialState,
1354
+ {
1355
+ global: [
1356
+ ...h,
1357
+ lt({ name: x, state: w }, f.length),
1358
+ ...u
1359
+ ],
1360
+ local: e.operations.local
1361
+ },
1362
+ l
1343
1363
  );
1344
1364
  }
1345
- function si(n, a) {
1365
+ function li(e, a) {
1346
1366
  return {
1347
- ...n,
1367
+ ...e,
1348
1368
  name: a.name,
1349
- state: a.state ?? {}
1369
+ state: a.state ?? { global: {}, local: {} }
1350
1370
  };
1351
1371
  }
1352
- const Pt = "SET_NAME", Y = "UNDO", K = "REDO", M = "PRUNE", Wt = "LOAD_STATE";
1353
- function ci(n, a) {
1354
- return [Y, K, M].includes(a.type) ? n.revision : n.revision + 1;
1372
+ const Wt = "SET_NAME", Y = "UNDO", K = "REDO", M = "PRUNE", Ht = "LOAD_STATE";
1373
+ function ci(e, a) {
1374
+ return [Y, K, M].includes(a.type) ? e.revision : e.revision + 1;
1355
1375
  }
1356
- function li(n, a) {
1376
+ function ui(e, a) {
1357
1377
  return {
1358
- ...n,
1359
- revision: ci(n, a),
1378
+ ...e,
1379
+ revision: ci(e, a),
1360
1380
  lastModified: (/* @__PURE__ */ new Date()).toISOString()
1361
1381
  };
1362
1382
  }
1363
- function ui(n, a) {
1383
+ function fi(e, a) {
1364
1384
  if ([Y, K, M, M].includes(a.type))
1365
- return n;
1366
- const s = n.operations.slice(0, n.revision);
1367
- return {
1368
- ...n,
1369
- operations: [
1370
- ...s,
1371
- {
1372
- ...a,
1373
- index: s.length,
1374
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1375
- hash: ""
1376
- }
1377
- ]
1385
+ return e;
1386
+ const s = e.operations.global.slice(
1387
+ 0,
1388
+ e.revision
1389
+ ), l = e.operations.local.slice();
1390
+ return !a.scope || a.scope === "global" ? s.push({
1391
+ ...a,
1392
+ index: s.length,
1393
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1394
+ hash: "",
1395
+ scope: "global"
1396
+ }) : a.scope === "local" && l.push({
1397
+ ...a,
1398
+ index: l.length,
1399
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1400
+ hash: "",
1401
+ scope: "local"
1402
+ }), {
1403
+ ...e,
1404
+ operations: {
1405
+ global: s,
1406
+ local: l
1407
+ }
1378
1408
  };
1379
1409
  }
1380
- function fi(n, a) {
1381
- let s = ui(n, a);
1382
- return s = li(s, a), s;
1410
+ function hi(e, a) {
1411
+ let s = fi(e, a);
1412
+ return (!a.scope || a.scope === "global") && (s = ui(s, a)), s;
1383
1413
  }
1384
- function hi(n, a, s) {
1385
- switch (kt().parse(a), a.type) {
1386
- case Pt:
1387
- return ni(n, a.input);
1414
+ function mi(e, a, s) {
1415
+ switch (Tt().parse(a), a.type) {
1416
+ case Wt:
1417
+ return ai(e, a.input);
1388
1418
  case Y:
1389
- return ai(n, a.input, s);
1419
+ return oi(e, a.input, s);
1390
1420
  case K:
1391
- return oi(n, a.input, s);
1421
+ return pi(e, a.input, s);
1392
1422
  case M:
1393
- return pi(
1394
- n,
1423
+ return si(
1424
+ e,
1395
1425
  a.input.start,
1396
1426
  a.input.end,
1397
1427
  s
1398
1428
  );
1399
- case Wt:
1400
- return si(n, a.input.state);
1429
+ case Ht:
1430
+ return li(e, a.input.state);
1401
1431
  default:
1402
- return n;
1432
+ return e;
1403
1433
  }
1404
1434
  }
1405
- function mi(n, a, s, c) {
1406
- let f = n;
1407
- return _t(a) && (f = hi(f, a, s)), f = fi(f, a), f = Et(f, (h) => {
1408
- const u = s(h.state, a, c);
1435
+ function xi(e, a, s, l) {
1436
+ let f = e;
1437
+ return _t(a) && (f = mi(f, a, s)), f = hi(f, a), f = bt(f, (h) => {
1438
+ const u = s(h.state, a, l);
1409
1439
  if (u)
1410
1440
  return yr({
1411
1441
  ...f,
1412
1442
  state: u
1413
1443
  });
1414
- }), Et(f, (h) => {
1415
- h.operations[h.operations.length - 1].hash = yi(h), !_t(a) && a.attachments && a.attachments.forEach((u) => {
1444
+ }), bt(f, (h) => {
1445
+ !a.scope || a.scope === "global" ? h.operations.global[h.operations.global.length - 1].hash = Ft(h, "global") : a.scope === "local" && (h.operations.local[h.operations.local.length - 1].hash = Ft(h, "local")), !_t(a) && a.attachments && a.attachments.forEach((u) => {
1416
1446
  const { hash: o, ...x } = u;
1417
1447
  h.attachments[o] = {
1418
1448
  ...x
@@ -1420,68 +1450,72 @@ function mi(n, a, s, c) {
1420
1450
  });
1421
1451
  });
1422
1452
  }
1423
- function _t(n) {
1424
- return [Pt, Y, K, M, Wt].includes(n.type);
1453
+ function _t(e) {
1454
+ return [Wt, Y, K, M, Ht].includes(e.type);
1425
1455
  }
1426
- function R(n, a, s, c, f = "global") {
1427
- if (!n)
1456
+ function R(e, a, s, l, f = "global") {
1457
+ if (!e)
1428
1458
  throw new Error("Empty action type");
1429
- if (typeof n != "string")
1430
- throw new Error(`Invalid action type: ${n}`);
1431
- const h = { type: n, input: a, scope: f };
1432
- return s && (h.attachments = s), c == null || c().parse(h), h;
1459
+ if (typeof e != "string")
1460
+ throw new Error(`Invalid action type: ${e}`);
1461
+ const h = { type: e, input: a, scope: f };
1462
+ return s && (h.attachments = s), l == null || l().parse(h), h;
1433
1463
  }
1434
- function xi(n, a = mi) {
1435
- return (s, c, f) => a(s, c, n, f);
1464
+ function gi(e, a = xi) {
1465
+ return (s, l, f) => a(s, l, e, f);
1436
1466
  }
1437
- const di = (n, a) => ({
1467
+ const di = (e, a) => ({
1438
1468
  name: "",
1439
1469
  documentType: "",
1440
1470
  revision: 0,
1441
1471
  created: (/* @__PURE__ */ new Date()).toISOString(),
1442
1472
  lastModified: (/* @__PURE__ */ new Date()).toISOString(),
1443
1473
  attachments: {},
1444
- ...n,
1445
- state: (a == null ? void 0 : a(n == null ? void 0 : n.state)) ?? (n == null ? void 0 : n.state) ?? {}
1446
- }), wi = (n, a) => {
1474
+ ...e,
1475
+ state: (a == null ? void 0 : a(e == null ? void 0 : e.state)) ?? (e == null ? void 0 : e.state) ?? { global: {}, local: {} }
1476
+ }), wi = (e, a) => {
1447
1477
  const s = di(
1448
- n,
1478
+ e,
1449
1479
  a
1450
1480
  );
1451
1481
  return {
1452
1482
  ...s,
1453
1483
  initialState: s,
1454
- operations: []
1484
+ operations: { global: [], local: [] }
1455
1485
  };
1456
- }, yi = (n) => Z(wr(n.state)), ji = (n, a = 1e3) => {
1486
+ }, Ft = (e, a = "global") => Z(
1487
+ wr(
1488
+ a === "local" ? e.state.local : e.state.global
1489
+ )
1490
+ ), ji = (e, a = 1e3) => {
1457
1491
  const s = Math.random() * a;
1458
- return Z(`${(n ?? /* @__PURE__ */ new Date()).toISOString()}${s}`);
1492
+ return Z(`${(e ?? /* @__PURE__ */ new Date()).toISOString()}${s}`);
1459
1493
  };
1460
- function $(n) {
1461
- return gr(vr(n, !0));
1494
+ function $(e) {
1495
+ return vr(br(e, !0));
1462
1496
  }
1463
- const Ht = (n) => R(
1497
+ const Zt = (e) => R(
1464
1498
  "SET_NAME",
1465
- n,
1499
+ e,
1466
1500
  void 0,
1467
1501
  at
1468
- ), Zt = (n = 1) => R("UNDO", n, void 0, ot), Yt = (n = 1) => R("REDO", n, void 0, nt), Kt = (n, a) => R(
1502
+ ), Yt = (e = 1) => R("UNDO", e, void 0, ot), Kt = (e = 1) => R("REDO", e, void 0, nt), Xt = (e, a) => R(
1469
1503
  "PRUNE",
1470
- { start: n, end: a },
1504
+ { start: e, end: a },
1471
1505
  void 0,
1472
1506
  et
1473
- ), ct = (n, a) => R(
1507
+ ), lt = (e, a) => R(
1474
1508
  "LOAD_STATE",
1475
- { state: n, operations: a },
1509
+ { state: e, operations: a },
1476
1510
  void 0,
1477
1511
  it
1478
1512
  ), Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1479
1513
  __proto__: null,
1480
- loadState: ct,
1481
- prune: Kt,
1482
- redo: Yt,
1483
- setName: Ht,
1484
- undo: Zt
1514
+ loadState: lt,
1515
+ prune: Xt,
1516
+ redo: Kt,
1517
+ setName: Zt,
1518
+ undo: Yt
1485
1519
  }, Symbol.toStringTag, { value: "Module" }));
1486
1520
  class Ii {
1487
1521
  /**
@@ -1489,11 +1523,11 @@ class Ii {
1489
1523
  * @param reducer - The reducer function that updates the state.
1490
1524
  * @param document - The initial state of the document.
1491
1525
  */
1492
- constructor(a, s, c) {
1526
+ constructor(a, s, l) {
1493
1527
  q(this, "_document");
1494
1528
  q(this, "_reducer");
1495
1529
  q(this, "_signalDispatch");
1496
- this._reducer = a, this._document = s, this._signalDispatch = c;
1530
+ this._reducer = a, this._document = s, this._signalDispatch = l;
1497
1531
  }
1498
1532
  /**
1499
1533
  * Dispatches an action to update the state of the document.
@@ -1513,15 +1547,15 @@ class Ii {
1513
1547
  * @param extension - The file extension to use when saving the state.
1514
1548
  * @returns The file path where the state was saved.
1515
1549
  */
1516
- saveToFile(a, s, c) {
1517
- return ri(this._document, a, s, c);
1550
+ saveToFile(a, s, l) {
1551
+ return ii(this._document, a, s, l);
1518
1552
  }
1519
1553
  /**
1520
1554
  * Loads the state of the document from a file.
1521
1555
  * @param path - The file path where the state is stored.
1522
1556
  */
1523
1557
  async loadFromFile(a) {
1524
- this._document = await bt(a, this._reducer);
1558
+ this._document = await Et(a, this._reducer);
1525
1559
  }
1526
1560
  /**
1527
1561
  * Loads the state of the document from a file and returns it.
@@ -1530,7 +1564,7 @@ class Ii {
1530
1564
  * @returns The state of the document.
1531
1565
  */
1532
1566
  static async stateFromFile(a, s) {
1533
- return await bt(a, s);
1567
+ return await Et(a, s);
1534
1568
  }
1535
1569
  /**
1536
1570
  * Gets the current state of the document.
@@ -1598,21 +1632,21 @@ class Ii {
1598
1632
  * @param name - The new name of the document.
1599
1633
  */
1600
1634
  setName(a) {
1601
- return this.dispatch(Ht(a)), this;
1635
+ return this.dispatch(Zt(a)), this;
1602
1636
  }
1603
1637
  /**
1604
1638
  * Reverts a number of actions from the document.
1605
1639
  * @param count - The number of actions to revert.
1606
1640
  */
1607
1641
  undo(a) {
1608
- return this.dispatch(Zt(a)), this;
1642
+ return this.dispatch(Yt(a)), this;
1609
1643
  }
1610
1644
  /**
1611
1645
  * Reapplies a number of actions to the document.
1612
1646
  * @param count - The number of actions to reapply.
1613
1647
  */
1614
1648
  redo(a) {
1615
- return this.dispatch(Yt(a)), this;
1649
+ return this.dispatch(Kt(a)), this;
1616
1650
  }
1617
1651
  /**
1618
1652
  * Removes a range of operations from the document.
@@ -1620,7 +1654,7 @@ class Ii {
1620
1654
  * @param end - The ending index of the range to remove.
1621
1655
  */
1622
1656
  prune(a, s) {
1623
- return this.dispatch(Kt(a, s)), this;
1657
+ return this.dispatch(Xt(a, s)), this;
1624
1658
  }
1625
1659
  /**
1626
1660
  * Loads a document state and a set of operations.
@@ -1628,16 +1662,16 @@ class Ii {
1628
1662
  * @param operations - The operations to apply to the document.
1629
1663
  */
1630
1664
  loadState(a, s) {
1631
- return this.dispatch(ct(a, s)), this;
1665
+ return this.dispatch(lt(a, s)), this;
1632
1666
  }
1633
1667
  }
1634
- function ki(n, a) {
1668
+ function ki(e, a) {
1635
1669
  a.forEach((s) => {
1636
- Object.getOwnPropertyNames(s.prototype).forEach((c) => {
1670
+ Object.getOwnPropertyNames(s.prototype).forEach((l) => {
1637
1671
  Object.defineProperty(
1638
- n.prototype,
1639
- c,
1640
- Object.getOwnPropertyDescriptor(s.prototype, c) || /* @__PURE__ */ Object.create(null)
1672
+ e.prototype,
1673
+ l,
1674
+ Object.getOwnPropertyDescriptor(s.prototype, l) || /* @__PURE__ */ Object.create(null)
1641
1675
  );
1642
1676
  });
1643
1677
  });
@@ -1646,21 +1680,21 @@ export {
1646
1680
  Ii as B,
1647
1681
  di as a,
1648
1682
  wi as b,
1649
- xi as c,
1683
+ gi as c,
1650
1684
  Ai as d,
1651
- ii as e,
1685
+ ei as e,
1652
1686
  R as f,
1653
1687
  ki as g,
1654
1688
  Ui as h,
1655
1689
  _t as i,
1656
- $t as j,
1690
+ Jt as j,
1657
1691
  Si as k,
1658
- bt as l,
1692
+ Et as l,
1659
1693
  Bi as m,
1660
- yi as n,
1694
+ Ft as n,
1661
1695
  ji as o,
1662
- mi as p,
1696
+ xi as p,
1663
1697
  $ as r,
1664
- ri as s,
1698
+ ii as s,
1665
1699
  Fi as z
1666
1700
  };