@wp-playground/storage 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 (3) hide show
  1. package/index.cjs +17 -17
  2. package/index.js +817 -792
  3. package/package.json +5 -5
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { Semaphore as Lt, normalizePath as Mt, joinPaths as Ie } from "@php-wasm/util";
2
- import { Octokit as _e } from "octokit";
3
- import Ae from "crc-32";
4
- import Gt from "pako";
1
+ import { Semaphore as Lt, normalizePath as Mt, joinPaths as Ee } from "@php-wasm/util";
2
+ import { Octokit as Ie } from "octokit";
3
+ import _e from "crc-32";
4
+ import vt from "pako";
5
5
  function jr(n) {
6
- return new _e({
6
+ return new Ie({
7
7
  auth: n
8
8
  });
9
9
  }
@@ -14,15 +14,15 @@ function Lr(n, r = "") {
14
14
  s.path.startsWith(r) && (o[s.path.substring(r.length)] = s.content);
15
15
  return o;
16
16
  }
17
- async function Fe(n, r, o, s, f, u = {}) {
18
- u.progress || (u.progress = {
17
+ async function Ae(n, r, o, s, u, f = {}) {
18
+ f.progress || (f.progress = {
19
19
  foundFiles: 0,
20
20
  downloadedFiles: 0
21
21
  });
22
- const { onProgress: h } = u, c = [], w = [], { data: y } = await n.rest.repos.getContent({
22
+ const { onProgress: h } = f, a = [], w = [], { data: y } = await n.rest.repos.getContent({
23
23
  owner: r,
24
24
  repo: o,
25
- path: f,
25
+ path: u,
26
26
  ref: s
27
27
  });
28
28
  if (!Array.isArray(y))
@@ -30,65 +30,65 @@ async function Fe(n, r, o, s, f, u = {}) {
30
30
  `Expected the list of files to be an array, but got ${typeof y}`
31
31
  );
32
32
  for (const b of y)
33
- b.type === "file" ? (++u.progress.foundFiles, h == null || h(u.progress), c.push(
34
- Se(n, r, o, s, b).then((B) => (++u.progress.downloadedFiles, h == null || h(u.progress), B))
33
+ b.type === "file" ? (++f.progress.foundFiles, h == null || h(f.progress), a.push(
34
+ Ue(n, r, o, s, b).then((B) => (++f.progress.downloadedFiles, h == null || h(f.progress), B))
35
35
  )) : b.type === "dir" && w.push(
36
- Fe(
36
+ Ae(
37
37
  n,
38
38
  r,
39
39
  o,
40
40
  s,
41
41
  b.path,
42
- u
42
+ f
43
43
  )
44
44
  );
45
- const g = await Promise.all(c), m = (await Promise.all(w)).flatMap(
45
+ const g = await Promise.all(a), m = (await Promise.all(w)).flatMap(
46
46
  (b) => b
47
47
  );
48
48
  return [...g, ...m];
49
49
  }
50
- const Ue = new Lt({ concurrency: 15 });
51
- async function Se(n, r, o, s, f) {
52
- const u = await Ue.acquire();
50
+ const Fe = new Lt({ concurrency: 15 });
51
+ async function Ue(n, r, o, s, u) {
52
+ const f = await Fe.acquire();
53
53
  try {
54
54
  const { data: h } = await n.rest.repos.getContent({
55
55
  owner: r,
56
56
  repo: o,
57
57
  ref: s,
58
- path: f.path
58
+ path: u.path
59
59
  });
60
60
  if (!("content" in h))
61
- throw new Error(`No content found for ${f.path}`);
61
+ throw new Error(`No content found for ${u.path}`);
62
62
  return {
63
- name: f.name,
64
- path: f.path,
65
- content: ke(h.content)
63
+ name: u.name,
64
+ path: u.path,
65
+ content: Se(h.content)
66
66
  };
67
67
  } finally {
68
- u();
68
+ f();
69
69
  }
70
70
  }
71
- function ke(n) {
71
+ function Se(n) {
72
72
  const r = window.atob(n), o = r.length, s = new Uint8Array(o);
73
- for (let f = 0; f < o; f++)
74
- s[f] = r.charCodeAt(f);
73
+ for (let u = 0; u < o; u++)
74
+ s[u] = r.charCodeAt(u);
75
75
  return s;
76
76
  }
77
- async function Mr(n, r, o, s, f) {
77
+ async function Mr(n, r, o, s, u) {
78
78
  var g;
79
- const { data: u } = await n.rest.pulls.get({
79
+ const { data: f } = await n.rest.pulls.get({
80
80
  owner: r,
81
81
  repo: o,
82
82
  pull_number: s
83
- }), c = (g = (await n.rest.actions.listWorkflowRuns({
83
+ }), a = (g = (await n.rest.actions.listWorkflowRuns({
84
84
  owner: r,
85
85
  repo: o,
86
- branch: u.head.ref,
87
- workflow_id: f
86
+ branch: f.head.ref,
87
+ workflow_id: u
88
88
  })).data.workflow_runs[0]) == null ? void 0 : g.id, w = await n.rest.actions.listWorkflowRunArtifacts({
89
89
  owner: r,
90
90
  repo: o,
91
- run_id: c
91
+ run_id: a
92
92
  });
93
93
  return (await n.rest.actions.downloadArtifact({
94
94
  owner: r,
@@ -97,18 +97,18 @@ async function Mr(n, r, o, s, f) {
97
97
  archive_format: "zip"
98
98
  })).data;
99
99
  }
100
- async function Gr(n, r, o) {
101
- var u;
102
- const { data: s, headers: f } = await n.request(
100
+ async function vr(n, r, o) {
101
+ var f;
102
+ const { data: s, headers: u } = await n.request(
103
103
  "GET /repos/{owner}/{repo}",
104
104
  {
105
105
  owner: r,
106
106
  repo: o
107
107
  }
108
108
  );
109
- return !(!f["x-oauth-scopes"] || !((u = s.permissions) != null && u.push));
109
+ return !(!u["x-oauth-scopes"] || !((f = s.permissions) != null && f.push));
110
110
  }
111
- async function Hr(n, r, o, s, f) {
111
+ async function Gr(n, r, o, s, u) {
112
112
  await n.request("GET /repos/{owner}/{repo}/branches/{branch}", {
113
113
  owner: r,
114
114
  repo: o,
@@ -119,16 +119,16 @@ async function Hr(n, r, o, s, f) {
119
119
  ) ? await n.request("PATCH /repos/{owner}/{repo}/git/refs/{ref}", {
120
120
  owner: r,
121
121
  repo: o,
122
- sha: f,
122
+ sha: u,
123
123
  ref: `heads/${s}`
124
124
  }) : await n.request("POST /repos/{owner}/{repo}/git/refs", {
125
125
  owner: r,
126
126
  repo: o,
127
- sha: f,
127
+ sha: u,
128
128
  ref: `refs/heads/${s}`
129
129
  });
130
130
  }
131
- async function qr(n, r, o) {
131
+ async function Hr(n, r, o) {
132
132
  const s = await n.request("GET /user");
133
133
  return (await n.request("GET /repos/{owner}/{repo}/forks", {
134
134
  owner: r,
@@ -140,27 +140,27 @@ async function qr(n, r, o) {
140
140
  repo: o
141
141
  }), s.data.login;
142
142
  }
143
- async function vr(n, r, o, s, f, u) {
143
+ async function qr(n, r, o, s, u, f) {
144
144
  const {
145
145
  data: { sha: h }
146
146
  } = await n.request("POST /repos/{owner}/{repo}/git/commits", {
147
147
  owner: r,
148
148
  repo: o,
149
149
  message: s,
150
- tree: u,
151
- parents: [f]
150
+ tree: f,
151
+ parents: [u]
152
152
  });
153
153
  return h;
154
154
  }
155
- async function zr(n, r, o, s, f) {
156
- const u = await Te(
155
+ async function zr(n, r, o, s, u) {
156
+ const f = await ke(
157
157
  n,
158
158
  r,
159
159
  o,
160
160
  s,
161
- f
161
+ u
162
162
  );
163
- if (u.length === 0)
163
+ if (f.length === 0)
164
164
  return null;
165
165
  const {
166
166
  data: { sha: h }
@@ -168,31 +168,31 @@ async function zr(n, r, o, s, f) {
168
168
  owner: r,
169
169
  repo: o,
170
170
  base_tree: s,
171
- tree: u
171
+ tree: f
172
172
  });
173
173
  return h;
174
174
  }
175
- async function Te(n, r, o, s, f) {
176
- const u = [];
177
- for (const [h, c] of f.create)
178
- u.push(Ct(n, r, o, h, c));
179
- for (const [h, c] of f.update)
180
- u.push(Ct(n, r, o, h, c));
181
- for (const h of f.delete)
182
- u.push($e(n, r, o, s, h));
183
- return Promise.all(u).then(
184
- (h) => h.filter((c) => !!c)
175
+ async function ke(n, r, o, s, u) {
176
+ const f = [];
177
+ for (const [h, a] of u.create)
178
+ f.push(Ct(n, r, o, h, a));
179
+ for (const [h, a] of u.update)
180
+ f.push(Ct(n, r, o, h, a));
181
+ for (const h of u.delete)
182
+ f.push(Te(n, r, o, s, h));
183
+ return Promise.all(f).then(
184
+ (h) => h.filter((a) => !!a)
185
185
  );
186
186
  }
187
- const Ht = new Lt({ concurrency: 10 });
188
- async function Ct(n, r, o, s, f) {
189
- const u = await Ht.acquire();
187
+ const Gt = new Lt({ concurrency: 10 });
188
+ async function Ct(n, r, o, s, u) {
189
+ const f = await Gt.acquire();
190
190
  try {
191
- if (ArrayBuffer.isView(f))
191
+ if (ArrayBuffer.isView(u))
192
192
  try {
193
193
  const h = new TextDecoder("utf-8", {
194
194
  fatal: !0
195
- }).decode(f);
195
+ }).decode(u);
196
196
  return {
197
197
  path: s,
198
198
  content: h,
@@ -200,49 +200,49 @@ async function Ct(n, r, o, s, f) {
200
200
  };
201
201
  } catch {
202
202
  const {
203
- data: { sha: c }
203
+ data: { sha: a }
204
204
  } = await n.rest.git.createBlob({
205
205
  owner: r,
206
206
  repo: o,
207
207
  encoding: "base64",
208
- content: Re(f)
208
+ content: $e(u)
209
209
  });
210
210
  return {
211
211
  path: s,
212
- sha: c,
212
+ sha: a,
213
213
  mode: "100644"
214
214
  };
215
215
  }
216
216
  else
217
217
  return {
218
218
  path: s,
219
- content: f,
219
+ content: u,
220
220
  mode: "100644"
221
221
  };
222
222
  } finally {
223
- u();
223
+ f();
224
224
  }
225
225
  }
226
- async function $e(n, r, o, s, f) {
227
- const u = await Ht.acquire();
226
+ async function Te(n, r, o, s, u) {
227
+ const f = await Gt.acquire();
228
228
  try {
229
229
  return await n.request("HEAD /repos/{owner}/{repo}/contents/:path", {
230
230
  owner: r,
231
231
  repo: o,
232
232
  ref: s,
233
- path: f
233
+ path: u
234
234
  }), {
235
- path: f,
235
+ path: u,
236
236
  mode: "100644",
237
237
  sha: null
238
238
  };
239
239
  } catch {
240
240
  return;
241
241
  } finally {
242
- u();
242
+ f();
243
243
  }
244
244
  }
245
- function Re(n) {
245
+ function $e(n) {
246
246
  const r = [], o = n.byteLength;
247
247
  for (let s = 0; s < o; s++)
248
248
  r.push(String.fromCharCode(n[s]));
@@ -258,15 +258,15 @@ async function* Wr(n, r, { exceptPaths: o = [] } = {}) {
258
258
  }
259
259
  const s = [r];
260
260
  for (; s.length; ) {
261
- const f = s.pop();
262
- if (!f)
261
+ const u = s.pop();
262
+ if (!u)
263
263
  return;
264
- const u = await n.listFiles(f);
265
- for (const h of u) {
266
- const c = Ie(f, h);
267
- o.includes(c.substring(r.length + 1)) || (await n.isDir(c) ? s.push(c) : yield {
268
- path: c,
269
- read: async () => await n.readFileAsBuffer(c)
264
+ const f = await n.listFiles(u);
265
+ for (const h of f) {
266
+ const a = Ee(u, h);
267
+ o.includes(a.substring(r.length + 1)) || (await n.isDir(a) ? s.push(a) : yield {
268
+ path: a,
269
+ read: async () => await n.readFileAsBuffer(a)
270
270
  });
271
271
  }
272
272
  }
@@ -277,22 +277,22 @@ async function Yr(n, r) {
277
277
  update: /* @__PURE__ */ new Map(),
278
278
  delete: /* @__PURE__ */ new Set()
279
279
  }, s = /* @__PURE__ */ new Set();
280
- for await (const f of r) {
281
- s.add(f.path);
282
- const u = n.get(f.path), h = await f.read();
283
- u ? Ce(u, h) || o.update.set(f.path, h) : o.create.set(f.path, h);
280
+ for await (const u of r) {
281
+ s.add(u.path);
282
+ const f = n.get(u.path), h = await u.read();
283
+ f ? Re(f, h) || o.update.set(u.path, h) : o.create.set(u.path, h);
284
284
  }
285
- for (const f of n.keys())
286
- s.has(f) || o.delete.add(f);
285
+ for (const u of n.keys())
286
+ s.has(u) || o.delete.add(u);
287
287
  return o;
288
288
  }
289
- function Ce(n, r) {
289
+ function Re(n, r) {
290
290
  return n.length === r.length && n.every((o, s) => o === r[s]);
291
291
  }
292
- async function Oe(n) {
293
- return n.type === "local-fs" ? n.handle : Pe(n.path);
292
+ async function Ce(n) {
293
+ return n.type === "local-fs" ? n.handle : Oe(n.path);
294
294
  }
295
- async function Pe(n) {
295
+ async function Oe(n) {
296
296
  const r = n.split("/").filter((s) => s.length > 0);
297
297
  let o = await navigator.storage.getDirectory();
298
298
  for (const s of r)
@@ -309,13 +309,13 @@ async function Vr(n) {
309
309
  return "/" + o.join("/");
310
310
  }
311
311
  async function Kr(n) {
312
- const r = await Oe(n);
312
+ const r = await Ce(n);
313
313
  for await (const o of r.keys())
314
314
  await r.removeEntry(o, {
315
315
  recursive: !0
316
316
  });
317
317
  }
318
- function De(n) {
318
+ function Pe(n) {
319
319
  let r = [n];
320
320
  return {
321
321
  next() {
@@ -329,14 +329,14 @@ function De(n) {
329
329
  }
330
330
  };
331
331
  }
332
- function qt(n) {
333
- return n[Symbol.asyncIterator] ? n[Symbol.asyncIterator]() : n[Symbol.iterator] ? n[Symbol.iterator]() : n.next ? n : De(n);
332
+ function Ht(n) {
333
+ return n[Symbol.asyncIterator] ? n[Symbol.asyncIterator]() : n[Symbol.iterator] ? n[Symbol.iterator]() : n.next ? n : Pe(n);
334
334
  }
335
- class vt {
335
+ class qt {
336
336
  constructor(r) {
337
337
  if (typeof Buffer > "u")
338
338
  throw new Error("Missing Buffer dependency");
339
- this.stream = qt(r), this.buffer = null, this.cursor = 0, this.undoCursor = 0, this.started = !1, this._ended = !1, this._discardedBytes = 0;
339
+ this.stream = Ht(r), this.buffer = null, this.cursor = 0, this.undoCursor = 0, this.started = !1, this._ended = !1, this._discardedBytes = 0;
340
340
  }
341
341
  eof() {
342
342
  return this._ended && this.cursor === this.buffer.length;
@@ -395,7 +395,7 @@ class vt {
395
395
  function Ne(n) {
396
396
  return n.reduce((r, o) => r + o.length, 0);
397
397
  }
398
- function je(n, r) {
398
+ function De(n, r) {
399
399
  const o = r.toString(16);
400
400
  return "0".repeat(n - o.length) + o;
401
401
  }
@@ -408,22 +408,22 @@ class k {
408
408
  }
409
409
  static encode(r) {
410
410
  typeof r == "string" && (r = Buffer.from(r));
411
- const o = r.length + 4, s = je(4, o);
411
+ const o = r.length + 4, s = De(4, o);
412
412
  return Buffer.concat([Buffer.from(s, "utf8"), r]);
413
413
  }
414
414
  static streamReader(r) {
415
- const o = new vt(r);
415
+ const o = new qt(r);
416
416
  return async function() {
417
417
  try {
418
- let f = await o.read(4);
419
- if (f == null)
418
+ let u = await o.read(4);
419
+ if (u == null)
420
420
  return !0;
421
- if (f = parseInt(f.toString("utf8"), 16), f === 0 || f === 1)
421
+ if (u = parseInt(u.toString("utf8"), 16), u === 0 || u === 1)
422
422
  return null;
423
- const u = await o.read(f - 4);
424
- return u ?? !0;
425
- } catch (f) {
426
- return r.error = f, !0;
423
+ const f = await o.read(u - 4);
424
+ return f ?? !0;
425
+ } catch (u) {
426
+ return r.error = u, !0;
427
427
  }
428
428
  };
429
429
  }
@@ -472,10 +472,10 @@ ot.code = "UnsafeFilepathError";
472
472
  function zt(n, r) {
473
473
  return -(n < r) || +(n > r);
474
474
  }
475
- function Le(n, r) {
475
+ function je(n, r) {
476
476
  return zt(n.path, r.path);
477
477
  }
478
- function Me(n, r) {
478
+ function Le(n, r) {
479
479
  return zt(Ot(n), Ot(r));
480
480
  }
481
481
  function Ot(n) {
@@ -496,7 +496,7 @@ function Wt(n) {
496
496
  }
497
497
  throw new _(`Unexpected GitTree entry mode: ${n}`);
498
498
  }
499
- function Ge(n) {
499
+ function Me(n) {
500
500
  const r = [];
501
501
  let o = 0;
502
502
  for (; o < n.length; ) {
@@ -505,22 +505,22 @@ function Ge(n) {
505
505
  throw new _(
506
506
  `GitTree: Error parsing buffer at byte location ${o}: Could not find the next space character.`
507
507
  );
508
- const f = n.indexOf(0, o);
509
- if (f === -1)
508
+ const u = n.indexOf(0, o);
509
+ if (u === -1)
510
510
  throw new _(
511
511
  `GitTree: Error parsing buffer at byte location ${o}: Could not find the next null character.`
512
512
  );
513
- let u = n.slice(o, s).toString("utf8");
514
- u === "40000" && (u = "040000");
515
- const h = Wt(u), c = n.slice(s + 1, f).toString("utf8");
516
- if (c.includes("\\") || c.includes("/"))
517
- throw new ot(c);
518
- const w = n.slice(f + 1, f + 21).toString("hex");
519
- o = f + 21, r.push({ mode: u, path: c, oid: w, type: h });
513
+ let f = n.slice(o, s).toString("utf8");
514
+ f === "40000" && (f = "040000");
515
+ const h = Wt(f), a = n.slice(s + 1, u).toString("utf8");
516
+ if (a.includes("\\") || a.includes("/"))
517
+ throw new ot(a);
518
+ const w = n.slice(u + 1, u + 21).toString("hex");
519
+ o = u + 21, r.push({ mode: f, path: a, oid: w, type: h });
520
520
  }
521
521
  return r;
522
522
  }
523
- function He(n) {
523
+ function ve(n) {
524
524
  if (typeof n == "number" && (n = n.toString(8)), n.match(/^0?4.*/))
525
525
  return "040000";
526
526
  if (n.match(/^1006.*/))
@@ -533,18 +533,18 @@ function He(n) {
533
533
  return "160000";
534
534
  throw new _(`Could not understand file mode: ${n}`);
535
535
  }
536
- function qe(n) {
537
- return !n.oid && n.sha && (n.oid = n.sha), n.mode = He(n.mode), n.type || (n.type = Wt(n.mode)), n;
536
+ function Ge(n) {
537
+ return !n.oid && n.sha && (n.oid = n.sha), n.mode = ve(n.mode), n.type || (n.type = Wt(n.mode)), n;
538
538
  }
539
539
  class bt {
540
540
  constructor(r) {
541
541
  if (Buffer.isBuffer(r))
542
- this._entries = Ge(r);
542
+ this._entries = Me(r);
543
543
  else if (Array.isArray(r))
544
- this._entries = r.map(qe);
544
+ this._entries = r.map(Ge);
545
545
  else
546
546
  throw new _("invalid type passed to GitTree constructor");
547
- this._entries.sort(Le);
547
+ this._entries.sort(je);
548
548
  }
549
549
  static from(r) {
550
550
  return new bt(r);
@@ -555,10 +555,10 @@ class bt {
555
555
  }
556
556
  toObject() {
557
557
  const r = [...this._entries];
558
- return r.sort(Me), Buffer.concat(
558
+ return r.sort(Le), Buffer.concat(
559
559
  r.map((o) => {
560
- const s = Buffer.from(o.mode.replace(/^0/, "")), f = Buffer.from(" "), u = Buffer.from(o.path, "utf8"), h = Buffer.from([0]), c = Buffer.from(o.oid, "hex");
561
- return Buffer.concat([s, f, u, h, c]);
560
+ const s = Buffer.from(o.mode.replace(/^0/, "")), u = Buffer.from(" "), f = Buffer.from(o.path, "utf8"), h = Buffer.from([0]), a = Buffer.from(o.oid, "hex");
561
+ return Buffer.concat([s, u, f, h, a]);
562
562
  })
563
563
  );
564
564
  }
@@ -574,42 +574,42 @@ class bt {
574
574
  }
575
575
  }
576
576
  function yt({ name: n, email: r, timestamp: o, timezoneOffset: s }) {
577
- return s = ve(s), `${n} <${r}> ${o} ${s}`;
577
+ return s = He(s), `${n} <${r}> ${o} ${s}`;
578
578
  }
579
- function ve(n) {
580
- const r = ze(We(n));
579
+ function He(n) {
580
+ const r = qe(ze(n));
581
581
  n = Math.abs(n);
582
582
  const o = Math.floor(n / 60);
583
583
  n -= o * 60;
584
- let s = String(o), f = String(n);
585
- return s.length < 2 && (s = "0" + s), f.length < 2 && (f = "0" + f), (r === -1 ? "-" : "+") + s + f;
584
+ let s = String(o), u = String(n);
585
+ return s.length < 2 && (s = "0" + s), u.length < 2 && (u = "0" + u), (r === -1 ? "-" : "+") + s + u;
586
586
  }
587
- function ze(n) {
587
+ function qe(n) {
588
588
  return Math.sign(n) || (Object.is(n, -0) ? -1 : 1);
589
589
  }
590
- function We(n) {
590
+ function ze(n) {
591
591
  return n === 0 ? n : -n;
592
592
  }
593
- function H(n) {
593
+ function G(n) {
594
594
  return n = n.replace(/\r/g, ""), n = n.replace(/^\n+/, ""), n = n.replace(/\n+$/, "") + `
595
595
  `, n;
596
596
  }
597
597
  function it(n) {
598
- const [, r, o, s, f] = n.match(
598
+ const [, r, o, s, u] = n.match(
599
599
  /^(.*) <(.*)> (.*) (.*)$/
600
600
  );
601
601
  return {
602
602
  name: r,
603
603
  email: o,
604
604
  timestamp: Number(s),
605
- timezoneOffset: Ye(f)
605
+ timezoneOffset: We(u)
606
606
  };
607
607
  }
608
- function Ye(n) {
608
+ function We(n) {
609
609
  let [, r, o, s] = n.match(/(\+|-)(\d\d)(\d\d)/);
610
- return s = (r === "+" ? 1 : -1) * (Number(o) * 60 + Number(s)), Ve(s);
610
+ return s = (r === "+" ? 1 : -1) * (Number(o) * 60 + Number(s)), Ye(s);
611
611
  }
612
- function Ve(n) {
612
+ function Ye(n) {
613
613
  return n === 0 ? n : -n;
614
614
  }
615
615
  class Z {
@@ -660,18 +660,18 @@ ${r.gpgsig ? r.gpgsig : ""}`;
660
660
  headers() {
661
661
  const r = this.justHeaders().split(`
662
662
  `), o = [];
663
- for (const f of r)
664
- f[0] === " " ? o[o.length - 1] += `
665
- ` + f.slice(1) : o.push(f);
663
+ for (const u of r)
664
+ u[0] === " " ? o[o.length - 1] += `
665
+ ` + u.slice(1) : o.push(u);
666
666
  const s = {};
667
- for (const f of o) {
668
- const u = f.slice(0, f.indexOf(" ")), h = f.slice(f.indexOf(" ") + 1);
669
- Array.isArray(s[u]) ? s[u].push(h) : s[u] = h;
667
+ for (const u of o) {
668
+ const f = u.slice(0, u.indexOf(" ")), h = u.slice(u.indexOf(" ") + 1);
669
+ Array.isArray(s[f]) ? s[f].push(h) : s[f] = h;
670
670
  }
671
671
  return s.tagger && (s.tagger = it(s.tagger)), s.committer && (s.committer = it(s.committer)), s;
672
672
  }
673
673
  withoutSignature() {
674
- const r = H(this._tag);
674
+ const r = G(this._tag);
675
675
  return r.indexOf(`
676
676
  -----BEGIN PGP SIGNATURE-----`) === -1 ? r : r.slice(0, r.lastIndexOf(`
677
677
  -----BEGIN PGP SIGNATURE-----`));
@@ -684,7 +684,7 @@ ${r.gpgsig ? r.gpgsig : ""}`;
684
684
  this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),
685
685
  this._tag.indexOf("-----END PGP SIGNATURE-----") + 27
686
686
  );
687
- return H(r);
687
+ return G(r);
688
688
  }
689
689
  payload() {
690
690
  return this.withoutSignature() + `
@@ -694,10 +694,10 @@ ${r.gpgsig ? r.gpgsig : ""}`;
694
694
  return Buffer.from(this._tag, "utf8");
695
695
  }
696
696
  static async sign(r, o, s) {
697
- const f = r.payload();
698
- let { signature: u } = await o({ payload: f, secretKey: s });
699
- u = H(u);
700
- const h = f + u;
697
+ const u = r.payload();
698
+ let { signature: f } = await o({ payload: u, secretKey: s });
699
+ f = G(f);
700
+ const h = u + f;
701
701
  return Z.from(h);
702
702
  }
703
703
  }
@@ -707,7 +707,7 @@ function lt(n) {
707
707
  `) + `
708
708
  `;
709
709
  }
710
- function Ke(n) {
710
+ function Ve(n) {
711
711
  return n.split(`
712
712
  `).map((r) => r.replace(/^ /, "")).join(`
713
713
  `);
@@ -724,12 +724,12 @@ class O {
724
724
  throw new _("invalid type passed to GitCommit constructor");
725
725
  }
726
726
  static fromPayloadSignature({ payload: r, signature: o }) {
727
- const s = O.justHeaders(r), f = O.justMessage(r), u = H(
727
+ const s = O.justHeaders(r), u = O.justMessage(r), f = G(
728
728
  s + `
729
729
  gpgsig` + lt(o) + `
730
- ` + f
730
+ ` + u
731
731
  );
732
- return new O(u);
732
+ return new O(f);
733
733
  }
734
734
  static from(r) {
735
735
  return new O(r);
@@ -749,7 +749,7 @@ gpgsig` + lt(o) + `
749
749
  return Object.assign({ message: this.message() }, this.headers());
750
750
  }
751
751
  static justMessage(r) {
752
- return H(r.slice(r.indexOf(`
752
+ return G(r.slice(r.indexOf(`
753
753
 
754
754
  `) + 2));
755
755
  }
@@ -761,15 +761,15 @@ gpgsig` + lt(o) + `
761
761
  parseHeaders() {
762
762
  const r = O.justHeaders(this._commit).split(`
763
763
  `), o = [];
764
- for (const f of r)
765
- f[0] === " " ? o[o.length - 1] += `
766
- ` + f.slice(1) : o.push(f);
764
+ for (const u of r)
765
+ u[0] === " " ? o[o.length - 1] += `
766
+ ` + u.slice(1) : o.push(u);
767
767
  const s = {
768
768
  parent: []
769
769
  };
770
- for (const f of o) {
771
- const u = f.slice(0, f.indexOf(" ")), h = f.slice(f.indexOf(" ") + 1);
772
- Array.isArray(s[u]) ? s[u].push(h) : s[u] = h;
770
+ for (const u of o) {
771
+ const f = u.slice(0, u.indexOf(" ")), h = u.slice(u.indexOf(" ") + 1);
772
+ Array.isArray(s[f]) ? s[f].push(h) : s[f] = h;
773
773
  }
774
774
  return s.author && (s.author = it(s.author)), s.committer && (s.committer = it(s.committer)), s;
775
775
  }
@@ -780,26 +780,26 @@ gpgsig` + lt(o) + `
780
780
  `, r.parent) {
781
781
  if (r.parent.length === void 0)
782
782
  throw new _("commit 'parent' property should be an array");
783
- for (const u of r.parent)
784
- o += `parent ${u}
783
+ for (const f of r.parent)
784
+ o += `parent ${f}
785
785
  `;
786
786
  }
787
787
  const s = r.author;
788
788
  o += `author ${yt(s)}
789
789
  `;
790
- const f = r.committer || r.author;
791
- return o += `committer ${yt(f)}
790
+ const u = r.committer || r.author;
791
+ return o += `committer ${yt(u)}
792
792
  `, r.gpgsig && (o += "gpgsig" + lt(r.gpgsig)), o;
793
793
  }
794
794
  static render(r) {
795
795
  return O.renderHeaders(r) + `
796
- ` + H(r.message);
796
+ ` + G(r.message);
797
797
  }
798
798
  render() {
799
799
  return this._commit;
800
800
  }
801
801
  withoutSignature() {
802
- const r = H(this._commit);
802
+ const r = G(this._commit);
803
803
  if (r.indexOf(`
804
804
  gpgsig`) === -1)
805
805
  return r;
@@ -808,7 +808,7 @@ gpgsig`)), s = r.slice(
808
808
  r.indexOf(`-----END PGP SIGNATURE-----
809
809
  `) + 28
810
810
  );
811
- return H(o + `
811
+ return G(o + `
812
812
  ` + s);
813
813
  }
814
814
  isolateSignature() {
@@ -816,19 +816,19 @@ gpgsig`)), s = r.slice(
816
816
  this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),
817
817
  this._commit.indexOf("-----END PGP SIGNATURE-----") + 27
818
818
  );
819
- return Ke(r);
819
+ return Ve(r);
820
820
  }
821
821
  static async sign(r, o, s) {
822
- const f = r.withoutSignature(), u = O.justMessage(r._commit);
823
- let { signature: h } = await o({ payload: f, secretKey: s });
824
- h = H(h);
822
+ const u = r.withoutSignature(), f = O.justMessage(r._commit);
823
+ let { signature: h } = await o({ payload: u, secretKey: s });
824
+ h = G(h);
825
825
  const w = O.justHeaders(r._commit) + `
826
826
  gpgsig` + lt(h) + `
827
- ` + u;
827
+ ` + f;
828
828
  return O.from(w);
829
829
  }
830
830
  }
831
- class Je {
831
+ class Ke {
832
832
  static wrap({ type: r, object: o }) {
833
833
  return Buffer.concat([
834
834
  Buffer.from(`${r} ${o.byteLength.toString()}\0`),
@@ -836,13 +836,13 @@ class Je {
836
836
  ]);
837
837
  }
838
838
  static unwrap(r) {
839
- const o = r.indexOf(32), s = r.indexOf(0), f = r.slice(0, o).toString("utf8"), u = r.slice(o + 1, s).toString("utf8"), h = r.length - (s + 1);
840
- if (parseInt(u) !== h)
839
+ const o = r.indexOf(32), s = r.indexOf(0), u = r.slice(0, o).toString("utf8"), f = r.slice(o + 1, s).toString("utf8"), h = r.length - (s + 1);
840
+ if (parseInt(f) !== h)
841
841
  throw new _(
842
- `Length mismatch: expected ${u} bytes but got ${h} instead.`
842
+ `Length mismatch: expected ${f} bytes but got ${h} instead.`
843
843
  );
844
844
  return {
845
- type: f,
845
+ type: u,
846
846
  object: Buffer.from(r.slice(s + 1))
847
847
  };
848
848
  }
@@ -869,12 +869,12 @@ class z {
869
869
  return this._start += o, s;
870
870
  }
871
871
  write(r, o, s) {
872
- const f = this.buffer.write(r, this._start, o, s);
873
- return this._start += o, f;
872
+ const u = this.buffer.write(r, this._start, o, s);
873
+ return this._start += o, u;
874
874
  }
875
875
  copy(r, o, s) {
876
- const f = r.copy(this.buffer, this._start, o, s);
877
- return this._start += f, f;
876
+ const u = r.copy(this.buffer, this._start, o, s);
877
+ return this._start += u, u;
878
878
  }
879
879
  readUInt8() {
880
880
  const r = this.buffer.readUInt8(this._start);
@@ -901,29 +901,29 @@ class z {
901
901
  return this._start += 4, o;
902
902
  }
903
903
  }
904
- function Xe(n, r) {
904
+ function Je(n, r) {
905
905
  const o = new z(n), s = Pt(o);
906
906
  if (s !== r.byteLength)
907
907
  throw new _(
908
908
  `applyDelta expected source buffer to be ${s} bytes but the provided buffer was ${r.length} bytes`
909
909
  );
910
- const f = Pt(o);
911
- let u;
912
- const h = Nt(o, r);
913
- if (h.byteLength === f)
914
- u = h;
910
+ const u = Pt(o);
911
+ let f;
912
+ const h = Dt(o, r);
913
+ if (h.byteLength === u)
914
+ f = h;
915
915
  else {
916
- u = Buffer.alloc(f);
917
- const c = new z(u);
918
- for (c.copy(h); !o.eof(); )
919
- c.copy(Nt(o, r));
920
- const w = c.tell();
921
- if (f !== w)
916
+ f = Buffer.alloc(u);
917
+ const a = new z(f);
918
+ for (a.copy(h); !o.eof(); )
919
+ a.copy(Dt(o, r));
920
+ const w = a.tell();
921
+ if (u !== w)
922
922
  throw new _(
923
- `applyDelta expected target buffer to be ${f} bytes but the resulting buffer was ${w} bytes`
923
+ `applyDelta expected target buffer to be ${u} bytes but the resulting buffer was ${w} bytes`
924
924
  );
925
925
  }
926
- return u;
926
+ return f;
927
927
  }
928
928
  function Pt(n) {
929
929
  let r = 0, o = 0, s = null;
@@ -932,33 +932,33 @@ function Pt(n) {
932
932
  while (s & 128);
933
933
  return r;
934
934
  }
935
- function Dt(n, r, o) {
936
- let s = 0, f = 0;
935
+ function Nt(n, r, o) {
936
+ let s = 0, u = 0;
937
937
  for (; o--; )
938
- r & 1 && (s |= n.readUInt8() << f), r >>= 1, f += 8;
938
+ r & 1 && (s |= n.readUInt8() << u), r >>= 1, u += 8;
939
939
  return s;
940
940
  }
941
- function Nt(n, r) {
942
- const o = n.readUInt8(), s = 128, f = 15, u = 112;
941
+ function Dt(n, r) {
942
+ const o = n.readUInt8(), s = 128, u = 15, f = 112;
943
943
  if (o & s) {
944
- const h = Dt(n, o & f, 4);
945
- let c = Dt(n, (o & u) >> 4, 3);
946
- return c === 0 && (c = 65536), r.slice(h, h + c);
944
+ const h = Nt(n, o & u, 4);
945
+ let a = Nt(n, (o & f) >> 4, 3);
946
+ return a === 0 && (a = 65536), r.slice(h, h + a);
947
947
  } else
948
948
  return n.slice(o);
949
949
  }
950
- async function Ze(n, r) {
951
- const o = new vt(n);
950
+ async function Xe(n, r) {
951
+ const o = new qt(n);
952
952
  let s = await o.read(4);
953
953
  if (s = s.toString("utf8"), s !== "PACK")
954
954
  throw new _(`Invalid PACK header '${s}'`);
955
- let f = await o.read(4);
956
- if (f = f.readUInt32BE(0), f !== 2)
957
- throw new _(`Invalid packfile version: ${f}`);
958
955
  let u = await o.read(4);
959
- if (u = u.readUInt32BE(0), !(u < 1))
960
- for (; !o.eof() && u--; ) {
961
- const h = o.tell(), { type: c, length: w, ofs: y, reference: g } = await Qe(o), m = new Gt.Inflate();
956
+ if (u = u.readUInt32BE(0), u !== 2)
957
+ throw new _(`Invalid packfile version: ${u}`);
958
+ let f = await o.read(4);
959
+ if (f = f.readUInt32BE(0), !(f < 1))
960
+ for (; !o.eof() && f--; ) {
961
+ const h = o.tell(), { type: a, length: w, ofs: y, reference: g } = await Ze(o), m = new vt.Inflate();
962
962
  for (; !m.result; ) {
963
963
  const b = await o.chunk();
964
964
  if (!b)
@@ -974,8 +974,8 @@ async function Ze(n, r) {
974
974
  const B = o.tell();
975
975
  await r({
976
976
  data: m.result,
977
- type: c,
978
- num: u,
977
+ type: a,
978
+ num: f,
979
979
  offset: h,
980
980
  end: B,
981
981
  reference: g,
@@ -985,7 +985,7 @@ async function Ze(n, r) {
985
985
  }
986
986
  }
987
987
  }
988
- async function Qe(n) {
988
+ async function Ze(n) {
989
989
  let r = await n.byte();
990
990
  const o = r >> 4 & 7;
991
991
  let s = r & 15;
@@ -995,27 +995,27 @@ async function Qe(n) {
995
995
  r = await n.byte(), s |= (r & 127) << h, h += 7;
996
996
  while (r & 128);
997
997
  }
998
- let f, u;
998
+ let u, f;
999
999
  if (o === 6) {
1000
1000
  let h = 0;
1001
- f = 0;
1002
- const c = [];
1001
+ u = 0;
1002
+ const a = [];
1003
1003
  do
1004
- r = await n.byte(), f |= (r & 127) << h, h += 7, c.push(r);
1004
+ r = await n.byte(), u |= (r & 127) << h, h += 7, a.push(r);
1005
1005
  while (r & 128);
1006
- u = Buffer.from(c);
1006
+ f = Buffer.from(a);
1007
1007
  }
1008
- return o === 7 && (u = await n.read(20)), { type: o, length: s, ofs: f, reference: u };
1008
+ return o === 7 && (f = await n.read(20)), { type: o, length: s, ofs: u, reference: f };
1009
1009
  }
1010
- let tr = !1;
1011
- async function er(n) {
1012
- return tr ? rr(n) : Gt.inflate(n);
1010
+ let Qe = !1;
1011
+ async function tr(n) {
1012
+ return Qe ? er(n) : vt.inflate(n);
1013
1013
  }
1014
- async function rr(n) {
1014
+ async function er(n) {
1015
1015
  const r = new DecompressionStream("deflate"), o = new Blob([n]).stream().pipeThrough(r);
1016
1016
  return new Uint8Array(await new Response(o).arrayBuffer());
1017
1017
  }
1018
- function nr(n) {
1018
+ function rr(n) {
1019
1019
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
1020
1020
  }
1021
1021
  var gt = { exports: {} };
@@ -1036,12 +1036,12 @@ typeof Object.create == "function" ? gt.exports = function(r, o) {
1036
1036
  s.prototype = o.prototype, r.prototype = new s(), r.prototype.constructor = r;
1037
1037
  }
1038
1038
  };
1039
- var ir = gt.exports, mt = { exports: {} }, q = {}, st = {};
1040
- st.byteLength = ar;
1041
- st.toByteArray = fr;
1042
- st.fromByteArray = lr;
1043
- var j = [], P = [], or = typeof Uint8Array < "u" ? Uint8Array : Array, pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1044
- for (var K = 0, sr = pt.length; K < sr; ++K)
1039
+ var nr = gt.exports, mt = { exports: {} }, H = {}, st = {};
1040
+ st.byteLength = sr;
1041
+ st.toByteArray = cr;
1042
+ st.fromByteArray = hr;
1043
+ var j = [], P = [], ir = typeof Uint8Array < "u" ? Uint8Array : Array, pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1044
+ for (var K = 0, or = pt.length; K < or; ++K)
1045
1045
  j[K] = pt[K], P[pt.charCodeAt(K)] = K;
1046
1046
  P["-".charCodeAt(0)] = 62;
1047
1047
  P["_".charCodeAt(0)] = 63;
@@ -1054,58 +1054,58 @@ function Yt(n) {
1054
1054
  var s = o === r ? 0 : 4 - o % 4;
1055
1055
  return [o, s];
1056
1056
  }
1057
- function ar(n) {
1057
+ function sr(n) {
1058
1058
  var r = Yt(n), o = r[0], s = r[1];
1059
1059
  return (o + s) * 3 / 4 - s;
1060
1060
  }
1061
- function cr(n, r, o) {
1061
+ function ar(n, r, o) {
1062
1062
  return (r + o) * 3 / 4 - o;
1063
1063
  }
1064
- function fr(n) {
1065
- var r, o = Yt(n), s = o[0], f = o[1], u = new or(cr(n, s, f)), h = 0, c = f > 0 ? s - 4 : s, w;
1066
- for (w = 0; w < c; w += 4)
1067
- r = P[n.charCodeAt(w)] << 18 | P[n.charCodeAt(w + 1)] << 12 | P[n.charCodeAt(w + 2)] << 6 | P[n.charCodeAt(w + 3)], u[h++] = r >> 16 & 255, u[h++] = r >> 8 & 255, u[h++] = r & 255;
1068
- return f === 2 && (r = P[n.charCodeAt(w)] << 2 | P[n.charCodeAt(w + 1)] >> 4, u[h++] = r & 255), f === 1 && (r = P[n.charCodeAt(w)] << 10 | P[n.charCodeAt(w + 1)] << 4 | P[n.charCodeAt(w + 2)] >> 2, u[h++] = r >> 8 & 255, u[h++] = r & 255), u;
1064
+ function cr(n) {
1065
+ var r, o = Yt(n), s = o[0], u = o[1], f = new ir(ar(n, s, u)), h = 0, a = u > 0 ? s - 4 : s, w;
1066
+ for (w = 0; w < a; w += 4)
1067
+ r = P[n.charCodeAt(w)] << 18 | P[n.charCodeAt(w + 1)] << 12 | P[n.charCodeAt(w + 2)] << 6 | P[n.charCodeAt(w + 3)], f[h++] = r >> 16 & 255, f[h++] = r >> 8 & 255, f[h++] = r & 255;
1068
+ return u === 2 && (r = P[n.charCodeAt(w)] << 2 | P[n.charCodeAt(w + 1)] >> 4, f[h++] = r & 255), u === 1 && (r = P[n.charCodeAt(w)] << 10 | P[n.charCodeAt(w + 1)] << 4 | P[n.charCodeAt(w + 2)] >> 2, f[h++] = r >> 8 & 255, f[h++] = r & 255), f;
1069
1069
  }
1070
1070
  function ur(n) {
1071
1071
  return j[n >> 18 & 63] + j[n >> 12 & 63] + j[n >> 6 & 63] + j[n & 63];
1072
1072
  }
1073
- function hr(n, r, o) {
1074
- for (var s, f = [], u = r; u < o; u += 3)
1075
- s = (n[u] << 16 & 16711680) + (n[u + 1] << 8 & 65280) + (n[u + 2] & 255), f.push(ur(s));
1076
- return f.join("");
1073
+ function fr(n, r, o) {
1074
+ for (var s, u = [], f = r; f < o; f += 3)
1075
+ s = (n[f] << 16 & 16711680) + (n[f + 1] << 8 & 65280) + (n[f + 2] & 255), u.push(ur(s));
1076
+ return u.join("");
1077
1077
  }
1078
- function lr(n) {
1079
- for (var r, o = n.length, s = o % 3, f = [], u = 16383, h = 0, c = o - s; h < c; h += u)
1080
- f.push(hr(n, h, h + u > c ? c : h + u));
1081
- return s === 1 ? (r = n[o - 1], f.push(
1078
+ function hr(n) {
1079
+ for (var r, o = n.length, s = o % 3, u = [], f = 16383, h = 0, a = o - s; h < a; h += f)
1080
+ u.push(fr(n, h, h + f > a ? a : h + f));
1081
+ return s === 1 ? (r = n[o - 1], u.push(
1082
1082
  j[r >> 2] + j[r << 4 & 63] + "=="
1083
- )) : s === 2 && (r = (n[o - 2] << 8) + n[o - 1], f.push(
1083
+ )) : s === 2 && (r = (n[o - 2] << 8) + n[o - 1], u.push(
1084
1084
  j[r >> 10] + j[r >> 4 & 63] + j[r << 2 & 63] + "="
1085
- )), f.join("");
1085
+ )), u.join("");
1086
1086
  }
1087
1087
  var xt = {};
1088
1088
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
1089
- xt.read = function(n, r, o, s, f) {
1090
- var u, h, c = f * 8 - s - 1, w = (1 << c) - 1, y = w >> 1, g = -7, m = o ? f - 1 : 0, b = o ? -1 : 1, B = n[r + m];
1091
- for (m += b, u = B & (1 << -g) - 1, B >>= -g, g += c; g > 0; u = u * 256 + n[r + m], m += b, g -= 8)
1089
+ xt.read = function(n, r, o, s, u) {
1090
+ var f, h, a = u * 8 - s - 1, w = (1 << a) - 1, y = w >> 1, g = -7, m = o ? u - 1 : 0, b = o ? -1 : 1, B = n[r + m];
1091
+ for (m += b, f = B & (1 << -g) - 1, B >>= -g, g += a; g > 0; f = f * 256 + n[r + m], m += b, g -= 8)
1092
1092
  ;
1093
- for (h = u & (1 << -g) - 1, u >>= -g, g += s; g > 0; h = h * 256 + n[r + m], m += b, g -= 8)
1093
+ for (h = f & (1 << -g) - 1, f >>= -g, g += s; g > 0; h = h * 256 + n[r + m], m += b, g -= 8)
1094
1094
  ;
1095
- if (u === 0)
1096
- u = 1 - y;
1095
+ if (f === 0)
1096
+ f = 1 - y;
1097
1097
  else {
1098
- if (u === w)
1098
+ if (f === w)
1099
1099
  return h ? NaN : (B ? -1 : 1) * (1 / 0);
1100
- h = h + Math.pow(2, s), u = u - y;
1100
+ h = h + Math.pow(2, s), f = f - y;
1101
1101
  }
1102
- return (B ? -1 : 1) * h * Math.pow(2, u - s);
1102
+ return (B ? -1 : 1) * h * Math.pow(2, f - s);
1103
1103
  };
1104
- xt.write = function(n, r, o, s, f, u) {
1105
- var h, c, w, y = u * 8 - f - 1, g = (1 << y) - 1, m = g >> 1, b = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, B = s ? 0 : u - 1, T = s ? 1 : -1, L = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
1106
- for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (c = isNaN(r) ? 1 : 0, h = g) : (h = Math.floor(Math.log(r) / Math.LN2), r * (w = Math.pow(2, -h)) < 1 && (h--, w *= 2), h + m >= 1 ? r += b / w : r += b * Math.pow(2, 1 - m), r * w >= 2 && (h++, w /= 2), h + m >= g ? (c = 0, h = g) : h + m >= 1 ? (c = (r * w - 1) * Math.pow(2, f), h = h + m) : (c = r * Math.pow(2, m - 1) * Math.pow(2, f), h = 0)); f >= 8; n[o + B] = c & 255, B += T, c /= 256, f -= 8)
1104
+ xt.write = function(n, r, o, s, u, f) {
1105
+ var h, a, w, y = f * 8 - u - 1, g = (1 << y) - 1, m = g >> 1, b = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, B = s ? 0 : f - 1, T = s ? 1 : -1, L = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
1106
+ for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, h = g) : (h = Math.floor(Math.log(r) / Math.LN2), r * (w = Math.pow(2, -h)) < 1 && (h--, w *= 2), h + m >= 1 ? r += b / w : r += b * Math.pow(2, 1 - m), r * w >= 2 && (h++, w /= 2), h + m >= g ? (a = 0, h = g) : h + m >= 1 ? (a = (r * w - 1) * Math.pow(2, u), h = h + m) : (a = r * Math.pow(2, m - 1) * Math.pow(2, u), h = 0)); u >= 8; n[o + B] = a & 255, B += T, a /= 256, u -= 8)
1107
1107
  ;
1108
- for (h = h << f | c, y += f; y > 0; n[o + B] = h & 255, B += T, h /= 256, y -= 8)
1108
+ for (h = h << u | a, y += u; y > 0; n[o + B] = h & 255, B += T, h /= 256, y -= 8)
1109
1109
  ;
1110
1110
  n[o + B - T] |= L * 128;
1111
1111
  };
@@ -1117,12 +1117,12 @@ xt.write = function(n, r, o, s, f, u) {
1117
1117
  */
1118
1118
  (function(n) {
1119
1119
  const r = st, o = xt, s = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
1120
- n.Buffer = c, n.SlowBuffer = M, n.INSPECT_MAX_BYTES = 50;
1121
- const f = 2147483647;
1122
- n.kMaxLength = f, c.TYPED_ARRAY_SUPPORT = u(), !c.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
1120
+ n.Buffer = a, n.SlowBuffer = M, n.INSPECT_MAX_BYTES = 50;
1121
+ const u = 2147483647;
1122
+ n.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = f(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
1123
1123
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
1124
1124
  );
1125
- function u() {
1125
+ function f() {
1126
1126
  try {
1127
1127
  const i = new Uint8Array(1), t = { foo: function() {
1128
1128
  return 42;
@@ -1132,26 +1132,26 @@ xt.write = function(n, r, o, s, f, u) {
1132
1132
  return !1;
1133
1133
  }
1134
1134
  }
1135
- Object.defineProperty(c.prototype, "parent", {
1135
+ Object.defineProperty(a.prototype, "parent", {
1136
1136
  enumerable: !0,
1137
1137
  get: function() {
1138
- if (c.isBuffer(this))
1138
+ if (a.isBuffer(this))
1139
1139
  return this.buffer;
1140
1140
  }
1141
- }), Object.defineProperty(c.prototype, "offset", {
1141
+ }), Object.defineProperty(a.prototype, "offset", {
1142
1142
  enumerable: !0,
1143
1143
  get: function() {
1144
- if (c.isBuffer(this))
1144
+ if (a.isBuffer(this))
1145
1145
  return this.byteOffset;
1146
1146
  }
1147
1147
  });
1148
1148
  function h(i) {
1149
- if (i > f)
1149
+ if (i > u)
1150
1150
  throw new RangeError('The value "' + i + '" is invalid for option "size"');
1151
1151
  const t = new Uint8Array(i);
1152
- return Object.setPrototypeOf(t, c.prototype), t;
1152
+ return Object.setPrototypeOf(t, a.prototype), t;
1153
1153
  }
1154
- function c(i, t, e) {
1154
+ function a(i, t, e) {
1155
1155
  if (typeof i == "number") {
1156
1156
  if (typeof t == "string")
1157
1157
  throw new TypeError(
@@ -1161,7 +1161,7 @@ xt.write = function(n, r, o, s, f, u) {
1161
1161
  }
1162
1162
  return w(i, t, e);
1163
1163
  }
1164
- c.poolSize = 8192;
1164
+ a.poolSize = 8192;
1165
1165
  function w(i, t, e) {
1166
1166
  if (typeof i == "string")
1167
1167
  return b(i, t);
@@ -1171,27 +1171,27 @@ xt.write = function(n, r, o, s, f, u) {
1171
1171
  throw new TypeError(
1172
1172
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
1173
1173
  );
1174
- if (N(i, ArrayBuffer) || i && N(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (N(i, SharedArrayBuffer) || i && N(i.buffer, SharedArrayBuffer)))
1174
+ if (D(i, ArrayBuffer) || i && D(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (D(i, SharedArrayBuffer) || i && D(i.buffer, SharedArrayBuffer)))
1175
1175
  return L(i, t, e);
1176
1176
  if (typeof i == "number")
1177
1177
  throw new TypeError(
1178
1178
  'The "value" argument must not be of type number. Received type number'
1179
1179
  );
1180
- const a = i.valueOf && i.valueOf();
1181
- if (a != null && a !== i)
1182
- return c.from(a, t, e);
1183
- const l = D(i);
1180
+ const c = i.valueOf && i.valueOf();
1181
+ if (c != null && c !== i)
1182
+ return a.from(c, t, e);
1183
+ const l = N(i);
1184
1184
  if (l)
1185
1185
  return l;
1186
1186
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
1187
- return c.from(i[Symbol.toPrimitive]("string"), t, e);
1187
+ return a.from(i[Symbol.toPrimitive]("string"), t, e);
1188
1188
  throw new TypeError(
1189
1189
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
1190
1190
  );
1191
1191
  }
1192
- c.from = function(i, t, e) {
1192
+ a.from = function(i, t, e) {
1193
1193
  return w(i, t, e);
1194
- }, Object.setPrototypeOf(c.prototype, Uint8Array.prototype), Object.setPrototypeOf(c, Uint8Array);
1194
+ }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
1195
1195
  function y(i) {
1196
1196
  if (typeof i != "number")
1197
1197
  throw new TypeError('"size" argument must be of type number');
@@ -1201,33 +1201,33 @@ xt.write = function(n, r, o, s, f, u) {
1201
1201
  function g(i, t, e) {
1202
1202
  return y(i), i <= 0 ? h(i) : t !== void 0 ? typeof e == "string" ? h(i).fill(t, e) : h(i).fill(t) : h(i);
1203
1203
  }
1204
- c.alloc = function(i, t, e) {
1204
+ a.alloc = function(i, t, e) {
1205
1205
  return g(i, t, e);
1206
1206
  };
1207
1207
  function m(i) {
1208
1208
  return y(i), h(i < 0 ? 0 : U(i) | 0);
1209
1209
  }
1210
- c.allocUnsafe = function(i) {
1210
+ a.allocUnsafe = function(i) {
1211
1211
  return m(i);
1212
- }, c.allocUnsafeSlow = function(i) {
1212
+ }, a.allocUnsafeSlow = function(i) {
1213
1213
  return m(i);
1214
1214
  };
1215
1215
  function b(i, t) {
1216
- if ((typeof t != "string" || t === "") && (t = "utf8"), !c.isEncoding(t))
1216
+ if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
1217
1217
  throw new TypeError("Unknown encoding: " + t);
1218
1218
  const e = $(i, t) | 0;
1219
- let a = h(e);
1220
- const l = a.write(i, t);
1221
- return l !== e && (a = a.slice(0, l)), a;
1219
+ let c = h(e);
1220
+ const l = c.write(i, t);
1221
+ return l !== e && (c = c.slice(0, l)), c;
1222
1222
  }
1223
1223
  function B(i) {
1224
1224
  const t = i.length < 0 ? 0 : U(i.length) | 0, e = h(t);
1225
- for (let a = 0; a < t; a += 1)
1226
- e[a] = i[a] & 255;
1225
+ for (let c = 0; c < t; c += 1)
1226
+ e[c] = i[c] & 255;
1227
1227
  return e;
1228
1228
  }
1229
1229
  function T(i) {
1230
- if (N(i, Uint8Array)) {
1230
+ if (D(i, Uint8Array)) {
1231
1231
  const t = new Uint8Array(i);
1232
1232
  return L(t.buffer, t.byteOffset, t.byteLength);
1233
1233
  }
@@ -1238,11 +1238,11 @@ xt.write = function(n, r, o, s, f, u) {
1238
1238
  throw new RangeError('"offset" is outside of buffer bounds');
1239
1239
  if (i.byteLength < t + (e || 0))
1240
1240
  throw new RangeError('"length" is outside of buffer bounds');
1241
- let a;
1242
- return t === void 0 && e === void 0 ? a = new Uint8Array(i) : e === void 0 ? a = new Uint8Array(i, t) : a = new Uint8Array(i, t, e), Object.setPrototypeOf(a, c.prototype), a;
1241
+ let c;
1242
+ return t === void 0 && e === void 0 ? c = new Uint8Array(i) : e === void 0 ? c = new Uint8Array(i, t) : c = new Uint8Array(i, t, e), Object.setPrototypeOf(c, a.prototype), c;
1243
1243
  }
1244
- function D(i) {
1245
- if (c.isBuffer(i)) {
1244
+ function N(i) {
1245
+ if (a.isBuffer(i)) {
1246
1246
  const t = U(i.length) | 0, e = h(t);
1247
1247
  return e.length === 0 || i.copy(e, 0, 0, t), e;
1248
1248
  }
@@ -1252,30 +1252,30 @@ xt.write = function(n, r, o, s, f, u) {
1252
1252
  return B(i.data);
1253
1253
  }
1254
1254
  function U(i) {
1255
- if (i >= f)
1256
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
1255
+ if (i >= u)
1256
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
1257
1257
  return i | 0;
1258
1258
  }
1259
1259
  function M(i) {
1260
- return +i != i && (i = 0), c.alloc(+i);
1260
+ return +i != i && (i = 0), a.alloc(+i);
1261
1261
  }
1262
- c.isBuffer = function(t) {
1263
- return t != null && t._isBuffer === !0 && t !== c.prototype;
1264
- }, c.compare = function(t, e) {
1265
- if (N(t, Uint8Array) && (t = c.from(t, t.offset, t.byteLength)), N(e, Uint8Array) && (e = c.from(e, e.offset, e.byteLength)), !c.isBuffer(t) || !c.isBuffer(e))
1262
+ a.isBuffer = function(t) {
1263
+ return t != null && t._isBuffer === !0 && t !== a.prototype;
1264
+ }, a.compare = function(t, e) {
1265
+ if (D(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), D(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
1266
1266
  throw new TypeError(
1267
1267
  'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
1268
1268
  );
1269
1269
  if (t === e)
1270
1270
  return 0;
1271
- let a = t.length, l = e.length;
1272
- for (let p = 0, d = Math.min(a, l); p < d; ++p)
1271
+ let c = t.length, l = e.length;
1272
+ for (let p = 0, d = Math.min(c, l); p < d; ++p)
1273
1273
  if (t[p] !== e[p]) {
1274
- a = t[p], l = e[p];
1274
+ c = t[p], l = e[p];
1275
1275
  break;
1276
1276
  }
1277
- return a < l ? -1 : l < a ? 1 : 0;
1278
- }, c.isEncoding = function(t) {
1277
+ return c < l ? -1 : l < c ? 1 : 0;
1278
+ }, a.isEncoding = function(t) {
1279
1279
  switch (String(t).toLowerCase()) {
1280
1280
  case "hex":
1281
1281
  case "utf8":
@@ -1292,26 +1292,26 @@ xt.write = function(n, r, o, s, f, u) {
1292
1292
  default:
1293
1293
  return !1;
1294
1294
  }
1295
- }, c.concat = function(t, e) {
1295
+ }, a.concat = function(t, e) {
1296
1296
  if (!Array.isArray(t))
1297
1297
  throw new TypeError('"list" argument must be an Array of Buffers');
1298
1298
  if (t.length === 0)
1299
- return c.alloc(0);
1300
- let a;
1299
+ return a.alloc(0);
1300
+ let c;
1301
1301
  if (e === void 0)
1302
- for (e = 0, a = 0; a < t.length; ++a)
1303
- e += t[a].length;
1304
- const l = c.allocUnsafe(e);
1302
+ for (e = 0, c = 0; c < t.length; ++c)
1303
+ e += t[c].length;
1304
+ const l = a.allocUnsafe(e);
1305
1305
  let p = 0;
1306
- for (a = 0; a < t.length; ++a) {
1307
- let d = t[a];
1308
- if (N(d, Uint8Array))
1309
- p + d.length > l.length ? (c.isBuffer(d) || (d = c.from(d)), d.copy(l, p)) : Uint8Array.prototype.set.call(
1306
+ for (c = 0; c < t.length; ++c) {
1307
+ let d = t[c];
1308
+ if (D(d, Uint8Array))
1309
+ p + d.length > l.length ? (a.isBuffer(d) || (d = a.from(d)), d.copy(l, p)) : Uint8Array.prototype.set.call(
1310
1310
  l,
1311
1311
  d,
1312
1312
  p
1313
1313
  );
1314
- else if (c.isBuffer(d))
1314
+ else if (a.isBuffer(d))
1315
1315
  d.copy(l, p);
1316
1316
  else
1317
1317
  throw new TypeError('"list" argument must be an Array of Buffers');
@@ -1320,16 +1320,16 @@ xt.write = function(n, r, o, s, f, u) {
1320
1320
  return l;
1321
1321
  };
1322
1322
  function $(i, t) {
1323
- if (c.isBuffer(i))
1323
+ if (a.isBuffer(i))
1324
1324
  return i.length;
1325
- if (ArrayBuffer.isView(i) || N(i, ArrayBuffer))
1325
+ if (ArrayBuffer.isView(i) || D(i, ArrayBuffer))
1326
1326
  return i.byteLength;
1327
1327
  if (typeof i != "string")
1328
1328
  throw new TypeError(
1329
1329
  'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
1330
1330
  );
1331
- const e = i.length, a = arguments.length > 2 && arguments[2] === !0;
1332
- if (!a && e === 0)
1331
+ const e = i.length, c = arguments.length > 2 && arguments[2] === !0;
1332
+ if (!c && e === 0)
1333
1333
  return 0;
1334
1334
  let l = !1;
1335
1335
  for (; ; )
@@ -1340,7 +1340,7 @@ xt.write = function(n, r, o, s, f, u) {
1340
1340
  return e;
1341
1341
  case "utf8":
1342
1342
  case "utf-8":
1343
- return ut(i).length;
1343
+ return ft(i).length;
1344
1344
  case "ucs2":
1345
1345
  case "ucs-2":
1346
1346
  case "utf16le":
@@ -1352,94 +1352,94 @@ xt.write = function(n, r, o, s, f, u) {
1352
1352
  return Rt(i).length;
1353
1353
  default:
1354
1354
  if (l)
1355
- return a ? -1 : ut(i).length;
1355
+ return c ? -1 : ft(i).length;
1356
1356
  t = ("" + t).toLowerCase(), l = !0;
1357
1357
  }
1358
1358
  }
1359
- c.byteLength = $;
1360
- function G(i, t, e) {
1361
- let a = !1;
1359
+ a.byteLength = $;
1360
+ function v(i, t, e) {
1361
+ let c = !1;
1362
1362
  if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
1363
1363
  return "";
1364
1364
  for (i || (i = "utf8"); ; )
1365
1365
  switch (i) {
1366
1366
  case "hex":
1367
- return de(this, t, e);
1367
+ return pe(this, t, e);
1368
1368
  case "utf8":
1369
1369
  case "utf-8":
1370
1370
  return It(this, t, e);
1371
1371
  case "ascii":
1372
- return le(this, t, e);
1372
+ return he(this, t, e);
1373
1373
  case "latin1":
1374
1374
  case "binary":
1375
- return pe(this, t, e);
1375
+ return le(this, t, e);
1376
1376
  case "base64":
1377
1377
  return ue(this, t, e);
1378
1378
  case "ucs2":
1379
1379
  case "ucs-2":
1380
1380
  case "utf16le":
1381
1381
  case "utf-16le":
1382
- return we(this, t, e);
1382
+ return de(this, t, e);
1383
1383
  default:
1384
- if (a)
1384
+ if (c)
1385
1385
  throw new TypeError("Unknown encoding: " + i);
1386
- i = (i + "").toLowerCase(), a = !0;
1386
+ i = (i + "").toLowerCase(), c = !0;
1387
1387
  }
1388
1388
  }
1389
- c.prototype._isBuffer = !0;
1389
+ a.prototype._isBuffer = !0;
1390
1390
  function R(i, t, e) {
1391
- const a = i[t];
1392
- i[t] = i[e], i[e] = a;
1391
+ const c = i[t];
1392
+ i[t] = i[e], i[e] = c;
1393
1393
  }
1394
- c.prototype.swap16 = function() {
1394
+ a.prototype.swap16 = function() {
1395
1395
  const t = this.length;
1396
1396
  if (t % 2 !== 0)
1397
1397
  throw new RangeError("Buffer size must be a multiple of 16-bits");
1398
1398
  for (let e = 0; e < t; e += 2)
1399
1399
  R(this, e, e + 1);
1400
1400
  return this;
1401
- }, c.prototype.swap32 = function() {
1401
+ }, a.prototype.swap32 = function() {
1402
1402
  const t = this.length;
1403
1403
  if (t % 4 !== 0)
1404
1404
  throw new RangeError("Buffer size must be a multiple of 32-bits");
1405
1405
  for (let e = 0; e < t; e += 4)
1406
1406
  R(this, e, e + 3), R(this, e + 1, e + 2);
1407
1407
  return this;
1408
- }, c.prototype.swap64 = function() {
1408
+ }, a.prototype.swap64 = function() {
1409
1409
  const t = this.length;
1410
1410
  if (t % 8 !== 0)
1411
1411
  throw new RangeError("Buffer size must be a multiple of 64-bits");
1412
1412
  for (let e = 0; e < t; e += 8)
1413
1413
  R(this, e, e + 7), R(this, e + 1, e + 6), R(this, e + 2, e + 5), R(this, e + 3, e + 4);
1414
1414
  return this;
1415
- }, c.prototype.toString = function() {
1415
+ }, a.prototype.toString = function() {
1416
1416
  const t = this.length;
1417
- return t === 0 ? "" : arguments.length === 0 ? It(this, 0, t) : G.apply(this, arguments);
1418
- }, c.prototype.toLocaleString = c.prototype.toString, c.prototype.equals = function(t) {
1419
- if (!c.isBuffer(t))
1417
+ return t === 0 ? "" : arguments.length === 0 ? It(this, 0, t) : v.apply(this, arguments);
1418
+ }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
1419
+ if (!a.isBuffer(t))
1420
1420
  throw new TypeError("Argument must be a Buffer");
1421
- return this === t ? !0 : c.compare(this, t) === 0;
1422
- }, c.prototype.inspect = function() {
1421
+ return this === t ? !0 : a.compare(this, t) === 0;
1422
+ }, a.prototype.inspect = function() {
1423
1423
  let t = "";
1424
1424
  const e = n.INSPECT_MAX_BYTES;
1425
1425
  return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
1426
- }, s && (c.prototype[s] = c.prototype.inspect), c.prototype.compare = function(t, e, a, l, p) {
1427
- if (N(t, Uint8Array) && (t = c.from(t, t.offset, t.byteLength)), !c.isBuffer(t))
1426
+ }, s && (a.prototype[s] = a.prototype.inspect), a.prototype.compare = function(t, e, c, l, p) {
1427
+ if (D(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
1428
1428
  throw new TypeError(
1429
1429
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
1430
1430
  );
1431
- if (e === void 0 && (e = 0), a === void 0 && (a = t ? t.length : 0), l === void 0 && (l = 0), p === void 0 && (p = this.length), e < 0 || a > t.length || l < 0 || p > this.length)
1431
+ if (e === void 0 && (e = 0), c === void 0 && (c = t ? t.length : 0), l === void 0 && (l = 0), p === void 0 && (p = this.length), e < 0 || c > t.length || l < 0 || p > this.length)
1432
1432
  throw new RangeError("out of range index");
1433
- if (l >= p && e >= a)
1433
+ if (l >= p && e >= c)
1434
1434
  return 0;
1435
1435
  if (l >= p)
1436
1436
  return -1;
1437
- if (e >= a)
1437
+ if (e >= c)
1438
1438
  return 1;
1439
- if (e >>>= 0, a >>>= 0, l >>>= 0, p >>>= 0, this === t)
1439
+ if (e >>>= 0, c >>>= 0, l >>>= 0, p >>>= 0, this === t)
1440
1440
  return 0;
1441
- let d = p - l, x = a - e;
1442
- const A = Math.min(d, x), I = this.slice(l, p), F = t.slice(e, a);
1441
+ let d = p - l, x = c - e;
1442
+ const A = Math.min(d, x), I = this.slice(l, p), F = t.slice(e, c);
1443
1443
  for (let E = 0; E < A; ++E)
1444
1444
  if (I[E] !== F[E]) {
1445
1445
  d = I[E], x = F[E];
@@ -1447,10 +1447,10 @@ xt.write = function(n, r, o, s, f, u) {
1447
1447
  }
1448
1448
  return d < x ? -1 : x < d ? 1 : 0;
1449
1449
  };
1450
- function Bt(i, t, e, a, l) {
1450
+ function Bt(i, t, e, c, l) {
1451
1451
  if (i.length === 0)
1452
1452
  return -1;
1453
- if (typeof e == "string" ? (a = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, ht(e) && (e = l ? 0 : i.length - 1), e < 0 && (e = i.length + e), e >= i.length) {
1453
+ if (typeof e == "string" ? (c = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, ht(e) && (e = l ? 0 : i.length - 1), e < 0 && (e = i.length + e), e >= i.length) {
1454
1454
  if (l)
1455
1455
  return -1;
1456
1456
  e = i.length - 1;
@@ -1459,15 +1459,15 @@ xt.write = function(n, r, o, s, f, u) {
1459
1459
  e = 0;
1460
1460
  else
1461
1461
  return -1;
1462
- if (typeof t == "string" && (t = c.from(t, a)), c.isBuffer(t))
1463
- return t.length === 0 ? -1 : Et(i, t, e, a, l);
1462
+ if (typeof t == "string" && (t = a.from(t, c)), a.isBuffer(t))
1463
+ return t.length === 0 ? -1 : Et(i, t, e, c, l);
1464
1464
  if (typeof t == "number")
1465
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : Et(i, [t], e, a, l);
1465
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : Et(i, [t], e, c, l);
1466
1466
  throw new TypeError("val must be string, number or Buffer");
1467
1467
  }
1468
- function Et(i, t, e, a, l) {
1468
+ function Et(i, t, e, c, l) {
1469
1469
  let p = 1, d = i.length, x = t.length;
1470
- if (a !== void 0 && (a = String(a).toLowerCase(), a === "ucs2" || a === "ucs-2" || a === "utf16le" || a === "utf-16le")) {
1470
+ if (c !== void 0 && (c = String(c).toLowerCase(), c === "ucs2" || c === "ucs-2" || c === "utf16le" || c === "utf-16le")) {
1471
1471
  if (i.length < 2 || t.length < 2)
1472
1472
  return -1;
1473
1473
  p = 2, d /= 2, x /= 2, e /= 2;
@@ -1497,21 +1497,21 @@ xt.write = function(n, r, o, s, f, u) {
1497
1497
  }
1498
1498
  return -1;
1499
1499
  }
1500
- c.prototype.includes = function(t, e, a) {
1501
- return this.indexOf(t, e, a) !== -1;
1502
- }, c.prototype.indexOf = function(t, e, a) {
1503
- return Bt(this, t, e, a, !0);
1504
- }, c.prototype.lastIndexOf = function(t, e, a) {
1505
- return Bt(this, t, e, a, !1);
1500
+ a.prototype.includes = function(t, e, c) {
1501
+ return this.indexOf(t, e, c) !== -1;
1502
+ }, a.prototype.indexOf = function(t, e, c) {
1503
+ return Bt(this, t, e, c, !0);
1504
+ }, a.prototype.lastIndexOf = function(t, e, c) {
1505
+ return Bt(this, t, e, c, !1);
1506
1506
  };
1507
- function oe(i, t, e, a) {
1507
+ function ie(i, t, e, c) {
1508
1508
  e = Number(e) || 0;
1509
1509
  const l = i.length - e;
1510
- a ? (a = Number(a), a > l && (a = l)) : a = l;
1510
+ c ? (c = Number(c), c > l && (c = l)) : c = l;
1511
1511
  const p = t.length;
1512
- a > p / 2 && (a = p / 2);
1512
+ c > p / 2 && (c = p / 2);
1513
1513
  let d;
1514
- for (d = 0; d < a; ++d) {
1514
+ for (d = 0; d < c; ++d) {
1515
1515
  const x = parseInt(t.substr(d * 2, 2), 16);
1516
1516
  if (ht(x))
1517
1517
  return d;
@@ -1519,58 +1519,58 @@ xt.write = function(n, r, o, s, f, u) {
1519
1519
  }
1520
1520
  return d;
1521
1521
  }
1522
- function se(i, t, e, a) {
1523
- return nt(ut(t, i.length - e), i, e, a);
1522
+ function oe(i, t, e, c) {
1523
+ return nt(ft(t, i.length - e), i, e, c);
1524
1524
  }
1525
- function ae(i, t, e, a) {
1526
- return nt(be(t), i, e, a);
1525
+ function se(i, t, e, c) {
1526
+ return nt(me(t), i, e, c);
1527
1527
  }
1528
- function ce(i, t, e, a) {
1529
- return nt(Rt(t), i, e, a);
1528
+ function ae(i, t, e, c) {
1529
+ return nt(Rt(t), i, e, c);
1530
1530
  }
1531
- function fe(i, t, e, a) {
1532
- return nt(xe(t, i.length - e), i, e, a);
1531
+ function ce(i, t, e, c) {
1532
+ return nt(be(t, i.length - e), i, e, c);
1533
1533
  }
1534
- c.prototype.write = function(t, e, a, l) {
1534
+ a.prototype.write = function(t, e, c, l) {
1535
1535
  if (e === void 0)
1536
- l = "utf8", a = this.length, e = 0;
1537
- else if (a === void 0 && typeof e == "string")
1538
- l = e, a = this.length, e = 0;
1536
+ l = "utf8", c = this.length, e = 0;
1537
+ else if (c === void 0 && typeof e == "string")
1538
+ l = e, c = this.length, e = 0;
1539
1539
  else if (isFinite(e))
1540
- e = e >>> 0, isFinite(a) ? (a = a >>> 0, l === void 0 && (l = "utf8")) : (l = a, a = void 0);
1540
+ e = e >>> 0, isFinite(c) ? (c = c >>> 0, l === void 0 && (l = "utf8")) : (l = c, c = void 0);
1541
1541
  else
1542
1542
  throw new Error(
1543
1543
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
1544
1544
  );
1545
1545
  const p = this.length - e;
1546
- if ((a === void 0 || a > p) && (a = p), t.length > 0 && (a < 0 || e < 0) || e > this.length)
1546
+ if ((c === void 0 || c > p) && (c = p), t.length > 0 && (c < 0 || e < 0) || e > this.length)
1547
1547
  throw new RangeError("Attempt to write outside buffer bounds");
1548
1548
  l || (l = "utf8");
1549
1549
  let d = !1;
1550
1550
  for (; ; )
1551
1551
  switch (l) {
1552
1552
  case "hex":
1553
- return oe(this, t, e, a);
1553
+ return ie(this, t, e, c);
1554
1554
  case "utf8":
1555
1555
  case "utf-8":
1556
- return se(this, t, e, a);
1556
+ return oe(this, t, e, c);
1557
1557
  case "ascii":
1558
1558
  case "latin1":
1559
1559
  case "binary":
1560
- return ae(this, t, e, a);
1560
+ return se(this, t, e, c);
1561
1561
  case "base64":
1562
- return ce(this, t, e, a);
1562
+ return ae(this, t, e, c);
1563
1563
  case "ucs2":
1564
1564
  case "ucs-2":
1565
1565
  case "utf16le":
1566
1566
  case "utf-16le":
1567
- return fe(this, t, e, a);
1567
+ return ce(this, t, e, c);
1568
1568
  default:
1569
1569
  if (d)
1570
1570
  throw new TypeError("Unknown encoding: " + l);
1571
1571
  l = ("" + l).toLowerCase(), d = !0;
1572
1572
  }
1573
- }, c.prototype.toJSON = function() {
1573
+ }, a.prototype.toJSON = function() {
1574
1574
  return {
1575
1575
  type: "Buffer",
1576
1576
  data: Array.prototype.slice.call(this._arr || this, 0)
@@ -1581,7 +1581,7 @@ xt.write = function(n, r, o, s, f, u) {
1581
1581
  }
1582
1582
  function It(i, t, e) {
1583
1583
  e = Math.min(i.length, e);
1584
- const a = [];
1584
+ const c = [];
1585
1585
  let l = t;
1586
1586
  for (; l < e; ) {
1587
1587
  const p = i[l];
@@ -1602,57 +1602,57 @@ xt.write = function(n, r, o, s, f, u) {
1602
1602
  A = i[l + 1], I = i[l + 2], F = i[l + 3], (A & 192) === 128 && (I & 192) === 128 && (F & 192) === 128 && (E = (p & 15) << 18 | (A & 63) << 12 | (I & 63) << 6 | F & 63, E > 65535 && E < 1114112 && (d = E));
1603
1603
  }
1604
1604
  }
1605
- d === null ? (d = 65533, x = 1) : d > 65535 && (d -= 65536, a.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), a.push(d), l += x;
1605
+ d === null ? (d = 65533, x = 1) : d > 65535 && (d -= 65536, c.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), c.push(d), l += x;
1606
1606
  }
1607
- return he(a);
1607
+ return fe(c);
1608
1608
  }
1609
1609
  const _t = 4096;
1610
- function he(i) {
1610
+ function fe(i) {
1611
1611
  const t = i.length;
1612
1612
  if (t <= _t)
1613
1613
  return String.fromCharCode.apply(String, i);
1614
- let e = "", a = 0;
1615
- for (; a < t; )
1614
+ let e = "", c = 0;
1615
+ for (; c < t; )
1616
1616
  e += String.fromCharCode.apply(
1617
1617
  String,
1618
- i.slice(a, a += _t)
1618
+ i.slice(c, c += _t)
1619
1619
  );
1620
1620
  return e;
1621
1621
  }
1622
- function le(i, t, e) {
1623
- let a = "";
1622
+ function he(i, t, e) {
1623
+ let c = "";
1624
1624
  e = Math.min(i.length, e);
1625
1625
  for (let l = t; l < e; ++l)
1626
- a += String.fromCharCode(i[l] & 127);
1627
- return a;
1626
+ c += String.fromCharCode(i[l] & 127);
1627
+ return c;
1628
1628
  }
1629
- function pe(i, t, e) {
1630
- let a = "";
1629
+ function le(i, t, e) {
1630
+ let c = "";
1631
1631
  e = Math.min(i.length, e);
1632
1632
  for (let l = t; l < e; ++l)
1633
- a += String.fromCharCode(i[l]);
1634
- return a;
1633
+ c += String.fromCharCode(i[l]);
1634
+ return c;
1635
1635
  }
1636
- function de(i, t, e) {
1637
- const a = i.length;
1638
- (!t || t < 0) && (t = 0), (!e || e < 0 || e > a) && (e = a);
1636
+ function pe(i, t, e) {
1637
+ const c = i.length;
1638
+ (!t || t < 0) && (t = 0), (!e || e < 0 || e > c) && (e = c);
1639
1639
  let l = "";
1640
1640
  for (let p = t; p < e; ++p)
1641
- l += Be[i[p]];
1641
+ l += xe[i[p]];
1642
1642
  return l;
1643
1643
  }
1644
- function we(i, t, e) {
1645
- const a = i.slice(t, e);
1644
+ function de(i, t, e) {
1645
+ const c = i.slice(t, e);
1646
1646
  let l = "";
1647
- for (let p = 0; p < a.length - 1; p += 2)
1648
- l += String.fromCharCode(a[p] + a[p + 1] * 256);
1647
+ for (let p = 0; p < c.length - 1; p += 2)
1648
+ l += String.fromCharCode(c[p] + c[p + 1] * 256);
1649
1649
  return l;
1650
1650
  }
1651
- c.prototype.slice = function(t, e) {
1652
- const a = this.length;
1653
- t = ~~t, e = e === void 0 ? a : ~~e, t < 0 ? (t += a, t < 0 && (t = 0)) : t > a && (t = a), e < 0 ? (e += a, e < 0 && (e = 0)) : e > a && (e = a), e < t && (e = t);
1651
+ a.prototype.slice = function(t, e) {
1652
+ const c = this.length;
1653
+ t = ~~t, e = e === void 0 ? c : ~~e, t < 0 ? (t += c, t < 0 && (t = 0)) : t > c && (t = c), e < 0 ? (e += c, e < 0 && (e = 0)) : e > c && (e = c), e < t && (e = t);
1654
1654
  const l = this.subarray(t, e);
1655
- return Object.setPrototypeOf(l, c.prototype), l;
1655
+ return Object.setPrototypeOf(l, a.prototype), l;
1656
1656
  };
1657
1657
  function S(i, t, e) {
1658
1658
  if (i % 1 !== 0 || i < 0)
@@ -1660,220 +1660,220 @@ xt.write = function(n, r, o, s, f, u) {
1660
1660
  if (i + t > e)
1661
1661
  throw new RangeError("Trying to access beyond buffer length");
1662
1662
  }
1663
- c.prototype.readUintLE = c.prototype.readUIntLE = function(t, e, a) {
1664
- t = t >>> 0, e = e >>> 0, a || S(t, e, this.length);
1663
+ a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, c) {
1664
+ t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
1665
1665
  let l = this[t], p = 1, d = 0;
1666
1666
  for (; ++d < e && (p *= 256); )
1667
1667
  l += this[t + d] * p;
1668
1668
  return l;
1669
- }, c.prototype.readUintBE = c.prototype.readUIntBE = function(t, e, a) {
1670
- t = t >>> 0, e = e >>> 0, a || S(t, e, this.length);
1669
+ }, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, c) {
1670
+ t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
1671
1671
  let l = this[t + --e], p = 1;
1672
1672
  for (; e > 0 && (p *= 256); )
1673
1673
  l += this[t + --e] * p;
1674
1674
  return l;
1675
- }, c.prototype.readUint8 = c.prototype.readUInt8 = function(t, e) {
1675
+ }, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
1676
1676
  return t = t >>> 0, e || S(t, 1, this.length), this[t];
1677
- }, c.prototype.readUint16LE = c.prototype.readUInt16LE = function(t, e) {
1677
+ }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(t, e) {
1678
1678
  return t = t >>> 0, e || S(t, 2, this.length), this[t] | this[t + 1] << 8;
1679
- }, c.prototype.readUint16BE = c.prototype.readUInt16BE = function(t, e) {
1679
+ }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(t, e) {
1680
1680
  return t = t >>> 0, e || S(t, 2, this.length), this[t] << 8 | this[t + 1];
1681
- }, c.prototype.readUint32LE = c.prototype.readUInt32LE = function(t, e) {
1681
+ }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(t, e) {
1682
1682
  return t = t >>> 0, e || S(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1683
- }, c.prototype.readUint32BE = c.prototype.readUInt32BE = function(t, e) {
1683
+ }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(t, e) {
1684
1684
  return t = t >>> 0, e || S(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1685
- }, c.prototype.readBigUInt64LE = v(function(t) {
1685
+ }, a.prototype.readBigUInt64LE = q(function(t) {
1686
1686
  t = t >>> 0, V(t, "offset");
1687
- const e = this[t], a = this[t + 7];
1688
- (e === void 0 || a === void 0) && X(t, this.length - 8);
1689
- const l = e + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24, p = this[++t] + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + a * 2 ** 24;
1687
+ const e = this[t], c = this[t + 7];
1688
+ (e === void 0 || c === void 0) && X(t, this.length - 8);
1689
+ const l = e + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24, p = this[++t] + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + c * 2 ** 24;
1690
1690
  return BigInt(l) + (BigInt(p) << BigInt(32));
1691
- }), c.prototype.readBigUInt64BE = v(function(t) {
1691
+ }), a.prototype.readBigUInt64BE = q(function(t) {
1692
1692
  t = t >>> 0, V(t, "offset");
1693
- const e = this[t], a = this[t + 7];
1694
- (e === void 0 || a === void 0) && X(t, this.length - 8);
1695
- const l = e * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t], p = this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + a;
1693
+ const e = this[t], c = this[t + 7];
1694
+ (e === void 0 || c === void 0) && X(t, this.length - 8);
1695
+ const l = e * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t], p = this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + c;
1696
1696
  return (BigInt(l) << BigInt(32)) + BigInt(p);
1697
- }), c.prototype.readIntLE = function(t, e, a) {
1698
- t = t >>> 0, e = e >>> 0, a || S(t, e, this.length);
1697
+ }), a.prototype.readIntLE = function(t, e, c) {
1698
+ t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
1699
1699
  let l = this[t], p = 1, d = 0;
1700
1700
  for (; ++d < e && (p *= 256); )
1701
1701
  l += this[t + d] * p;
1702
1702
  return p *= 128, l >= p && (l -= Math.pow(2, 8 * e)), l;
1703
- }, c.prototype.readIntBE = function(t, e, a) {
1704
- t = t >>> 0, e = e >>> 0, a || S(t, e, this.length);
1703
+ }, a.prototype.readIntBE = function(t, e, c) {
1704
+ t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
1705
1705
  let l = e, p = 1, d = this[t + --l];
1706
1706
  for (; l > 0 && (p *= 256); )
1707
1707
  d += this[t + --l] * p;
1708
1708
  return p *= 128, d >= p && (d -= Math.pow(2, 8 * e)), d;
1709
- }, c.prototype.readInt8 = function(t, e) {
1709
+ }, a.prototype.readInt8 = function(t, e) {
1710
1710
  return t = t >>> 0, e || S(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1711
- }, c.prototype.readInt16LE = function(t, e) {
1711
+ }, a.prototype.readInt16LE = function(t, e) {
1712
1712
  t = t >>> 0, e || S(t, 2, this.length);
1713
- const a = this[t] | this[t + 1] << 8;
1714
- return a & 32768 ? a | 4294901760 : a;
1715
- }, c.prototype.readInt16BE = function(t, e) {
1713
+ const c = this[t] | this[t + 1] << 8;
1714
+ return c & 32768 ? c | 4294901760 : c;
1715
+ }, a.prototype.readInt16BE = function(t, e) {
1716
1716
  t = t >>> 0, e || S(t, 2, this.length);
1717
- const a = this[t + 1] | this[t] << 8;
1718
- return a & 32768 ? a | 4294901760 : a;
1719
- }, c.prototype.readInt32LE = function(t, e) {
1717
+ const c = this[t + 1] | this[t] << 8;
1718
+ return c & 32768 ? c | 4294901760 : c;
1719
+ }, a.prototype.readInt32LE = function(t, e) {
1720
1720
  return t = t >>> 0, e || S(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1721
- }, c.prototype.readInt32BE = function(t, e) {
1721
+ }, a.prototype.readInt32BE = function(t, e) {
1722
1722
  return t = t >>> 0, e || S(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1723
- }, c.prototype.readBigInt64LE = v(function(t) {
1723
+ }, a.prototype.readBigInt64LE = q(function(t) {
1724
1724
  t = t >>> 0, V(t, "offset");
1725
- const e = this[t], a = this[t + 7];
1726
- (e === void 0 || a === void 0) && X(t, this.length - 8);
1727
- const l = this[t + 4] + this[t + 5] * 2 ** 8 + this[t + 6] * 2 ** 16 + (a << 24);
1725
+ const e = this[t], c = this[t + 7];
1726
+ (e === void 0 || c === void 0) && X(t, this.length - 8);
1727
+ const l = this[t + 4] + this[t + 5] * 2 ** 8 + this[t + 6] * 2 ** 16 + (c << 24);
1728
1728
  return (BigInt(l) << BigInt(32)) + BigInt(e + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24);
1729
- }), c.prototype.readBigInt64BE = v(function(t) {
1729
+ }), a.prototype.readBigInt64BE = q(function(t) {
1730
1730
  t = t >>> 0, V(t, "offset");
1731
- const e = this[t], a = this[t + 7];
1732
- (e === void 0 || a === void 0) && X(t, this.length - 8);
1731
+ const e = this[t], c = this[t + 7];
1732
+ (e === void 0 || c === void 0) && X(t, this.length - 8);
1733
1733
  const l = (e << 24) + // Overflow
1734
1734
  this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t];
1735
- return (BigInt(l) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + a);
1736
- }), c.prototype.readFloatLE = function(t, e) {
1735
+ return (BigInt(l) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + c);
1736
+ }), a.prototype.readFloatLE = function(t, e) {
1737
1737
  return t = t >>> 0, e || S(t, 4, this.length), o.read(this, t, !0, 23, 4);
1738
- }, c.prototype.readFloatBE = function(t, e) {
1738
+ }, a.prototype.readFloatBE = function(t, e) {
1739
1739
  return t = t >>> 0, e || S(t, 4, this.length), o.read(this, t, !1, 23, 4);
1740
- }, c.prototype.readDoubleLE = function(t, e) {
1740
+ }, a.prototype.readDoubleLE = function(t, e) {
1741
1741
  return t = t >>> 0, e || S(t, 8, this.length), o.read(this, t, !0, 52, 8);
1742
- }, c.prototype.readDoubleBE = function(t, e) {
1742
+ }, a.prototype.readDoubleBE = function(t, e) {
1743
1743
  return t = t >>> 0, e || S(t, 8, this.length), o.read(this, t, !1, 52, 8);
1744
1744
  };
1745
- function C(i, t, e, a, l, p) {
1746
- if (!c.isBuffer(i))
1745
+ function C(i, t, e, c, l, p) {
1746
+ if (!a.isBuffer(i))
1747
1747
  throw new TypeError('"buffer" argument must be a Buffer instance');
1748
1748
  if (t > l || t < p)
1749
1749
  throw new RangeError('"value" argument is out of bounds');
1750
- if (e + a > i.length)
1750
+ if (e + c > i.length)
1751
1751
  throw new RangeError("Index out of range");
1752
1752
  }
1753
- c.prototype.writeUintLE = c.prototype.writeUIntLE = function(t, e, a, l) {
1754
- if (t = +t, e = e >>> 0, a = a >>> 0, !l) {
1755
- const x = Math.pow(2, 8 * a) - 1;
1756
- C(this, t, e, a, x, 0);
1753
+ a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, c, l) {
1754
+ if (t = +t, e = e >>> 0, c = c >>> 0, !l) {
1755
+ const x = Math.pow(2, 8 * c) - 1;
1756
+ C(this, t, e, c, x, 0);
1757
1757
  }
1758
1758
  let p = 1, d = 0;
1759
- for (this[e] = t & 255; ++d < a && (p *= 256); )
1759
+ for (this[e] = t & 255; ++d < c && (p *= 256); )
1760
1760
  this[e + d] = t / p & 255;
1761
- return e + a;
1762
- }, c.prototype.writeUintBE = c.prototype.writeUIntBE = function(t, e, a, l) {
1763
- if (t = +t, e = e >>> 0, a = a >>> 0, !l) {
1764
- const x = Math.pow(2, 8 * a) - 1;
1765
- C(this, t, e, a, x, 0);
1761
+ return e + c;
1762
+ }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, c, l) {
1763
+ if (t = +t, e = e >>> 0, c = c >>> 0, !l) {
1764
+ const x = Math.pow(2, 8 * c) - 1;
1765
+ C(this, t, e, c, x, 0);
1766
1766
  }
1767
- let p = a - 1, d = 1;
1767
+ let p = c - 1, d = 1;
1768
1768
  for (this[e + p] = t & 255; --p >= 0 && (d *= 256); )
1769
1769
  this[e + p] = t / d & 255;
1770
- return e + a;
1771
- }, c.prototype.writeUint8 = c.prototype.writeUInt8 = function(t, e, a) {
1772
- return t = +t, e = e >>> 0, a || C(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1773
- }, c.prototype.writeUint16LE = c.prototype.writeUInt16LE = function(t, e, a) {
1774
- return t = +t, e = e >>> 0, a || C(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1775
- }, c.prototype.writeUint16BE = c.prototype.writeUInt16BE = function(t, e, a) {
1776
- return t = +t, e = e >>> 0, a || C(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1777
- }, c.prototype.writeUint32LE = c.prototype.writeUInt32LE = function(t, e, a) {
1778
- return t = +t, e = e >>> 0, a || C(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
1779
- }, c.prototype.writeUint32BE = c.prototype.writeUInt32BE = function(t, e, a) {
1780
- return t = +t, e = e >>> 0, a || C(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1770
+ return e + c;
1771
+ }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, c) {
1772
+ return t = +t, e = e >>> 0, c || C(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1773
+ }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, c) {
1774
+ return t = +t, e = e >>> 0, c || C(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1775
+ }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, c) {
1776
+ return t = +t, e = e >>> 0, c || C(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1777
+ }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, c) {
1778
+ return t = +t, e = e >>> 0, c || C(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
1779
+ }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, c) {
1780
+ return t = +t, e = e >>> 0, c || C(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1781
1781
  };
1782
- function At(i, t, e, a, l) {
1783
- $t(t, a, l, i, e, 7);
1782
+ function At(i, t, e, c, l) {
1783
+ $t(t, c, l, i, e, 7);
1784
1784
  let p = Number(t & BigInt(4294967295));
1785
1785
  i[e++] = p, p = p >> 8, i[e++] = p, p = p >> 8, i[e++] = p, p = p >> 8, i[e++] = p;
1786
1786
  let d = Number(t >> BigInt(32) & BigInt(4294967295));
1787
1787
  return i[e++] = d, d = d >> 8, i[e++] = d, d = d >> 8, i[e++] = d, d = d >> 8, i[e++] = d, e;
1788
1788
  }
1789
- function Ft(i, t, e, a, l) {
1790
- $t(t, a, l, i, e, 7);
1789
+ function Ft(i, t, e, c, l) {
1790
+ $t(t, c, l, i, e, 7);
1791
1791
  let p = Number(t & BigInt(4294967295));
1792
1792
  i[e + 7] = p, p = p >> 8, i[e + 6] = p, p = p >> 8, i[e + 5] = p, p = p >> 8, i[e + 4] = p;
1793
1793
  let d = Number(t >> BigInt(32) & BigInt(4294967295));
1794
1794
  return i[e + 3] = d, d = d >> 8, i[e + 2] = d, d = d >> 8, i[e + 1] = d, d = d >> 8, i[e] = d, e + 8;
1795
1795
  }
1796
- c.prototype.writeBigUInt64LE = v(function(t, e = 0) {
1796
+ a.prototype.writeBigUInt64LE = q(function(t, e = 0) {
1797
1797
  return At(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
1798
- }), c.prototype.writeBigUInt64BE = v(function(t, e = 0) {
1798
+ }), a.prototype.writeBigUInt64BE = q(function(t, e = 0) {
1799
1799
  return Ft(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
1800
- }), c.prototype.writeIntLE = function(t, e, a, l) {
1800
+ }), a.prototype.writeIntLE = function(t, e, c, l) {
1801
1801
  if (t = +t, e = e >>> 0, !l) {
1802
- const A = Math.pow(2, 8 * a - 1);
1803
- C(this, t, e, a, A - 1, -A);
1802
+ const A = Math.pow(2, 8 * c - 1);
1803
+ C(this, t, e, c, A - 1, -A);
1804
1804
  }
1805
1805
  let p = 0, d = 1, x = 0;
1806
- for (this[e] = t & 255; ++p < a && (d *= 256); )
1806
+ for (this[e] = t & 255; ++p < c && (d *= 256); )
1807
1807
  t < 0 && x === 0 && this[e + p - 1] !== 0 && (x = 1), this[e + p] = (t / d >> 0) - x & 255;
1808
- return e + a;
1809
- }, c.prototype.writeIntBE = function(t, e, a, l) {
1808
+ return e + c;
1809
+ }, a.prototype.writeIntBE = function(t, e, c, l) {
1810
1810
  if (t = +t, e = e >>> 0, !l) {
1811
- const A = Math.pow(2, 8 * a - 1);
1812
- C(this, t, e, a, A - 1, -A);
1811
+ const A = Math.pow(2, 8 * c - 1);
1812
+ C(this, t, e, c, A - 1, -A);
1813
1813
  }
1814
- let p = a - 1, d = 1, x = 0;
1814
+ let p = c - 1, d = 1, x = 0;
1815
1815
  for (this[e + p] = t & 255; --p >= 0 && (d *= 256); )
1816
1816
  t < 0 && x === 0 && this[e + p + 1] !== 0 && (x = 1), this[e + p] = (t / d >> 0) - x & 255;
1817
- return e + a;
1818
- }, c.prototype.writeInt8 = function(t, e, a) {
1819
- return t = +t, e = e >>> 0, a || C(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1820
- }, c.prototype.writeInt16LE = function(t, e, a) {
1821
- return t = +t, e = e >>> 0, a || C(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1822
- }, c.prototype.writeInt16BE = function(t, e, a) {
1823
- return t = +t, e = e >>> 0, a || C(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1824
- }, c.prototype.writeInt32LE = function(t, e, a) {
1825
- return t = +t, e = e >>> 0, a || C(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
1826
- }, c.prototype.writeInt32BE = function(t, e, a) {
1827
- return t = +t, e = e >>> 0, a || C(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1828
- }, c.prototype.writeBigInt64LE = v(function(t, e = 0) {
1817
+ return e + c;
1818
+ }, a.prototype.writeInt8 = function(t, e, c) {
1819
+ return t = +t, e = e >>> 0, c || C(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1820
+ }, a.prototype.writeInt16LE = function(t, e, c) {
1821
+ return t = +t, e = e >>> 0, c || C(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1822
+ }, a.prototype.writeInt16BE = function(t, e, c) {
1823
+ return t = +t, e = e >>> 0, c || C(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1824
+ }, a.prototype.writeInt32LE = function(t, e, c) {
1825
+ return t = +t, e = e >>> 0, c || C(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
1826
+ }, a.prototype.writeInt32BE = function(t, e, c) {
1827
+ return t = +t, e = e >>> 0, c || C(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1828
+ }, a.prototype.writeBigInt64LE = q(function(t, e = 0) {
1829
1829
  return At(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
1830
- }), c.prototype.writeBigInt64BE = v(function(t, e = 0) {
1830
+ }), a.prototype.writeBigInt64BE = q(function(t, e = 0) {
1831
1831
  return Ft(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
1832
1832
  });
1833
- function Ut(i, t, e, a, l, p) {
1834
- if (e + a > i.length)
1833
+ function Ut(i, t, e, c, l, p) {
1834
+ if (e + c > i.length)
1835
1835
  throw new RangeError("Index out of range");
1836
1836
  if (e < 0)
1837
1837
  throw new RangeError("Index out of range");
1838
1838
  }
1839
- function St(i, t, e, a, l) {
1840
- return t = +t, e = e >>> 0, l || Ut(i, t, e, 4), o.write(i, t, e, a, 23, 4), e + 4;
1839
+ function St(i, t, e, c, l) {
1840
+ return t = +t, e = e >>> 0, l || Ut(i, t, e, 4), o.write(i, t, e, c, 23, 4), e + 4;
1841
1841
  }
1842
- c.prototype.writeFloatLE = function(t, e, a) {
1843
- return St(this, t, e, !0, a);
1844
- }, c.prototype.writeFloatBE = function(t, e, a) {
1845
- return St(this, t, e, !1, a);
1842
+ a.prototype.writeFloatLE = function(t, e, c) {
1843
+ return St(this, t, e, !0, c);
1844
+ }, a.prototype.writeFloatBE = function(t, e, c) {
1845
+ return St(this, t, e, !1, c);
1846
1846
  };
1847
- function kt(i, t, e, a, l) {
1848
- return t = +t, e = e >>> 0, l || Ut(i, t, e, 8), o.write(i, t, e, a, 52, 8), e + 8;
1849
- }
1850
- c.prototype.writeDoubleLE = function(t, e, a) {
1851
- return kt(this, t, e, !0, a);
1852
- }, c.prototype.writeDoubleBE = function(t, e, a) {
1853
- return kt(this, t, e, !1, a);
1854
- }, c.prototype.copy = function(t, e, a, l) {
1855
- if (!c.isBuffer(t))
1847
+ function kt(i, t, e, c, l) {
1848
+ return t = +t, e = e >>> 0, l || Ut(i, t, e, 8), o.write(i, t, e, c, 52, 8), e + 8;
1849
+ }
1850
+ a.prototype.writeDoubleLE = function(t, e, c) {
1851
+ return kt(this, t, e, !0, c);
1852
+ }, a.prototype.writeDoubleBE = function(t, e, c) {
1853
+ return kt(this, t, e, !1, c);
1854
+ }, a.prototype.copy = function(t, e, c, l) {
1855
+ if (!a.isBuffer(t))
1856
1856
  throw new TypeError("argument should be a Buffer");
1857
- if (a || (a = 0), !l && l !== 0 && (l = this.length), e >= t.length && (e = t.length), e || (e = 0), l > 0 && l < a && (l = a), l === a || t.length === 0 || this.length === 0)
1857
+ if (c || (c = 0), !l && l !== 0 && (l = this.length), e >= t.length && (e = t.length), e || (e = 0), l > 0 && l < c && (l = c), l === c || t.length === 0 || this.length === 0)
1858
1858
  return 0;
1859
1859
  if (e < 0)
1860
1860
  throw new RangeError("targetStart out of bounds");
1861
- if (a < 0 || a >= this.length)
1861
+ if (c < 0 || c >= this.length)
1862
1862
  throw new RangeError("Index out of range");
1863
1863
  if (l < 0)
1864
1864
  throw new RangeError("sourceEnd out of bounds");
1865
- l > this.length && (l = this.length), t.length - e < l - a && (l = t.length - e + a);
1866
- const p = l - a;
1867
- return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, a, l) : Uint8Array.prototype.set.call(
1865
+ l > this.length && (l = this.length), t.length - e < l - c && (l = t.length - e + c);
1866
+ const p = l - c;
1867
+ return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, c, l) : Uint8Array.prototype.set.call(
1868
1868
  t,
1869
- this.subarray(a, l),
1869
+ this.subarray(c, l),
1870
1870
  e
1871
1871
  ), p;
1872
- }, c.prototype.fill = function(t, e, a, l) {
1872
+ }, a.prototype.fill = function(t, e, c, l) {
1873
1873
  if (typeof t == "string") {
1874
- if (typeof e == "string" ? (l = e, e = 0, a = this.length) : typeof a == "string" && (l = a, a = this.length), l !== void 0 && typeof l != "string")
1874
+ if (typeof e == "string" ? (l = e, e = 0, c = this.length) : typeof c == "string" && (l = c, c = this.length), l !== void 0 && typeof l != "string")
1875
1875
  throw new TypeError("encoding must be a string");
1876
- if (typeof l == "string" && !c.isEncoding(l))
1876
+ if (typeof l == "string" && !a.isEncoding(l))
1877
1877
  throw new TypeError("Unknown encoding: " + l);
1878
1878
  if (t.length === 1) {
1879
1879
  const d = t.charCodeAt(0);
@@ -1881,26 +1881,26 @@ xt.write = function(n, r, o, s, f, u) {
1881
1881
  }
1882
1882
  } else
1883
1883
  typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
1884
- if (e < 0 || this.length < e || this.length < a)
1884
+ if (e < 0 || this.length < e || this.length < c)
1885
1885
  throw new RangeError("Out of range index");
1886
- if (a <= e)
1886
+ if (c <= e)
1887
1887
  return this;
1888
- e = e >>> 0, a = a === void 0 ? this.length : a >>> 0, t || (t = 0);
1888
+ e = e >>> 0, c = c === void 0 ? this.length : c >>> 0, t || (t = 0);
1889
1889
  let p;
1890
1890
  if (typeof t == "number")
1891
- for (p = e; p < a; ++p)
1891
+ for (p = e; p < c; ++p)
1892
1892
  this[p] = t;
1893
1893
  else {
1894
- const d = c.isBuffer(t) ? t : c.from(t, l), x = d.length;
1894
+ const d = a.isBuffer(t) ? t : a.from(t, l), x = d.length;
1895
1895
  if (x === 0)
1896
1896
  throw new TypeError('The value "' + t + '" is invalid for argument "value"');
1897
- for (p = 0; p < a - e; ++p)
1897
+ for (p = 0; p < c - e; ++p)
1898
1898
  this[p + e] = d[p % x];
1899
1899
  }
1900
1900
  return this;
1901
1901
  };
1902
1902
  const Y = {};
1903
- function ft(i, t, e) {
1903
+ function ut(i, t, e) {
1904
1904
  Y[i] = class extends e {
1905
1905
  constructor() {
1906
1906
  super(), Object.defineProperty(this, "message", {
@@ -1925,43 +1925,43 @@ xt.write = function(n, r, o, s, f, u) {
1925
1925
  }
1926
1926
  };
1927
1927
  }
1928
- ft(
1928
+ ut(
1929
1929
  "ERR_BUFFER_OUT_OF_BOUNDS",
1930
1930
  function(i) {
1931
1931
  return i ? `${i} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
1932
1932
  },
1933
1933
  RangeError
1934
- ), ft(
1934
+ ), ut(
1935
1935
  "ERR_INVALID_ARG_TYPE",
1936
1936
  function(i, t) {
1937
1937
  return `The "${i}" argument must be of type number. Received type ${typeof t}`;
1938
1938
  },
1939
1939
  TypeError
1940
- ), ft(
1940
+ ), ut(
1941
1941
  "ERR_OUT_OF_RANGE",
1942
1942
  function(i, t, e) {
1943
- let a = `The value of "${i}" is out of range.`, l = e;
1944
- return Number.isInteger(e) && Math.abs(e) > 2 ** 32 ? l = Tt(String(e)) : typeof e == "bigint" && (l = String(e), (e > BigInt(2) ** BigInt(32) || e < -(BigInt(2) ** BigInt(32))) && (l = Tt(l)), l += "n"), a += ` It must be ${t}. Received ${l}`, a;
1943
+ let c = `The value of "${i}" is out of range.`, l = e;
1944
+ return Number.isInteger(e) && Math.abs(e) > 2 ** 32 ? l = Tt(String(e)) : typeof e == "bigint" && (l = String(e), (e > BigInt(2) ** BigInt(32) || e < -(BigInt(2) ** BigInt(32))) && (l = Tt(l)), l += "n"), c += ` It must be ${t}. Received ${l}`, c;
1945
1945
  },
1946
1946
  RangeError
1947
1947
  );
1948
1948
  function Tt(i) {
1949
1949
  let t = "", e = i.length;
1950
- const a = i[0] === "-" ? 1 : 0;
1951
- for (; e >= a + 4; e -= 3)
1950
+ const c = i[0] === "-" ? 1 : 0;
1951
+ for (; e >= c + 4; e -= 3)
1952
1952
  t = `_${i.slice(e - 3, e)}${t}`;
1953
1953
  return `${i.slice(0, e)}${t}`;
1954
1954
  }
1955
- function ye(i, t, e) {
1955
+ function we(i, t, e) {
1956
1956
  V(t, "offset"), (i[t] === void 0 || i[t + e] === void 0) && X(t, i.length - (e + 1));
1957
1957
  }
1958
- function $t(i, t, e, a, l, p) {
1958
+ function $t(i, t, e, c, l, p) {
1959
1959
  if (i > e || i < t) {
1960
1960
  const d = typeof t == "bigint" ? "n" : "";
1961
1961
  let x;
1962
1962
  throw p > 3 ? t === 0 || t === BigInt(0) ? x = `>= 0${d} and < 2${d} ** ${(p + 1) * 8}${d}` : x = `>= -(2${d} ** ${(p + 1) * 8 - 1}${d}) and < 2 ** ${(p + 1) * 8 - 1}${d}` : x = `>= ${t}${d} and <= ${e}${d}`, new Y.ERR_OUT_OF_RANGE("value", x, i);
1963
1963
  }
1964
- ye(a, l, p);
1964
+ we(c, l, p);
1965
1965
  }
1966
1966
  function V(i, t) {
1967
1967
  if (typeof i != "number")
@@ -1974,27 +1974,27 @@ xt.write = function(n, r, o, s, f, u) {
1974
1974
  i
1975
1975
  );
1976
1976
  }
1977
- const ge = /[^+/0-9A-Za-z-_]/g;
1978
- function me(i) {
1979
- if (i = i.split("=")[0], i = i.trim().replace(ge, ""), i.length < 2)
1977
+ const ye = /[^+/0-9A-Za-z-_]/g;
1978
+ function ge(i) {
1979
+ if (i = i.split("=")[0], i = i.trim().replace(ye, ""), i.length < 2)
1980
1980
  return "";
1981
1981
  for (; i.length % 4 !== 0; )
1982
1982
  i = i + "=";
1983
1983
  return i;
1984
1984
  }
1985
- function ut(i, t) {
1985
+ function ft(i, t) {
1986
1986
  t = t || 1 / 0;
1987
1987
  let e;
1988
- const a = i.length;
1988
+ const c = i.length;
1989
1989
  let l = null;
1990
1990
  const p = [];
1991
- for (let d = 0; d < a; ++d) {
1991
+ for (let d = 0; d < c; ++d) {
1992
1992
  if (e = i.charCodeAt(d), e > 55295 && e < 57344) {
1993
1993
  if (!l) {
1994
1994
  if (e > 56319) {
1995
1995
  (t -= 3) > -1 && p.push(239, 191, 189);
1996
1996
  continue;
1997
- } else if (d + 1 === a) {
1997
+ } else if (d + 1 === c) {
1998
1998
  (t -= 3) > -1 && p.push(239, 191, 189);
1999
1999
  continue;
2000
2000
  }
@@ -2041,75 +2041,75 @@ xt.write = function(n, r, o, s, f, u) {
2041
2041
  }
2042
2042
  return p;
2043
2043
  }
2044
- function be(i) {
2044
+ function me(i) {
2045
2045
  const t = [];
2046
2046
  for (let e = 0; e < i.length; ++e)
2047
2047
  t.push(i.charCodeAt(e) & 255);
2048
2048
  return t;
2049
2049
  }
2050
- function xe(i, t) {
2051
- let e, a, l;
2050
+ function be(i, t) {
2051
+ let e, c, l;
2052
2052
  const p = [];
2053
2053
  for (let d = 0; d < i.length && !((t -= 2) < 0); ++d)
2054
- e = i.charCodeAt(d), a = e >> 8, l = e % 256, p.push(l), p.push(a);
2054
+ e = i.charCodeAt(d), c = e >> 8, l = e % 256, p.push(l), p.push(c);
2055
2055
  return p;
2056
2056
  }
2057
2057
  function Rt(i) {
2058
- return r.toByteArray(me(i));
2058
+ return r.toByteArray(ge(i));
2059
2059
  }
2060
- function nt(i, t, e, a) {
2060
+ function nt(i, t, e, c) {
2061
2061
  let l;
2062
- for (l = 0; l < a && !(l + e >= t.length || l >= i.length); ++l)
2062
+ for (l = 0; l < c && !(l + e >= t.length || l >= i.length); ++l)
2063
2063
  t[l + e] = i[l];
2064
2064
  return l;
2065
2065
  }
2066
- function N(i, t) {
2066
+ function D(i, t) {
2067
2067
  return i instanceof t || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === t.name;
2068
2068
  }
2069
2069
  function ht(i) {
2070
2070
  return i !== i;
2071
2071
  }
2072
- const Be = function() {
2072
+ const xe = function() {
2073
2073
  const i = "0123456789abcdef", t = new Array(256);
2074
2074
  for (let e = 0; e < 16; ++e) {
2075
- const a = e * 16;
2075
+ const c = e * 16;
2076
2076
  for (let l = 0; l < 16; ++l)
2077
- t[a + l] = i[e] + i[l];
2077
+ t[c + l] = i[e] + i[l];
2078
2078
  }
2079
2079
  return t;
2080
2080
  }();
2081
- function v(i) {
2082
- return typeof BigInt > "u" ? Ee : i;
2081
+ function q(i) {
2082
+ return typeof BigInt > "u" ? Be : i;
2083
2083
  }
2084
- function Ee() {
2084
+ function Be() {
2085
2085
  throw new Error("BigInt not supported");
2086
2086
  }
2087
- })(q);
2087
+ })(H);
2088
2088
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
2089
2089
  (function(n, r) {
2090
- var o = q, s = o.Buffer;
2091
- function f(h, c) {
2090
+ var o = H, s = o.Buffer;
2091
+ function u(h, a) {
2092
2092
  for (var w in h)
2093
- c[w] = h[w];
2093
+ a[w] = h[w];
2094
2094
  }
2095
- s.from && s.alloc && s.allocUnsafe && s.allocUnsafeSlow ? n.exports = o : (f(o, r), r.Buffer = u);
2096
- function u(h, c, w) {
2097
- return s(h, c, w);
2095
+ s.from && s.alloc && s.allocUnsafe && s.allocUnsafeSlow ? n.exports = o : (u(o, r), r.Buffer = f);
2096
+ function f(h, a, w) {
2097
+ return s(h, a, w);
2098
2098
  }
2099
- u.prototype = Object.create(s.prototype), f(s, u), u.from = function(h, c, w) {
2099
+ f.prototype = Object.create(s.prototype), u(s, f), f.from = function(h, a, w) {
2100
2100
  if (typeof h == "number")
2101
2101
  throw new TypeError("Argument must not be a number");
2102
- return s(h, c, w);
2103
- }, u.alloc = function(h, c, w) {
2102
+ return s(h, a, w);
2103
+ }, f.alloc = function(h, a, w) {
2104
2104
  if (typeof h != "number")
2105
2105
  throw new TypeError("Argument must be a number");
2106
2106
  var y = s(h);
2107
- return c !== void 0 ? typeof w == "string" ? y.fill(c, w) : y.fill(c) : y.fill(0), y;
2108
- }, u.allocUnsafe = function(h) {
2107
+ return a !== void 0 ? typeof w == "string" ? y.fill(a, w) : y.fill(a) : y.fill(0), y;
2108
+ }, f.allocUnsafe = function(h) {
2109
2109
  if (typeof h != "number")
2110
2110
  throw new TypeError("Argument must be a number");
2111
2111
  return s(h);
2112
- }, u.allocUnsafeSlow = function(h) {
2112
+ }, f.allocUnsafeSlow = function(h) {
2113
2113
  if (typeof h != "number")
2114
2114
  throw new TypeError("Argument must be a number");
2115
2115
  return o.SlowBuffer(h);
@@ -2121,12 +2121,12 @@ function at(n, r) {
2121
2121
  }
2122
2122
  at.prototype.update = function(n, r) {
2123
2123
  typeof n == "string" && (r = r || "utf8", n = Kt.from(n, r));
2124
- for (var o = this._block, s = this._blockSize, f = n.length, u = this._len, h = 0; h < f; ) {
2125
- for (var c = u % s, w = Math.min(f - h, s - c), y = 0; y < w; y++)
2126
- o[c + y] = n[h + y];
2127
- u += w, h += w, u % s === 0 && this._update(o);
2124
+ for (var o = this._block, s = this._blockSize, u = n.length, f = this._len, h = 0; h < u; ) {
2125
+ for (var a = f % s, w = Math.min(u - h, s - a), y = 0; y < w; y++)
2126
+ o[a + y] = n[h + y];
2127
+ f += w, h += w, f % s === 0 && this._update(o);
2128
2128
  }
2129
- return this._len += f, this;
2129
+ return this._len += u, this;
2130
2130
  };
2131
2131
  at.prototype.digest = function(n) {
2132
2132
  var r = this._len % this._blockSize;
@@ -2135,59 +2135,59 @@ at.prototype.digest = function(n) {
2135
2135
  if (o <= 4294967295)
2136
2136
  this._block.writeUInt32BE(o, this._blockSize - 4);
2137
2137
  else {
2138
- var s = (o & 4294967295) >>> 0, f = (o - s) / 4294967296;
2139
- this._block.writeUInt32BE(f, this._blockSize - 8), this._block.writeUInt32BE(s, this._blockSize - 4);
2138
+ var s = (o & 4294967295) >>> 0, u = (o - s) / 4294967296;
2139
+ this._block.writeUInt32BE(u, this._blockSize - 8), this._block.writeUInt32BE(s, this._blockSize - 4);
2140
2140
  }
2141
2141
  this._update(this._block);
2142
- var u = this._hash();
2143
- return n ? u.toString(n) : u;
2142
+ var f = this._hash();
2143
+ return n ? f.toString(n) : f;
2144
2144
  };
2145
2145
  at.prototype._update = function() {
2146
2146
  throw new Error("_update must be implemented by subclass");
2147
2147
  };
2148
- var pr = at, dr = ir, Jt = pr, wr = Vt.Buffer, yr = [
2148
+ var lr = at, pr = nr, Jt = lr, dr = Vt.Buffer, wr = [
2149
2149
  1518500249,
2150
2150
  1859775393,
2151
2151
  -1894007588,
2152
2152
  -899497514
2153
- ], gr = new Array(80);
2153
+ ], yr = new Array(80);
2154
2154
  function rt() {
2155
- this.init(), this._w = gr, Jt.call(this, 64, 56);
2155
+ this.init(), this._w = yr, Jt.call(this, 64, 56);
2156
2156
  }
2157
- dr(rt, Jt);
2157
+ pr(rt, Jt);
2158
2158
  rt.prototype.init = function() {
2159
2159
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
2160
2160
  };
2161
- function mr(n) {
2161
+ function gr(n) {
2162
2162
  return n << 1 | n >>> 31;
2163
2163
  }
2164
- function br(n) {
2164
+ function mr(n) {
2165
2165
  return n << 5 | n >>> 27;
2166
2166
  }
2167
- function xr(n) {
2167
+ function br(n) {
2168
2168
  return n << 30 | n >>> 2;
2169
2169
  }
2170
- function Br(n, r, o, s) {
2170
+ function xr(n, r, o, s) {
2171
2171
  return n === 0 ? r & o | ~r & s : n === 2 ? r & o | r & s | o & s : r ^ o ^ s;
2172
2172
  }
2173
2173
  rt.prototype._update = function(n) {
2174
- for (var r = this._w, o = this._a | 0, s = this._b | 0, f = this._c | 0, u = this._d | 0, h = this._e | 0, c = 0; c < 16; ++c)
2175
- r[c] = n.readInt32BE(c * 4);
2176
- for (; c < 80; ++c)
2177
- r[c] = mr(r[c - 3] ^ r[c - 8] ^ r[c - 14] ^ r[c - 16]);
2174
+ for (var r = this._w, o = this._a | 0, s = this._b | 0, u = this._c | 0, f = this._d | 0, h = this._e | 0, a = 0; a < 16; ++a)
2175
+ r[a] = n.readInt32BE(a * 4);
2176
+ for (; a < 80; ++a)
2177
+ r[a] = gr(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
2178
2178
  for (var w = 0; w < 80; ++w) {
2179
- var y = ~~(w / 20), g = br(o) + Br(y, s, f, u) + h + r[w] + yr[y] | 0;
2180
- h = u, u = f, f = xr(s), s = o, o = g;
2179
+ var y = ~~(w / 20), g = mr(o) + xr(y, s, u, f) + h + r[w] + wr[y] | 0;
2180
+ h = f, f = u, u = br(s), s = o, o = g;
2181
2181
  }
2182
- this._a = o + this._a | 0, this._b = s + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = h + this._e | 0;
2182
+ this._a = o + this._a | 0, this._b = s + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = h + this._e | 0;
2183
2183
  };
2184
2184
  rt.prototype._hash = function() {
2185
- var n = wr.allocUnsafe(20);
2185
+ var n = dr.allocUnsafe(20);
2186
2186
  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;
2187
2187
  };
2188
- var Er = rt;
2189
- const Ir = /* @__PURE__ */ nr(Er);
2190
- function _r(n) {
2188
+ var Br = rt;
2189
+ const Er = /* @__PURE__ */ rr(Br);
2190
+ function Ir(n) {
2191
2191
  let r = "";
2192
2192
  for (const o of new Uint8Array(n))
2193
2193
  o < 16 && (r += "0"), r += o.toString(16);
@@ -2195,16 +2195,16 @@ function _r(n) {
2195
2195
  }
2196
2196
  let dt = null;
2197
2197
  async function jt(n) {
2198
- return dt === null && (dt = await Fr()), dt ? Xt(n) : Ar(n);
2198
+ return dt === null && (dt = await Ar()), dt ? Xt(n) : _r(n);
2199
2199
  }
2200
- function Ar(n) {
2201
- return new Ir().update(n).digest("hex");
2200
+ function _r(n) {
2201
+ return new Er().update(n).digest("hex");
2202
2202
  }
2203
2203
  async function Xt(n) {
2204
2204
  const r = await crypto.subtle.digest("SHA-1", n);
2205
- return _r(r);
2205
+ return Ir(r);
2206
2206
  }
2207
- async function Fr() {
2207
+ async function Ar() {
2208
2208
  try {
2209
2209
  if (await Xt(new Uint8Array([])) === "da39a3ee5e6b4b0d3255bfef95601890afd80709")
2210
2210
  return !0;
@@ -2212,21 +2212,21 @@ async function Fr() {
2212
2212
  }
2213
2213
  return !1;
2214
2214
  }
2215
- function Ur(n) {
2215
+ function Fr(n) {
2216
2216
  const r = [];
2217
2217
  let o = 0, s = 0;
2218
2218
  do {
2219
2219
  o = n.readUInt8();
2220
- const f = o & 127;
2221
- r.push(f), s = o & 128;
2220
+ const u = o & 127;
2221
+ r.push(u), s = o & 128;
2222
2222
  } while (s);
2223
- return r.reduce((f, u) => f + 1 << 7 | u, -1);
2223
+ return r.reduce((u, f) => u + 1 << 7 | f, -1);
2224
2224
  }
2225
- function Sr(n, r) {
2226
- let o = r, s = 4, f = null;
2225
+ function Ur(n, r) {
2226
+ let o = r, s = 4, u = null;
2227
2227
  do
2228
- f = n.readUInt8(), o |= (f & 127) << s, s += 7;
2229
- while (f & 128);
2228
+ u = n.readUInt8(), o |= (u & 127) << s, s += 7;
2229
+ while (u & 128);
2230
2230
  return o;
2231
2231
  }
2232
2232
  class Q {
@@ -2237,28 +2237,28 @@ class Q {
2237
2237
  const s = new z(r);
2238
2238
  if (s.slice(4).toString("hex") !== "ff744f63")
2239
2239
  return;
2240
- const u = s.readUInt32BE();
2241
- if (u !== 2)
2240
+ const f = s.readUInt32BE();
2241
+ if (f !== 2)
2242
2242
  throw new _(
2243
- `Unable to read version ${u} packfile IDX. (Only version 2 supported)`
2243
+ `Unable to read version ${f} packfile IDX. (Only version 2 supported)`
2244
2244
  );
2245
2245
  if (r.byteLength > 2048 * 1024 * 1024)
2246
2246
  throw new _(
2247
2247
  "To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size."
2248
2248
  );
2249
2249
  s.seek(s.tell() + 4 * 255);
2250
- const h = s.readUInt32BE(), c = [];
2250
+ const h = s.readUInt32BE(), a = [];
2251
2251
  for (let g = 0; g < h; g++) {
2252
2252
  const m = s.slice(20).toString("hex");
2253
- c[g] = m;
2253
+ a[g] = m;
2254
2254
  }
2255
2255
  s.seek(s.tell() + 4 * h);
2256
2256
  const w = /* @__PURE__ */ new Map();
2257
2257
  for (let g = 0; g < h; g++)
2258
- w.set(c[g], s.readUInt32BE());
2258
+ w.set(a[g], s.readUInt32BE());
2259
2259
  const y = s.slice(20).toString("hex");
2260
2260
  return new Q({
2261
- hashes: c,
2261
+ hashes: a,
2262
2262
  crcs: {},
2263
2263
  offsets: w,
2264
2264
  packfileSha: y,
@@ -2266,72 +2266,72 @@ class Q {
2266
2266
  });
2267
2267
  }
2268
2268
  static async fromPack({ pack: r, getExternalRefDelta: o, onProgress: s }) {
2269
- const f = {
2269
+ const u = {
2270
2270
  1: "commit",
2271
2271
  2: "tree",
2272
2272
  3: "blob",
2273
2273
  4: "tag",
2274
2274
  6: "ofs-delta",
2275
2275
  7: "ref-delta"
2276
- }, u = {}, h = r.slice(-20).toString("hex"), c = [], w = {}, y = /* @__PURE__ */ new Map();
2276
+ }, f = {}, h = r.slice(-20).toString("hex"), a = [], w = {}, y = /* @__PURE__ */ new Map();
2277
2277
  let g = null, m = null;
2278
- await Ze([r], async ({ data: D, type: U, reference: M, offset: $, num: G }) => {
2279
- g === null && (g = G);
2278
+ await Xe([r], async ({ data: N, type: U, reference: M, offset: $, num: v }) => {
2279
+ g === null && (g = v);
2280
2280
  const R = Math.floor(
2281
- (g - G) * 100 / g
2281
+ (g - v) * 100 / g
2282
2282
  );
2283
2283
  R !== m && s && await s({
2284
2284
  phase: "Receiving objects",
2285
- loaded: g - G,
2285
+ loaded: g - v,
2286
2286
  total: g
2287
- }), m = R, U = f[U], ["commit", "tree", "blob", "tag"].includes(U) ? u[$] = {
2287
+ }), m = R, U = u[U], ["commit", "tree", "blob", "tag"].includes(U) ? f[$] = {
2288
2288
  type: U,
2289
2289
  offset: $
2290
- } : U === "ofs-delta" ? u[$] = {
2290
+ } : U === "ofs-delta" ? f[$] = {
2291
2291
  type: U,
2292
2292
  offset: $
2293
- } : U === "ref-delta" && (u[$] = {
2293
+ } : U === "ref-delta" && (f[$] = {
2294
2294
  type: U,
2295
2295
  offset: $
2296
2296
  });
2297
2297
  });
2298
- const b = Object.keys(u).map(Number);
2299
- for (const [D, U] of b.entries()) {
2300
- const M = D + 1 === b.length ? r.byteLength - 20 : b[D + 1], $ = u[U], G = Ae.buf(r.slice(U, M)) >>> 0;
2301
- $.end = M, $.crc = G;
2298
+ const b = Object.keys(f).map(Number);
2299
+ for (const [N, U] of b.entries()) {
2300
+ const M = N + 1 === b.length ? r.byteLength - 20 : b[N + 1], $ = f[U], v = _e.buf(r.slice(U, M)) >>> 0;
2301
+ $.end = M, $.crc = v;
2302
2302
  }
2303
2303
  const B = new Q({
2304
2304
  pack: Promise.resolve(r),
2305
2305
  packfileSha: h,
2306
2306
  crcs: w,
2307
- hashes: c,
2307
+ hashes: a,
2308
2308
  offsets: y,
2309
2309
  getExternalRefDelta: o
2310
2310
  });
2311
2311
  m = null;
2312
2312
  let T = 0;
2313
2313
  const L = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
2314
- for (let D in u) {
2315
- D = Number(D);
2314
+ for (let N in f) {
2315
+ N = Number(N);
2316
2316
  const U = Math.floor(T * 100 / g);
2317
2317
  U !== m && s && await s({
2318
2318
  phase: "Resolving deltas",
2319
2319
  loaded: T,
2320
2320
  total: g
2321
2321
  }), T++, m = U;
2322
- const M = u[D];
2322
+ const M = f[N];
2323
2323
  if (!M.oid)
2324
2324
  try {
2325
2325
  B.readDepth = 0, B.externalReadDepth = 0;
2326
- const { type: $, object: G } = await B.readSlice({ start: D });
2326
+ const { type: $, object: v } = await B.readSlice({ start: N });
2327
2327
  L[B.readDepth] += 1;
2328
- const R = await jt(Je.wrap({ type: $, object: G }));
2329
- M.oid = R, c.push(R), y.set(R, D), w[R] = M.crc;
2328
+ const R = await jt(Ke.wrap({ type: $, object: v }));
2329
+ M.oid = R, a.push(R), y.set(R, N), w[R] = M.crc;
2330
2330
  } catch {
2331
2331
  continue;
2332
2332
  }
2333
2333
  }
2334
- return c.sort(), B;
2334
+ return a.sort(), B;
2335
2335
  }
2336
2336
  async toBuffer() {
2337
2337
  const r = [], o = (y, g) => {
@@ -2348,16 +2348,16 @@ class Q {
2348
2348
  r.push(s.buffer);
2349
2349
  for (const y of this.hashes)
2350
2350
  o(y, "hex");
2351
- const f = new z(Buffer.alloc(this.hashes.length * 4));
2352
- for (const y of this.hashes)
2353
- f.writeUInt32BE(this.crcs[y]);
2354
- r.push(f.buffer);
2355
2351
  const u = new z(Buffer.alloc(this.hashes.length * 4));
2356
2352
  for (const y of this.hashes)
2357
- u.writeUInt32BE(this.offsets.get(y));
2358
- r.push(u.buffer), o(this.packfileSha, "hex");
2359
- const h = Buffer.concat(r), c = await jt(h), w = Buffer.alloc(20);
2360
- return w.write(c, "hex"), Buffer.concat([h, w]);
2353
+ u.writeUInt32BE(this.crcs[y]);
2354
+ r.push(u.buffer);
2355
+ const f = new z(Buffer.alloc(this.hashes.length * 4));
2356
+ for (const y of this.hashes)
2357
+ f.writeUInt32BE(this.offsets.get(y));
2358
+ r.push(f.buffer), o(this.packfileSha, "hex");
2359
+ const h = Buffer.concat(r), a = await jt(h), w = Buffer.alloc(20);
2360
+ return w.write(a, "hex"), Buffer.concat([h, w]);
2361
2361
  }
2362
2362
  async load({ pack: r }) {
2363
2363
  this.pack = r;
@@ -2390,28 +2390,28 @@ class Q {
2390
2390
  throw new _(
2391
2391
  "Tried to read from a GitPackIndex with no packfile loaded into memory"
2392
2392
  );
2393
- const s = (await this.pack).slice(r), f = new z(s), u = f.readUInt8(), h = u & 112;
2394
- let c = o[h];
2395
- if (c === void 0)
2393
+ const s = (await this.pack).slice(r), u = new z(s), f = u.readUInt8(), h = f & 112;
2394
+ let a = o[h];
2395
+ if (a === void 0)
2396
2396
  throw new _("Unrecognized type: 0b" + h.toString(2));
2397
- const w = u & 15;
2397
+ const w = f & 15;
2398
2398
  let y = w;
2399
- u & 128 && (y = Sr(f, w));
2399
+ f & 128 && (y = Ur(u, w));
2400
2400
  let m = null, b = null;
2401
- if (c === "ofs_delta") {
2402
- const T = Ur(f), L = r - T;
2403
- ({ object: m, type: c } = await this.readSlice({ start: L }));
2401
+ if (a === "ofs_delta") {
2402
+ const T = Fr(u), L = r - T;
2403
+ ({ object: m, type: a } = await this.readSlice({ start: L }));
2404
2404
  }
2405
- if (c === "ref_delta") {
2406
- const T = f.slice(20).toString("hex");
2407
- ({ object: m, type: c } = await this.read({ oid: T }));
2405
+ if (a === "ref_delta") {
2406
+ const T = u.slice(20).toString("hex");
2407
+ ({ object: m, type: a } = await this.read({ oid: T }));
2408
2408
  }
2409
- const B = s.slice(f.tell());
2410
- if (b = Buffer.from(await er(B)), b.byteLength !== y)
2409
+ const B = s.slice(u.tell());
2410
+ if (b = Buffer.from(await tr(B)), b.byteLength !== y)
2411
2411
  throw new _(
2412
2412
  `Packfile told us object would have length ${y} but it had length ${b.byteLength}`
2413
2413
  );
2414
- return m && (b = Buffer.from(Xe(b, m))), this.readDepth > 3 && (this.offsetCache[r] = { type: c, object: b }), { type: c, format: "content", object: b };
2414
+ return m && (b = Buffer.from(Je(b, m))), this.readDepth > 3 && (this.offsetCache[r] = { type: a, object: b }), { type: a, format: "content", object: b };
2415
2415
  }
2416
2416
  }
2417
2417
  class tt extends J {
@@ -2430,18 +2430,18 @@ class ct extends J {
2430
2430
  * @param {'blob'|'commit'|'tag'|'tree'} expected
2431
2431
  * @param {string} [filepath]
2432
2432
  */
2433
- constructor(r, o, s, f) {
2433
+ constructor(r, o, s, u) {
2434
2434
  super(
2435
- `Object ${r} ${f ? `at ${f}` : ""}was anticipated to be a ${s} but it is a ${o}.`
2436
- ), this.code = this.name = ct.code, this.data = { oid: r, actual: o, expected: s, filepath: f };
2435
+ `Object ${r} ${u ? `at ${u}` : ""}was anticipated to be a ${s} but it is a ${o}.`
2436
+ ), this.code = this.name = ct.code, this.data = { oid: r, actual: o, expected: s, filepath: u };
2437
2437
  }
2438
2438
  }
2439
2439
  ct.code = "ObjectTypeError";
2440
2440
  async function Zt(n, r) {
2441
- const o = qt(n);
2441
+ const o = Ht(n);
2442
2442
  for (; ; ) {
2443
- const { value: s, done: f } = await o.next();
2444
- if (s && await r(s), f)
2443
+ const { value: s, done: u } = await o.next();
2444
+ if (s && await r(s), u)
2445
2445
  break;
2446
2446
  }
2447
2447
  o.return && o.return();
@@ -2449,13 +2449,13 @@ async function Zt(n, r) {
2449
2449
  async function et(n) {
2450
2450
  let r = 0;
2451
2451
  const o = [];
2452
- await Zt(n, (u) => {
2453
- o.push(u), r += u.byteLength;
2452
+ await Zt(n, (f) => {
2453
+ o.push(f), r += f.byteLength;
2454
2454
  });
2455
2455
  const s = new Uint8Array(r);
2456
- let f = 0;
2457
- for (const u of o)
2458
- s.set(u, f), f += u.byteLength;
2456
+ let u = 0;
2457
+ for (const f of o)
2458
+ s.set(f, u), u += f.byteLength;
2459
2459
  return s;
2460
2460
  }
2461
2461
  class wt {
@@ -2494,39 +2494,39 @@ class wt {
2494
2494
  });
2495
2495
  }
2496
2496
  }
2497
- class kr {
2497
+ class Sr {
2498
2498
  static demux(r) {
2499
- const o = k.streamReader(r), s = new wt(), f = new wt(), u = new wt(), h = async function() {
2500
- const c = await o();
2501
- if (c === null)
2499
+ const o = k.streamReader(r), s = new wt(), u = new wt(), f = new wt(), h = async function() {
2500
+ const a = await o();
2501
+ if (a === null)
2502
2502
  return h();
2503
- if (c === !0) {
2504
- s.end(), u.end(), r.error ? f.destroy(r.error) : f.end();
2503
+ if (a === !0) {
2504
+ s.end(), f.end(), r.error ? u.destroy(r.error) : u.end();
2505
2505
  return;
2506
2506
  }
2507
- switch (c[0]) {
2507
+ switch (a[0]) {
2508
2508
  case 1: {
2509
- f.write(c.slice(1));
2509
+ u.write(a.slice(1));
2510
2510
  break;
2511
2511
  }
2512
2512
  case 2: {
2513
- u.write(c.slice(1));
2513
+ f.write(a.slice(1));
2514
2514
  break;
2515
2515
  }
2516
2516
  case 3: {
2517
- const w = c.slice(1);
2518
- u.write(w), s.end(), u.end(), f.destroy(new Error(w.toString("utf8")));
2517
+ const w = a.slice(1);
2518
+ f.write(w), s.end(), f.end(), u.destroy(new Error(w.toString("utf8")));
2519
2519
  return;
2520
2520
  }
2521
2521
  default:
2522
- s.write(c);
2522
+ s.write(a);
2523
2523
  }
2524
2524
  h();
2525
2525
  };
2526
2526
  return h(), {
2527
2527
  packetlines: s,
2528
- packfile: f,
2529
- progress: u
2528
+ packfile: u,
2529
+ progress: f
2530
2530
  };
2531
2531
  }
2532
2532
  // static mux ({
@@ -2598,49 +2598,69 @@ class kr {
2598
2598
  // }
2599
2599
  }
2600
2600
  async function Qt(n) {
2601
- const { packetlines: r, packfile: o, progress: s } = kr.demux(n), f = [], u = [], h = [];
2602
- let c = !1, w = !1;
2601
+ const { packetlines: r, packfile: o, progress: s } = Sr.demux(n), u = [], f = [], h = [];
2602
+ let a = !1, w = !1;
2603
2603
  return new Promise((y, g) => {
2604
2604
  Zt(r, (m) => {
2605
2605
  const b = m.toString("utf8").trim();
2606
2606
  if (b.startsWith("shallow")) {
2607
2607
  const B = b.slice(-41).trim();
2608
- B.length !== 40 && g(new tt(B)), f.push(B);
2608
+ B.length !== 40 && g(new tt(B)), u.push(B);
2609
2609
  } else if (b.startsWith("unshallow")) {
2610
2610
  const B = b.slice(-41).trim();
2611
- B.length !== 40 && g(new tt(B)), u.push(B);
2611
+ B.length !== 40 && g(new tt(B)), f.push(B);
2612
2612
  } else if (b.startsWith("ACK")) {
2613
2613
  const [, B, T] = b.split(" ");
2614
2614
  h.push({ oid: B, status: T }), T || (w = !0);
2615
2615
  } else
2616
- b.startsWith("NAK") ? (c = !0, w = !0) : (w = !0, c = !0);
2617
- w && (n.error ? g(n.error) : y({ shallows: f, unshallows: u, acks: h, nak: c, packfile: o, progress: s }));
2616
+ b.startsWith("NAK") ? (a = !0, w = !0) : (w = !0, a = !0);
2617
+ w && (n.error ? g(n.error) : y({ shallows: u, unshallows: f, acks: h, nak: a, packfile: o, progress: s }));
2618
2618
  }).finally(() => {
2619
- w || (n.error ? g(n.error) : y({ shallows: f, unshallows: u, acks: h, nak: c, packfile: o, progress: s }));
2619
+ w || (n.error ? g(n.error) : y({ shallows: u, unshallows: f, acks: h, nak: a, packfile: o, progress: s }));
2620
2620
  });
2621
2621
  });
2622
2622
  }
2623
- typeof window < "u" && (window.Buffer = q.Buffer);
2623
+ typeof window < "u" && (window.Buffer = H.Buffer);
2624
2624
  async function Xr(n, r, o) {
2625
- const f = (await ee(n, r))[r], u = await re(n, f), h = await $r(u, f, o), c = await Rr(
2625
+ const s = await ee(n, r), u = await $r(s, r, o), f = await Rr(
2626
2626
  n,
2627
- o.map((y) => h[y].oid)
2628
- ), w = {};
2627
+ o.map((a) => u[a].oid)
2628
+ ), h = {};
2629
2629
  return await Promise.all(
2630
- o.map(async (y) => {
2631
- w[y] = await ne(
2632
- c,
2633
- h[y].oid
2630
+ o.map(async (a) => {
2631
+ h[a] = await re(
2632
+ f,
2633
+ u[a].oid
2634
2634
  );
2635
2635
  })
2636
- ), w;
2636
+ ), h;
2637
2637
  }
2638
2638
  async function Zr(n, r) {
2639
- const o = await ee(n, r);
2640
- if (!(r in o))
2641
- throw new Error(`Branch ${r} not found`);
2642
- const s = o[r], f = await re(n, s), u = await Tr(f, s);
2643
- return u != null && u.object ? te(u) : [];
2639
+ const o = await ee(n, r), s = await Tr(o, r);
2640
+ return s != null && s.object ? te(s) : [];
2641
+ }
2642
+ async function Qr(n, r) {
2643
+ switch ((r.type === "infer" || r.type === void 0) && (["", "HEAD"].includes(r.value) ? r = {
2644
+ value: r.value,
2645
+ type: "refname"
2646
+ } : typeof r.value == "string" && r.value.length === 40 && (r = {
2647
+ value: r.value,
2648
+ type: "commit"
2649
+ })), r.type === "branch" && (r = {
2650
+ value: `refs/heads/${r.value}`,
2651
+ type: "refname"
2652
+ }), r.type) {
2653
+ case "commit":
2654
+ return r.value;
2655
+ case "refname": {
2656
+ const o = await kr(n, r.value);
2657
+ if (!(r.value in o))
2658
+ throw new Error(`Branch ${r.value} not found`);
2659
+ return o[r.value];
2660
+ }
2661
+ default:
2662
+ throw new Error(`Invalid ref type: ${r.type}`);
2663
+ }
2644
2664
  }
2645
2665
  function te(n) {
2646
2666
  return n.object.map((r) => {
@@ -2657,8 +2677,8 @@ function te(n) {
2657
2677
  };
2658
2678
  }).filter((r) => !!(r != null && r.name));
2659
2679
  }
2660
- async function ee(n, r) {
2661
- const o = q.Buffer.from(
2680
+ async function kr(n, r) {
2681
+ const o = H.Buffer.from(
2662
2682
  await et([
2663
2683
  k.encode(`command=ls-refs
2664
2684
  `),
@@ -2682,15 +2702,15 @@ async function ee(n, r) {
2682
2702
  "Git-Protocol": "version=2"
2683
2703
  },
2684
2704
  body: o
2685
- }), f = {};
2686
- for await (const u of Cr(s)) {
2687
- const h = u.indexOf(" "), c = u.slice(0, h), w = u.slice(h + 1, u.length - 1);
2688
- f[w] = c;
2705
+ }), u = {};
2706
+ for await (const f of Cr(s)) {
2707
+ const h = f.indexOf(" "), a = f.slice(0, h), w = f.slice(h + 1, f.length - 1);
2708
+ u[w] = a;
2689
2709
  }
2690
- return f;
2710
+ return u;
2691
2711
  }
2692
- async function re(n, r) {
2693
- const o = q.Buffer.from(
2712
+ async function ee(n, r) {
2713
+ const o = H.Buffer.from(
2694
2714
  await et([
2695
2715
  k.encode(
2696
2716
  `want ${r} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3 filter
@@ -2716,25 +2736,25 @@ async function re(n, r) {
2716
2736
  "Content-Length": `${o.length}`
2717
2737
  },
2718
2738
  body: o
2719
- }), f = ie(s.body), u = await Qt(f), h = q.Buffer.from(await et(u.packfile)), c = await Q.fromPack({
2739
+ }), u = ne(s.body), f = await Qt(u), h = H.Buffer.from(await et(f.packfile)), a = await Q.fromPack({
2720
2740
  pack: h
2721
- }), w = c.read;
2722
- return c.read = async function({ oid: y, ...g }) {
2741
+ }), w = a.read;
2742
+ return a.read = async function({ oid: y, ...g }) {
2723
2743
  const m = await w.call(this, { oid: y, ...g });
2724
2744
  return m.oid = y, m;
2725
- }, c;
2745
+ }, a;
2726
2746
  }
2727
2747
  async function Tr(n, r) {
2728
2748
  const o = await n.read({
2729
2749
  oid: r
2730
2750
  });
2731
2751
  W(o);
2732
- const s = await n.read({ oid: o.object.tree }), f = [s];
2733
- for (; f.length > 0; ) {
2734
- const u = f.pop(), h = await n.read({ oid: u.oid });
2735
- if (W(h), u.object = h.object, h.type === "tree")
2736
- for (const c of h.object)
2737
- c.type === "tree" && f.push(c);
2752
+ const s = await n.read({ oid: o.object.tree }), u = [s];
2753
+ for (; u.length > 0; ) {
2754
+ const f = u.pop(), h = await n.read({ oid: f.oid });
2755
+ if (W(h), f.object = h.object, h.type === "tree")
2756
+ for (const a of h.object)
2757
+ a.type === "tree" && u.push(a);
2738
2758
  }
2739
2759
  return s;
2740
2760
  }
@@ -2743,22 +2763,22 @@ async function $r(n, r, o) {
2743
2763
  oid: r
2744
2764
  });
2745
2765
  W(s);
2746
- const f = await n.read({ oid: s.object.tree });
2747
- W(f);
2748
- const u = {};
2766
+ const u = await n.read({ oid: s.object.tree });
2767
+ W(u);
2768
+ const f = {};
2749
2769
  for (const h of o) {
2750
- let c = f;
2770
+ let a = u;
2751
2771
  const w = h.split("/");
2752
2772
  for (const y of w) {
2753
- if (c.type !== "tree")
2773
+ if (a.type !== "tree")
2754
2774
  throw new Error(`Path not found in the repo: ${h}`);
2755
2775
  let g = !1;
2756
- for (const m of c.object)
2776
+ for (const m of a.object)
2757
2777
  if (m.path === y) {
2758
2778
  try {
2759
- c = await n.read({ oid: m.oid }), W(c);
2779
+ a = await n.read({ oid: m.oid }), W(a);
2760
2780
  } catch {
2761
- c = m;
2781
+ a = m;
2762
2782
  }
2763
2783
  g = !0;
2764
2784
  break;
@@ -2766,16 +2786,16 @@ async function $r(n, r, o) {
2766
2786
  if (!g)
2767
2787
  throw new Error(`Path not found in the repo: ${h}`);
2768
2788
  }
2769
- u[h] = c;
2789
+ f[h] = a;
2770
2790
  }
2771
- return u;
2791
+ return f;
2772
2792
  }
2773
2793
  async function Rr(n, r) {
2774
- const o = q.Buffer.from(
2794
+ const o = H.Buffer.from(
2775
2795
  await et([
2776
2796
  ...r.map(
2777
- (c) => k.encode(
2778
- `want ${c} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3
2797
+ (a) => k.encode(
2798
+ `want ${a} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3
2779
2799
  `
2780
2800
  )
2781
2801
  ),
@@ -2791,26 +2811,26 @@ async function Rr(n, r) {
2791
2811
  "Content-Length": `${o.length}`
2792
2812
  },
2793
2813
  body: o
2794
- }), f = ie(s.body), u = await Qt(f), h = q.Buffer.from(await et(u.packfile));
2814
+ }), u = ne(s.body), f = await Qt(u), h = H.Buffer.from(await et(f.packfile));
2795
2815
  return await Q.fromPack({
2796
2816
  pack: h
2797
2817
  });
2798
2818
  }
2799
- async function ne(n, r) {
2819
+ async function re(n, r) {
2800
2820
  const o = await n.read({ oid: r });
2801
2821
  if (W(o), o.type === "blob")
2802
2822
  return o.object;
2803
2823
  const s = {};
2804
- for (const { path: f, oid: u, type: h } of o.object)
2824
+ for (const { path: u, oid: f, type: h } of o.object)
2805
2825
  if (h === "blob") {
2806
- const c = await n.read({ oid: u });
2807
- W(c), s[f] = c.object;
2826
+ const a = await n.read({ oid: f });
2827
+ W(a), s[u] = a.object;
2808
2828
  } else
2809
- h === "tree" && (s[f] = await ne(n, u));
2829
+ h === "tree" && (s[u] = await re(n, f));
2810
2830
  return s;
2811
2831
  }
2812
2832
  function W(n) {
2813
- if (n.object instanceof q.Buffer)
2833
+ if (n.object instanceof H.Buffer)
2814
2834
  switch (n.type) {
2815
2835
  case "commit":
2816
2836
  n.object = O.from(n.object).parse();
@@ -2842,7 +2862,7 @@ async function* Cr(n) {
2842
2862
  yield r.substring(o + 4, o + s), o += s;
2843
2863
  }
2844
2864
  }
2845
- function ie(n) {
2865
+ function ne(n) {
2846
2866
  if (n[Symbol.asyncIterator])
2847
2867
  return n;
2848
2868
  const r = n.getReader();
@@ -2858,7 +2878,7 @@ function ie(n) {
2858
2878
  }
2859
2879
  };
2860
2880
  }
2861
- function Qr(n, r) {
2881
+ function tn(n, r) {
2862
2882
  r = Mt(r);
2863
2883
  const o = ["", ".", "/"].includes(r);
2864
2884
  let s = n;
@@ -2866,9 +2886,9 @@ function Qr(n, r) {
2866
2886
  r = "";
2867
2887
  else {
2868
2888
  const h = r.split("/");
2869
- for (const c of h) {
2889
+ for (const a of h) {
2870
2890
  const w = s == null ? void 0 : s.find(
2871
- (y) => y.name === c
2891
+ (y) => y.name === a
2872
2892
  );
2873
2893
  if ((w == null ? void 0 : w.type) === "folder")
2874
2894
  s = w.children;
@@ -2876,40 +2896,45 @@ function Qr(n, r) {
2876
2896
  return w ? [w.name] : [];
2877
2897
  }
2878
2898
  }
2879
- const f = [], u = [{ tree: s, path: r }];
2880
- for (; u.length > 0; ) {
2881
- const { tree: h, path: c } = u.pop();
2899
+ const u = [], f = [{ tree: s, path: r }];
2900
+ for (; f.length > 0; ) {
2901
+ const { tree: h, path: a } = f.pop();
2882
2902
  for (const w of h) {
2883
- const y = `${c}${c ? "/" : ""}${w.name}`;
2884
- w.type === "folder" ? u.push({
2903
+ const y = `${a}${a ? "/" : ""}${w.name}`;
2904
+ w.type === "folder" ? f.push({
2885
2905
  tree: w.children,
2886
2906
  path: y
2887
- }) : f.push(y);
2907
+ }) : u.push(y);
2888
2908
  }
2889
2909
  }
2890
- return f;
2910
+ return u;
2911
+ }
2912
+ function en(n, r) {
2913
+ return n.startsWith(r) ? n.substring(r.length) : n;
2891
2914
  }
2892
2915
  export {
2893
2916
  Yr as changeset,
2894
2917
  Kr as clearContentsFromMountDevice,
2895
2918
  jr as createClient,
2896
- vr as createCommit,
2897
- Hr as createOrUpdateBranch,
2919
+ qr as createCommit,
2920
+ Gr as createOrUpdateBranch,
2898
2921
  zr as createTree,
2899
2922
  Ct as createTreeNode,
2900
- Te as createTreeNodes,
2901
- $e as deleteFile,
2902
- Oe as directoryHandleFromMountDevice,
2923
+ ke as createTreeNodes,
2924
+ Te as deleteFile,
2925
+ Ce as directoryHandleFromMountDevice,
2903
2926
  Vr as directoryHandleToOpfsPath,
2904
2927
  Lr as filesListToObject,
2905
- qr as fork,
2928
+ Hr as fork,
2906
2929
  Mr as getArtifact,
2907
- Fe as getFilesFromDirectory,
2930
+ Ae as getFilesFromDirectory,
2908
2931
  Wr as iterateFiles,
2909
- Qr as listDescendantFiles,
2932
+ tn as listDescendantFiles,
2910
2933
  Zr as listGitFiles,
2911
- ee as listGitRefs,
2912
- Gr as mayPush,
2913
- Pe as opfsPathToDirectoryHandle,
2934
+ kr as listGitRefs,
2935
+ vr as mayPush,
2936
+ Oe as opfsPathToDirectoryHandle,
2937
+ en as removePathPrefix,
2938
+ Qr as resolveCommitHash,
2914
2939
  Xr as sparseCheckout
2915
2940
  };