@cbortech/cbor 0.23.1 → 0.25.0
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.
- package/README.ja.md +76 -29
- package/README.md +76 -29
- package/dist/ast/CborArray.d.ts +3 -3
- package/dist/ast/CborBignum.d.ts +5 -5
- package/dist/ast/CborByteString.d.ts +2 -2
- package/dist/ast/CborEllipsis.d.ts +2 -2
- package/dist/ast/CborEmbeddedCBOR.d.ts +3 -3
- package/dist/ast/CborFloat.d.ts +2 -2
- package/dist/ast/CborIndefiniteByteString.d.ts +3 -3
- package/dist/ast/CborIndefiniteTextString.d.ts +3 -3
- package/dist/ast/CborItem.d.ts +16 -10
- package/dist/ast/CborMap.d.ts +3 -3
- package/dist/ast/CborNint.d.ts +2 -2
- package/dist/ast/CborSimple.d.ts +2 -2
- package/dist/ast/CborTag.d.ts +3 -3
- package/dist/ast/CborTextString.d.ts +2 -2
- package/dist/ast/CborUint.d.ts +2 -2
- package/dist/ast/CborUnresolvedAppExt.d.ts +2 -2
- package/dist/ast/index.cjs +1 -1
- package/dist/ast/index.js +1 -1
- package/dist/cbor.d.ts +54 -22
- package/dist/cdn/parser.d.ts +7 -0
- package/dist/{edn → cdn}/serialize-utils.d.ts +4 -4
- package/dist/cdn/serializer.d.ts +7 -0
- package/dist/{edn → cdn}/tokenizer.d.ts +3 -3
- package/dist/extensions/cri.d.ts +7 -7
- package/dist/extensions/dt.d.ts +9 -9
- package/dist/extensions/ip.d.ts +8 -8
- package/dist/extensions/types.d.ts +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +36 -18
- package/dist/index.js.map +1 -1
- package/dist/mapEntries-CNxwMt7o.cjs +31 -0
- package/dist/mapEntries-CNxwMt7o.cjs.map +1 -0
- package/dist/{mapEntries-CSjvgq1X.js → mapEntries-Da-2HMRf.js} +583 -1219
- package/dist/mapEntries-Da-2HMRf.js.map +1 -0
- package/dist/simple.d.ts +2 -2
- package/dist/tag.d.ts +1 -1
- package/dist/types.d.ts +51 -25
- package/dist/utils/hexfloat.d.ts +2 -2
- package/package.json +20 -19
- package/dist/edn/parser.d.ts +0 -7
- package/dist/edn/serializer.d.ts +0 -7
- package/dist/extensions/hash.d.ts +0 -17
- package/dist/mapEntries-C73nWM8o.cjs +0 -31
- package/dist/mapEntries-C73nWM8o.cjs.map +0 -1
- package/dist/mapEntries-CSjvgq1X.js.map +0 -1
|
@@ -104,15 +104,18 @@ var c = class {
|
|
|
104
104
|
} : e;
|
|
105
105
|
return this._toCBOR(t);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
toCDN(e) {
|
|
108
108
|
let t = this._defaults ? {
|
|
109
109
|
...this._defaults,
|
|
110
110
|
...e
|
|
111
|
-
} : e, n = this.
|
|
111
|
+
} : e, n = this._toCDN(t, 0);
|
|
112
112
|
if (!t?.preserveComments) return n;
|
|
113
113
|
let r = this.comments?.leading?.map((e) => e.text) ?? [], i = this.comments?.trailing ?? [], a = i.length === 0 ? n : `${n} ${i.map((e) => e.text.trimEnd()).join(" ")}`;
|
|
114
114
|
return [...r, a].join("\n");
|
|
115
115
|
}
|
|
116
|
+
toEDN(e) {
|
|
117
|
+
return this.toCDN(e);
|
|
118
|
+
}
|
|
116
119
|
toJS(e) {
|
|
117
120
|
let t = this._defaults ? {
|
|
118
121
|
...this._defaults,
|
|
@@ -133,11 +136,11 @@ var c = class {
|
|
|
133
136
|
return [{
|
|
134
137
|
depth: e,
|
|
135
138
|
hex: Array.from(this._toCBOR(), (e) => e.toString(16).toUpperCase().padStart(2, "0")).join(" "),
|
|
136
|
-
comment: this.
|
|
139
|
+
comment: this._toCDN(t, 0)
|
|
137
140
|
}];
|
|
138
141
|
}
|
|
139
142
|
}, f = "getFloat16" in DataView.prototype && "setFloat16" in DataView.prototype, p = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
|
|
140
|
-
function
|
|
143
|
+
function ee(e) {
|
|
141
144
|
p.setFloat64(0, e, !1);
|
|
142
145
|
let t = p.getUint32(0, !1), n = p.getUint32(4, !1), r = t >>> 31 & 1, i = t >>> 20 & 2047, a = t & 1048575;
|
|
143
146
|
if (i === 2047) {
|
|
@@ -160,18 +163,18 @@ function m(e) {
|
|
|
160
163
|
let u = o <= 0 ? 0 : o;
|
|
161
164
|
return r << 15 | u << 10 | s;
|
|
162
165
|
}
|
|
163
|
-
function
|
|
166
|
+
function te(e) {
|
|
164
167
|
let t = e >>> 15 & 1, n = e >>> 10 & 31, r = e & 1023;
|
|
165
168
|
return n === 31 ? r === 0 ? t ? -Infinity : Infinity : NaN : n === 0 ? r === 0 ? t ? -0 : 0 : (t ? -1 : 1) * 2 ** -14 * (r / 1024) : (t ? -1 : 1) * 2 ** (n - 15) * (1 + r / 1024);
|
|
166
169
|
}
|
|
167
|
-
var
|
|
170
|
+
var ne = f ? (e, t, n, r) => {
|
|
168
171
|
e.setFloat16(t, n, r);
|
|
169
172
|
} : (e, t, n, r) => {
|
|
170
|
-
e.setUint16(t,
|
|
173
|
+
e.setUint16(t, ee(n), r);
|
|
171
174
|
};
|
|
172
175
|
//#endregion
|
|
173
176
|
//#region src/cbor/encode.ts
|
|
174
|
-
function
|
|
177
|
+
function m(e, t, n) {
|
|
175
178
|
if (n !== void 0) {
|
|
176
179
|
if (n === "i") {
|
|
177
180
|
if (t > 23n) throw RangeError(`value ${t} does not fit in immediate encoding _i (max 23)`);
|
|
@@ -210,24 +213,24 @@ function _(e, t, n) {
|
|
|
210
213
|
let r = new Uint8Array(9);
|
|
211
214
|
return r[0] = e << 5 | 27, new DataView(r.buffer).setBigUint64(1, t, !1), r;
|
|
212
215
|
}
|
|
213
|
-
function
|
|
216
|
+
function h(e) {
|
|
214
217
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
215
218
|
for (let t of e) n.set(t, r), r += t.length;
|
|
216
219
|
return n;
|
|
217
220
|
}
|
|
218
|
-
var
|
|
219
|
-
function
|
|
220
|
-
return Object.is(
|
|
221
|
+
var re = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4));
|
|
222
|
+
function ie(e) {
|
|
223
|
+
return Object.is(te(ee(e)), e);
|
|
221
224
|
}
|
|
222
|
-
function
|
|
223
|
-
return
|
|
225
|
+
function ae(e) {
|
|
226
|
+
return re.setFloat32(0, e, !1), Object.is(re.getFloat32(0, !1), e);
|
|
224
227
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
228
|
+
function oe(e) {
|
|
229
|
+
return ie(e) ? "half" : ae(e) ? "single" : "double";
|
|
227
230
|
}
|
|
228
231
|
//#endregion
|
|
229
232
|
//#region src/ast/CborUint.ts
|
|
230
|
-
var
|
|
233
|
+
var g = class extends d {
|
|
231
234
|
value;
|
|
232
235
|
encodingWidth;
|
|
233
236
|
constructor(e, t) {
|
|
@@ -236,9 +239,9 @@ var y = class extends d {
|
|
|
236
239
|
this.encodingWidth = t?.encodingWidth;
|
|
237
240
|
}
|
|
238
241
|
_toCBOR(e) {
|
|
239
|
-
return
|
|
242
|
+
return m(0, this.value, this.encodingWidth);
|
|
240
243
|
}
|
|
241
|
-
|
|
244
|
+
_toCDN(e, t) {
|
|
242
245
|
let n = this.encodingWidth === void 0 ? "" : `_${this.encodingWidth}`, r = this.value;
|
|
243
246
|
switch (e?.intFormat) {
|
|
244
247
|
case "hex": return `0x${r.toString(16)}${n}`;
|
|
@@ -251,7 +254,7 @@ var y = class extends d {
|
|
|
251
254
|
let t = e?.integerAs ?? "auto";
|
|
252
255
|
return t === "bigint" ? this.value : t === "number" || this.value <= BigInt(2 ** 53 - 1) ? Number(this.value) : this.value;
|
|
253
256
|
}
|
|
254
|
-
},
|
|
257
|
+
}, _ = class extends d {
|
|
255
258
|
argument;
|
|
256
259
|
encodingWidth;
|
|
257
260
|
constructor(e, t) {
|
|
@@ -265,9 +268,9 @@ var y = class extends d {
|
|
|
265
268
|
return -1n - this.argument;
|
|
266
269
|
}
|
|
267
270
|
_toCBOR(e) {
|
|
268
|
-
return
|
|
271
|
+
return m(1, this.argument, this.encodingWidth);
|
|
269
272
|
}
|
|
270
|
-
|
|
273
|
+
_toCDN(e, t) {
|
|
271
274
|
let n = this.encodingWidth === void 0 ? "" : `_${this.encodingWidth}`, r = this.argument + 1n;
|
|
272
275
|
switch (e?.intFormat) {
|
|
273
276
|
case "hex": return `-0x${r.toString(16)}${n}`;
|
|
@@ -282,31 +285,31 @@ var y = class extends d {
|
|
|
282
285
|
}
|
|
283
286
|
};
|
|
284
287
|
//#endregion
|
|
285
|
-
//#region src/
|
|
286
|
-
function
|
|
288
|
+
//#region src/cdn/serialize-utils.ts
|
|
289
|
+
function v(e) {
|
|
287
290
|
let t = e?.indent;
|
|
288
291
|
return t === void 0 ? null : typeof t == "number" ? " ".repeat(t) : t;
|
|
289
292
|
}
|
|
290
|
-
function
|
|
293
|
+
function y(e, t) {
|
|
291
294
|
return e.repeat(t);
|
|
292
295
|
}
|
|
293
|
-
function
|
|
296
|
+
function se(e) {
|
|
294
297
|
return !!(e.comments?.leading?.length || e.comments?.trailing?.length || e.comments?.dangling?.length);
|
|
295
298
|
}
|
|
296
|
-
function
|
|
299
|
+
function ce(e) {
|
|
297
300
|
return !!(e.comments?.trailing?.length || e.comments?.dangling?.length);
|
|
298
301
|
}
|
|
299
|
-
function
|
|
302
|
+
function le(e, t) {
|
|
300
303
|
return (e.comments?.leading ?? []).map((e) => t + e.text);
|
|
301
304
|
}
|
|
302
|
-
function
|
|
305
|
+
function ue(e) {
|
|
303
306
|
let t = e.comments?.trailing ?? [];
|
|
304
307
|
return t.length === 0 ? "" : " " + t.map((e) => e.text).join(" ");
|
|
305
308
|
}
|
|
306
|
-
function
|
|
309
|
+
function de(e, t) {
|
|
307
310
|
return (e.comments?.dangling ?? []).map((e) => t + e.text);
|
|
308
311
|
}
|
|
309
|
-
function
|
|
312
|
+
function fe(e, t = !1) {
|
|
310
313
|
let n = e?.commas ?? "comma", r = n !== "none";
|
|
311
314
|
return {
|
|
312
315
|
inlineSep: r ? t ? "," : ", " : " ",
|
|
@@ -315,18 +318,18 @@ function ue(e, t = !1) {
|
|
|
315
318
|
colSep: t ? ":" : ": "
|
|
316
319
|
};
|
|
317
320
|
}
|
|
318
|
-
function
|
|
321
|
+
function pe(e) {
|
|
319
322
|
return typeof e.toHex == "function" ? e.toHex() : Array.from(e, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
320
323
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
323
|
-
if (
|
|
324
|
+
var me = typeof new Uint8Array().toBase64 == "function";
|
|
325
|
+
function he(e) {
|
|
326
|
+
if (me) return e.toBase64({ omitPadding: !0 });
|
|
324
327
|
let t = "";
|
|
325
328
|
for (let n of e) t += String.fromCharCode(n);
|
|
326
329
|
return btoa(t).replace(/=/g, "");
|
|
327
330
|
}
|
|
328
|
-
function
|
|
329
|
-
if (
|
|
331
|
+
function ge(e) {
|
|
332
|
+
if (me) return e.toBase64({
|
|
330
333
|
alphabet: "base64url",
|
|
331
334
|
omitPadding: !0
|
|
332
335
|
});
|
|
@@ -334,44 +337,44 @@ function me(e) {
|
|
|
334
337
|
for (let n of e) t += String.fromCharCode(n);
|
|
335
338
|
return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
336
339
|
}
|
|
337
|
-
var
|
|
338
|
-
function
|
|
340
|
+
var _e = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", ve = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
|
|
341
|
+
function ye(e, t) {
|
|
339
342
|
let n = "", r = 0, i = 0;
|
|
340
343
|
for (let a of e) for (r = r << 8 | a, i += 8; i >= 5;) i -= 5, n += t[r >> i & 31];
|
|
341
344
|
return i > 0 && (n += t[r << 5 - i & 31]), n;
|
|
342
345
|
}
|
|
343
|
-
function
|
|
346
|
+
function be(e) {
|
|
344
347
|
for (let t of e) {
|
|
345
348
|
let e = t.codePointAt(0);
|
|
346
349
|
if (e < 32 || e === 127) return !0;
|
|
347
350
|
}
|
|
348
351
|
return !1;
|
|
349
352
|
}
|
|
350
|
-
function
|
|
353
|
+
function xe(e, t, n) {
|
|
351
354
|
if (n === "string") {
|
|
352
|
-
let t =
|
|
353
|
-
if (t != null) return
|
|
355
|
+
let t = Se(e);
|
|
356
|
+
if (t != null) return we(t);
|
|
354
357
|
}
|
|
355
358
|
if (n === "printable-string" || n === void 0) {
|
|
356
|
-
let t =
|
|
357
|
-
if (t != null && !
|
|
359
|
+
let t = Se(e);
|
|
360
|
+
if (t != null && !be(t)) return we(t);
|
|
358
361
|
}
|
|
359
362
|
switch (t) {
|
|
360
|
-
case "base64": return `b64'${
|
|
361
|
-
case "base64url": return `b64'${
|
|
362
|
-
case "base32": return `b32'${
|
|
363
|
-
case "base32hex": return `h32'${
|
|
364
|
-
default: return `h'${
|
|
363
|
+
case "base64": return `b64'${he(e)}'`;
|
|
364
|
+
case "base64url": return `b64'${ge(e)}'`;
|
|
365
|
+
case "base32": return `b32'${ye(e, _e)}'`;
|
|
366
|
+
case "base32hex": return `h32'${ye(e, ve)}'`;
|
|
367
|
+
default: return `h'${pe(e)}'`;
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
|
-
function
|
|
370
|
+
function Se(e) {
|
|
368
371
|
try {
|
|
369
372
|
return new TextDecoder("utf-8", { fatal: !0 }).decode(e);
|
|
370
373
|
} catch {
|
|
371
374
|
return null;
|
|
372
375
|
}
|
|
373
376
|
}
|
|
374
|
-
function
|
|
377
|
+
function Ce(e, t) {
|
|
375
378
|
let n = t.codePointAt(0), r = t;
|
|
376
379
|
for (let i of e) {
|
|
377
380
|
let e = i.codePointAt(0);
|
|
@@ -396,29 +399,29 @@ function xe(e, t) {
|
|
|
396
399
|
}
|
|
397
400
|
return r + t;
|
|
398
401
|
}
|
|
399
|
-
function Se(e) {
|
|
400
|
-
return xe(e, "'");
|
|
401
|
-
}
|
|
402
|
-
function Ce(e) {
|
|
403
|
-
return xe(e, "'");
|
|
404
|
-
}
|
|
405
402
|
function we(e) {
|
|
406
|
-
return
|
|
403
|
+
return Ce(e, "'");
|
|
407
404
|
}
|
|
408
405
|
function Te(e) {
|
|
406
|
+
return Ce(e, "'");
|
|
407
|
+
}
|
|
408
|
+
function b(e) {
|
|
409
|
+
return Ce(e, "\"");
|
|
410
|
+
}
|
|
411
|
+
function Ee(e) {
|
|
409
412
|
if (isNaN(e)) return "NaN";
|
|
410
413
|
if (!isFinite(e)) return e > 0 ? "Infinity" : "-Infinity";
|
|
411
414
|
if (Object.is(e, -0)) return "-0.0";
|
|
412
415
|
let t = e.toString();
|
|
413
416
|
return t.includes(".") || t.includes("e") ? t : t + ".0";
|
|
414
417
|
}
|
|
415
|
-
function
|
|
418
|
+
function De(e, t, n) {
|
|
416
419
|
return t === void 0 || t === n ? "" : t === "half" ? "_1" : t === "single" ? "_2" : "_3";
|
|
417
420
|
}
|
|
418
421
|
//#endregion
|
|
419
422
|
//#region src/utils/hexfloat.ts
|
|
420
|
-
var
|
|
421
|
-
function
|
|
423
|
+
var Oe = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
|
|
424
|
+
function ke(e) {
|
|
422
425
|
let t = e.startsWith("-"), n = e.slice(t ? 3 : 2), r = n.search(/[pP]/);
|
|
423
426
|
if (r === -1) throw SyntaxError(`EDN parse error: hex float missing 'p' exponent: ${e}`);
|
|
424
427
|
let i = n.slice(0, r), a = n.slice(r + 1);
|
|
@@ -436,30 +439,30 @@ function Oe(e) {
|
|
|
436
439
|
let l = c * 2 ** o;
|
|
437
440
|
return t ? -l : l;
|
|
438
441
|
}
|
|
439
|
-
function
|
|
442
|
+
function Ae(e) {
|
|
440
443
|
if (isNaN(e)) return "NaN";
|
|
441
444
|
if (!isFinite(e)) return e > 0 ? "Infinity" : "-Infinity";
|
|
442
445
|
let t = Object.is(e, -0) || e < 0, n = Math.abs(e);
|
|
443
446
|
if (n === 0) return t ? "-0x0p+0" : "0x0p+0";
|
|
444
|
-
|
|
445
|
-
let r =
|
|
447
|
+
Oe.setFloat64(0, n, !1);
|
|
448
|
+
let r = Oe.getUint32(0, !1), i = Oe.getUint32(4, !1), a = r >>> 20 & 2047, o = r & 1048575, s = i, c = (o.toString(16).padStart(5, "0") + s.toString(16).padStart(8, "0")).replace(/0+$/, ""), l = c === "" ? "" : `.${c}`, u, d;
|
|
446
449
|
a === 0 ? (u = "0", d = -1022) : (u = "1", d = a - 1023);
|
|
447
450
|
let f = d >= 0 ? `+${d}` : `${d}`, p = `0x${u}${l}p${f}`;
|
|
448
451
|
return t ? `-${p}` : p;
|
|
449
452
|
}
|
|
450
453
|
//#endregion
|
|
451
454
|
//#region src/ast/CborFloat.ts
|
|
452
|
-
var
|
|
455
|
+
var x = class extends d {
|
|
453
456
|
value;
|
|
454
457
|
precision;
|
|
455
458
|
constructor(e, t) {
|
|
456
459
|
super(), this.value = e, this.precision = t?.precision;
|
|
457
460
|
}
|
|
458
461
|
_toCBOR(e) {
|
|
459
|
-
let t = this.precision ??
|
|
462
|
+
let t = this.precision ?? oe(this.value);
|
|
460
463
|
if (t === "half") {
|
|
461
464
|
let e = new Uint8Array(3);
|
|
462
|
-
return e[0] = 249,
|
|
465
|
+
return e[0] = 249, ne(new DataView(e.buffer), 1, this.value, !1), e;
|
|
463
466
|
}
|
|
464
467
|
if (t === "single") {
|
|
465
468
|
let e = new Uint8Array(5);
|
|
@@ -468,14 +471,14 @@ var S = class extends d {
|
|
|
468
471
|
let n = new Uint8Array(9);
|
|
469
472
|
return n[0] = 251, new DataView(n.buffer).setFloat64(1, this.value, !1), n;
|
|
470
473
|
}
|
|
471
|
-
|
|
472
|
-
let n =
|
|
473
|
-
return (e?.floatFormat === "hex" ?
|
|
474
|
+
_toCDN(e, t) {
|
|
475
|
+
let n = oe(this.value);
|
|
476
|
+
return (e?.floatFormat === "hex" ? Ae(this.value) : Ee(this.value)) + De(this.value, this.precision, n);
|
|
474
477
|
}
|
|
475
478
|
_toJS(e) {
|
|
476
479
|
return this.value;
|
|
477
480
|
}
|
|
478
|
-
},
|
|
481
|
+
}, S = class extends d {
|
|
479
482
|
tag;
|
|
480
483
|
content;
|
|
481
484
|
encodingWidth;
|
|
@@ -484,27 +487,28 @@ var S = class extends d {
|
|
|
484
487
|
this.content = t, this.encodingWidth = n?.encodingWidth;
|
|
485
488
|
}
|
|
486
489
|
_toCBOR(e) {
|
|
487
|
-
return
|
|
490
|
+
return h([m(6, this.tag, this.encodingWidth), this.content._toCBOR(e)]);
|
|
488
491
|
}
|
|
489
|
-
|
|
492
|
+
_toCDN(e, t) {
|
|
490
493
|
let n = this.encodingWidth === void 0 ? "" : `_${this.encodingWidth}`;
|
|
491
|
-
return `${this.tag}${n}(${this.content.
|
|
494
|
+
return `${this.tag}${n}(${this.content._toCDN(e, t)})`;
|
|
492
495
|
}
|
|
493
496
|
_toHexDump(e, t) {
|
|
494
497
|
let n = [{
|
|
495
498
|
depth: e,
|
|
496
|
-
hex: ((e) => Array.from(e, (e) => e.toString(16).toUpperCase().padStart(2, "0")).join(" "))(
|
|
499
|
+
hex: ((e) => Array.from(e, (e) => e.toString(16).toUpperCase().padStart(2, "0")).join(" "))(m(6, this.tag, this.encodingWidth)),
|
|
497
500
|
comment: `Tag ${this.tag}`
|
|
498
501
|
}];
|
|
499
502
|
return n.push(...this.content._toHexDump(e + 1, t)), n;
|
|
500
503
|
}
|
|
501
504
|
_toJS(e) {
|
|
502
|
-
|
|
505
|
+
let t = this.content._toJS(e);
|
|
506
|
+
return e?.stripTags ? t : c.set(t, this.tag);
|
|
503
507
|
}
|
|
504
508
|
};
|
|
505
509
|
//#endregion
|
|
506
|
-
//#region src/
|
|
507
|
-
function
|
|
510
|
+
//#region src/cdn/tokenizer.ts
|
|
511
|
+
function je(e, t) {
|
|
508
512
|
let n = 1, r = 1;
|
|
509
513
|
for (let i = 0; i < t; i++) e[i] === "\n" ? (n++, r = 1) : r++;
|
|
510
514
|
return {
|
|
@@ -512,7 +516,8 @@ function Ae(e, t) {
|
|
|
512
516
|
col: r
|
|
513
517
|
};
|
|
514
518
|
}
|
|
515
|
-
var
|
|
519
|
+
var Me = class {
|
|
520
|
+
input;
|
|
516
521
|
pos;
|
|
517
522
|
line;
|
|
518
523
|
col;
|
|
@@ -523,7 +528,7 @@ var je = class {
|
|
|
523
528
|
this.input = e;
|
|
524
529
|
let n = t?.offset ?? 0;
|
|
525
530
|
if (!Number.isInteger(n) || n < 0 || n > e.length) throw RangeError(`EDN parse offset must be an integer between 0 and ${e.length}`);
|
|
526
|
-
let r =
|
|
531
|
+
let r = je(e, n);
|
|
527
532
|
this.pos = n, this.line = r.line, this.col = r.col, this._lastConsumedEndOffset = n;
|
|
528
533
|
}
|
|
529
534
|
peek() {
|
|
@@ -1385,7 +1390,7 @@ var je = class {
|
|
|
1385
1390
|
}
|
|
1386
1391
|
this._fail(`unknown identifier ${JSON.stringify(n)}`, e, t);
|
|
1387
1392
|
}
|
|
1388
|
-
},
|
|
1393
|
+
}, C = class extends d {
|
|
1389
1394
|
indefiniteLength = !1;
|
|
1390
1395
|
value;
|
|
1391
1396
|
ednEncoding;
|
|
@@ -1395,18 +1400,18 @@ var je = class {
|
|
|
1395
1400
|
super(), this.value = e, this.ednEncoding = t?.ednEncoding ?? "hex", this.encodingWidth = t?.encodingWidth, this.ednSource = t?.ednSource;
|
|
1396
1401
|
}
|
|
1397
1402
|
_toCBOR(e) {
|
|
1398
|
-
return
|
|
1403
|
+
return h([m(2, BigInt(this.value.length), this.encodingWidth), this.value]);
|
|
1399
1404
|
}
|
|
1400
|
-
|
|
1405
|
+
_toCDN(e, t) {
|
|
1401
1406
|
let n = this.encodingWidth === void 0 ? "" : `_${this.encodingWidth}`;
|
|
1402
1407
|
if (e?.preserveByteString && this.ednSource !== void 0) return this.ednSource + n;
|
|
1403
1408
|
let r = e?.bstrEncoding ?? this.ednEncoding;
|
|
1404
|
-
return
|
|
1409
|
+
return xe(this.value, r, e?.sqstr) + n;
|
|
1405
1410
|
}
|
|
1406
1411
|
_toJS(e) {
|
|
1407
1412
|
return this.value;
|
|
1408
1413
|
}
|
|
1409
|
-
},
|
|
1414
|
+
}, w = class extends d {
|
|
1410
1415
|
indefiniteLength = !0;
|
|
1411
1416
|
chunks;
|
|
1412
1417
|
constructor(e) {
|
|
@@ -1415,10 +1420,10 @@ var je = class {
|
|
|
1415
1420
|
_toCBOR(e) {
|
|
1416
1421
|
let t = [new Uint8Array([95])];
|
|
1417
1422
|
for (let n of this.chunks) t.push(n._toCBOR(e));
|
|
1418
|
-
return t.push(new Uint8Array([255])),
|
|
1423
|
+
return t.push(new Uint8Array([255])), h(t);
|
|
1419
1424
|
}
|
|
1420
|
-
|
|
1421
|
-
return this.chunks.length === 0 ? "''_" : `(_ ${this.chunks.map((t) => t.
|
|
1425
|
+
_toCDN(e, t) {
|
|
1426
|
+
return this.chunks.length === 0 ? "''_" : `(_ ${this.chunks.map((t) => t._toCDN(e, 0)).join(", ")})`;
|
|
1422
1427
|
}
|
|
1423
1428
|
_toHexDump(e, t) {
|
|
1424
1429
|
let n = (e) => e.toString(16).toUpperCase().padStart(2, "0"), r = [{
|
|
@@ -1447,10 +1452,10 @@ var je = class {
|
|
|
1447
1452
|
_toCBOR(e) {
|
|
1448
1453
|
let t = [new Uint8Array([127])];
|
|
1449
1454
|
for (let n of this.chunks) t.push(n._toCBOR(e));
|
|
1450
|
-
return t.push(new Uint8Array([255])),
|
|
1455
|
+
return t.push(new Uint8Array([255])), h(t);
|
|
1451
1456
|
}
|
|
1452
|
-
|
|
1453
|
-
return this.chunks.length === 0 ? "\"\"_" : `(_ ${this.chunks.map((t) => t.
|
|
1457
|
+
_toCDN(e, t) {
|
|
1458
|
+
return this.chunks.length === 0 ? "\"\"_" : `(_ ${this.chunks.map((t) => t._toCDN(e, 0)).join(", ")})`;
|
|
1454
1459
|
}
|
|
1455
1460
|
_toHexDump(e, t) {
|
|
1456
1461
|
let n = (e) => e.toString(16).toUpperCase().padStart(2, "0"), r = [{
|
|
@@ -1479,28 +1484,28 @@ var je = class {
|
|
|
1479
1484
|
if (this.indefiniteLength) {
|
|
1480
1485
|
let t = [new Uint8Array([159])];
|
|
1481
1486
|
for (let n of this.items) t.push(n._toCBOR(e));
|
|
1482
|
-
return t.push(new Uint8Array([255])),
|
|
1487
|
+
return t.push(new Uint8Array([255])), h(t);
|
|
1483
1488
|
}
|
|
1484
|
-
let t = [
|
|
1489
|
+
let t = [m(4, BigInt(this.items.length), this.encodingWidth)];
|
|
1485
1490
|
for (let n of this.items) t.push(n._toCBOR(e));
|
|
1486
|
-
return
|
|
1491
|
+
return h(t);
|
|
1487
1492
|
}
|
|
1488
|
-
|
|
1489
|
-
let n =
|
|
1493
|
+
_toCDN(e, t) {
|
|
1494
|
+
let n = v(e), r = e?.preserveComments, i = r && (ce(this) || this.items.some(se));
|
|
1490
1495
|
n === null && i && (n = " ");
|
|
1491
|
-
let { inlineSep: a, multilineSep: o, trailSep: s } =
|
|
1496
|
+
let { inlineSep: a, multilineSep: o, trailSep: s } = fe(e, n === null), c = !this.indefiniteLength && this.encodingWidth !== void 0 ? `_${this.encodingWidth} ` : "";
|
|
1492
1497
|
if (n === null || this.items.length === 0 && !i) {
|
|
1493
|
-
let n = this.items.map((n) => n.
|
|
1498
|
+
let n = this.items.map((n) => n._toCDN(e, t + 1)).join(a);
|
|
1494
1499
|
return this.indefiniteLength ? this.items.length === 0 ? "[_ ]" : `[_ ${n}]` : `[${c}${n}]`;
|
|
1495
1500
|
}
|
|
1496
|
-
let l =
|
|
1501
|
+
let l = y(n, t + 1), u = y(n, t), d = this.indefiniteLength ? "[_ " : `[${c}`, f = [];
|
|
1497
1502
|
for (let n = 0; n < this.items.length; n++) {
|
|
1498
1503
|
let i = this.items[n];
|
|
1499
|
-
r && f.push(...
|
|
1504
|
+
r && f.push(...le(i, l));
|
|
1500
1505
|
let a = n < this.items.length - 1 ? o : s;
|
|
1501
|
-
f.push(`${l}${i.
|
|
1506
|
+
f.push(`${l}${i._toCDN(e, t + 1)}${a}${r ? ue(i) : ""}`);
|
|
1502
1507
|
}
|
|
1503
|
-
return r && f.push(...
|
|
1508
|
+
return r && f.push(...de(this, l)), `${d}\n${f.join("\n")}\n${u}]`;
|
|
1504
1509
|
}
|
|
1505
1510
|
_toHexDump(e, t) {
|
|
1506
1511
|
let n = (e) => e.toString(16).toUpperCase().padStart(2, "0"), r = (e) => Array.from(e, (e) => e.toString(16).toUpperCase().padStart(2, "0")).join(" ");
|
|
@@ -1519,7 +1524,7 @@ var je = class {
|
|
|
1519
1524
|
}
|
|
1520
1525
|
let i = [{
|
|
1521
1526
|
depth: e,
|
|
1522
|
-
hex: r(
|
|
1527
|
+
hex: r(m(4, BigInt(this.items.length), this.encodingWidth)),
|
|
1523
1528
|
comment: `Array of length ${this.items.length}`
|
|
1524
1529
|
}];
|
|
1525
1530
|
for (let n of this.items) i.push(...n._toHexDump(e + 1, t));
|
|
@@ -1549,32 +1554,32 @@ var je = class {
|
|
|
1549
1554
|
if (this.indefiniteLength) {
|
|
1550
1555
|
let t = [new Uint8Array([191])];
|
|
1551
1556
|
for (let [n, r] of this.entries) t.push(n._toCBOR(e), r._toCBOR(e));
|
|
1552
|
-
return t.push(new Uint8Array([255])),
|
|
1557
|
+
return t.push(new Uint8Array([255])), h(t);
|
|
1553
1558
|
}
|
|
1554
|
-
let t = [
|
|
1559
|
+
let t = [m(5, BigInt(this.entries.length), this.encodingWidth)];
|
|
1555
1560
|
for (let [n, r] of this.entries) t.push(n._toCBOR(e), r._toCBOR(e));
|
|
1556
|
-
return
|
|
1561
|
+
return h(t);
|
|
1557
1562
|
}
|
|
1558
|
-
|
|
1559
|
-
let n =
|
|
1563
|
+
_toCDN(e, t) {
|
|
1564
|
+
let n = v(e), r = e?.preserveComments, i = r && (ce(this) || this.entries.some(([e, t]) => se(e) || se(t)));
|
|
1560
1565
|
n === null && i && (n = " ");
|
|
1561
|
-
let { inlineSep: a, multilineSep: o, trailSep: s, colSep: c } =
|
|
1566
|
+
let { inlineSep: a, multilineSep: o, trailSep: s, colSep: c } = fe(e, n === null), l = !this.indefiniteLength && this.encodingWidth !== void 0 ? `_${this.encodingWidth} ` : "", u = this.indefiniteLength ? "{_ " : `{${l}`;
|
|
1562
1567
|
if (n === null || this.entries.length === 0 && !i) {
|
|
1563
|
-
let n = this.entries.map(([n, r]) => `${n.
|
|
1568
|
+
let n = this.entries.map(([n, r]) => `${n._toCDN(e, t + 1)}${c}${r._toCDN(e, t + 1)}`).join(a);
|
|
1564
1569
|
return this.indefiniteLength ? this.entries.length === 0 ? "{_ }" : `{_ ${n}}` : `{${l}${n}}`;
|
|
1565
1570
|
}
|
|
1566
|
-
let d =
|
|
1571
|
+
let d = y(n, t + 1), f = y(n, t), p = [];
|
|
1567
1572
|
for (let n = 0; n < this.entries.length; n++) {
|
|
1568
1573
|
let [i, a] = this.entries[n];
|
|
1569
|
-
r && p.push(...
|
|
1574
|
+
r && p.push(...le(i, d));
|
|
1570
1575
|
let l = n < this.entries.length - 1 ? o : s, u = r ? Ne([
|
|
1571
1576
|
...i.comments?.trailing ?? [],
|
|
1572
1577
|
...a.comments?.leading ?? [],
|
|
1573
1578
|
...a.comments?.trailing ?? []
|
|
1574
1579
|
]) : "";
|
|
1575
|
-
p.push(`${d}${i.
|
|
1580
|
+
p.push(`${d}${i._toCDN(e, t + 1)}${c}${a._toCDN(e, t + 1)}${l}${u}`);
|
|
1576
1581
|
}
|
|
1577
|
-
return r && p.push(...
|
|
1582
|
+
return r && p.push(...de(this, d)), `${u}\n${p.join("\n")}\n${f}}`;
|
|
1578
1583
|
}
|
|
1579
1584
|
_toHexDump(e, t) {
|
|
1580
1585
|
let n = (e) => e.toString(16).toUpperCase().padStart(2, "0"), r = (e) => Array.from(e, (e) => e.toString(16).toUpperCase().padStart(2, "0")).join(" ");
|
|
@@ -1593,7 +1598,7 @@ var je = class {
|
|
|
1593
1598
|
}
|
|
1594
1599
|
let i = [{
|
|
1595
1600
|
depth: e,
|
|
1596
|
-
hex: r(
|
|
1601
|
+
hex: r(m(5, BigInt(this.entries.length), this.encodingWidth)),
|
|
1597
1602
|
comment: `Map of length ${this.entries.length}`
|
|
1598
1603
|
}];
|
|
1599
1604
|
for (let [n, r] of this.entries) i.push(...n._toHexDump(e + 1, t)), i.push(...r._toHexDump(e + 1, t));
|
|
@@ -1610,13 +1615,13 @@ var je = class {
|
|
|
1610
1615
|
}
|
|
1611
1616
|
return n;
|
|
1612
1617
|
};
|
|
1613
|
-
return e?.mapAs === "entries" ? n() : e?.mapAs === "object" || this.entries.every(([e]) => e instanceof
|
|
1618
|
+
return e?.mapAs === "entries" ? n() : e?.mapAs === "object" || this.entries.every(([e]) => e instanceof N) ? (() => {
|
|
1614
1619
|
let n = e ? {
|
|
1615
1620
|
...e,
|
|
1616
1621
|
reviver: void 0
|
|
1617
1622
|
} : void 0, r = {};
|
|
1618
1623
|
for (let [e, t] of this.entries) {
|
|
1619
|
-
let i = e instanceof
|
|
1624
|
+
let i = e instanceof N ? e.value : e.toCDN(), a = t._toJS(n);
|
|
1620
1625
|
i === "__proto__" ? Object.defineProperty(r, i, {
|
|
1621
1626
|
value: a,
|
|
1622
1627
|
writable: !0,
|
|
@@ -1628,10 +1633,10 @@ var je = class {
|
|
|
1628
1633
|
let i = /* @__PURE__ */ new Map();
|
|
1629
1634
|
for (let e = 0; e < this.entries.length; e++) {
|
|
1630
1635
|
let [t] = this.entries[e];
|
|
1631
|
-
i.set(t instanceof
|
|
1636
|
+
i.set(t instanceof N ? t.value : t.toCDN(), e);
|
|
1632
1637
|
}
|
|
1633
1638
|
for (let n = 0; n < this.entries.length; n++) {
|
|
1634
|
-
let [a, o] = this.entries[n], s = a instanceof
|
|
1639
|
+
let [a, o] = this.entries[n], s = a instanceof N ? a.value : a.toCDN();
|
|
1635
1640
|
if (i.get(s) !== n) continue;
|
|
1636
1641
|
let c = o._toJS(e), u = t.call(r, s, c);
|
|
1637
1642
|
u === l || e?.undefinedOmits && u === void 0 ? delete r[s] : s === "__proto__" ? Object.defineProperty(r, s, {
|
|
@@ -1663,7 +1668,7 @@ var O = class e extends d {
|
|
|
1663
1668
|
_toCBOR(e) {
|
|
1664
1669
|
return this.value <= 23 ? new Uint8Array([224 | this.value]) : new Uint8Array([248, this.value]);
|
|
1665
1670
|
}
|
|
1666
|
-
|
|
1671
|
+
_toCDN(e, t) {
|
|
1667
1672
|
switch (this.value) {
|
|
1668
1673
|
case 20: return "false";
|
|
1669
1674
|
case 21: return "true";
|
|
@@ -1681,29 +1686,29 @@ var O = class e extends d {
|
|
|
1681
1686
|
default: return new u(this.value);
|
|
1682
1687
|
}
|
|
1683
1688
|
}
|
|
1684
|
-
},
|
|
1689
|
+
}, k = class extends d {
|
|
1685
1690
|
items;
|
|
1686
1691
|
constructor(e) {
|
|
1687
1692
|
super(), this.items = e;
|
|
1688
1693
|
}
|
|
1689
1694
|
_content(e) {
|
|
1690
|
-
return
|
|
1695
|
+
return h(this.items.map((t) => t._toCBOR(e)));
|
|
1691
1696
|
}
|
|
1692
1697
|
_toCBOR(e) {
|
|
1693
1698
|
let t = this._content(e);
|
|
1694
|
-
return
|
|
1699
|
+
return h([m(2, BigInt(t.length)), t]);
|
|
1695
1700
|
}
|
|
1696
|
-
|
|
1701
|
+
_toCDN(e, t) {
|
|
1697
1702
|
if (this.items.length === 0) return "<<>>";
|
|
1698
|
-
let n =
|
|
1699
|
-
if (n === null) return `<<${this.items.map((n) => n.
|
|
1700
|
-
let o =
|
|
1703
|
+
let n = v(e), { inlineSep: r, multilineSep: i, trailSep: a } = fe(e, n === null);
|
|
1704
|
+
if (n === null) return `<<${this.items.map((n) => n._toCDN(e, t + 1)).join(r)}>>`;
|
|
1705
|
+
let o = y(n, t + 1), s = y(n, t), c = this.items.map((n) => `${o}${n._toCDN(e, t + 1)}`), l = c.length - 1;
|
|
1701
1706
|
return `<<\n${c.map((e, t) => t < l ? `${e}${i}` : `${e}${a}`).join("\n")}\n${s}>>`;
|
|
1702
1707
|
}
|
|
1703
1708
|
_toHexDump(e, t) {
|
|
1704
1709
|
let n = (e) => Array.from(e, (e) => e.toString(16).toUpperCase().padStart(2, "0")).join(" "), r = this._content().length, i = [{
|
|
1705
1710
|
depth: e,
|
|
1706
|
-
hex: n(
|
|
1711
|
+
hex: n(m(2, BigInt(r))),
|
|
1707
1712
|
comment: `Embedded CBOR sequence, ${r} byte${r === 1 ? "" : "s"}`
|
|
1708
1713
|
}];
|
|
1709
1714
|
for (let n of this.items) i.push(...n._toHexDump(e + 1, t));
|
|
@@ -1712,24 +1717,24 @@ var O = class e extends d {
|
|
|
1712
1717
|
_toJS(e) {
|
|
1713
1718
|
return this._content();
|
|
1714
1719
|
}
|
|
1715
|
-
},
|
|
1720
|
+
}, Pe = 999n, Fe = class extends S {
|
|
1716
1721
|
constructor(e, t) {
|
|
1717
|
-
let n = t.length === 1 && t[0] instanceof
|
|
1718
|
-
super(
|
|
1722
|
+
let n = t.length === 1 && t[0] instanceof N ? t[0] : new E(t);
|
|
1723
|
+
super(Pe, new E([new N(e), n]));
|
|
1719
1724
|
}
|
|
1720
|
-
|
|
1725
|
+
_toCDN(e, t) {
|
|
1721
1726
|
let n = this.content, r = n.items[0].value, i = n.items[1];
|
|
1722
|
-
return i instanceof
|
|
1727
|
+
return i instanceof N ? `${r}${Te(i.value)}` : `${r}<<${i.items.map((n) => n._toCDN(e, t)).join(", ")}>>`;
|
|
1723
1728
|
}
|
|
1724
|
-
},
|
|
1729
|
+
}, Ie = 888n, A = class extends S {
|
|
1725
1730
|
constructor(e) {
|
|
1726
|
-
e === void 0 ? super(
|
|
1731
|
+
e === void 0 ? super(Ie, O.NULL) : super(Ie, new E(e));
|
|
1727
1732
|
}
|
|
1728
|
-
|
|
1729
|
-
return this.content instanceof O ? "..." : this.content instanceof E ? this.content.items.map((n) => n.
|
|
1733
|
+
_toCDN(e, t) {
|
|
1734
|
+
return this.content instanceof O ? "..." : this.content instanceof E ? this.content.items.map((n) => n._toCDN(e, t)).join(" + ") : super._toCDN(e, t);
|
|
1730
1735
|
}
|
|
1731
|
-
},
|
|
1732
|
-
function
|
|
1736
|
+
}, Le = 2n, Re = 3n, ze = 18446744073709551615n, Be = -(ze + 1n);
|
|
1737
|
+
function Ve(e) {
|
|
1733
1738
|
if (e < 0n) throw RangeError("bigintToBytes requires a non-negative value");
|
|
1734
1739
|
if (e === 0n) return new Uint8Array();
|
|
1735
1740
|
let t = e.toString(16);
|
|
@@ -1738,30 +1743,30 @@ function He(e) {
|
|
|
1738
1743
|
for (let e = 0; e < n.length; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
|
|
1739
1744
|
return n;
|
|
1740
1745
|
}
|
|
1741
|
-
function
|
|
1746
|
+
function He(e) {
|
|
1742
1747
|
let t = 0n;
|
|
1743
1748
|
for (let n of e) t = t << 8n | BigInt(n);
|
|
1744
1749
|
return t;
|
|
1745
1750
|
}
|
|
1746
|
-
var
|
|
1751
|
+
var j = class extends S {
|
|
1747
1752
|
bigValue;
|
|
1748
1753
|
constructor(e) {
|
|
1749
|
-
if (e <=
|
|
1750
|
-
super(
|
|
1754
|
+
if (e <= ze) throw RangeError(`CborBigUint value ${e} fits in CborUint; use CborUint instead`);
|
|
1755
|
+
super(Le, new C(Ve(e))), this.bigValue = e;
|
|
1751
1756
|
}
|
|
1752
|
-
|
|
1757
|
+
_toCDN(e, t) {
|
|
1753
1758
|
return this.bigValue.toString();
|
|
1754
1759
|
}
|
|
1755
1760
|
_toJS(e) {
|
|
1756
1761
|
return this.bigValue;
|
|
1757
1762
|
}
|
|
1758
|
-
},
|
|
1763
|
+
}, M = class extends S {
|
|
1759
1764
|
bigValue;
|
|
1760
1765
|
constructor(e) {
|
|
1761
|
-
if (e >=
|
|
1762
|
-
super(
|
|
1766
|
+
if (e >= Be) throw RangeError(`CborBigNint value ${e} fits in CborNint; use CborNint instead`);
|
|
1767
|
+
super(Re, new C(Ve(-1n - e))), this.bigValue = e;
|
|
1763
1768
|
}
|
|
1764
|
-
|
|
1769
|
+
_toCDN(e, t) {
|
|
1765
1770
|
return this.bigValue.toString();
|
|
1766
1771
|
}
|
|
1767
1772
|
_toJS(e) {
|
|
@@ -1769,12 +1774,12 @@ var We = class extends C {
|
|
|
1769
1774
|
}
|
|
1770
1775
|
};
|
|
1771
1776
|
//#endregion
|
|
1772
|
-
//#region src/
|
|
1773
|
-
function
|
|
1774
|
-
let n = new
|
|
1775
|
-
return t?.preserveComments &&
|
|
1777
|
+
//#region src/cdn/parser.ts
|
|
1778
|
+
function Ue(e, t) {
|
|
1779
|
+
let n = new Me(e, { offset: t?.offset }), r = new nt(n, t?.extensions, t?.unresolvedExtension, t?.allowInvalidUtf8, t?.allowTrailing).parse();
|
|
1780
|
+
return t?.preserveComments && Qe(r, n.comments, e), r;
|
|
1776
1781
|
}
|
|
1777
|
-
function
|
|
1782
|
+
function We(e) {
|
|
1778
1783
|
let t = e, n;
|
|
1779
1784
|
if (/[_][0-3i]$/.test(e)) {
|
|
1780
1785
|
let r = e[e.length - 1];
|
|
@@ -1785,10 +1790,10 @@ function qe(e) {
|
|
|
1785
1790
|
encodingWidth: n
|
|
1786
1791
|
};
|
|
1787
1792
|
}
|
|
1788
|
-
function
|
|
1793
|
+
function Ge(e) {
|
|
1789
1794
|
return e.startsWith("-") ? -BigInt(e.slice(1)) : BigInt(e);
|
|
1790
1795
|
}
|
|
1791
|
-
function
|
|
1796
|
+
function Ke(e) {
|
|
1792
1797
|
if (e === "NaN") return {
|
|
1793
1798
|
value: NaN,
|
|
1794
1799
|
precision: void 0
|
|
@@ -1804,22 +1809,22 @@ function Ye(e) {
|
|
|
1804
1809
|
if (e.endsWith("_i") || e.endsWith("_0")) throw SyntaxError("EDN parse error: _0 and _i encoding indicators are not valid for floating-point values");
|
|
1805
1810
|
let t = e, n;
|
|
1806
1811
|
return e.endsWith("_1") ? (n = "half", t = e.slice(0, -2)) : e.endsWith("_2") ? (n = "single", t = e.slice(0, -2)) : e.endsWith("_3") && (n = "double", t = e.slice(0, -2)), /^-?0[xX]/.test(t) ? {
|
|
1807
|
-
value:
|
|
1812
|
+
value: ke(t),
|
|
1808
1813
|
precision: n
|
|
1809
1814
|
} : {
|
|
1810
1815
|
value: parseFloat(t),
|
|
1811
1816
|
precision: n
|
|
1812
1817
|
};
|
|
1813
1818
|
}
|
|
1814
|
-
function
|
|
1819
|
+
function qe(e) {
|
|
1815
1820
|
if (typeof Uint8Array.fromHex == "function") return Uint8Array.fromHex(e);
|
|
1816
1821
|
if (e.length % 2 != 0) throw SyntaxError(`hex string has odd length: ${e.length}`);
|
|
1817
1822
|
let t = new Uint8Array(e.length / 2);
|
|
1818
1823
|
for (let n = 0; n < e.length; n += 2) t[n / 2] = parseInt(e.slice(n, n + 2), 16);
|
|
1819
1824
|
return t;
|
|
1820
1825
|
}
|
|
1821
|
-
var
|
|
1822
|
-
function
|
|
1826
|
+
var Je = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", Ye = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
|
|
1827
|
+
function Xe(e, t) {
|
|
1823
1828
|
let n = e.replace(/=+$/, "").toUpperCase(), r = n.length % 8;
|
|
1824
1829
|
if (r === 1 || r === 3 || r === 6) throw SyntaxError(`invalid base32 length: ${n.length} characters`);
|
|
1825
1830
|
let i = new Uint8Array(128).fill(255);
|
|
@@ -1833,7 +1838,7 @@ function $e(e, t) {
|
|
|
1833
1838
|
if (s > 0 && o & (1 << s) - 1) throw SyntaxError("non-zero trailing bits in base32 input");
|
|
1834
1839
|
return a;
|
|
1835
1840
|
}
|
|
1836
|
-
function
|
|
1841
|
+
function Ze(e) {
|
|
1837
1842
|
if (typeof Uint8Array.fromBase64 == "function") {
|
|
1838
1843
|
let t = /[-_]/.test(e) ? "base64url" : "base64";
|
|
1839
1844
|
return Uint8Array.fromBase64(e, {
|
|
@@ -1845,30 +1850,30 @@ function et(e) {
|
|
|
1845
1850
|
for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
|
|
1846
1851
|
return i;
|
|
1847
1852
|
}
|
|
1848
|
-
function
|
|
1853
|
+
function Qe(e, t, n) {
|
|
1849
1854
|
if (t.length === 0) return;
|
|
1850
|
-
let r =
|
|
1855
|
+
let r = $e(e), i = tt(n);
|
|
1851
1856
|
for (let a of t) {
|
|
1852
1857
|
let t = { ...a }, o = [...r].filter((e) => e.end <= a.start).sort((e, t) => t.end - e.end || t.start - e.start)[0], s = o ? n.slice(o.end, a.start) : "";
|
|
1853
1858
|
if (o && i(o.end) === a.line && !s.includes(":")) {
|
|
1854
|
-
|
|
1859
|
+
et(o.node, "trailing", t);
|
|
1855
1860
|
continue;
|
|
1856
1861
|
}
|
|
1857
1862
|
let c = [...r].filter((e) => e.start < a.start && a.end < e.end).sort((e, t) => t.start - e.start || e.end - t.end)[0], l = [...r].filter((e) => e.start >= a.end).sort((e, t) => e.start - t.start || t.end - e.end)[0];
|
|
1858
1863
|
if ((!c || l && l.end <= c.end) && l) {
|
|
1859
|
-
|
|
1864
|
+
et(l.node, "leading", t);
|
|
1860
1865
|
continue;
|
|
1861
1866
|
}
|
|
1862
|
-
|
|
1867
|
+
et(c?.node ?? e, "dangling", t);
|
|
1863
1868
|
}
|
|
1864
1869
|
}
|
|
1865
|
-
function
|
|
1870
|
+
function $e(e) {
|
|
1866
1871
|
let t = [], n = (e) => {
|
|
1867
1872
|
if (e.start !== void 0 && e.end !== void 0 && t.push({
|
|
1868
1873
|
node: e,
|
|
1869
1874
|
start: e.start,
|
|
1870
1875
|
end: e.end
|
|
1871
|
-
}), e instanceof E || e instanceof
|
|
1876
|
+
}), e instanceof E || e instanceof k) {
|
|
1872
1877
|
for (let t of e.items) n(t);
|
|
1873
1878
|
return;
|
|
1874
1879
|
}
|
|
@@ -1876,18 +1881,18 @@ function nt(e) {
|
|
|
1876
1881
|
for (let [t, r] of e.entries) n(t), n(r);
|
|
1877
1882
|
return;
|
|
1878
1883
|
}
|
|
1879
|
-
if (e instanceof
|
|
1884
|
+
if (e instanceof w || e instanceof T) {
|
|
1880
1885
|
for (let t of e.chunks) n(t);
|
|
1881
1886
|
return;
|
|
1882
1887
|
}
|
|
1883
|
-
e instanceof
|
|
1888
|
+
e instanceof S && n(e.content);
|
|
1884
1889
|
};
|
|
1885
1890
|
return n(e), t;
|
|
1886
1891
|
}
|
|
1887
|
-
function
|
|
1892
|
+
function et(e, t, n) {
|
|
1888
1893
|
e.comments ??= {}, e.comments[t] ??= [], e.comments[t].push(n);
|
|
1889
1894
|
}
|
|
1890
|
-
function
|
|
1895
|
+
function tt(e) {
|
|
1891
1896
|
let t = [0];
|
|
1892
1897
|
for (let n = 0; n < e.length; n++) e[n] === "\n" && t.push(n + 1);
|
|
1893
1898
|
return (n) => {
|
|
@@ -1901,13 +1906,16 @@ function it(e) {
|
|
|
1901
1906
|
return a + 1;
|
|
1902
1907
|
};
|
|
1903
1908
|
}
|
|
1904
|
-
var
|
|
1909
|
+
var nt = class {
|
|
1910
|
+
t;
|
|
1911
|
+
allowInvalidUtf8;
|
|
1912
|
+
allowTrailing;
|
|
1905
1913
|
extByPrefix;
|
|
1906
1914
|
extByTag;
|
|
1907
1915
|
unresolvedExtension;
|
|
1908
1916
|
constructor(e, t, n, r, i) {
|
|
1909
1917
|
this.t = e, this.allowInvalidUtf8 = r, this.allowTrailing = i, this.extByPrefix = /* @__PURE__ */ new Map(), this.extByTag = /* @__PURE__ */ new Map(), this.unresolvedExtension = n ?? "cpa999";
|
|
1910
|
-
for (let e of [...
|
|
1918
|
+
for (let e of [...Z, ...t ?? []]) {
|
|
1911
1919
|
for (let t of e.appStringPrefixes ?? []) this.extByPrefix.set(t, e);
|
|
1912
1920
|
for (let t of e.tagNumbers ?? []) this.extByTag.set(t, e);
|
|
1913
1921
|
}
|
|
@@ -1934,7 +1942,7 @@ var at = class {
|
|
|
1934
1942
|
case "BYTES_B64":
|
|
1935
1943
|
case "BYTES_B32":
|
|
1936
1944
|
case "BYTES_H32": return this.t.consume(), this._parseBytesConcat(this._decodeBytesToken(e), e.type, e.raw);
|
|
1937
|
-
case "EMPTY_INDEF_BYTES": return this.t.consume(), new
|
|
1945
|
+
case "EMPTY_INDEF_BYTES": return this.t.consume(), new w([]);
|
|
1938
1946
|
case "EMPTY_INDEF_TEXT": return this.t.consume(), new T([]);
|
|
1939
1947
|
case "TRUE": return this.t.consume(), O.TRUE;
|
|
1940
1948
|
case "FALSE": return this.t.consume(), O.FALSE;
|
|
@@ -1949,7 +1957,7 @@ var at = class {
|
|
|
1949
1957
|
this.t.consume();
|
|
1950
1958
|
let t = this.extByPrefix.get(e.appPrefix);
|
|
1951
1959
|
if (!t?.parseAppString) {
|
|
1952
|
-
if (this.unresolvedExtension === "cpa999") return new
|
|
1960
|
+
if (this.unresolvedExtension === "cpa999") return new Fe(e.appPrefix, [new N(e.value)]);
|
|
1953
1961
|
this._fail(`unknown app-string extension: ${JSON.stringify(e.appPrefix)}`, e);
|
|
1954
1962
|
}
|
|
1955
1963
|
return t.parseAppString(e.appPrefix, e.value);
|
|
@@ -1961,28 +1969,28 @@ var at = class {
|
|
|
1961
1969
|
this.expect("GT_GT");
|
|
1962
1970
|
let n = this.extByPrefix.get(e.appPrefix);
|
|
1963
1971
|
if (!n) {
|
|
1964
|
-
if (this.unresolvedExtension === "cpa999") return new
|
|
1972
|
+
if (this.unresolvedExtension === "cpa999") return new Fe(e.appPrefix, t);
|
|
1965
1973
|
this._fail(`unknown app-string extension: ${JSON.stringify(e.appPrefix)}`, e);
|
|
1966
1974
|
}
|
|
1967
1975
|
return n.parseAppSequence || this._fail(`app-string extension ${JSON.stringify(e.appPrefix)} does not support <<...>> form`, e), n.parseAppSequence(e.appPrefix, t);
|
|
1968
1976
|
}
|
|
1969
1977
|
case "ELLIPSIS": {
|
|
1970
|
-
if (this.t.consume(), this.t.peek().type !== "PLUS") return new
|
|
1971
|
-
let e = [new
|
|
1978
|
+
if (this.t.consume(), this.t.peek().type !== "PLUS") return new A();
|
|
1979
|
+
let e = [new A()];
|
|
1972
1980
|
for (; this.t.peek().type === "PLUS";) this.t.consume(), e.push(this.parseValue());
|
|
1973
|
-
return new
|
|
1981
|
+
return new A(e);
|
|
1974
1982
|
}
|
|
1975
1983
|
case "BYTES_HEX_ELIDED": return this.t.consume(), this._parseHexElidedConcat(e);
|
|
1976
1984
|
default: this._fail(`unexpected token: ${JSON.stringify(e.value)}`, e);
|
|
1977
1985
|
}
|
|
1978
1986
|
}
|
|
1979
1987
|
parseIntegerOrTag() {
|
|
1980
|
-
let e = this.t.consume(), { numStr: t, encodingWidth: n } =
|
|
1981
|
-
if (i > 18446744073709551615n) return this.t.peek().type === "LPAREN" && this._fail("tag number exceeds maximum uint64", e), new
|
|
1982
|
-
if (i < -18446744073709551616n) return new
|
|
1983
|
-
let a = i >= 0n ? new
|
|
1988
|
+
let e = this.t.consume(), { numStr: t, encodingWidth: n } = We(e.value), r = n === void 0 ? this.consumeEncodingIndicator() : n, i = Ge(t);
|
|
1989
|
+
if (i > 18446744073709551615n) return this.t.peek().type === "LPAREN" && this._fail("tag number exceeds maximum uint64", e), new j(i);
|
|
1990
|
+
if (i < -18446744073709551616n) return new M(i);
|
|
1991
|
+
let a = i >= 0n ? new g(i, r === void 0 ? void 0 : { encodingWidth: r }) : new _(i, r === void 0 ? void 0 : { encodingWidth: r });
|
|
1984
1992
|
if (this.t.peek().type === "LPAREN") {
|
|
1985
|
-
a instanceof
|
|
1993
|
+
a instanceof g || this._fail("tag number must be non-negative", e), this.t.consume();
|
|
1986
1994
|
let t = this.parseValue();
|
|
1987
1995
|
this.expect("RPAREN");
|
|
1988
1996
|
let n = a.value, i = this.extByTag.get(n);
|
|
@@ -1990,19 +1998,19 @@ var at = class {
|
|
|
1990
1998
|
let e = i.parseTag(n, t);
|
|
1991
1999
|
if (e !== void 0) return e;
|
|
1992
2000
|
}
|
|
1993
|
-
return new
|
|
2001
|
+
return new S(n, t, r === void 0 ? void 0 : { encodingWidth: r });
|
|
1994
2002
|
}
|
|
1995
2003
|
return a;
|
|
1996
2004
|
}
|
|
1997
2005
|
parseFloat() {
|
|
1998
|
-
let { value: e, precision: t } =
|
|
1999
|
-
return new
|
|
2006
|
+
let { value: e, precision: t } = Ke(this.t.consume().value);
|
|
2007
|
+
return new x(e, t === void 0 ? void 0 : { precision: t });
|
|
2000
2008
|
}
|
|
2001
2009
|
parseString() {
|
|
2002
2010
|
let e = this.t.consume();
|
|
2003
2011
|
if (this.t.peek().type !== "PLUS") {
|
|
2004
2012
|
let t = this.consumeEncodingIndicator();
|
|
2005
|
-
return new
|
|
2013
|
+
return new N(e.value, t === void 0 ? void 0 : { encodingWidth: t });
|
|
2006
2014
|
}
|
|
2007
2015
|
let t = !1, n = [{ text: e.value }];
|
|
2008
2016
|
for (; this.t.peek().type === "PLUS";) {
|
|
@@ -2012,11 +2020,11 @@ var at = class {
|
|
|
2012
2020
|
}
|
|
2013
2021
|
if (!t) {
|
|
2014
2022
|
let e = this.consumeEncodingIndicator();
|
|
2015
|
-
return new
|
|
2023
|
+
return new N(n.map((e) => "text" in e ? e.text : "").join(""), e === void 0 ? void 0 : { encodingWidth: e });
|
|
2016
2024
|
}
|
|
2017
2025
|
let r = [], i = "";
|
|
2018
|
-
for (let e of n) "ellipsis" in e ? (i !== "" && (r.push(new
|
|
2019
|
-
return i !== "" && r.push(new
|
|
2026
|
+
for (let e of n) "ellipsis" in e ? (i !== "" && (r.push(new N(i)), i = ""), r.push(new A())) : i += e.text;
|
|
2027
|
+
return i !== "" && r.push(new N(i)), new A(r);
|
|
2020
2028
|
}
|
|
2021
2029
|
_isBytesToken(e) {
|
|
2022
2030
|
return e === "BYTES_HEX" || e === "SQSTR" || e === "BYTES_B64" || e === "BYTES_B32" || e === "BYTES_H32";
|
|
@@ -2024,10 +2032,10 @@ var at = class {
|
|
|
2024
2032
|
_decodeBytesToken(e) {
|
|
2025
2033
|
switch (e.type) {
|
|
2026
2034
|
case "BYTES_HEX":
|
|
2027
|
-
case "SQSTR": return
|
|
2028
|
-
case "BYTES_B64": return
|
|
2029
|
-
case "BYTES_B32": return
|
|
2030
|
-
case "BYTES_H32": return
|
|
2035
|
+
case "SQSTR": return qe(e.value);
|
|
2036
|
+
case "BYTES_B64": return Ze(e.value);
|
|
2037
|
+
case "BYTES_B32": return Xe(e.value, Je);
|
|
2038
|
+
case "BYTES_H32": return Xe(e.value, Ye);
|
|
2031
2039
|
default: this._fail("expected byte string token", e);
|
|
2032
2040
|
}
|
|
2033
2041
|
}
|
|
@@ -2039,7 +2047,7 @@ var at = class {
|
|
|
2039
2047
|
this._fail("byte string in text concatenation is not valid UTF-8", t);
|
|
2040
2048
|
}
|
|
2041
2049
|
}
|
|
2042
|
-
|
|
2050
|
+
_tokenTypeToCdnEncoding(e) {
|
|
2043
2051
|
switch (e) {
|
|
2044
2052
|
case "BYTES_B64": return "base64";
|
|
2045
2053
|
case "BYTES_B32": return "base32";
|
|
@@ -2050,8 +2058,8 @@ var at = class {
|
|
|
2050
2058
|
_parseBytesConcat(e, t, n) {
|
|
2051
2059
|
if (this.t.peek().type !== "PLUS") {
|
|
2052
2060
|
let r = this.consumeEncodingIndicator();
|
|
2053
|
-
return new
|
|
2054
|
-
ednEncoding: this.
|
|
2061
|
+
return new C(e, {
|
|
2062
|
+
ednEncoding: this._tokenTypeToCdnEncoding(t),
|
|
2055
2063
|
ednSource: n,
|
|
2056
2064
|
...r === void 0 ? {} : { encodingWidth: r }
|
|
2057
2065
|
});
|
|
@@ -2064,25 +2072,25 @@ var at = class {
|
|
|
2064
2072
|
else if (e.type === "BYTES_HEX_ELIDED") {
|
|
2065
2073
|
this.t.consume();
|
|
2066
2074
|
let t = this._buildBytesElidedItems(e.value);
|
|
2067
|
-
for (let e of t) e instanceof
|
|
2075
|
+
for (let e of t) e instanceof A ? (i.push({ ellipsis: !0 }), r = !0) : e instanceof C && i.push({ bytes: e.value });
|
|
2068
2076
|
} else this._isBytesToken(e.type) ? (this.t.consume(), i.push({ bytes: this._decodeBytesToken(e) })) : e.type === "TSTR" || e.type === "RAWSTRING" ? (this.t.consume(), i.push({ bytes: new TextEncoder().encode(e.value) })) : this._fail(`expected byte string after +, got ${JSON.stringify(e.value)}`, e);
|
|
2069
2077
|
}
|
|
2070
2078
|
if (!r) {
|
|
2071
2079
|
let e = this.consumeEncodingIndicator(), t = i.map((e) => "bytes" in e ? e.bytes : new Uint8Array());
|
|
2072
|
-
return new
|
|
2080
|
+
return new C(this._concatBytes(t), e === void 0 ? void 0 : { encodingWidth: e });
|
|
2073
2081
|
}
|
|
2074
2082
|
let a = [], o = [], s = () => {
|
|
2075
|
-
o.length > 0 && (a.push(new
|
|
2083
|
+
o.length > 0 && (a.push(new C(this._concatBytes([...o]))), o.length = 0);
|
|
2076
2084
|
};
|
|
2077
|
-
for (let e of i) "ellipsis" in e ? (s(), a.push(new
|
|
2078
|
-
return s(), new
|
|
2085
|
+
for (let e of i) "ellipsis" in e ? (s(), a.push(new A())) : o.push(e.bytes);
|
|
2086
|
+
return s(), new A(a);
|
|
2079
2087
|
}
|
|
2080
2088
|
_parseHexElidedConcat(e) {
|
|
2081
2089
|
let t = this._buildBytesElidedItems(e.value);
|
|
2082
2090
|
for (; this.t.peek().type === "PLUS";) {
|
|
2083
2091
|
this.t.consume();
|
|
2084
2092
|
let e = this.t.peek();
|
|
2085
|
-
if (e.type === "ELLIPSIS") this.t.consume(), t.push(new
|
|
2093
|
+
if (e.type === "ELLIPSIS") this.t.consume(), t.push(new A());
|
|
2086
2094
|
else if (e.type === "BYTES_HEX_ELIDED") {
|
|
2087
2095
|
this.t.consume();
|
|
2088
2096
|
let n = this._buildBytesElidedItems(e.value);
|
|
@@ -2090,20 +2098,20 @@ var at = class {
|
|
|
2090
2098
|
} else if (this._isBytesToken(e.type)) {
|
|
2091
2099
|
this.t.consume();
|
|
2092
2100
|
let n = this._decodeBytesToken(e), r = t[t.length - 1];
|
|
2093
|
-
r instanceof
|
|
2101
|
+
r instanceof C ? t[t.length - 1] = new C(this._concatBytes([r.value, n])) : t.push(new C(n));
|
|
2094
2102
|
} else this._fail(`expected byte string after +, got ${JSON.stringify(e.value)}`, e);
|
|
2095
2103
|
}
|
|
2096
|
-
return new
|
|
2104
|
+
return new A(t);
|
|
2097
2105
|
}
|
|
2098
2106
|
_buildBytesElidedItems(e) {
|
|
2099
2107
|
let t = e.split("..."), n = [];
|
|
2100
|
-
for (let e = 0; e < t.length; e++) e > 0 && n.push(new
|
|
2108
|
+
for (let e = 0; e < t.length; e++) e > 0 && n.push(new A()), t[e].length > 0 && n.push(new C(qe(t[e])));
|
|
2101
2109
|
return n;
|
|
2102
2110
|
}
|
|
2103
2111
|
_mergeFirstBytesItem(e, t) {
|
|
2104
2112
|
if (t.length === 0) return;
|
|
2105
2113
|
let n = e[e.length - 1], r = t[0];
|
|
2106
|
-
n instanceof
|
|
2114
|
+
n instanceof C && r instanceof C ? (e[e.length - 1] = new C(this._concatBytes([n.value, r.value])), e.push(...t.slice(1))) : e.push(...t);
|
|
2107
2115
|
}
|
|
2108
2116
|
_concatBytes(e) {
|
|
2109
2117
|
let t = e.reduce((e, t) => e + t.byteLength, 0), n = new Uint8Array(t), r = 0;
|
|
@@ -2114,14 +2122,14 @@ var at = class {
|
|
|
2114
2122
|
this.t.consume(), this.expect("LPAREN");
|
|
2115
2123
|
let e = this.t.peek();
|
|
2116
2124
|
e.type !== "INTEGER" && this._fail(`expected integer inside simple(), got ${JSON.stringify(e.value)}`, e), this.t.consume();
|
|
2117
|
-
let { numStr: t } =
|
|
2125
|
+
let { numStr: t } = We(e.value), n = Number(Ge(t));
|
|
2118
2126
|
return this.expect("RPAREN"), new O(n);
|
|
2119
2127
|
}
|
|
2120
2128
|
parseEmbeddedCBOR() {
|
|
2121
2129
|
this.t.consume();
|
|
2122
2130
|
let e = [];
|
|
2123
2131
|
for (; this.t.peek().type !== "GT_GT" && !(e.length > 0 && this.t.peek().type === "COMMA" && (this.t.consume(), this.t.peek().type === "GT_GT"));) e.push(this.parseValue());
|
|
2124
|
-
return this.expect("GT_GT"), new
|
|
2132
|
+
return this.expect("GT_GT"), new k(e);
|
|
2125
2133
|
}
|
|
2126
2134
|
parseArray() {
|
|
2127
2135
|
this.t.consume();
|
|
@@ -2166,12 +2174,12 @@ var at = class {
|
|
|
2166
2174
|
for (; this.t.peek().type !== "RPAREN" && !(t.length > 0 && this.t.peek().type === "COMMA" && (this.t.consume(), this.t.peek().type === "RPAREN"));) t.push(this.parseValue());
|
|
2167
2175
|
this.expect("RPAREN"), t.length === 0 && this._fail("empty indefinite group (_ ) is ambiguous; use ''_ for bytes or \"\"_ for text");
|
|
2168
2176
|
let n = t[0];
|
|
2169
|
-
if (n instanceof
|
|
2170
|
-
if (e instanceof
|
|
2177
|
+
if (n instanceof C) return new w(t.map((e, t) => {
|
|
2178
|
+
if (e instanceof C) return e;
|
|
2171
2179
|
this._fail(`indefinite byte string chunk ${t} must be a byte string, not a text string`);
|
|
2172
2180
|
}));
|
|
2173
|
-
if (n instanceof
|
|
2174
|
-
if (e instanceof
|
|
2181
|
+
if (n instanceof N) return new T(t.map((e, t) => {
|
|
2182
|
+
if (e instanceof N) return e;
|
|
2175
2183
|
this._fail(`indefinite text string chunk ${t} must be a text string, not a byte string`);
|
|
2176
2184
|
}));
|
|
2177
2185
|
this._fail("indefinite group chunks must be byte strings or text strings");
|
|
@@ -2190,7 +2198,7 @@ var at = class {
|
|
|
2190
2198
|
let n = t ? ` at line ${t.line}, column ${t.col}` : "";
|
|
2191
2199
|
throw SyntaxError(`EDN parse error${n}: ${e}`);
|
|
2192
2200
|
}
|
|
2193
|
-
},
|
|
2201
|
+
}, rt = new TextEncoder(), it = !1, N = class extends d {
|
|
2194
2202
|
indefiniteLength = !1;
|
|
2195
2203
|
value;
|
|
2196
2204
|
encodingWidth;
|
|
@@ -2198,39 +2206,42 @@ var at = class {
|
|
|
2198
2206
|
super(), this.value = e, this.encodingWidth = t?.encodingWidth;
|
|
2199
2207
|
}
|
|
2200
2208
|
_toCBOR(e) {
|
|
2201
|
-
let t =
|
|
2202
|
-
return
|
|
2209
|
+
let t = rt.encode(this.value);
|
|
2210
|
+
return h([m(3, BigInt(t.length), this.encodingWidth), t]);
|
|
2203
2211
|
}
|
|
2204
|
-
|
|
2212
|
+
_toCDN(e, t) {
|
|
2205
2213
|
let n = this.encodingWidth === void 0 ? "" : `_${this.encodingWidth}`;
|
|
2206
|
-
return
|
|
2214
|
+
return at(this.value, n, e, t);
|
|
2207
2215
|
}
|
|
2208
2216
|
_toJS(e) {
|
|
2209
2217
|
return this.value;
|
|
2210
2218
|
}
|
|
2211
2219
|
};
|
|
2212
|
-
function
|
|
2213
|
-
let i = n?.textStringFormat ?? [], a =
|
|
2214
|
-
if (i.length === 0 || a === null) return
|
|
2215
|
-
let o = /* @__PURE__ */ new Map();
|
|
2216
|
-
if (i.includes("
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
let
|
|
2222
|
-
if (
|
|
2223
|
-
let
|
|
2224
|
-
let r =
|
|
2225
|
-
return n ===
|
|
2226
|
-
}),
|
|
2227
|
-
for (let e = 1; e <
|
|
2228
|
-
let t =
|
|
2229
|
-
|
|
2230
|
-
}
|
|
2231
|
-
return
|
|
2232
|
-
}
|
|
2233
|
-
function
|
|
2220
|
+
function at(e, t, n, r) {
|
|
2221
|
+
let i = ot(n?.textStringFormat ?? []), a = v(n);
|
|
2222
|
+
if (i.length === 0 || a === null) return b(e) + t;
|
|
2223
|
+
let o = /* @__PURE__ */ new Map(), s = null;
|
|
2224
|
+
if (i.includes("cdn") && (s = ct(e), s !== null)) for (let { point: e, contentDepth: t } of s) o.set(e, t);
|
|
2225
|
+
if (i.includes("newline")) {
|
|
2226
|
+
let t = s === null ? st(e, 0) : lt(e);
|
|
2227
|
+
for (let { point: e, contentDepth: n } of t) o.has(e) || o.set(e, n);
|
|
2228
|
+
}
|
|
2229
|
+
let c = gt(e, o);
|
|
2230
|
+
if (c.length <= 1) return b(e) + t;
|
|
2231
|
+
let l = c.map(({ text: e }, n) => {
|
|
2232
|
+
let r = b(e);
|
|
2233
|
+
return n === c.length - 1 ? r + t : r;
|
|
2234
|
+
}), u = l[0];
|
|
2235
|
+
for (let e = 1; e < l.length; e++) {
|
|
2236
|
+
let t = y(a, r + 1 + c[e].contentDepth);
|
|
2237
|
+
u += ` +\n${t}${l[e]}`;
|
|
2238
|
+
}
|
|
2239
|
+
return u;
|
|
2240
|
+
}
|
|
2241
|
+
function ot(e) {
|
|
2242
|
+
return e.map((e) => e === "cboredn" ? (it || (it = !0, console.warn("`textStringFormat: ['cboredn']` is deprecated; use `textStringFormat: ['cdn']` instead.")), "cdn") : e);
|
|
2243
|
+
}
|
|
2244
|
+
function st(e, t) {
|
|
2234
2245
|
let n = [];
|
|
2235
2246
|
for (let r = 0; r < e.length; r++) {
|
|
2236
2247
|
let i = e[r];
|
|
@@ -2247,33 +2258,42 @@ function ct(e, t) {
|
|
|
2247
2258
|
}
|
|
2248
2259
|
return n;
|
|
2249
2260
|
}
|
|
2250
|
-
function
|
|
2261
|
+
function ct(e) {
|
|
2251
2262
|
try {
|
|
2252
|
-
|
|
2263
|
+
Ue(e);
|
|
2253
2264
|
} catch {
|
|
2254
2265
|
return null;
|
|
2255
2266
|
}
|
|
2256
|
-
let t = [], n = new
|
|
2267
|
+
let t = [], n = new Me(e), r = 0, i = null, a = !1, o = 0;
|
|
2257
2268
|
for (;;) {
|
|
2258
|
-
let
|
|
2259
|
-
if (
|
|
2260
|
-
let
|
|
2261
|
-
a || (a = !0,
|
|
2262
|
-
point:
|
|
2263
|
-
contentDepth: r
|
|
2264
|
-
})), i !== null && (dt.has(e.type) && e.offset === i.point ? s = !0 : t.push({
|
|
2265
|
-
point: e.offset,
|
|
2266
|
-
contentDepth: i.contentDepth
|
|
2267
|
-
}), i = null), ut.has(e.type) ? (r++, i = {
|
|
2268
|
-
point: e.endOffset,
|
|
2269
|
-
contentDepth: r
|
|
2270
|
-
}) : dt.has(e.type) ? (r = Math.max(0, r - 1), s || t.push({
|
|
2271
|
-
point: e.offset,
|
|
2269
|
+
let s = n.consume();
|
|
2270
|
+
if (s.type === "EOF") break;
|
|
2271
|
+
let c = !1;
|
|
2272
|
+
if (a || (a = !0, s.offset > 0 && mt(n.comments, 0, s.offset) && t.push({
|
|
2273
|
+
point: s.offset,
|
|
2272
2274
|
contentDepth: r
|
|
2273
|
-
}))
|
|
2274
|
-
|
|
2275
|
+
})), i !== null) {
|
|
2276
|
+
if (i.kind === "opener" && dt.has(s.type)) {
|
|
2277
|
+
i.point = s.endOffset, o = s.endOffset;
|
|
2278
|
+
continue;
|
|
2279
|
+
} else i.kind === "opener" && pt.has(s.type) && ht(e, i.point, s.offset) ? c = !0 : t.push({
|
|
2280
|
+
point: s.offset,
|
|
2281
|
+
contentDepth: i.contentDepth
|
|
2282
|
+
});
|
|
2283
|
+
i = null;
|
|
2284
|
+
}
|
|
2285
|
+
ft.has(s.type) ? (r++, i = {
|
|
2286
|
+
point: s.endOffset,
|
|
2287
|
+
contentDepth: r,
|
|
2288
|
+
kind: "opener"
|
|
2289
|
+
}) : pt.has(s.type) ? (r = Math.max(0, r - 1), c || t.push({
|
|
2290
|
+
point: s.offset,
|
|
2275
2291
|
contentDepth: r
|
|
2276
|
-
})
|
|
2292
|
+
})) : s.type === "COMMA" && (i = {
|
|
2293
|
+
point: s.endOffset,
|
|
2294
|
+
contentDepth: r,
|
|
2295
|
+
kind: "comma"
|
|
2296
|
+
}), o = s.endOffset;
|
|
2277
2297
|
}
|
|
2278
2298
|
let s = n.comments.find((e) => e.start >= o);
|
|
2279
2299
|
return s !== void 0 && t.push({
|
|
@@ -2281,21 +2301,41 @@ function lt(e) {
|
|
|
2281
2301
|
contentDepth: r
|
|
2282
2302
|
}), t;
|
|
2283
2303
|
}
|
|
2284
|
-
|
|
2304
|
+
function lt(e) {
|
|
2305
|
+
let t = [], n = new Me(e), r = 0;
|
|
2306
|
+
for (;;) {
|
|
2307
|
+
let i = n.consume();
|
|
2308
|
+
if (i.type === "EOF") break;
|
|
2309
|
+
if (ft.has(i.type)) r++;
|
|
2310
|
+
else if (pt.has(i.type)) r = Math.max(0, r - 1);
|
|
2311
|
+
else if (i.type !== "COMMA" && ut.has(i.type)) {
|
|
2312
|
+
let n = e.slice(i.offset, i.endOffset);
|
|
2313
|
+
for (let { point: e } of st(n, 0)) t.push({
|
|
2314
|
+
point: i.offset + e,
|
|
2315
|
+
contentDepth: r + 1
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
return t;
|
|
2320
|
+
}
|
|
2321
|
+
var ut = new Set(["TSTR", "RAWSTRING"]), dt = new Set(["ENCODING_INDICATOR", "UNDERSCORE"]), ft = new Set([
|
|
2285
2322
|
"LBRACKET",
|
|
2286
2323
|
"LBRACE",
|
|
2287
2324
|
"LPAREN",
|
|
2288
2325
|
"LT_LT"
|
|
2289
|
-
]),
|
|
2326
|
+
]), pt = new Set([
|
|
2290
2327
|
"RBRACKET",
|
|
2291
2328
|
"RBRACE",
|
|
2292
2329
|
"RPAREN",
|
|
2293
2330
|
"GT_GT"
|
|
2294
2331
|
]);
|
|
2295
|
-
function
|
|
2332
|
+
function mt(e, t, n) {
|
|
2296
2333
|
return e.some((e) => e.start >= t && e.end <= n);
|
|
2297
2334
|
}
|
|
2298
|
-
function
|
|
2335
|
+
function ht(e, t, n) {
|
|
2336
|
+
return /^[\t\n\r ]*$/.test(e.slice(t, n));
|
|
2337
|
+
}
|
|
2338
|
+
function gt(e, t) {
|
|
2299
2339
|
let n = [...t].filter(([t]) => t > 0 && t < e.length).sort(([e], [t]) => e - t);
|
|
2300
2340
|
if (n.length === 0) return [{
|
|
2301
2341
|
text: e,
|
|
@@ -2313,7 +2353,7 @@ function pt(e, t) {
|
|
|
2313
2353
|
}
|
|
2314
2354
|
//#endregion
|
|
2315
2355
|
//#region src/extensions/dt.ts
|
|
2316
|
-
function
|
|
2356
|
+
function P(e) {
|
|
2317
2357
|
if (Number.isInteger(e)) return (/* @__PURE__ */ new Date(e * 1e3)).toISOString().replace(/\.000Z$/, "Z");
|
|
2318
2358
|
let t = Math.round(e * 1e3);
|
|
2319
2359
|
if (t / 1e3 === e) return new Date(t).toISOString().replace(/\.000Z$/, "Z");
|
|
@@ -2321,96 +2361,96 @@ function j(e) {
|
|
|
2321
2361
|
for (; s.length < 3;) s += "0";
|
|
2322
2362
|
return `${i}.${s}Z`;
|
|
2323
2363
|
}
|
|
2324
|
-
function
|
|
2364
|
+
function _t(e) {
|
|
2325
2365
|
if (e.length !== 1) throw SyntaxError("dt<<...>>: expected exactly one item");
|
|
2326
2366
|
let t = e[0];
|
|
2327
|
-
if (t instanceof
|
|
2328
|
-
if (t instanceof
|
|
2367
|
+
if (t instanceof N) return t.value;
|
|
2368
|
+
if (t instanceof C) return new TextDecoder("utf-8", { fatal: !0 }).decode(t.value);
|
|
2329
2369
|
throw SyntaxError("dt<<...>>: expected a text string or byte string");
|
|
2330
2370
|
}
|
|
2331
|
-
function
|
|
2371
|
+
function vt(e) {
|
|
2332
2372
|
let t = e.match(/^(.+T\d{2}:\d{2}:\d{2})(\.\d+)(Z|[+-]\d{2}:\d{2})$/i), n, r;
|
|
2333
2373
|
t ? (n = t[1] + t[3], r = parseFloat("0" + t[2])) : (n = e, r = void 0);
|
|
2334
2374
|
let i = Date.parse(n);
|
|
2335
2375
|
if (isNaN(i)) throw SyntaxError(`dt: invalid RFC 3339 date-time: ${JSON.stringify(e)}`);
|
|
2336
2376
|
if (r === void 0) {
|
|
2337
2377
|
let e = i / 1e3;
|
|
2338
|
-
return e >= 0 ? new
|
|
2378
|
+
return e >= 0 ? new bt(BigInt(e)) : new xt(BigInt(e));
|
|
2339
2379
|
}
|
|
2340
|
-
return new
|
|
2380
|
+
return new St(i / 1e3 + r);
|
|
2341
2381
|
}
|
|
2342
|
-
var
|
|
2382
|
+
var yt = 1n, bt = class extends g {
|
|
2343
2383
|
constructor(e, t) {
|
|
2344
2384
|
super(e, t);
|
|
2345
2385
|
}
|
|
2346
|
-
|
|
2347
|
-
return e?.appStrings === !1 ? super.
|
|
2386
|
+
_toCDN(e, t) {
|
|
2387
|
+
return e?.appStrings === !1 ? super._toCDN(e, t) : `dt'${P(Number(this.value))}'`;
|
|
2348
2388
|
}
|
|
2349
|
-
},
|
|
2389
|
+
}, xt = class extends _ {
|
|
2350
2390
|
constructor(e, t) {
|
|
2351
2391
|
super(e, t);
|
|
2352
2392
|
}
|
|
2353
|
-
|
|
2354
|
-
return e?.appStrings === !1 ? super.
|
|
2393
|
+
_toCDN(e, t) {
|
|
2394
|
+
return e?.appStrings === !1 ? super._toCDN(e, t) : `dt'${P(Number(this.value))}'`;
|
|
2355
2395
|
}
|
|
2356
|
-
},
|
|
2396
|
+
}, St = class extends x {
|
|
2357
2397
|
constructor(e, t) {
|
|
2358
2398
|
super(e, t);
|
|
2359
2399
|
}
|
|
2360
|
-
|
|
2361
|
-
return e?.appStrings === !1 ? super.
|
|
2400
|
+
_toCDN(e, t) {
|
|
2401
|
+
return e?.appStrings === !1 ? super._toCDN(e, t) : `dt'${P(this.value)}'`;
|
|
2362
2402
|
}
|
|
2363
|
-
},
|
|
2403
|
+
}, Ct = class extends S {
|
|
2364
2404
|
constructor(e, t) {
|
|
2365
|
-
super(
|
|
2405
|
+
super(yt, vt(e), t);
|
|
2366
2406
|
}
|
|
2367
|
-
|
|
2368
|
-
if (e?.appStrings === !1) return super.
|
|
2407
|
+
_toCDN(e, t) {
|
|
2408
|
+
if (e?.appStrings === !1) return super._toCDN(e, t);
|
|
2369
2409
|
let n = this.content;
|
|
2370
|
-
return `DT'${
|
|
2410
|
+
return `DT'${P(n instanceof x ? n.value : Number(n.value))}'`;
|
|
2371
2411
|
}
|
|
2372
|
-
},
|
|
2412
|
+
}, wt = class extends Ct {
|
|
2373
2413
|
constructor(e, t) {
|
|
2374
2414
|
super(e, t);
|
|
2375
2415
|
}
|
|
2376
2416
|
_toJS(e) {
|
|
2377
|
-
let t = this.content, n = t instanceof
|
|
2417
|
+
let t = this.content, n = t instanceof x ? t.value * 1e3 : Number(t.value) * 1e3;
|
|
2378
2418
|
return new Date(n);
|
|
2379
2419
|
}
|
|
2380
2420
|
};
|
|
2381
|
-
function
|
|
2421
|
+
function Tt(e) {
|
|
2382
2422
|
let t = e?.jsDate ?? !1;
|
|
2383
2423
|
function n(e) {
|
|
2384
|
-
return t ? new
|
|
2424
|
+
return t ? new wt(e) : new Ct(e);
|
|
2385
2425
|
}
|
|
2386
2426
|
let r = {
|
|
2387
2427
|
appStringPrefixes: ["dt", "DT"],
|
|
2388
|
-
tagNumbers: [
|
|
2428
|
+
tagNumbers: [yt],
|
|
2389
2429
|
parseAppString(e, t) {
|
|
2390
|
-
return e === "DT" ? n(t) :
|
|
2430
|
+
return e === "DT" ? n(t) : vt(t);
|
|
2391
2431
|
},
|
|
2392
2432
|
parseAppSequence(e, t) {
|
|
2393
|
-
let r =
|
|
2394
|
-
return e === "DT" ? n(r) :
|
|
2433
|
+
let r = _t(t);
|
|
2434
|
+
return e === "DT" ? n(r) : vt(r);
|
|
2395
2435
|
},
|
|
2396
2436
|
parseTag(e, t) {
|
|
2397
2437
|
if (e !== 1n) return;
|
|
2398
2438
|
let r;
|
|
2399
|
-
if (t instanceof
|
|
2400
|
-
else if (t instanceof
|
|
2401
|
-
else if (t instanceof
|
|
2439
|
+
if (t instanceof g) r = Number(t.value);
|
|
2440
|
+
else if (t instanceof _) r = Number(t.value);
|
|
2441
|
+
else if (t instanceof x) r = t.value;
|
|
2402
2442
|
else return;
|
|
2403
|
-
return n(
|
|
2443
|
+
return n(P(r));
|
|
2404
2444
|
}
|
|
2405
2445
|
};
|
|
2406
2446
|
return t && (r.fromJS = (e, t) => {
|
|
2407
|
-
if (e instanceof Date) return new
|
|
2447
|
+
if (e instanceof Date) return new wt(P(e.getTime() / 1e3));
|
|
2408
2448
|
}, r.isJSType = (e) => e instanceof Date), r;
|
|
2409
2449
|
}
|
|
2410
|
-
var
|
|
2450
|
+
var Et = Tt(), Dt = Tt({ jsDate: !0 });
|
|
2411
2451
|
//#endregion
|
|
2412
2452
|
//#region src/utils/ip.ts
|
|
2413
|
-
function
|
|
2453
|
+
function F(e) {
|
|
2414
2454
|
let t = e.split(".");
|
|
2415
2455
|
if (t.length !== 4) throw SyntaxError(`ip: invalid IPv4 address: ${JSON.stringify(e)}`);
|
|
2416
2456
|
let n = new Uint8Array(4);
|
|
@@ -2423,11 +2463,11 @@ function Tt(e) {
|
|
|
2423
2463
|
}
|
|
2424
2464
|
return n;
|
|
2425
2465
|
}
|
|
2426
|
-
function
|
|
2466
|
+
function Ot(e) {
|
|
2427
2467
|
let t = new Uint8Array(16);
|
|
2428
2468
|
if (e === "::") return t;
|
|
2429
2469
|
let n = e, r = null, i = e.match(/^(.*):(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/);
|
|
2430
|
-
i && (n = i[1], n.endsWith(":") && (n += ":"), r =
|
|
2470
|
+
i && (n = i[1], n.endsWith(":") && (n += ":"), r = F(i[2]));
|
|
2431
2471
|
let a = n.split("::");
|
|
2432
2472
|
if (a.length > 2) throw SyntaxError(`ip: invalid IPv6 address: ${JSON.stringify(e)}`);
|
|
2433
2473
|
let o = a.length === 2, s = a[0] ? a[0].split(":") : [], c = o && a[1] ? a[1].split(":") : [], l = r ? 6 : 8;
|
|
@@ -2444,11 +2484,11 @@ function Et(e) {
|
|
|
2444
2484
|
}
|
|
2445
2485
|
return r && t.set(r, 12), t;
|
|
2446
2486
|
}
|
|
2447
|
-
function
|
|
2487
|
+
function I(e) {
|
|
2448
2488
|
return Array.from(e).join(".");
|
|
2449
2489
|
}
|
|
2450
|
-
function
|
|
2451
|
-
let t = e.slice(0, 10).every((e) => e === 0) && e[10] === 255 && e[11] === 255 ?
|
|
2490
|
+
function kt(e) {
|
|
2491
|
+
let t = e.slice(0, 10).every((e) => e === 0) && e[10] === 255 && e[11] === 255 ? I(e.slice(12)) : null, n = t ? 6 : 8, r = [];
|
|
2452
2492
|
for (let t = 0; t < n * 2; t += 2) r.push(e[t] << 8 | e[t + 1]);
|
|
2453
2493
|
let i = -1, a = 0, o = 0;
|
|
2454
2494
|
for (; o < n;) if (r[o] === 0) {
|
|
@@ -2462,29 +2502,29 @@ function Ot(e) {
|
|
|
2462
2502
|
}
|
|
2463
2503
|
//#endregion
|
|
2464
2504
|
//#region src/extensions/ip.ts
|
|
2465
|
-
var
|
|
2466
|
-
function
|
|
2505
|
+
var L = "ip", R = "IP", z = 52n, B = 54n;
|
|
2506
|
+
function At(e) {
|
|
2467
2507
|
if (e.length !== 1) throw SyntaxError("ip<<...>>: expected exactly one item");
|
|
2468
2508
|
let t = e[0];
|
|
2469
|
-
if (t instanceof
|
|
2470
|
-
if (t instanceof
|
|
2509
|
+
if (t instanceof N) return t.value;
|
|
2510
|
+
if (t instanceof C) return new TextDecoder("utf-8", { fatal: !0 }).decode(t.value);
|
|
2471
2511
|
throw SyntaxError("ip<<...>>: expected a text string or byte string");
|
|
2472
2512
|
}
|
|
2473
|
-
function
|
|
2513
|
+
function jt(e) {
|
|
2474
2514
|
return /^\d/.test(e) && e.includes(".") && !e.includes(":") ? {
|
|
2475
|
-
bytes:
|
|
2515
|
+
bytes: F(e),
|
|
2476
2516
|
isV4: !0
|
|
2477
2517
|
} : {
|
|
2478
|
-
bytes:
|
|
2518
|
+
bytes: Ot(e),
|
|
2479
2519
|
isV4: !1
|
|
2480
2520
|
};
|
|
2481
2521
|
}
|
|
2482
|
-
function
|
|
2483
|
-
if (e.length === 4) return
|
|
2484
|
-
if (e.length === 16) return
|
|
2522
|
+
function V(e) {
|
|
2523
|
+
if (e.length === 4) return I(e);
|
|
2524
|
+
if (e.length === 16) return kt(e);
|
|
2485
2525
|
throw SyntaxError(`ip: unexpected byte length: ${e.length}`);
|
|
2486
2526
|
}
|
|
2487
|
-
function
|
|
2527
|
+
function Mt(e, t) {
|
|
2488
2528
|
let n = new Uint8Array(e.length);
|
|
2489
2529
|
n.set(e);
|
|
2490
2530
|
let r = Math.floor(t / 8), i = t % 8;
|
|
@@ -2494,79 +2534,79 @@ function It(e, t) {
|
|
|
2494
2534
|
for (; a > 0 && n[a - 1] === 0;) a--;
|
|
2495
2535
|
return n.slice(0, a);
|
|
2496
2536
|
}
|
|
2497
|
-
function
|
|
2537
|
+
function Nt(e, t) {
|
|
2498
2538
|
let n = new Uint8Array(t);
|
|
2499
2539
|
return n.set(e), n;
|
|
2500
2540
|
}
|
|
2501
|
-
var
|
|
2502
|
-
|
|
2503
|
-
return e?.appStrings === !1 ? super.
|
|
2541
|
+
var Pt = class extends C {
|
|
2542
|
+
_toCDN(e, t) {
|
|
2543
|
+
return e?.appStrings === !1 ? super._toCDN(e, t) : `${L}'${V(this.value)}'`;
|
|
2504
2544
|
}
|
|
2505
|
-
},
|
|
2545
|
+
}, Ft = class extends E {
|
|
2506
2546
|
_isV4;
|
|
2507
2547
|
constructor(e, t, n) {
|
|
2508
|
-
super([new
|
|
2548
|
+
super([new g(BigInt(e)), new C(t)]), this._isV4 = n;
|
|
2509
2549
|
}
|
|
2510
|
-
|
|
2511
|
-
if (e?.appStrings === !1) return super.
|
|
2550
|
+
_toCDN(e, t) {
|
|
2551
|
+
if (e?.appStrings === !1) return super._toCDN(e, t);
|
|
2512
2552
|
let n = Number(this.items[0].value), r = this.items[1].value;
|
|
2513
|
-
return `${
|
|
2553
|
+
return `${L}'${V(Nt(r, this._isV4 ? 4 : 16))}/${n}'`;
|
|
2514
2554
|
}
|
|
2515
|
-
},
|
|
2555
|
+
}, H = class extends S {
|
|
2516
2556
|
constructor(e, t) {
|
|
2517
2557
|
super(e, t);
|
|
2518
2558
|
}
|
|
2519
|
-
|
|
2520
|
-
if (e?.appStrings === !1) return super.
|
|
2521
|
-
let n = this.tag ===
|
|
2522
|
-
if (r instanceof
|
|
2523
|
-
if (r instanceof E && r.items.length === 2 && r.items[0] instanceof
|
|
2559
|
+
_toCDN(e, t) {
|
|
2560
|
+
if (e?.appStrings === !1) return super._toCDN(e, t);
|
|
2561
|
+
let n = this.tag === z ? 4 : 16, r = this.content;
|
|
2562
|
+
if (r instanceof C) return `${R}'${V(r.value)}'`;
|
|
2563
|
+
if (r instanceof E && r.items.length === 2 && r.items[0] instanceof g && r.items[1] instanceof C) {
|
|
2524
2564
|
let e = Number(r.items[0].value);
|
|
2525
|
-
return `${
|
|
2565
|
+
return `${R}'${V(Nt(r.items[1].value, n))}/${e}'`;
|
|
2526
2566
|
}
|
|
2527
|
-
return super.
|
|
2567
|
+
return super._toCDN(e, t);
|
|
2528
2568
|
}
|
|
2529
2569
|
};
|
|
2530
|
-
function
|
|
2570
|
+
function It(e, t) {
|
|
2531
2571
|
let n = t.indexOf("/");
|
|
2532
2572
|
if (n === -1) {
|
|
2533
|
-
let { bytes: n, isV4: r } =
|
|
2534
|
-
return e ===
|
|
2573
|
+
let { bytes: n, isV4: r } = jt(t);
|
|
2574
|
+
return e === R ? new H(r ? z : B, new C(n)) : new Pt(n);
|
|
2535
2575
|
}
|
|
2536
2576
|
let r = t.slice(0, n), i = t.slice(n + 1);
|
|
2537
2577
|
if (!/^\d+$/.test(i)) throw SyntaxError(`ip: invalid prefix length: ${JSON.stringify(i)}`);
|
|
2538
|
-
let a = parseInt(i, 10), { bytes: o, isV4: s } =
|
|
2578
|
+
let a = parseInt(i, 10), { bytes: o, isV4: s } = jt(r), c = s ? 32 : 128;
|
|
2539
2579
|
if (a > c) throw SyntaxError(`ip: prefix length ${a} exceeds maximum ${c} for ${s ? "IPv4" : "IPv6"}`);
|
|
2540
|
-
let l =
|
|
2541
|
-
return e ===
|
|
2580
|
+
let l = Mt(o, a);
|
|
2581
|
+
return e === R ? new H(s ? z : B, new E([new g(BigInt(a)), new C(l)])) : new Ft(a, l, s);
|
|
2542
2582
|
}
|
|
2543
|
-
var
|
|
2544
|
-
appStringPrefixes: [
|
|
2545
|
-
tagNumbers: [
|
|
2583
|
+
var Lt = {
|
|
2584
|
+
appStringPrefixes: [L, R],
|
|
2585
|
+
tagNumbers: [z, B],
|
|
2546
2586
|
parseAppString(e, t) {
|
|
2547
|
-
return
|
|
2587
|
+
return It(e, t);
|
|
2548
2588
|
},
|
|
2549
2589
|
parseAppSequence(e, t) {
|
|
2550
|
-
return
|
|
2590
|
+
return It(e, At(t));
|
|
2551
2591
|
},
|
|
2552
2592
|
parseTag(e, t) {
|
|
2553
|
-
if (!(e !==
|
|
2593
|
+
if (!(e !== z && e !== B) && (t instanceof C || t instanceof E)) return new H(e, t);
|
|
2554
2594
|
}
|
|
2555
|
-
},
|
|
2556
|
-
tagNumbers: [
|
|
2595
|
+
}, Rt = 18446744073709551615n, zt = -(Rt + 1n), Bt = {
|
|
2596
|
+
tagNumbers: [Le, Re],
|
|
2557
2597
|
parseTag(e, t) {
|
|
2558
|
-
if (t instanceof
|
|
2598
|
+
if (t instanceof C) {
|
|
2559
2599
|
if (e === 2n) {
|
|
2560
|
-
let e =
|
|
2561
|
-
return e >
|
|
2600
|
+
let e = He(t.value);
|
|
2601
|
+
return e > Rt ? new j(e) : void 0;
|
|
2562
2602
|
}
|
|
2563
2603
|
if (e === 3n) {
|
|
2564
|
-
let e = -1n -
|
|
2565
|
-
return e <
|
|
2604
|
+
let e = -1n - He(t.value);
|
|
2605
|
+
return e < zt ? new M(e) : void 0;
|
|
2566
2606
|
}
|
|
2567
2607
|
}
|
|
2568
2608
|
}
|
|
2569
|
-
},
|
|
2609
|
+
}, Vt = "cri", U = "CRI", Ht = 99n, Ut = new Map([
|
|
2570
2610
|
["coap", -1n],
|
|
2571
2611
|
["coaps", -2n],
|
|
2572
2612
|
["http", -3n],
|
|
@@ -2577,46 +2617,46 @@ var Ht = {
|
|
|
2577
2617
|
["coaps+tcp", -8n],
|
|
2578
2618
|
["coap+ws", -25n],
|
|
2579
2619
|
["coaps+ws", -26n]
|
|
2580
|
-
]),
|
|
2581
|
-
function
|
|
2620
|
+
]), Wt = new Map([...Ut.entries()].map(([e, t]) => [t, e]));
|
|
2621
|
+
function W(e) {
|
|
2582
2622
|
try {
|
|
2583
2623
|
return decodeURIComponent(e);
|
|
2584
2624
|
} catch {
|
|
2585
2625
|
return e;
|
|
2586
2626
|
}
|
|
2587
2627
|
}
|
|
2588
|
-
function
|
|
2628
|
+
function Gt(e) {
|
|
2589
2629
|
return Array.from(new TextEncoder().encode(e), (e) => `%${e.toString(16).toUpperCase().padStart(2, "0")}`).join("");
|
|
2590
2630
|
}
|
|
2591
|
-
function
|
|
2631
|
+
function G(e, t) {
|
|
2592
2632
|
let n = "";
|
|
2593
|
-
for (let r of e) n += t(r) ? r :
|
|
2633
|
+
for (let r of e) n += t(r) ? r : Gt(r);
|
|
2594
2634
|
return n;
|
|
2595
2635
|
}
|
|
2596
|
-
function
|
|
2636
|
+
function Kt(e) {
|
|
2597
2637
|
return /[A-Za-z0-9\-._~]/.test(e);
|
|
2598
2638
|
}
|
|
2599
|
-
function
|
|
2639
|
+
function qt(e) {
|
|
2600
2640
|
return /[!$&'()*+,;=]/.test(e);
|
|
2601
2641
|
}
|
|
2602
|
-
function
|
|
2603
|
-
return
|
|
2642
|
+
function Jt(e) {
|
|
2643
|
+
return Kt(e) || qt(e) || e === ":" || e === "@";
|
|
2604
2644
|
}
|
|
2605
|
-
function
|
|
2606
|
-
return (
|
|
2645
|
+
function Yt(e) {
|
|
2646
|
+
return (Jt(e) || e === "/" || e === "?") && e !== "&";
|
|
2607
2647
|
}
|
|
2608
|
-
function
|
|
2609
|
-
return
|
|
2648
|
+
function Xt(e) {
|
|
2649
|
+
return Jt(e) || e === "/" || e === "?";
|
|
2610
2650
|
}
|
|
2611
|
-
function
|
|
2612
|
-
return
|
|
2651
|
+
function Zt(e) {
|
|
2652
|
+
return Kt(e) || qt(e) || e === ":";
|
|
2613
2653
|
}
|
|
2614
|
-
function
|
|
2615
|
-
return
|
|
2654
|
+
function Qt(e) {
|
|
2655
|
+
return Kt(e) || qt(e);
|
|
2616
2656
|
}
|
|
2617
|
-
function
|
|
2657
|
+
function $t(e) {
|
|
2618
2658
|
let t = [], n = e, r = n.indexOf("@");
|
|
2619
|
-
r >= 0 && (t.push(O.FALSE), t.push(new
|
|
2659
|
+
r >= 0 && (t.push(O.FALSE), t.push(new N(W(n.slice(0, r)))), n = n.slice(r + 1));
|
|
2620
2660
|
let i, a = null;
|
|
2621
2661
|
if (n.startsWith("[")) {
|
|
2622
2662
|
let e = n.indexOf("]");
|
|
@@ -2625,126 +2665,126 @@ function on(e) {
|
|
|
2625
2665
|
let r = n.slice(e + 1);
|
|
2626
2666
|
if (r.startsWith(":")) a = r.slice(1);
|
|
2627
2667
|
else if (r.length > 0) throw SyntaxError("cri: unexpected characters after ']' in authority");
|
|
2628
|
-
t.push(new
|
|
2668
|
+
t.push(new C(Ot(i)));
|
|
2629
2669
|
} else {
|
|
2630
2670
|
let e = n.lastIndexOf(":");
|
|
2631
|
-
if (e >= 0 ? (i = n.slice(0, e), a = n.slice(e + 1)) : i = n, i !== "") if (/^\d{1,3}(\.\d{1,3}){3}$/.test(i)) t.push(new
|
|
2632
|
-
else for (let e of i.toLowerCase().split(".")) t.push(new
|
|
2671
|
+
if (e >= 0 ? (i = n.slice(0, e), a = n.slice(e + 1)) : i = n, i !== "") if (/^\d{1,3}(\.\d{1,3}){3}$/.test(i)) t.push(new C(F(i)));
|
|
2672
|
+
else for (let e of i.toLowerCase().split(".")) t.push(new N(e));
|
|
2633
2673
|
}
|
|
2634
2674
|
if (a !== null && a !== "") {
|
|
2635
2675
|
if (!/^\d+$/.test(a)) throw SyntaxError(`cri: invalid port: ${JSON.stringify(a)}`);
|
|
2636
2676
|
let e = parseInt(a, 10);
|
|
2637
2677
|
if (e > 65535) throw SyntaxError(`cri: port ${e} out of range`);
|
|
2638
|
-
t.push(new
|
|
2678
|
+
t.push(new g(BigInt(e)));
|
|
2639
2679
|
}
|
|
2640
2680
|
return new E(t);
|
|
2641
2681
|
}
|
|
2642
|
-
function
|
|
2682
|
+
function en(e) {
|
|
2643
2683
|
let t = e.items, n = 0, r = "";
|
|
2644
2684
|
if (n < t.length && t[n] instanceof O && t[n].value === 20) {
|
|
2645
2685
|
n++;
|
|
2646
2686
|
let e = t[n++];
|
|
2647
|
-
r +=
|
|
2687
|
+
r += G(e.value, Zt) + "@";
|
|
2648
2688
|
}
|
|
2649
2689
|
if (n >= t.length) return r;
|
|
2650
2690
|
let i = t[n];
|
|
2651
|
-
if (i instanceof
|
|
2691
|
+
if (i instanceof C) {
|
|
2652
2692
|
n++;
|
|
2653
2693
|
let { length: e } = i.value;
|
|
2654
|
-
if (e === 4) r +=
|
|
2655
|
-
else if (e === 16) r += "[" +
|
|
2694
|
+
if (e === 4) r += I(i.value);
|
|
2695
|
+
else if (e === 16) r += "[" + kt(i.value) + "]";
|
|
2656
2696
|
else throw Error(`cri: unexpected host-ip byte length: ${e}`);
|
|
2657
|
-
n < t.length && t[n] instanceof
|
|
2697
|
+
n < t.length && t[n] instanceof N && (r += `%25${G(t[n++].value, Qt)}`);
|
|
2658
2698
|
} else {
|
|
2659
2699
|
let e = [];
|
|
2660
|
-
for (; n < t.length && t[n] instanceof
|
|
2700
|
+
for (; n < t.length && t[n] instanceof N;) e.push(G(t[n++].value, Qt));
|
|
2661
2701
|
r += e.join(".");
|
|
2662
2702
|
}
|
|
2663
|
-
return n < t.length && t[n] instanceof
|
|
2703
|
+
return n < t.length && t[n] instanceof g && (r += ":" + t[n].value.toString()), r;
|
|
2664
2704
|
}
|
|
2665
|
-
function
|
|
2705
|
+
function tn(e) {
|
|
2666
2706
|
let t = e.slice(2), n = t.indexOf("/"), r, i;
|
|
2667
|
-
return n >= 0 ? (r = t.slice(0, n), i = t.slice(n + 1).split("/").map((e) => new
|
|
2668
|
-
authority:
|
|
2707
|
+
return n >= 0 ? (r = t.slice(0, n), i = t.slice(n + 1).split("/").map((e) => new N(W(e)))) : (r = t, i = []), {
|
|
2708
|
+
authority: $t(r),
|
|
2669
2709
|
pathSegments: i
|
|
2670
2710
|
};
|
|
2671
2711
|
}
|
|
2672
|
-
function
|
|
2712
|
+
function nn(e) {
|
|
2673
2713
|
let t = e, n = null, r = t.indexOf("#");
|
|
2674
|
-
r >= 0 && (n =
|
|
2714
|
+
r >= 0 && (n = W(t.slice(r + 1)), t = t.slice(0, r));
|
|
2675
2715
|
let i = null, a = t.indexOf("?");
|
|
2676
2716
|
if (a >= 0) {
|
|
2677
2717
|
let e = t.slice(a + 1);
|
|
2678
|
-
t = t.slice(0, a), i = e.split("&").map((e) => new
|
|
2718
|
+
t = t.slice(0, a), i = e.split("&").map((e) => new N(W(e)));
|
|
2679
2719
|
}
|
|
2680
2720
|
let o = [], s = /^([a-zA-Z][a-zA-Z0-9+.\-]*):([\s\S]*)$/.exec(t);
|
|
2681
2721
|
if (s) {
|
|
2682
|
-
let e = s[1].toLowerCase(), t = s[2], n =
|
|
2683
|
-
if (o.push(n === void 0 ? new
|
|
2684
|
-
let { authority: e, pathSegments: n } =
|
|
2722
|
+
let e = s[1].toLowerCase(), t = s[2], n = Ut.get(e);
|
|
2723
|
+
if (o.push(n === void 0 ? new N(e) : new _(n)), t.startsWith("//")) {
|
|
2724
|
+
let { authority: e, pathSegments: n } = tn(t);
|
|
2685
2725
|
o.push(e, new E(n));
|
|
2686
2726
|
} else if (t.startsWith("/")) {
|
|
2687
|
-
let e = t.slice(1).split("/").map((e) => new
|
|
2727
|
+
let e = t.slice(1).split("/").map((e) => new N(W(e)));
|
|
2688
2728
|
o.push(O.NULL, new E(e));
|
|
2689
2729
|
} else {
|
|
2690
|
-
let e = t.split("/").map((e) => new
|
|
2730
|
+
let e = t.split("/").map((e) => new N(W(e)));
|
|
2691
2731
|
o.push(O.TRUE, new E(e));
|
|
2692
2732
|
}
|
|
2693
2733
|
} else if (t.startsWith("//")) {
|
|
2694
|
-
let { authority: e, pathSegments: n } =
|
|
2734
|
+
let { authority: e, pathSegments: n } = tn(t);
|
|
2695
2735
|
o.push(O.FALSE, e, new E(n));
|
|
2696
2736
|
} else if (t.startsWith("/")) {
|
|
2697
|
-
let e = t.slice(1).split("/").map((e) => new
|
|
2737
|
+
let e = t.slice(1).split("/").map((e) => new N(W(e)));
|
|
2698
2738
|
o.push(O.TRUE, new E(e));
|
|
2699
|
-
} else if (t === "") o.push(new
|
|
2739
|
+
} else if (t === "") o.push(new g(0n));
|
|
2700
2740
|
else {
|
|
2701
2741
|
let n = 1n, r = t, i = !1;
|
|
2702
2742
|
for (r.startsWith("./") && (i = !0, r = r.slice(2)); r.startsWith("../");) n++, r = r.slice(3);
|
|
2703
2743
|
if (r === ".." ? (n++, r = "") : r === "." && (r = ""), n === 1n && !i && r !== "" && r.split("/")[0].includes(":")) throw SyntaxError(`cri: invalid relative-path reference — first segment must not contain ':' without a './' prefix (RFC 3986 §3.3): ${JSON.stringify(e)}`);
|
|
2704
|
-
let a = r === "" ? [] : r.split("/").map((e) => new
|
|
2705
|
-
o.push(new
|
|
2744
|
+
let a = r === "" ? [] : r.split("/").map((e) => new N(W(e)));
|
|
2745
|
+
o.push(new g(n), new E(a));
|
|
2706
2746
|
}
|
|
2707
|
-
if (i !== null && o.push(new E(i)), n !== null && (i === null && o.push(O.NULL), o.push(new
|
|
2747
|
+
if (i !== null && o.push(new E(i)), n !== null && (i === null && o.push(O.NULL), o.push(new N(n))), n !== null && i === null && o.splice(o.length - 2, 1), i === null && n === null) {
|
|
2708
2748
|
let e = o[o.length - 1];
|
|
2709
2749
|
e instanceof E && e.items.length === 0 && o.pop();
|
|
2710
2750
|
}
|
|
2711
|
-
return o.length === 1 && o[0] instanceof
|
|
2751
|
+
return o.length === 1 && o[0] instanceof g && o[0].value === 0n ? [] : o;
|
|
2712
2752
|
}
|
|
2713
|
-
function
|
|
2753
|
+
function K(e, t) {
|
|
2714
2754
|
let n = t, r = "";
|
|
2715
2755
|
if (n < e.length) {
|
|
2716
2756
|
let t = e[n];
|
|
2717
2757
|
if (t instanceof E) {
|
|
2718
2758
|
if (n++, t.items.length > 0) {
|
|
2719
2759
|
let e = t.items.map((e) => {
|
|
2720
|
-
if (!(e instanceof
|
|
2721
|
-
return
|
|
2760
|
+
if (!(e instanceof N)) throw Error("cri: query item must be a text string");
|
|
2761
|
+
return G(e.value, Yt);
|
|
2722
2762
|
});
|
|
2723
2763
|
r += "?" + e.join("&");
|
|
2724
2764
|
}
|
|
2725
2765
|
} else t instanceof O && t.value === 22 && n++;
|
|
2726
2766
|
}
|
|
2727
|
-
return n < e.length && e[n] instanceof
|
|
2767
|
+
return n < e.length && e[n] instanceof N && (r += "#" + G(e[n].value, Xt)), r;
|
|
2728
2768
|
}
|
|
2729
|
-
function
|
|
2769
|
+
function q(e) {
|
|
2730
2770
|
return e.items.map((e) => {
|
|
2731
|
-
if (!(e instanceof
|
|
2732
|
-
return
|
|
2771
|
+
if (!(e instanceof N)) throw Error("cri: path segment must be a text string");
|
|
2772
|
+
return G(e.value, Jt);
|
|
2733
2773
|
});
|
|
2734
2774
|
}
|
|
2735
|
-
function
|
|
2775
|
+
function rn(e) {
|
|
2736
2776
|
if (e.length === 0) return "";
|
|
2737
2777
|
let t = 0, n = e[t++];
|
|
2738
|
-
if (n instanceof
|
|
2778
|
+
if (n instanceof _ || n instanceof N) {
|
|
2739
2779
|
let r;
|
|
2740
|
-
if (n instanceof
|
|
2741
|
-
let e =
|
|
2780
|
+
if (n instanceof _) {
|
|
2781
|
+
let e = Wt.get(n.value);
|
|
2742
2782
|
if (e === void 0) throw Error(`cri: unrecognised scheme-id ${n.value}`);
|
|
2743
2783
|
r = e + ":";
|
|
2744
2784
|
} else r = n.value + ":";
|
|
2745
2785
|
if (t >= e.length) return r;
|
|
2746
2786
|
let i = e[t++], a = "", o = !1;
|
|
2747
|
-
if (i instanceof E) a = "//" +
|
|
2787
|
+
if (i instanceof E) a = "//" + en(i), o = !0;
|
|
2748
2788
|
else if (i instanceof O) if (i.value === 22) o = !0;
|
|
2749
2789
|
else if (i.value === 21) o = !1;
|
|
2750
2790
|
else throw Error(`cri: unexpected no-authority value: simple(${i.value})`);
|
|
@@ -2752,816 +2792,141 @@ function fn(e) {
|
|
|
2752
2792
|
let s = "";
|
|
2753
2793
|
if (t < e.length && e[t] instanceof E) {
|
|
2754
2794
|
let n = e[t++];
|
|
2755
|
-
n.items.length > 0 && (s = (o ? "/" : "") +
|
|
2795
|
+
n.items.length > 0 && (s = (o ? "/" : "") + q(n).join("/"));
|
|
2756
2796
|
}
|
|
2757
|
-
return r + a + s +
|
|
2797
|
+
return r + a + s + K(e, t);
|
|
2758
2798
|
}
|
|
2759
2799
|
if (n instanceof O && n.value === 20) {
|
|
2760
2800
|
if (t >= e.length || !(e[t] instanceof E)) throw Error("cri: network-path reference requires an authority array");
|
|
2761
|
-
let n =
|
|
2801
|
+
let n = en(e[t++]), r = "";
|
|
2762
2802
|
if (t < e.length && e[t] instanceof E) {
|
|
2763
2803
|
let n = e[t++];
|
|
2764
|
-
n.items.length > 0 && (r = "/" +
|
|
2804
|
+
n.items.length > 0 && (r = "/" + q(n).join("/"));
|
|
2765
2805
|
}
|
|
2766
|
-
return "//" + n + r +
|
|
2806
|
+
return "//" + n + r + K(e, t);
|
|
2767
2807
|
}
|
|
2768
2808
|
if (n instanceof O && n.value === 21) {
|
|
2769
2809
|
let n = "/";
|
|
2770
2810
|
if (t < e.length && e[t] instanceof E) {
|
|
2771
2811
|
let r = e[t++];
|
|
2772
|
-
n = "/" +
|
|
2812
|
+
n = "/" + q(r).join("/");
|
|
2773
2813
|
}
|
|
2774
|
-
return n +
|
|
2814
|
+
return n + K(e, t);
|
|
2775
2815
|
}
|
|
2776
|
-
if (n instanceof
|
|
2816
|
+
if (n instanceof g) {
|
|
2777
2817
|
let r = n.value;
|
|
2778
|
-
if (r === 0n) return
|
|
2818
|
+
if (r === 0n) return K(e, t);
|
|
2779
2819
|
let i = r === 1n ? "" : "../".repeat(Number(r) - 1), a;
|
|
2780
2820
|
if (t < e.length && e[t] instanceof E) {
|
|
2781
2821
|
let n = e[t++];
|
|
2782
2822
|
if (n.items.length > 0) {
|
|
2783
|
-
let e =
|
|
2823
|
+
let e = q(n);
|
|
2784
2824
|
a = (r === 1n && e[0].includes(":") ? "./" : i) + e.join("/");
|
|
2785
2825
|
} else a = i === "" ? "./" : i;
|
|
2786
2826
|
} else a = i === "" ? "./" : i;
|
|
2787
|
-
return a +
|
|
2827
|
+
return a + K(e, t);
|
|
2788
2828
|
}
|
|
2789
2829
|
throw Error("cri: unrecognised first element type in CRI array");
|
|
2790
2830
|
}
|
|
2791
|
-
var
|
|
2792
|
-
|
|
2793
|
-
if (e?.appStrings === !1) return super.
|
|
2831
|
+
var an = class extends E {
|
|
2832
|
+
_toCDN(e, t) {
|
|
2833
|
+
if (e?.appStrings === !1) return super._toCDN(e, t);
|
|
2794
2834
|
try {
|
|
2795
|
-
return `${
|
|
2835
|
+
return `${Vt}'${rn(this.items)}'`;
|
|
2796
2836
|
} catch {
|
|
2797
|
-
return super.
|
|
2837
|
+
return super._toCDN(e, t);
|
|
2798
2838
|
}
|
|
2799
2839
|
}
|
|
2800
|
-
},
|
|
2840
|
+
}, on = class extends S {
|
|
2801
2841
|
constructor(e) {
|
|
2802
|
-
super(
|
|
2842
|
+
super(Ht, e);
|
|
2803
2843
|
}
|
|
2804
|
-
|
|
2805
|
-
if (e?.appStrings === !1) return super.
|
|
2844
|
+
_toCDN(e, t) {
|
|
2845
|
+
if (e?.appStrings === !1) return super._toCDN(e, t);
|
|
2806
2846
|
try {
|
|
2807
|
-
return `${
|
|
2847
|
+
return `${U}'${rn(this.content.items)}'`;
|
|
2808
2848
|
} catch {
|
|
2809
|
-
return super.
|
|
2849
|
+
return super._toCDN(e, t);
|
|
2810
2850
|
}
|
|
2811
2851
|
}
|
|
2812
2852
|
};
|
|
2813
|
-
function
|
|
2853
|
+
function sn(e) {
|
|
2814
2854
|
if (e.length !== 1) throw SyntaxError("cri<<...>>: expected exactly one item");
|
|
2815
2855
|
let t = e[0];
|
|
2816
|
-
if (t instanceof
|
|
2817
|
-
if (t instanceof
|
|
2856
|
+
if (t instanceof N) return t.value;
|
|
2857
|
+
if (t instanceof C) return new TextDecoder("utf-8", { fatal: !0 }).decode(t.value);
|
|
2818
2858
|
throw SyntaxError("cri<<...>>: expected a text string or byte string");
|
|
2819
2859
|
}
|
|
2820
|
-
function
|
|
2821
|
-
let n = new
|
|
2822
|
-
return e ===
|
|
2860
|
+
function cn(e, t) {
|
|
2861
|
+
let n = new an(nn(t));
|
|
2862
|
+
return e === U ? new on(n) : n;
|
|
2823
2863
|
}
|
|
2824
|
-
var
|
|
2825
|
-
appStringPrefixes: [
|
|
2826
|
-
tagNumbers: [
|
|
2864
|
+
var ln = {
|
|
2865
|
+
appStringPrefixes: [Vt, U],
|
|
2866
|
+
tagNumbers: [Ht],
|
|
2827
2867
|
parseAppString(e, t) {
|
|
2828
|
-
return
|
|
2868
|
+
return cn(e, t);
|
|
2829
2869
|
},
|
|
2830
2870
|
parseAppSequence(e, t) {
|
|
2831
|
-
return
|
|
2871
|
+
return cn(e, sn(t));
|
|
2832
2872
|
},
|
|
2833
2873
|
parseTag(e, t) {
|
|
2834
|
-
if (e === 99n && t instanceof E) return new
|
|
2874
|
+
if (e === 99n && t instanceof E) return new on(new an(t.items, {
|
|
2835
2875
|
indefiniteLength: t.indefiniteLength,
|
|
2836
2876
|
encodingWidth: t.encodingWidth
|
|
2837
2877
|
}));
|
|
2838
2878
|
}
|
|
2839
|
-
}
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
}
|
|
2845
|
-
function yn(e, t = "") {
|
|
2846
|
-
if (typeof e != "number") {
|
|
2847
|
-
let n = t && `"${t}" `;
|
|
2848
|
-
throw TypeError(`${n}expected number, got ${typeof e}`);
|
|
2849
|
-
}
|
|
2850
|
-
if (!Number.isSafeInteger(e) || e < 0) {
|
|
2851
|
-
let n = t && `"${t}" `;
|
|
2852
|
-
throw RangeError(`${n}expected integer >= 0, got ${e}`);
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
function bn(e, t, n = "") {
|
|
2856
|
-
let r = vn(e), i = e?.length, a = t !== void 0;
|
|
2857
|
-
if (!r || a && i !== t) {
|
|
2858
|
-
let o = n && `"${n}" `, s = a ? ` of length ${t}` : "", c = r ? `length=${i}` : `type=${typeof e}`, l = o + "expected Uint8Array" + s + ", got " + c;
|
|
2859
|
-
throw r ? RangeError(l) : TypeError(l);
|
|
2860
|
-
}
|
|
2861
|
-
return e;
|
|
2862
|
-
}
|
|
2863
|
-
function xn(e, t = !0) {
|
|
2864
|
-
if (e.destroyed) throw Error("Hash instance has been destroyed");
|
|
2865
|
-
if (t && e.finished) throw Error("Hash#digest() has already been called");
|
|
2866
|
-
}
|
|
2867
|
-
function Sn(e, t) {
|
|
2868
|
-
bn(e, void 0, "digestInto() output");
|
|
2869
|
-
let n = t.outputLen;
|
|
2870
|
-
if (e.length < n) throw RangeError("\"digestInto() output\" expected to be of length >=" + n);
|
|
2871
|
-
}
|
|
2872
|
-
function Cn(e) {
|
|
2873
|
-
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
2874
|
-
}
|
|
2875
|
-
function P(...e) {
|
|
2876
|
-
for (let t = 0; t < e.length; t++) e[t].fill(0);
|
|
2877
|
-
}
|
|
2878
|
-
function wn(e) {
|
|
2879
|
-
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
2880
|
-
}
|
|
2881
|
-
function F(e, t) {
|
|
2882
|
-
return e << 32 - t | e >>> t;
|
|
2883
|
-
}
|
|
2884
|
-
function Tn(e, t) {
|
|
2885
|
-
return e << t | e >>> 32 - t >>> 0;
|
|
2886
|
-
}
|
|
2887
|
-
var En = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
2888
|
-
function Dn(e) {
|
|
2889
|
-
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
2890
|
-
}
|
|
2891
|
-
function On(e) {
|
|
2892
|
-
for (let t = 0; t < e.length; t++) e[t] = Dn(e[t]);
|
|
2893
|
-
return e;
|
|
2894
|
-
}
|
|
2895
|
-
var kn = En ? (e) => e : On;
|
|
2896
|
-
typeof Uint8Array.from([]).toHex == "function" && Uint8Array.fromHex;
|
|
2897
|
-
function I(e, t = {}) {
|
|
2898
|
-
let n = (t, n) => e(n).update(t).digest(), r = e(void 0);
|
|
2899
|
-
return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.canXOF = r.canXOF, n.create = (t) => e(t), Object.assign(n, t), Object.freeze(n);
|
|
2900
|
-
}
|
|
2901
|
-
var L = (e) => ({ oid: Uint8Array.from([
|
|
2902
|
-
6,
|
|
2903
|
-
9,
|
|
2904
|
-
96,
|
|
2905
|
-
134,
|
|
2906
|
-
72,
|
|
2907
|
-
1,
|
|
2908
|
-
101,
|
|
2909
|
-
3,
|
|
2910
|
-
4,
|
|
2911
|
-
2,
|
|
2912
|
-
e
|
|
2913
|
-
]) });
|
|
2914
|
-
//#endregion
|
|
2915
|
-
//#region node_modules/@noble/hashes/_md.js
|
|
2916
|
-
function An(e, t, n) {
|
|
2917
|
-
return e & t ^ ~e & n;
|
|
2918
|
-
}
|
|
2919
|
-
function jn(e, t, n) {
|
|
2920
|
-
return e & t ^ e & n ^ t & n;
|
|
2921
|
-
}
|
|
2922
|
-
var Mn = class {
|
|
2923
|
-
blockLen;
|
|
2924
|
-
outputLen;
|
|
2925
|
-
canXOF = !1;
|
|
2926
|
-
padOffset;
|
|
2927
|
-
isLE;
|
|
2928
|
-
buffer;
|
|
2929
|
-
view;
|
|
2930
|
-
finished = !1;
|
|
2931
|
-
length = 0;
|
|
2932
|
-
pos = 0;
|
|
2933
|
-
destroyed = !1;
|
|
2934
|
-
constructor(e, t, n, r) {
|
|
2935
|
-
this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view = wn(this.buffer);
|
|
2936
|
-
}
|
|
2937
|
-
update(e) {
|
|
2938
|
-
xn(this), bn(e);
|
|
2939
|
-
let { view: t, buffer: n, blockLen: r } = this, i = e.length;
|
|
2940
|
-
for (let a = 0; a < i;) {
|
|
2941
|
-
let o = Math.min(r - this.pos, i - a);
|
|
2942
|
-
if (o === r) {
|
|
2943
|
-
let t = wn(e);
|
|
2944
|
-
for (; r <= i - a; a += r) this.process(t, a);
|
|
2945
|
-
continue;
|
|
2946
|
-
}
|
|
2947
|
-
n.set(e.subarray(a, a + o), this.pos), this.pos += o, a += o, this.pos === r && (this.process(t, 0), this.pos = 0);
|
|
2948
|
-
}
|
|
2949
|
-
return this.length += e.length, this.roundClean(), this;
|
|
2950
|
-
}
|
|
2951
|
-
digestInto(e) {
|
|
2952
|
-
xn(this), Sn(e, this), this.finished = !0;
|
|
2953
|
-
let { buffer: t, view: n, blockLen: r, isLE: i } = this, { pos: a } = this;
|
|
2954
|
-
t[a++] = 128, P(this.buffer.subarray(a)), this.padOffset > r - a && (this.process(n, 0), a = 0);
|
|
2955
|
-
for (let e = a; e < r; e++) t[e] = 0;
|
|
2956
|
-
n.setBigUint64(r - 8, BigInt(this.length * 8), i), this.process(n, 0);
|
|
2957
|
-
let o = wn(e), s = this.outputLen;
|
|
2958
|
-
if (s % 4) throw Error("_sha2: outputLen must be aligned to 32bit");
|
|
2959
|
-
let c = s / 4, l = this.get();
|
|
2960
|
-
if (c > l.length) throw Error("_sha2: outputLen bigger than state");
|
|
2961
|
-
for (let e = 0; e < c; e++) o.setUint32(4 * e, l[e], i);
|
|
2962
|
-
}
|
|
2963
|
-
digest() {
|
|
2964
|
-
let { buffer: e, outputLen: t } = this;
|
|
2965
|
-
this.digestInto(e);
|
|
2966
|
-
let n = e.slice(0, t);
|
|
2967
|
-
return this.destroy(), n;
|
|
2968
|
-
}
|
|
2969
|
-
_cloneInto(e) {
|
|
2970
|
-
e ||= new this.constructor(), e.set(...this.get());
|
|
2971
|
-
let { blockLen: t, buffer: n, length: r, finished: i, destroyed: a, pos: o } = this;
|
|
2972
|
-
return e.destroyed = a, e.finished = i, e.length = r, e.pos = o, r % t && e.buffer.set(n), e;
|
|
2973
|
-
}
|
|
2974
|
-
clone() {
|
|
2975
|
-
return this._cloneInto();
|
|
2976
|
-
}
|
|
2977
|
-
}, R = /* @__PURE__ */ Uint32Array.from([
|
|
2978
|
-
1779033703,
|
|
2979
|
-
3144134277,
|
|
2980
|
-
1013904242,
|
|
2981
|
-
2773480762,
|
|
2982
|
-
1359893119,
|
|
2983
|
-
2600822924,
|
|
2984
|
-
528734635,
|
|
2985
|
-
1541459225
|
|
2986
|
-
]), z = /* @__PURE__ */ Uint32Array.from([
|
|
2987
|
-
3418070365,
|
|
2988
|
-
3238371032,
|
|
2989
|
-
1654270250,
|
|
2990
|
-
914150663,
|
|
2991
|
-
2438529370,
|
|
2992
|
-
812702999,
|
|
2993
|
-
355462360,
|
|
2994
|
-
4144912697,
|
|
2995
|
-
1731405415,
|
|
2996
|
-
4290775857,
|
|
2997
|
-
2394180231,
|
|
2998
|
-
1750603025,
|
|
2999
|
-
3675008525,
|
|
3000
|
-
1694076839,
|
|
3001
|
-
1203062813,
|
|
3002
|
-
3204075428
|
|
3003
|
-
]), B = /* @__PURE__ */ Uint32Array.from([
|
|
3004
|
-
1779033703,
|
|
3005
|
-
4089235720,
|
|
3006
|
-
3144134277,
|
|
3007
|
-
2227873595,
|
|
3008
|
-
1013904242,
|
|
3009
|
-
4271175723,
|
|
3010
|
-
2773480762,
|
|
3011
|
-
1595750129,
|
|
3012
|
-
1359893119,
|
|
3013
|
-
2917565137,
|
|
3014
|
-
2600822924,
|
|
3015
|
-
725511199,
|
|
3016
|
-
528734635,
|
|
3017
|
-
4215389547,
|
|
3018
|
-
1541459225,
|
|
3019
|
-
327033209
|
|
3020
|
-
]), Nn = /* @__PURE__ */ BigInt(2 ** 32 - 1), Pn = /* @__PURE__ */ BigInt(32);
|
|
3021
|
-
function Fn(e, t = !1) {
|
|
3022
|
-
return t ? {
|
|
3023
|
-
h: Number(e & Nn),
|
|
3024
|
-
l: Number(e >> Pn & Nn)
|
|
3025
|
-
} : {
|
|
3026
|
-
h: Number(e >> Pn & Nn) | 0,
|
|
3027
|
-
l: Number(e & Nn) | 0
|
|
3028
|
-
};
|
|
3029
|
-
}
|
|
3030
|
-
function In(e, t = !1) {
|
|
3031
|
-
let n = e.length, r = new Uint32Array(n), i = new Uint32Array(n);
|
|
3032
|
-
for (let a = 0; a < n; a++) {
|
|
3033
|
-
let { h: n, l: o } = Fn(e[a], t);
|
|
3034
|
-
[r[a], i[a]] = [n, o];
|
|
3035
|
-
}
|
|
3036
|
-
return [r, i];
|
|
3037
|
-
}
|
|
3038
|
-
var Ln = (e, t, n) => e >>> n, Rn = (e, t, n) => e << 32 - n | t >>> n, V = (e, t, n) => e >>> n | t << 32 - n, H = (e, t, n) => e << 32 - n | t >>> n, zn = (e, t, n) => e << 64 - n | t >>> n - 32, Bn = (e, t, n) => e >>> n - 32 | t << 64 - n, Vn = (e, t, n) => e << n | t >>> 32 - n, Hn = (e, t, n) => t << n | e >>> 32 - n, Un = (e, t, n) => t << n - 32 | e >>> 64 - n, Wn = (e, t, n) => e << n - 32 | t >>> 64 - n;
|
|
3039
|
-
function U(e, t, n, r) {
|
|
3040
|
-
let i = (t >>> 0) + (r >>> 0);
|
|
3041
|
-
return {
|
|
3042
|
-
h: e + n + (i / 2 ** 32 | 0) | 0,
|
|
3043
|
-
l: i | 0
|
|
3044
|
-
};
|
|
3045
|
-
}
|
|
3046
|
-
var Gn = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Kn = (e, t, n, r) => t + n + r + (e / 2 ** 32 | 0) | 0, qn = (e, t, n, r) => (e >>> 0) + (t >>> 0) + (n >>> 0) + (r >>> 0), Jn = (e, t, n, r, i) => t + n + r + i + (e / 2 ** 32 | 0) | 0, Yn = (e, t, n, r, i) => (e >>> 0) + (t >>> 0) + (n >>> 0) + (r >>> 0) + (i >>> 0), Xn = (e, t, n, r, i, a) => t + n + r + i + a + (e / 2 ** 32 | 0) | 0, Zn = /* @__PURE__ */ Uint32Array.from([
|
|
3047
|
-
1116352408,
|
|
3048
|
-
1899447441,
|
|
3049
|
-
3049323471,
|
|
3050
|
-
3921009573,
|
|
3051
|
-
961987163,
|
|
3052
|
-
1508970993,
|
|
3053
|
-
2453635748,
|
|
3054
|
-
2870763221,
|
|
3055
|
-
3624381080,
|
|
3056
|
-
310598401,
|
|
3057
|
-
607225278,
|
|
3058
|
-
1426881987,
|
|
3059
|
-
1925078388,
|
|
3060
|
-
2162078206,
|
|
3061
|
-
2614888103,
|
|
3062
|
-
3248222580,
|
|
3063
|
-
3835390401,
|
|
3064
|
-
4022224774,
|
|
3065
|
-
264347078,
|
|
3066
|
-
604807628,
|
|
3067
|
-
770255983,
|
|
3068
|
-
1249150122,
|
|
3069
|
-
1555081692,
|
|
3070
|
-
1996064986,
|
|
3071
|
-
2554220882,
|
|
3072
|
-
2821834349,
|
|
3073
|
-
2952996808,
|
|
3074
|
-
3210313671,
|
|
3075
|
-
3336571891,
|
|
3076
|
-
3584528711,
|
|
3077
|
-
113926993,
|
|
3078
|
-
338241895,
|
|
3079
|
-
666307205,
|
|
3080
|
-
773529912,
|
|
3081
|
-
1294757372,
|
|
3082
|
-
1396182291,
|
|
3083
|
-
1695183700,
|
|
3084
|
-
1986661051,
|
|
3085
|
-
2177026350,
|
|
3086
|
-
2456956037,
|
|
3087
|
-
2730485921,
|
|
3088
|
-
2820302411,
|
|
3089
|
-
3259730800,
|
|
3090
|
-
3345764771,
|
|
3091
|
-
3516065817,
|
|
3092
|
-
3600352804,
|
|
3093
|
-
4094571909,
|
|
3094
|
-
275423344,
|
|
3095
|
-
430227734,
|
|
3096
|
-
506948616,
|
|
3097
|
-
659060556,
|
|
3098
|
-
883997877,
|
|
3099
|
-
958139571,
|
|
3100
|
-
1322822218,
|
|
3101
|
-
1537002063,
|
|
3102
|
-
1747873779,
|
|
3103
|
-
1955562222,
|
|
3104
|
-
2024104815,
|
|
3105
|
-
2227730452,
|
|
3106
|
-
2361852424,
|
|
3107
|
-
2428436474,
|
|
3108
|
-
2756734187,
|
|
3109
|
-
3204031479,
|
|
3110
|
-
3329325298
|
|
3111
|
-
]), W = /* @__PURE__ */ new Uint32Array(64), Qn = class extends Mn {
|
|
3112
|
-
constructor(e) {
|
|
3113
|
-
super(64, e, 8, !1);
|
|
3114
|
-
}
|
|
3115
|
-
get() {
|
|
3116
|
-
let { A: e, B: t, C: n, D: r, E: i, F: a, G: o, H: s } = this;
|
|
3117
|
-
return [
|
|
3118
|
-
e,
|
|
3119
|
-
t,
|
|
3120
|
-
n,
|
|
3121
|
-
r,
|
|
3122
|
-
i,
|
|
3123
|
-
a,
|
|
3124
|
-
o,
|
|
3125
|
-
s
|
|
3126
|
-
];
|
|
3127
|
-
}
|
|
3128
|
-
set(e, t, n, r, i, a, o, s) {
|
|
3129
|
-
this.A = e | 0, this.B = t | 0, this.C = n | 0, this.D = r | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = s | 0;
|
|
3130
|
-
}
|
|
3131
|
-
process(e, t) {
|
|
3132
|
-
for (let n = 0; n < 16; n++, t += 4) W[n] = e.getUint32(t, !1);
|
|
3133
|
-
for (let e = 16; e < 64; e++) {
|
|
3134
|
-
let t = W[e - 15], n = W[e - 2], r = F(t, 7) ^ F(t, 18) ^ t >>> 3;
|
|
3135
|
-
W[e] = (F(n, 17) ^ F(n, 19) ^ n >>> 10) + W[e - 7] + r + W[e - 16] | 0;
|
|
3136
|
-
}
|
|
3137
|
-
let { A: n, B: r, C: i, D: a, E: o, F: s, G: c, H: l } = this;
|
|
3138
|
-
for (let e = 0; e < 64; e++) {
|
|
3139
|
-
let t = F(o, 6) ^ F(o, 11) ^ F(o, 25), u = l + t + An(o, s, c) + Zn[e] + W[e] | 0, d = (F(n, 2) ^ F(n, 13) ^ F(n, 22)) + jn(n, r, i) | 0;
|
|
3140
|
-
l = c, c = s, s = o, o = a + u | 0, a = i, i = r, r = n, n = u + d | 0;
|
|
3141
|
-
}
|
|
3142
|
-
n = n + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, s = s + this.F | 0, c = c + this.G | 0, l = l + this.H | 0, this.set(n, r, i, a, o, s, c, l);
|
|
3143
|
-
}
|
|
3144
|
-
roundClean() {
|
|
3145
|
-
P(W);
|
|
3146
|
-
}
|
|
3147
|
-
destroy() {
|
|
3148
|
-
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0), P(this.buffer);
|
|
3149
|
-
}
|
|
3150
|
-
}, $n = class extends Qn {
|
|
3151
|
-
A = R[0] | 0;
|
|
3152
|
-
B = R[1] | 0;
|
|
3153
|
-
C = R[2] | 0;
|
|
3154
|
-
D = R[3] | 0;
|
|
3155
|
-
E = R[4] | 0;
|
|
3156
|
-
F = R[5] | 0;
|
|
3157
|
-
G = R[6] | 0;
|
|
3158
|
-
H = R[7] | 0;
|
|
3159
|
-
constructor() {
|
|
3160
|
-
super(32);
|
|
3161
|
-
}
|
|
3162
|
-
}, er = In((/* @__PURE__ */ "0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817".split(".")).map((e) => BigInt(e))), tr = er[0], nr = er[1], G = /* @__PURE__ */ new Uint32Array(80), K = /* @__PURE__ */ new Uint32Array(80), rr = class extends Mn {
|
|
3163
|
-
constructor(e) {
|
|
3164
|
-
super(128, e, 16, !1);
|
|
3165
|
-
}
|
|
3166
|
-
get() {
|
|
3167
|
-
let { Ah: e, Al: t, Bh: n, Bl: r, Ch: i, Cl: a, Dh: o, Dl: s, Eh: c, El: l, Fh: u, Fl: d, Gh: f, Gl: p, Hh: m, Hl: h } = this;
|
|
3168
|
-
return [
|
|
3169
|
-
e,
|
|
3170
|
-
t,
|
|
3171
|
-
n,
|
|
3172
|
-
r,
|
|
3173
|
-
i,
|
|
3174
|
-
a,
|
|
3175
|
-
o,
|
|
3176
|
-
s,
|
|
3177
|
-
c,
|
|
3178
|
-
l,
|
|
3179
|
-
u,
|
|
3180
|
-
d,
|
|
3181
|
-
f,
|
|
3182
|
-
p,
|
|
3183
|
-
m,
|
|
3184
|
-
h
|
|
3185
|
-
];
|
|
3186
|
-
}
|
|
3187
|
-
set(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
3188
|
-
this.Ah = e | 0, this.Al = t | 0, this.Bh = n | 0, this.Bl = r | 0, this.Ch = i | 0, this.Cl = a | 0, this.Dh = o | 0, this.Dl = s | 0, this.Eh = c | 0, this.El = l | 0, this.Fh = u | 0, this.Fl = d | 0, this.Gh = f | 0, this.Gl = p | 0, this.Hh = m | 0, this.Hl = h | 0;
|
|
3189
|
-
}
|
|
3190
|
-
process(e, t) {
|
|
3191
|
-
for (let n = 0; n < 16; n++, t += 4) G[n] = e.getUint32(t), K[n] = e.getUint32(t += 4);
|
|
3192
|
-
for (let e = 16; e < 80; e++) {
|
|
3193
|
-
let t = G[e - 15] | 0, n = K[e - 15] | 0, r = V(t, n, 1) ^ V(t, n, 8) ^ Ln(t, n, 7), i = H(t, n, 1) ^ H(t, n, 8) ^ Rn(t, n, 7), a = G[e - 2] | 0, o = K[e - 2] | 0, s = V(a, o, 19) ^ zn(a, o, 61) ^ Ln(a, o, 6), c = qn(i, H(a, o, 19) ^ Bn(a, o, 61) ^ Rn(a, o, 6), K[e - 7], K[e - 16]);
|
|
3194
|
-
G[e] = Jn(c, r, s, G[e - 7], G[e - 16]) | 0, K[e] = c | 0;
|
|
3195
|
-
}
|
|
3196
|
-
let { Ah: n, Al: r, Bh: i, Bl: a, Ch: o, Cl: s, Dh: c, Dl: l, Eh: u, El: d, Fh: f, Fl: p, Gh: m, Gl: h, Hh: g, Hl: _ } = this;
|
|
3197
|
-
for (let e = 0; e < 80; e++) {
|
|
3198
|
-
let t = V(u, d, 14) ^ V(u, d, 18) ^ zn(u, d, 41), v = H(u, d, 14) ^ H(u, d, 18) ^ Bn(u, d, 41), ee = u & f ^ ~u & m, te = d & p ^ ~d & h, ne = Yn(_, v, te, nr[e], K[e]), re = Xn(ne, g, t, ee, tr[e], G[e]), y = ne | 0, b = V(n, r, 28) ^ zn(n, r, 34) ^ zn(n, r, 39), ie = H(n, r, 28) ^ Bn(n, r, 34) ^ Bn(n, r, 39), x = n & i ^ n & o ^ i & o, ae = r & a ^ r & s ^ a & s;
|
|
3199
|
-
g = m | 0, _ = h | 0, m = f | 0, h = p | 0, f = u | 0, p = d | 0, {h: u, l: d} = U(c | 0, l | 0, re | 0, y | 0), c = o | 0, l = s | 0, o = i | 0, s = a | 0, i = n | 0, a = r | 0;
|
|
3200
|
-
let oe = Gn(y, ie, ae);
|
|
3201
|
-
n = Kn(oe, re, b, x), r = oe | 0;
|
|
3202
|
-
}
|
|
3203
|
-
({h: n, l: r} = U(this.Ah | 0, this.Al | 0, n | 0, r | 0)), {h: i, l: a} = U(this.Bh | 0, this.Bl | 0, i | 0, a | 0), {h: o, l: s} = U(this.Ch | 0, this.Cl | 0, o | 0, s | 0), {h: c, l: l} = U(this.Dh | 0, this.Dl | 0, c | 0, l | 0), {h: u, l: d} = U(this.Eh | 0, this.El | 0, u | 0, d | 0), {h: f, l: p} = U(this.Fh | 0, this.Fl | 0, f | 0, p | 0), {h: m, l: h} = U(this.Gh | 0, this.Gl | 0, m | 0, h | 0), {h: g, l: _} = U(this.Hh | 0, this.Hl | 0, g | 0, _ | 0), this.set(n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _);
|
|
3204
|
-
}
|
|
3205
|
-
roundClean() {
|
|
3206
|
-
P(G, K);
|
|
3207
|
-
}
|
|
3208
|
-
destroy() {
|
|
3209
|
-
this.destroyed = !0, P(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
3210
|
-
}
|
|
3211
|
-
}, ir = class extends rr {
|
|
3212
|
-
Ah = B[0] | 0;
|
|
3213
|
-
Al = B[1] | 0;
|
|
3214
|
-
Bh = B[2] | 0;
|
|
3215
|
-
Bl = B[3] | 0;
|
|
3216
|
-
Ch = B[4] | 0;
|
|
3217
|
-
Cl = B[5] | 0;
|
|
3218
|
-
Dh = B[6] | 0;
|
|
3219
|
-
Dl = B[7] | 0;
|
|
3220
|
-
Eh = B[8] | 0;
|
|
3221
|
-
El = B[9] | 0;
|
|
3222
|
-
Fh = B[10] | 0;
|
|
3223
|
-
Fl = B[11] | 0;
|
|
3224
|
-
Gh = B[12] | 0;
|
|
3225
|
-
Gl = B[13] | 0;
|
|
3226
|
-
Hh = B[14] | 0;
|
|
3227
|
-
Hl = B[15] | 0;
|
|
3228
|
-
constructor() {
|
|
3229
|
-
super(64);
|
|
3230
|
-
}
|
|
3231
|
-
}, ar = class extends rr {
|
|
3232
|
-
Ah = z[0] | 0;
|
|
3233
|
-
Al = z[1] | 0;
|
|
3234
|
-
Bh = z[2] | 0;
|
|
3235
|
-
Bl = z[3] | 0;
|
|
3236
|
-
Ch = z[4] | 0;
|
|
3237
|
-
Cl = z[5] | 0;
|
|
3238
|
-
Dh = z[6] | 0;
|
|
3239
|
-
Dl = z[7] | 0;
|
|
3240
|
-
Eh = z[8] | 0;
|
|
3241
|
-
El = z[9] | 0;
|
|
3242
|
-
Fh = z[10] | 0;
|
|
3243
|
-
Fl = z[11] | 0;
|
|
3244
|
-
Gh = z[12] | 0;
|
|
3245
|
-
Gl = z[13] | 0;
|
|
3246
|
-
Hh = z[14] | 0;
|
|
3247
|
-
Hl = z[15] | 0;
|
|
3248
|
-
constructor() {
|
|
3249
|
-
super(48);
|
|
3250
|
-
}
|
|
3251
|
-
}, q = /* @__PURE__ */ Uint32Array.from([
|
|
3252
|
-
573645204,
|
|
3253
|
-
4230739756,
|
|
3254
|
-
2673172387,
|
|
3255
|
-
3360449730,
|
|
3256
|
-
596883563,
|
|
3257
|
-
1867755857,
|
|
3258
|
-
2520282905,
|
|
3259
|
-
1497426621,
|
|
3260
|
-
2519219938,
|
|
3261
|
-
2827943907,
|
|
3262
|
-
3193839141,
|
|
3263
|
-
1401305490,
|
|
3264
|
-
721525244,
|
|
3265
|
-
746961066,
|
|
3266
|
-
246885852,
|
|
3267
|
-
2177182882
|
|
3268
|
-
]), or = class extends rr {
|
|
3269
|
-
Ah = q[0] | 0;
|
|
3270
|
-
Al = q[1] | 0;
|
|
3271
|
-
Bh = q[2] | 0;
|
|
3272
|
-
Bl = q[3] | 0;
|
|
3273
|
-
Ch = q[4] | 0;
|
|
3274
|
-
Cl = q[5] | 0;
|
|
3275
|
-
Dh = q[6] | 0;
|
|
3276
|
-
Dl = q[7] | 0;
|
|
3277
|
-
Eh = q[8] | 0;
|
|
3278
|
-
El = q[9] | 0;
|
|
3279
|
-
Fh = q[10] | 0;
|
|
3280
|
-
Fl = q[11] | 0;
|
|
3281
|
-
Gh = q[12] | 0;
|
|
3282
|
-
Gl = q[13] | 0;
|
|
3283
|
-
Hh = q[14] | 0;
|
|
3284
|
-
Hl = q[15] | 0;
|
|
3285
|
-
constructor() {
|
|
3286
|
-
super(32);
|
|
3287
|
-
}
|
|
3288
|
-
}, sr = /* @__PURE__ */ I(() => new $n(), /* @__PURE__ */ L(1)), cr = /* @__PURE__ */ I(() => new ir(), /* @__PURE__ */ L(3)), lr = /* @__PURE__ */ I(() => new ar(), /* @__PURE__ */ L(2)), ur = /* @__PURE__ */ I(() => new or(), /* @__PURE__ */ L(6)), dr = BigInt(0), fr = BigInt(1), pr = BigInt(2), mr = BigInt(7), hr = BigInt(256), gr = BigInt(113), _r = [], vr = [], yr = [];
|
|
3289
|
-
for (let e = 0, t = fr, n = 1, r = 0; e < 24; e++) {
|
|
3290
|
-
[n, r] = [r, (2 * n + 3 * r) % 5], _r.push(2 * (5 * r + n)), vr.push((e + 1) * (e + 2) / 2 % 64);
|
|
3291
|
-
let i = dr;
|
|
3292
|
-
for (let e = 0; e < 7; e++) t = (t << fr ^ (t >> mr) * gr) % hr, t & pr && (i ^= fr << (fr << BigInt(e)) - fr);
|
|
3293
|
-
yr.push(i);
|
|
3294
|
-
}
|
|
3295
|
-
var br = In(yr, !0), xr = br[0], Sr = br[1], Cr = (e, t, n) => n > 32 ? Un(e, t, n) : Vn(e, t, n), wr = (e, t, n) => n > 32 ? Wn(e, t, n) : Hn(e, t, n);
|
|
3296
|
-
function Tr(e, t = 24) {
|
|
3297
|
-
if (yn(t, "rounds"), t < 1 || t > 24) throw Error("\"rounds\" expected integer 1..24");
|
|
3298
|
-
let n = new Uint32Array(10);
|
|
3299
|
-
for (let r = 24 - t; r < 24; r++) {
|
|
3300
|
-
for (let t = 0; t < 10; t++) n[t] = e[t] ^ e[t + 10] ^ e[t + 20] ^ e[t + 30] ^ e[t + 40];
|
|
3301
|
-
for (let t = 0; t < 10; t += 2) {
|
|
3302
|
-
let r = (t + 8) % 10, i = (t + 2) % 10, a = n[i], o = n[i + 1], s = Cr(a, o, 1) ^ n[r], c = wr(a, o, 1) ^ n[r + 1];
|
|
3303
|
-
for (let n = 0; n < 50; n += 10) e[t + n] ^= s, e[t + n + 1] ^= c;
|
|
3304
|
-
}
|
|
3305
|
-
let t = e[2], i = e[3];
|
|
3306
|
-
for (let n = 0; n < 24; n++) {
|
|
3307
|
-
let r = vr[n], a = Cr(t, i, r), o = wr(t, i, r), s = _r[n];
|
|
3308
|
-
t = e[s], i = e[s + 1], e[s] = a, e[s + 1] = o;
|
|
3309
|
-
}
|
|
3310
|
-
for (let t = 0; t < 50; t += 10) {
|
|
3311
|
-
let n = e[t], r = e[t + 1], i = e[t + 2], a = e[t + 3];
|
|
3312
|
-
e[t] ^= ~e[t + 2] & e[t + 4], e[t + 1] ^= ~e[t + 3] & e[t + 5], e[t + 2] ^= ~e[t + 4] & e[t + 6], e[t + 3] ^= ~e[t + 5] & e[t + 7], e[t + 4] ^= ~e[t + 6] & e[t + 8], e[t + 5] ^= ~e[t + 7] & e[t + 9], e[t + 6] ^= ~e[t + 8] & n, e[t + 7] ^= ~e[t + 9] & r, e[t + 8] ^= ~n & i, e[t + 9] ^= ~r & a;
|
|
3313
|
-
}
|
|
3314
|
-
e[0] ^= xr[r], e[1] ^= Sr[r];
|
|
3315
|
-
}
|
|
3316
|
-
P(n);
|
|
3317
|
-
}
|
|
3318
|
-
var Er = class e {
|
|
3319
|
-
state;
|
|
3320
|
-
pos = 0;
|
|
3321
|
-
posOut = 0;
|
|
3322
|
-
finished = !1;
|
|
3323
|
-
state32;
|
|
3324
|
-
destroyed = !1;
|
|
3325
|
-
blockLen;
|
|
3326
|
-
suffix;
|
|
3327
|
-
outputLen;
|
|
3328
|
-
canXOF;
|
|
3329
|
-
enableXOF = !1;
|
|
3330
|
-
rounds;
|
|
3331
|
-
constructor(e, t, n, r = !1, i = 24) {
|
|
3332
|
-
if (this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = r, this.canXOF = r, this.rounds = i, yn(n, "outputLen"), !(0 < e && e < 200)) throw Error("only keccak-f1600 function is supported");
|
|
3333
|
-
this.state = new Uint8Array(200), this.state32 = Cn(this.state);
|
|
3334
|
-
}
|
|
3335
|
-
clone() {
|
|
3336
|
-
return this._cloneInto();
|
|
3337
|
-
}
|
|
3338
|
-
keccak() {
|
|
3339
|
-
kn(this.state32), Tr(this.state32, this.rounds), kn(this.state32), this.posOut = 0, this.pos = 0;
|
|
3340
|
-
}
|
|
3341
|
-
update(e) {
|
|
3342
|
-
xn(this), bn(e);
|
|
3343
|
-
let { blockLen: t, state: n } = this, r = e.length;
|
|
3344
|
-
for (let i = 0; i < r;) {
|
|
3345
|
-
let a = Math.min(t - this.pos, r - i);
|
|
3346
|
-
for (let t = 0; t < a; t++) n[this.pos++] ^= e[i++];
|
|
3347
|
-
this.pos === t && this.keccak();
|
|
3348
|
-
}
|
|
3349
|
-
return this;
|
|
3350
|
-
}
|
|
3351
|
-
finish() {
|
|
3352
|
-
if (this.finished) return;
|
|
3353
|
-
this.finished = !0;
|
|
3354
|
-
let { state: e, suffix: t, pos: n, blockLen: r } = this;
|
|
3355
|
-
e[n] ^= t, t & 128 && n === r - 1 && this.keccak(), e[r - 1] ^= 128, this.keccak();
|
|
3356
|
-
}
|
|
3357
|
-
writeInto(e) {
|
|
3358
|
-
xn(this, !1), bn(e), this.finish();
|
|
3359
|
-
let t = this.state, { blockLen: n } = this;
|
|
3360
|
-
for (let r = 0, i = e.length; r < i;) {
|
|
3361
|
-
this.posOut >= n && this.keccak();
|
|
3362
|
-
let a = Math.min(n - this.posOut, i - r);
|
|
3363
|
-
e.set(t.subarray(this.posOut, this.posOut + a), r), this.posOut += a, r += a;
|
|
3364
|
-
}
|
|
3365
|
-
return e;
|
|
3366
|
-
}
|
|
3367
|
-
xofInto(e) {
|
|
3368
|
-
if (!this.enableXOF) throw Error("XOF is not possible for this instance");
|
|
3369
|
-
return this.writeInto(e);
|
|
3370
|
-
}
|
|
3371
|
-
xof(e) {
|
|
3372
|
-
return yn(e), this.xofInto(new Uint8Array(e));
|
|
3373
|
-
}
|
|
3374
|
-
digestInto(e) {
|
|
3375
|
-
if (Sn(e, this), this.finished) throw Error("digest() was already called");
|
|
3376
|
-
this.writeInto(e.subarray(0, this.outputLen)), this.destroy();
|
|
3377
|
-
}
|
|
3378
|
-
digest() {
|
|
3379
|
-
let e = new Uint8Array(this.outputLen);
|
|
3380
|
-
return this.digestInto(e), e;
|
|
3381
|
-
}
|
|
3382
|
-
destroy() {
|
|
3383
|
-
this.destroyed = !0, P(this.state);
|
|
3384
|
-
}
|
|
3385
|
-
_cloneInto(t) {
|
|
3386
|
-
let { blockLen: n, suffix: r, outputLen: i, rounds: a, enableXOF: o } = this;
|
|
3387
|
-
return t ||= new e(n, r, i, o, a), t.blockLen = n, t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = a, t.suffix = r, t.outputLen = i, t.enableXOF = o, t.canXOF = this.canXOF, t.destroyed = this.destroyed, t;
|
|
3388
|
-
}
|
|
3389
|
-
}, Dr = (e, t, n, r = {}) => I((r = {}) => new Er(t, e, r.dkLen === void 0 ? n : r.dkLen, !0), r), Or = /* @__PURE__ */ Dr(31, 168, 32, /* @__PURE__ */ L(11)), kr = /* @__PURE__ */ Dr(31, 136, 64, /* @__PURE__ */ L(12)), Ar = /* @__PURE__ */ Uint32Array.from([
|
|
3390
|
-
1732584193,
|
|
3391
|
-
4023233417,
|
|
3392
|
-
2562383102,
|
|
3393
|
-
271733878,
|
|
3394
|
-
3285377520
|
|
3395
|
-
]), J = /* @__PURE__ */ new Uint32Array(80), jr = class extends Mn {
|
|
3396
|
-
A = Ar[0] | 0;
|
|
3397
|
-
B = Ar[1] | 0;
|
|
3398
|
-
C = Ar[2] | 0;
|
|
3399
|
-
D = Ar[3] | 0;
|
|
3400
|
-
E = Ar[4] | 0;
|
|
3401
|
-
constructor() {
|
|
3402
|
-
super(64, 20, 8, !1);
|
|
3403
|
-
}
|
|
3404
|
-
get() {
|
|
3405
|
-
let { A: e, B: t, C: n, D: r, E: i } = this;
|
|
3406
|
-
return [
|
|
3407
|
-
e,
|
|
3408
|
-
t,
|
|
3409
|
-
n,
|
|
3410
|
-
r,
|
|
3411
|
-
i
|
|
3412
|
-
];
|
|
3413
|
-
}
|
|
3414
|
-
set(e, t, n, r, i) {
|
|
3415
|
-
this.A = e | 0, this.B = t | 0, this.C = n | 0, this.D = r | 0, this.E = i | 0;
|
|
3416
|
-
}
|
|
3417
|
-
process(e, t) {
|
|
3418
|
-
for (let n = 0; n < 16; n++, t += 4) J[n] = e.getUint32(t, !1);
|
|
3419
|
-
for (let e = 16; e < 80; e++) J[e] = Tn(J[e - 3] ^ J[e - 8] ^ J[e - 14] ^ J[e - 16], 1);
|
|
3420
|
-
let { A: n, B: r, C: i, D: a, E: o } = this;
|
|
3421
|
-
for (let e = 0; e < 80; e++) {
|
|
3422
|
-
let t, s;
|
|
3423
|
-
e < 20 ? (t = An(r, i, a), s = 1518500249) : e < 40 ? (t = r ^ i ^ a, s = 1859775393) : e < 60 ? (t = jn(r, i, a), s = 2400959708) : (t = r ^ i ^ a, s = 3395469782);
|
|
3424
|
-
let c = Tn(n, 5) + t + o + s + J[e] | 0;
|
|
3425
|
-
o = a, a = i, i = Tn(r, 30), r = n, n = c;
|
|
3426
|
-
}
|
|
3427
|
-
n = n + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, this.set(n, r, i, a, o);
|
|
3428
|
-
}
|
|
3429
|
-
roundClean() {
|
|
3430
|
-
P(J);
|
|
3431
|
-
}
|
|
3432
|
-
destroy() {
|
|
3433
|
-
this.destroyed = !0, this.set(0, 0, 0, 0, 0), P(this.buffer);
|
|
3434
|
-
}
|
|
3435
|
-
}, Mr = /* @__PURE__ */ I(() => new jr()), Nr = /* @__PURE__ */ Uint8Array.from([
|
|
3436
|
-
7,
|
|
3437
|
-
4,
|
|
3438
|
-
13,
|
|
3439
|
-
1,
|
|
3440
|
-
10,
|
|
3441
|
-
6,
|
|
3442
|
-
15,
|
|
3443
|
-
3,
|
|
3444
|
-
12,
|
|
3445
|
-
0,
|
|
3446
|
-
9,
|
|
3447
|
-
5,
|
|
3448
|
-
2,
|
|
3449
|
-
14,
|
|
3450
|
-
11,
|
|
3451
|
-
8
|
|
3452
|
-
]), Pr = Uint8Array.from(Array(16).fill(0).map((e, t) => t)), Fr = Pr.map((e) => (9 * e + 5) % 16), Ir = /* @__PURE__ */ (() => {
|
|
3453
|
-
let e = [[Pr], [Fr]];
|
|
3454
|
-
for (let t = 0; t < 4; t++) for (let n of e) n.push(n[t].map((e) => Nr[e]));
|
|
3455
|
-
return e;
|
|
3456
|
-
})();
|
|
3457
|
-
Ir[0], Ir[1];
|
|
3458
|
-
//#endregion
|
|
3459
|
-
//#region src/extensions/hash.ts
|
|
3460
|
-
var Lr = new Map([
|
|
3461
|
-
[-14, Mr],
|
|
3462
|
-
[-15, (e) => sr(e).slice(0, 8)],
|
|
3463
|
-
[-16, sr],
|
|
3464
|
-
[-17, ur],
|
|
3465
|
-
[-18, Or],
|
|
3466
|
-
[-43, lr],
|
|
3467
|
-
[-44, cr],
|
|
3468
|
-
[-45, kr]
|
|
3469
|
-
]), Rr = new Map([
|
|
3470
|
-
["SHA-1", -14],
|
|
3471
|
-
["SHA-256/64", -15],
|
|
3472
|
-
["SHA-256", -16],
|
|
3473
|
-
["SHA-512/256", -17],
|
|
3474
|
-
["SHAKE128", -18],
|
|
3475
|
-
["SHA-384", -43],
|
|
3476
|
-
["SHA-512", -44],
|
|
3477
|
-
["SHAKE256", -45]
|
|
3478
|
-
]), zr = new Map([...Rr.entries()].map(([e, t]) => [t, e])), Br = class extends w {
|
|
3479
|
-
_input;
|
|
3480
|
-
_algorithmId;
|
|
3481
|
-
constructor(e, t, n) {
|
|
3482
|
-
super(e), this._input = t, this._algorithmId = n;
|
|
3483
|
-
}
|
|
3484
|
-
_toEDN(e, t) {
|
|
3485
|
-
if (e?.appStrings === !1) return super._toEDN(e, t);
|
|
3486
|
-
let n = this._algorithmId === -16;
|
|
3487
|
-
if (this._input instanceof A && n) return `hash${Ce(this._input.value)}`;
|
|
3488
|
-
let r = this._input instanceof A ? Ce(this._input.value) : ye(this._input.value, e?.bstrEncoding ?? "hex", e?.sqstr);
|
|
3489
|
-
return n ? `hash<<${r}>>` : `hash<<${r}, ${zr.has(this._algorithmId) ? `"${zr.get(this._algorithmId)}"` : String(this._algorithmId)}>>`;
|
|
3490
|
-
}
|
|
3491
|
-
};
|
|
3492
|
-
function Vr(e) {
|
|
3493
|
-
if (e instanceof y || e instanceof b) return Number(e.value);
|
|
3494
|
-
if (e instanceof A) {
|
|
3495
|
-
let t = Rr.get(e.value);
|
|
3496
|
-
if (t === void 0) throw SyntaxError(`hash: unknown algorithm name: ${JSON.stringify(e.value)}`);
|
|
3497
|
-
return t;
|
|
3498
|
-
}
|
|
3499
|
-
throw SyntaxError("hash: algorithm must be an integer or text string");
|
|
3500
|
-
}
|
|
3501
|
-
function Hr(e, t) {
|
|
3502
|
-
let n = e instanceof A ? new TextEncoder().encode(e.value) : e.value, r = Lr.get(t);
|
|
3503
|
-
if (!r) throw SyntaxError(`hash: unsupported COSE algorithm ID ${t}`);
|
|
3504
|
-
return new Br(r(n), e, t);
|
|
3505
|
-
}
|
|
3506
|
-
var Ur = {
|
|
3507
|
-
appStringPrefixes: ["hash"],
|
|
3508
|
-
parseAppString(e, t) {
|
|
3509
|
-
return Hr(new A(t), -16);
|
|
3510
|
-
},
|
|
3511
|
-
parseAppSequence(e, t) {
|
|
3512
|
-
if (t.length === 0 || t.length > 2) throw SyntaxError(`hash<<...>>: expected 1 or 2 items, got ${t.length}`);
|
|
3513
|
-
let n = t[0];
|
|
3514
|
-
if (!(n instanceof A) && !(n instanceof w)) throw SyntaxError("hash: first argument must be a text or byte string");
|
|
3515
|
-
return Hr(n, t.length === 2 ? Vr(t[1]) : -16);
|
|
3516
|
-
}
|
|
3517
|
-
}, Wr = new TextDecoder("utf-8", { fatal: !0 });
|
|
3518
|
-
function Y(e) {
|
|
2879
|
+
}, un = new TextDecoder("utf-8", {
|
|
2880
|
+
fatal: !0,
|
|
2881
|
+
ignoreBOM: !0
|
|
2882
|
+
});
|
|
2883
|
+
function J(e) {
|
|
3519
2884
|
throw Error(`CBOR decode error: ${e}`);
|
|
3520
2885
|
}
|
|
3521
|
-
function
|
|
2886
|
+
function Y(e, t, n) {
|
|
3522
2887
|
if (n <= 23) return {
|
|
3523
2888
|
value: BigInt(n),
|
|
3524
2889
|
nextOffset: t
|
|
3525
2890
|
};
|
|
3526
2891
|
switch (n) {
|
|
3527
|
-
case 24: return t + 1 > e.byteLength &&
|
|
2892
|
+
case 24: return t + 1 > e.byteLength && J("unexpected end of input"), {
|
|
3528
2893
|
value: BigInt(e.getUint8(t)),
|
|
3529
2894
|
nextOffset: t + 1
|
|
3530
2895
|
};
|
|
3531
|
-
case 25: return t + 2 > e.byteLength &&
|
|
2896
|
+
case 25: return t + 2 > e.byteLength && J("unexpected end of input"), {
|
|
3532
2897
|
value: BigInt(e.getUint16(t, !1)),
|
|
3533
2898
|
nextOffset: t + 2
|
|
3534
2899
|
};
|
|
3535
|
-
case 26: return t + 4 > e.byteLength &&
|
|
2900
|
+
case 26: return t + 4 > e.byteLength && J("unexpected end of input"), {
|
|
3536
2901
|
value: BigInt(e.getUint32(t, !1)),
|
|
3537
2902
|
nextOffset: t + 4
|
|
3538
2903
|
};
|
|
3539
|
-
case 27: return t + 8 > e.byteLength &&
|
|
2904
|
+
case 27: return t + 8 > e.byteLength && J("unexpected end of input"), {
|
|
3540
2905
|
value: e.getBigUint64(t, !1),
|
|
3541
2906
|
nextOffset: t + 8
|
|
3542
2907
|
};
|
|
3543
|
-
default:
|
|
2908
|
+
default: J(`reserved additional info value: ${n}`);
|
|
3544
2909
|
}
|
|
3545
2910
|
}
|
|
3546
|
-
function
|
|
3547
|
-
let r = t, i =
|
|
2911
|
+
function X(e, t, n) {
|
|
2912
|
+
let r = t, i = dn(e, t, n);
|
|
3548
2913
|
return i.value.start = r, i.value.end = i.nextOffset, i;
|
|
3549
2914
|
}
|
|
3550
|
-
function
|
|
3551
|
-
t >= e.byteLength &&
|
|
2915
|
+
function dn(e, t, n) {
|
|
2916
|
+
t >= e.byteLength && J("unexpected end of input");
|
|
3552
2917
|
let r = e.getUint8(t++), i = r >> 5, a = r & 31;
|
|
3553
2918
|
switch (i) {
|
|
3554
2919
|
case 0: {
|
|
3555
|
-
let { value: n, nextOffset: r } =
|
|
2920
|
+
let { value: n, nextOffset: r } = Y(e, t, a);
|
|
3556
2921
|
return {
|
|
3557
|
-
value: new
|
|
2922
|
+
value: new g(n),
|
|
3558
2923
|
nextOffset: r
|
|
3559
2924
|
};
|
|
3560
2925
|
}
|
|
3561
2926
|
case 1: {
|
|
3562
|
-
let { value: n, nextOffset: r } =
|
|
2927
|
+
let { value: n, nextOffset: r } = Y(e, t, a);
|
|
3563
2928
|
return {
|
|
3564
|
-
value: new
|
|
2929
|
+
value: new _(-1n - n),
|
|
3565
2930
|
nextOffset: r
|
|
3566
2931
|
};
|
|
3567
2932
|
}
|
|
@@ -3569,21 +2934,21 @@ function Gr(e, t, n) {
|
|
|
3569
2934
|
if (a === 31) {
|
|
3570
2935
|
let r = [], i = t;
|
|
3571
2936
|
for (;;) {
|
|
3572
|
-
if (i >= e.byteLength &&
|
|
2937
|
+
if (i >= e.byteLength && J("unexpected end of indefinite byte string"), e.getUint8(i) === 255) {
|
|
3573
2938
|
i++;
|
|
3574
2939
|
break;
|
|
3575
2940
|
}
|
|
3576
|
-
let t =
|
|
3577
|
-
t.value instanceof
|
|
2941
|
+
let t = X(e, i, n);
|
|
2942
|
+
t.value instanceof C || J("indefinite-length byte string chunk must be a definite byte string"), r.push(t.value), i = t.nextOffset;
|
|
3578
2943
|
}
|
|
3579
2944
|
return {
|
|
3580
|
-
value: new
|
|
2945
|
+
value: new w(r),
|
|
3581
2946
|
nextOffset: i
|
|
3582
2947
|
};
|
|
3583
2948
|
}
|
|
3584
|
-
let { value: r, nextOffset: i } =
|
|
3585
|
-
return i + o > e.byteLength &&
|
|
3586
|
-
value: new
|
|
2949
|
+
let { value: r, nextOffset: i } = Y(e, t, a), o = Number(r);
|
|
2950
|
+
return i + o > e.byteLength && J("byte string extends beyond input"), {
|
|
2951
|
+
value: new C(new Uint8Array(e.buffer, e.byteOffset + i, o).slice()),
|
|
3587
2952
|
nextOffset: i + o
|
|
3588
2953
|
};
|
|
3589
2954
|
}
|
|
@@ -3591,28 +2956,28 @@ function Gr(e, t, n) {
|
|
|
3591
2956
|
if (a === 31) {
|
|
3592
2957
|
let r = [], i = t;
|
|
3593
2958
|
for (;;) {
|
|
3594
|
-
if (i >= e.byteLength &&
|
|
2959
|
+
if (i >= e.byteLength && J("unexpected end of indefinite text string"), e.getUint8(i) === 255) {
|
|
3595
2960
|
i++;
|
|
3596
2961
|
break;
|
|
3597
2962
|
}
|
|
3598
|
-
let t =
|
|
3599
|
-
t.value instanceof
|
|
2963
|
+
let t = X(e, i, n);
|
|
2964
|
+
t.value instanceof N || J("indefinite-length text string chunk must be a definite text string"), r.push(t.value), i = t.nextOffset;
|
|
3600
2965
|
}
|
|
3601
2966
|
return {
|
|
3602
2967
|
value: new T(r),
|
|
3603
2968
|
nextOffset: i
|
|
3604
2969
|
};
|
|
3605
2970
|
}
|
|
3606
|
-
let { value: r, nextOffset: i } =
|
|
3607
|
-
i + o > e.byteLength &&
|
|
2971
|
+
let { value: r, nextOffset: i } = Y(e, t, a), o = Number(r);
|
|
2972
|
+
i + o > e.byteLength && J("text string extends beyond input");
|
|
3608
2973
|
let s = new Uint8Array(e.buffer, e.byteOffset + i, o), c;
|
|
3609
2974
|
try {
|
|
3610
|
-
c =
|
|
2975
|
+
c = un.decode(s);
|
|
3611
2976
|
} catch {
|
|
3612
|
-
|
|
2977
|
+
J("invalid UTF-8 sequence in text string");
|
|
3613
2978
|
}
|
|
3614
2979
|
return {
|
|
3615
|
-
value: new
|
|
2980
|
+
value: new N(c),
|
|
3616
2981
|
nextOffset: i + o
|
|
3617
2982
|
};
|
|
3618
2983
|
}
|
|
@@ -3620,11 +2985,11 @@ function Gr(e, t, n) {
|
|
|
3620
2985
|
if (a === 31) {
|
|
3621
2986
|
let r = [], i = t;
|
|
3622
2987
|
for (;;) {
|
|
3623
|
-
if (i >= e.byteLength &&
|
|
2988
|
+
if (i >= e.byteLength && J("unexpected end of indefinite array"), e.getUint8(i) === 255) {
|
|
3624
2989
|
i++;
|
|
3625
2990
|
break;
|
|
3626
2991
|
}
|
|
3627
|
-
let t =
|
|
2992
|
+
let t = X(e, i, n);
|
|
3628
2993
|
r.push(t.value), i = t.nextOffset;
|
|
3629
2994
|
}
|
|
3630
2995
|
return {
|
|
@@ -3632,9 +2997,9 @@ function Gr(e, t, n) {
|
|
|
3632
2997
|
nextOffset: i
|
|
3633
2998
|
};
|
|
3634
2999
|
}
|
|
3635
|
-
let { value: r, nextOffset: i } =
|
|
3000
|
+
let { value: r, nextOffset: i } = Y(e, t, a), o = Number(r), s = [], c = i;
|
|
3636
3001
|
for (let t = 0; t < o; t++) {
|
|
3637
|
-
let t =
|
|
3002
|
+
let t = X(e, c, n);
|
|
3638
3003
|
s.push(t.value), c = t.nextOffset;
|
|
3639
3004
|
}
|
|
3640
3005
|
return {
|
|
@@ -3646,13 +3011,13 @@ function Gr(e, t, n) {
|
|
|
3646
3011
|
if (a === 31) {
|
|
3647
3012
|
let r = [], i = t;
|
|
3648
3013
|
for (;;) {
|
|
3649
|
-
if (i >= e.byteLength &&
|
|
3014
|
+
if (i >= e.byteLength && J("unexpected end of indefinite map"), e.getUint8(i) === 255) {
|
|
3650
3015
|
i++;
|
|
3651
3016
|
break;
|
|
3652
3017
|
}
|
|
3653
|
-
let t =
|
|
3018
|
+
let t = X(e, i, n);
|
|
3654
3019
|
i = t.nextOffset;
|
|
3655
|
-
let a =
|
|
3020
|
+
let a = X(e, i, n);
|
|
3656
3021
|
i = a.nextOffset, r.push([t.value, a.value]);
|
|
3657
3022
|
}
|
|
3658
3023
|
return {
|
|
@@ -3660,11 +3025,11 @@ function Gr(e, t, n) {
|
|
|
3660
3025
|
nextOffset: i
|
|
3661
3026
|
};
|
|
3662
3027
|
}
|
|
3663
|
-
let { value: r, nextOffset: i } =
|
|
3028
|
+
let { value: r, nextOffset: i } = Y(e, t, a), o = Number(r), s = [], c = i;
|
|
3664
3029
|
for (let t = 0; t < o; t++) {
|
|
3665
|
-
let t =
|
|
3030
|
+
let t = X(e, c, n);
|
|
3666
3031
|
c = t.nextOffset;
|
|
3667
|
-
let r =
|
|
3032
|
+
let r = X(e, c, n);
|
|
3668
3033
|
c = r.nextOffset, s.push([t.value, r.value]);
|
|
3669
3034
|
}
|
|
3670
3035
|
return {
|
|
@@ -3673,9 +3038,9 @@ function Gr(e, t, n) {
|
|
|
3673
3038
|
};
|
|
3674
3039
|
}
|
|
3675
3040
|
case 6: {
|
|
3676
|
-
a === 31 &&
|
|
3677
|
-
let { value: r, nextOffset: i } =
|
|
3678
|
-
for (let e of [...n?.extensions ?? [], ...
|
|
3041
|
+
a === 31 && J("tags cannot use indefinite-length encoding");
|
|
3042
|
+
let { value: r, nextOffset: i } = Y(e, t, a), o = X(e, i, n);
|
|
3043
|
+
for (let e of [...n?.extensions ?? [], ...Z]) if (e.parseTag) {
|
|
3679
3044
|
let t = e.parseTag(r, o.value);
|
|
3680
3045
|
if (t !== void 0) return {
|
|
3681
3046
|
value: t,
|
|
@@ -3683,7 +3048,7 @@ function Gr(e, t, n) {
|
|
|
3683
3048
|
};
|
|
3684
3049
|
}
|
|
3685
3050
|
return {
|
|
3686
|
-
value: new
|
|
3051
|
+
value: new S(r, o.value),
|
|
3687
3052
|
nextOffset: o.nextOffset
|
|
3688
3053
|
};
|
|
3689
3054
|
}
|
|
@@ -3709,50 +3074,49 @@ function Gr(e, t, n) {
|
|
|
3709
3074
|
nextOffset: t
|
|
3710
3075
|
};
|
|
3711
3076
|
if (a === 24) {
|
|
3712
|
-
t + 1 > e.byteLength &&
|
|
3077
|
+
t + 1 > e.byteLength && J("unexpected end of input");
|
|
3713
3078
|
let n = e.getUint8(t);
|
|
3714
|
-
return n < 32 &&
|
|
3079
|
+
return n < 32 && J(`simple value ${n} must be encoded in initial byte (0–31 reserved for extended encoding)`), {
|
|
3715
3080
|
value: new O(n),
|
|
3716
3081
|
nextOffset: t + 1
|
|
3717
3082
|
};
|
|
3718
3083
|
}
|
|
3719
|
-
return a === 25 ? (t + 2 > e.byteLength &&
|
|
3720
|
-
value: new
|
|
3084
|
+
return a === 25 ? (t + 2 > e.byteLength && J("unexpected end of input"), {
|
|
3085
|
+
value: new x(te(e.getUint16(t, !1)), { precision: "half" }),
|
|
3721
3086
|
nextOffset: t + 2
|
|
3722
|
-
}) : a === 26 ? (t + 4 > e.byteLength &&
|
|
3723
|
-
value: new
|
|
3087
|
+
}) : a === 26 ? (t + 4 > e.byteLength && J("unexpected end of input"), {
|
|
3088
|
+
value: new x(e.getFloat32(t, !1), { precision: "single" }),
|
|
3724
3089
|
nextOffset: t + 4
|
|
3725
|
-
}) : a === 27 ? (t + 8 > e.byteLength &&
|
|
3726
|
-
value: new
|
|
3090
|
+
}) : a === 27 ? (t + 8 > e.byteLength && J("unexpected end of input"), {
|
|
3091
|
+
value: new x(e.getFloat64(t, !1), { precision: "double" }),
|
|
3727
3092
|
nextOffset: t + 8
|
|
3728
|
-
}) : (a < 31 &&
|
|
3093
|
+
}) : (a < 31 && J(`reserved additional info value in major type 7: ${a}`), J("unexpected break code outside indefinite-length item"));
|
|
3729
3094
|
}
|
|
3730
|
-
return
|
|
3095
|
+
return J(`unknown major type: ${i}`);
|
|
3731
3096
|
}
|
|
3732
|
-
function
|
|
3097
|
+
function fn(e) {
|
|
3733
3098
|
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return new Uint8Array(e);
|
|
3734
3099
|
if (ArrayBuffer.isView(e)) return new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
3735
3100
|
throw TypeError("expected ArrayBufferView or ArrayBufferLike");
|
|
3736
3101
|
}
|
|
3737
|
-
function
|
|
3738
|
-
let n =
|
|
3102
|
+
function pn(e, t) {
|
|
3103
|
+
let n = fn(e), r = new DataView(n.buffer, n.byteOffset, n.byteLength), i = t?.offset ?? 0;
|
|
3739
3104
|
if (!Number.isInteger(i) || i < 0 || i > r.byteLength) throw RangeError(`CBOR decode offset must be an integer between 0 and ${r.byteLength}`);
|
|
3740
|
-
let { value: a, nextOffset: o } =
|
|
3741
|
-
return !t?.allowTrailing && o !== r.byteLength &&
|
|
3105
|
+
let { value: a, nextOffset: o } = X(r, i, t);
|
|
3106
|
+
return !t?.allowTrailing && o !== r.byteLength && J(`${r.byteLength - o} trailing byte(s) after end of CBOR item`), a;
|
|
3742
3107
|
}
|
|
3743
3108
|
//#endregion
|
|
3744
3109
|
//#region src/extensions/cbordata.ts
|
|
3745
|
-
var
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
Ur,
|
|
3110
|
+
var mn = 24n, Z = [
|
|
3111
|
+
Et,
|
|
3112
|
+
Lt,
|
|
3113
|
+
Bt,
|
|
3114
|
+
ln,
|
|
3751
3115
|
{
|
|
3752
|
-
tagNumbers: [
|
|
3116
|
+
tagNumbers: [mn],
|
|
3753
3117
|
parseTag(e, t) {
|
|
3754
|
-
if (e === 24n && t instanceof
|
|
3755
|
-
return new
|
|
3118
|
+
if (e === 24n && t instanceof C) try {
|
|
3119
|
+
return new S(mn, new k([pn(t.value)]));
|
|
3756
3120
|
} catch {
|
|
3757
3121
|
return;
|
|
3758
3122
|
}
|
|
@@ -3763,23 +3127,23 @@ var Jr = 24n, Yr = [
|
|
|
3763
3127
|
//#region src/js/fromJS.ts
|
|
3764
3128
|
function Q(e, t) {
|
|
3765
3129
|
if (t?.replacer) {
|
|
3766
|
-
let { replacer: n, ...r } = t, i =
|
|
3130
|
+
let { replacer: n, ...r } = t, i = _n(e, n, r.extensions, r.undefinedOmits);
|
|
3767
3131
|
return i === l ? O.UNDEFINED : Q(i, Object.keys(r).length > 0 ? r : void 0);
|
|
3768
3132
|
}
|
|
3769
|
-
return
|
|
3133
|
+
return hn(e, t, !0);
|
|
3770
3134
|
}
|
|
3771
|
-
function
|
|
3772
|
-
for (let n of [...t?.extensions ?? [], ...
|
|
3135
|
+
function hn(e, t, n) {
|
|
3136
|
+
for (let n of [...t?.extensions ?? [], ...Z]) if (n.fromJS) {
|
|
3773
3137
|
let r = n.fromJS(e, t ?? {});
|
|
3774
3138
|
if (r !== void 0) return r;
|
|
3775
3139
|
}
|
|
3776
3140
|
if (n && typeof e == "object" && e && c.symbol in e) {
|
|
3777
|
-
let n = e[c.symbol], r =
|
|
3778
|
-
for (let e of [...t?.extensions ?? [], ...
|
|
3141
|
+
let n = e[c.symbol], r = hn(e, t, !1);
|
|
3142
|
+
for (let e of [...t?.extensions ?? [], ...Z]) if (e.parseTag) {
|
|
3779
3143
|
let t = e.parseTag(n, r);
|
|
3780
3144
|
if (t !== void 0) return t;
|
|
3781
3145
|
}
|
|
3782
|
-
return new
|
|
3146
|
+
return new S(n, r);
|
|
3783
3147
|
}
|
|
3784
3148
|
if (e instanceof c.Null) return O.NULL;
|
|
3785
3149
|
if (e instanceof c.Undefined) return O.UNDEFINED;
|
|
@@ -3788,26 +3152,26 @@ function Xr(e, t, n) {
|
|
|
3788
3152
|
if (e === void 0) return O.UNDEFINED;
|
|
3789
3153
|
if (e === !0) return O.TRUE;
|
|
3790
3154
|
if (e === !1) return O.FALSE;
|
|
3791
|
-
if (typeof e == "bigint") return e > 18446744073709551615n ? new
|
|
3792
|
-
if (typeof e == "number") return (t?.encodeIntegerAs ?? "int") === "int" && Number.isInteger(e) && !Object.is(e, -0) ? e >= 0 ? new
|
|
3793
|
-
if (typeof e == "string") return new
|
|
3794
|
-
if (e instanceof Number || e instanceof Boolean || e instanceof String || Object.prototype.toString.call(e) === "[object BigInt]") return
|
|
3795
|
-
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return new
|
|
3796
|
-
if (ArrayBuffer.isView(e)) return e instanceof Uint8Array && t?.uint8ArrayAs === "array" ? new E(Array.from(e, (e) => new
|
|
3155
|
+
if (typeof e == "bigint") return e > 18446744073709551615n ? new j(e) : e < -18446744073709551616n ? new M(e) : e >= 0n ? new g(e) : new _(e);
|
|
3156
|
+
if (typeof e == "number") return (t?.encodeIntegerAs ?? "int") === "int" && Number.isInteger(e) && !Object.is(e, -0) ? e >= 0 ? new g(BigInt(e)) : new _(BigInt(e)) : new x(e);
|
|
3157
|
+
if (typeof e == "string") return new N(e);
|
|
3158
|
+
if (e instanceof Number || e instanceof Boolean || e instanceof String || Object.prototype.toString.call(e) === "[object BigInt]") return hn(e.valueOf(), t, !1);
|
|
3159
|
+
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return new C(new Uint8Array(e));
|
|
3160
|
+
if (ArrayBuffer.isView(e)) return e instanceof Uint8Array && t?.uint8ArrayAs === "array" ? new E(Array.from(e, (e) => new g(BigInt(e)))) : new C(new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
|
|
3797
3161
|
if (e instanceof $) return new D([...e].map(([e, n]) => [Q(e, t), Q(n, t)]));
|
|
3798
3162
|
if (Array.isArray(e)) return new E(e.map((e) => Q(e, t)));
|
|
3799
3163
|
if (typeof e == "object") {
|
|
3800
3164
|
let n = [];
|
|
3801
|
-
for (let [r, i] of Object.entries(e)) n.push([new
|
|
3165
|
+
for (let [r, i] of Object.entries(e)) n.push([new N(r), Q(i, t)]);
|
|
3802
3166
|
return new D(n);
|
|
3803
3167
|
}
|
|
3804
3168
|
throw TypeError(`fromJS: unsupported value type: ${typeof e}`);
|
|
3805
3169
|
}
|
|
3806
|
-
function
|
|
3170
|
+
function gn(e) {
|
|
3807
3171
|
return ArrayBuffer.isView(e) || e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer || e instanceof Number || e instanceof Boolean || e instanceof String || Object.prototype.toString.call(e) === "[object BigInt]" || e instanceof c.Null || e instanceof c.Undefined || e instanceof u;
|
|
3808
3172
|
}
|
|
3809
|
-
function
|
|
3810
|
-
let i = [...n ?? [], ...
|
|
3173
|
+
function _n(e, t, n, r) {
|
|
3174
|
+
let i = [...n ?? [], ...Z];
|
|
3811
3175
|
function a(e) {
|
|
3812
3176
|
return e === l || r === !0 && e === void 0;
|
|
3813
3177
|
}
|
|
@@ -3817,7 +3181,7 @@ function Qr(e, t, n, r) {
|
|
|
3817
3181
|
if (typeof e != "object" || !e) return e;
|
|
3818
3182
|
if (e instanceof $) return $.from(e, ([e, t]) => [e, r(t)]);
|
|
3819
3183
|
if (Array.isArray(e)) return e.map(r);
|
|
3820
|
-
if (c.symbol in e ||
|
|
3184
|
+
if (c.symbol in e || gn(e) || i.some((t) => t.isJSType?.(e))) return e;
|
|
3821
3185
|
let t = Object.getPrototypeOf(e);
|
|
3822
3186
|
if (t === Object.prototype || t === null) {
|
|
3823
3187
|
let t = e.toJSON;
|
|
@@ -3852,7 +3216,7 @@ function Qr(e, t, n, r) {
|
|
|
3852
3216
|
let r = s(t, String(n), e);
|
|
3853
3217
|
return a(r) ? null : r;
|
|
3854
3218
|
});
|
|
3855
|
-
if (
|
|
3219
|
+
if (gn(e) || i.some((t) => t.isJSType?.(e))) return e;
|
|
3856
3220
|
let t = {};
|
|
3857
3221
|
for (let n of Object.keys(e)) {
|
|
3858
3222
|
let r = s(e[n], n, e);
|
|
@@ -3870,7 +3234,7 @@ var $ = class extends Array {
|
|
|
3870
3234
|
toJSON() {
|
|
3871
3235
|
let e = {};
|
|
3872
3236
|
for (let [t, n] of this) {
|
|
3873
|
-
let r = typeof t == "string" ? t : Q(t).
|
|
3237
|
+
let r = typeof t == "string" ? t : Q(t).toCDN();
|
|
3874
3238
|
r === "__proto__" ? Object.defineProperty(e, r, {
|
|
3875
3239
|
value: n,
|
|
3876
3240
|
writable: !0,
|
|
@@ -3882,6 +3246,6 @@ var $ = class extends Array {
|
|
|
3882
3246
|
}
|
|
3883
3247
|
};
|
|
3884
3248
|
//#endregion
|
|
3885
|
-
export { l as C, n as D, c as E, u as S, t as T,
|
|
3249
|
+
export { l as C, n as D, c as E, u as S, t as T, S as _, Dt as a, g as b, M as c, O as d, D as f, C as g, w as h, pn as i, j as l, T as m, _n as n, N as o, E as p, Q as r, Ue as s, $ as t, k as u, x as v, e as w, d as x, _ as y };
|
|
3886
3250
|
|
|
3887
|
-
//# sourceMappingURL=mapEntries-
|
|
3251
|
+
//# sourceMappingURL=mapEntries-Da-2HMRf.js.map
|