@learncard/vpqr-plugin 1.0.55 → 1.1.1

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.
@@ -22,6 +22,10 @@ var __copyProps = (to, from, except, desc) => {
22
22
  return to;
23
23
  };
24
24
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
29
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
30
  mod
27
31
  ));
@@ -30,6 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
34
  // ../../../node_modules/.pnpm/base32-decode@1.0.0/node_modules/base32-decode/index.js
31
35
  var require_base32_decode = __commonJS({
32
36
  "../../../node_modules/.pnpm/base32-decode@1.0.0/node_modules/base32-decode/index.js"(exports, module2) {
37
+ "use strict";
33
38
  var RFC46482 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
34
39
  var RFC4648_HEX2 = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
35
40
  var CROCKFORD2 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
@@ -79,13 +84,13 @@ var require_base32_decode = __commonJS({
79
84
  });
80
85
 
81
86
  // src/index.ts
82
- var src_exports = {};
83
- __export(src_exports, {
87
+ var index_exports = {};
88
+ __export(index_exports, {
84
89
  getVpqrPlugin: () => getVpqrPlugin
85
90
  });
86
- module.exports = __toCommonJS(src_exports);
91
+ module.exports = __toCommonJS(index_exports);
87
92
 
88
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/is.js
93
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/is.js
89
94
  var typeofs = [
90
95
  "string",
91
96
  "number",
@@ -171,22 +176,33 @@ function getObjectType(value) {
171
176
  }
172
177
  __name(getObjectType, "getObjectType");
173
178
 
174
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/token.js
175
- var Type = class {
179
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/token.js
180
+ var _Type = class _Type {
181
+ /**
182
+ * @param {number} major
183
+ * @param {string} name
184
+ * @param {boolean} terminal
185
+ */
176
186
  constructor(major, name, terminal) {
177
187
  this.major = major;
178
188
  this.majorEncoded = major << 5;
179
189
  this.name = name;
180
190
  this.terminal = terminal;
181
191
  }
192
+ /* c8 ignore next 3 */
182
193
  toString() {
183
194
  return `Type[${this.major}].${this.name}`;
184
195
  }
196
+ /**
197
+ * @param {Type} typ
198
+ * @returns {number}
199
+ */
185
200
  compare(typ) {
186
201
  return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;
187
202
  }
188
203
  };
189
- __name(Type, "Type");
204
+ __name(_Type, "Type");
205
+ var Type = _Type;
190
206
  Type.uint = new Type(0, "uint", true);
191
207
  Type.negint = new Type(1, "negint", true);
192
208
  Type.bytes = new Type(2, "bytes", true);
@@ -200,7 +216,12 @@ Type.true = new Type(7, "true", true);
200
216
  Type.null = new Type(7, "null", true);
201
217
  Type.undefined = new Type(7, "undefined", true);
202
218
  Type.break = new Type(7, "break", true);
203
- var Token = class {
219
+ var _Token = class _Token {
220
+ /**
221
+ * @param {Type} type
222
+ * @param {any} [value]
223
+ * @param {number} [encodedLength]
224
+ */
204
225
  constructor(type, value, encodedLength) {
205
226
  this.type = type;
206
227
  this.value = value;
@@ -208,14 +229,19 @@ var Token = class {
208
229
  this.encodedBytes = void 0;
209
230
  this.byteValue = void 0;
210
231
  }
232
+ /* c8 ignore next 3 */
211
233
  toString() {
212
234
  return `Token[${this.type}].${this.value}`;
213
235
  }
214
236
  };
215
- __name(Token, "Token");
237
+ __name(_Token, "Token");
238
+ var Token = _Token;
216
239
 
217
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/byte-utils.js
218
- var useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === "function";
240
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/byte-utils.js
241
+ var useBuffer = globalThis.process && // @ts-ignore
242
+ !globalThis.process.browser && // @ts-ignore
243
+ globalThis.Buffer && // @ts-ignore
244
+ typeof globalThis.Buffer.isBuffer === "function";
219
245
  var textDecoder = new TextDecoder();
220
246
  var textEncoder = new TextEncoder();
221
247
  function isBuffer2(buf2) {
@@ -229,47 +255,133 @@ function asU8A(buf2) {
229
255
  return isBuffer2(buf2) ? new Uint8Array(buf2.buffer, buf2.byteOffset, buf2.byteLength) : buf2;
230
256
  }
231
257
  __name(asU8A, "asU8A");
232
- var toString = useBuffer ? (bytes, start, end) => {
233
- return end - start > 64 ? globalThis.Buffer.from(bytes.subarray(start, end)).toString("utf8") : utf8Slice(bytes, start, end);
234
- } : (bytes, start, end) => {
235
- return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end);
236
- };
237
- var fromString = useBuffer ? (string) => {
238
- return string.length > 64 ? globalThis.Buffer.from(string) : utf8ToBytes(string);
239
- } : (string) => {
240
- return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string);
241
- };
258
+ var toString = useBuffer ? (
259
+ // eslint-disable-line operator-linebreak
260
+ /**
261
+ * @param {Uint8Array} bytes
262
+ * @param {number} start
263
+ * @param {number} end
264
+ */
265
+ (bytes, start, end) => {
266
+ return end - start > 64 ? (
267
+ // eslint-disable-line operator-linebreak
268
+ // @ts-ignore
269
+ globalThis.Buffer.from(bytes.subarray(start, end)).toString("utf8")
270
+ ) : utf8Slice(bytes, start, end);
271
+ }
272
+ ) : (
273
+ // eslint-disable-line operator-linebreak
274
+ /**
275
+ * @param {Uint8Array} bytes
276
+ * @param {number} start
277
+ * @param {number} end
278
+ */
279
+ (bytes, start, end) => {
280
+ return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end);
281
+ }
282
+ );
283
+ var fromString = useBuffer ? (
284
+ // eslint-disable-line operator-linebreak
285
+ /**
286
+ * @param {string} string
287
+ */
288
+ (string) => {
289
+ return string.length > 64 ? (
290
+ // eslint-disable-line operator-linebreak
291
+ // @ts-ignore
292
+ globalThis.Buffer.from(string)
293
+ ) : utf8ToBytes(string);
294
+ }
295
+ ) : (
296
+ // eslint-disable-line operator-linebreak
297
+ /**
298
+ * @param {string} string
299
+ */
300
+ (string) => {
301
+ return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string);
302
+ }
303
+ );
242
304
  var fromArray = /* @__PURE__ */ __name((arr) => {
243
305
  return Uint8Array.from(arr);
244
306
  }, "fromArray");
245
- var slice = useBuffer ? (bytes, start, end) => {
246
- if (isBuffer2(bytes)) {
247
- return new Uint8Array(bytes.subarray(start, end));
248
- }
249
- return bytes.slice(start, end);
250
- } : (bytes, start, end) => {
251
- return bytes.slice(start, end);
252
- };
253
- var concat = useBuffer ? (chunks, length) => {
254
- chunks = chunks.map((c) => c instanceof Uint8Array ? c : globalThis.Buffer.from(c));
255
- return asU8A(globalThis.Buffer.concat(chunks, length));
256
- } : (chunks, length) => {
257
- const out = new Uint8Array(length);
258
- let off = 0;
259
- for (let b of chunks) {
260
- if (off + b.length > out.length) {
261
- b = b.subarray(0, out.length - off);
262
- }
263
- out.set(b, off);
264
- off += b.length;
265
- }
266
- return out;
267
- };
268
- var alloc = useBuffer ? (size) => {
269
- return globalThis.Buffer.allocUnsafe(size);
270
- } : (size) => {
271
- return new Uint8Array(size);
272
- };
307
+ var slice = useBuffer ? (
308
+ // eslint-disable-line operator-linebreak
309
+ /**
310
+ * @param {Uint8Array} bytes
311
+ * @param {number} start
312
+ * @param {number} end
313
+ */
314
+ (bytes, start, end) => {
315
+ if (isBuffer2(bytes)) {
316
+ return new Uint8Array(bytes.subarray(start, end));
317
+ }
318
+ return bytes.slice(start, end);
319
+ }
320
+ ) : (
321
+ // eslint-disable-line operator-linebreak
322
+ /**
323
+ * @param {Uint8Array} bytes
324
+ * @param {number} start
325
+ * @param {number} end
326
+ */
327
+ (bytes, start, end) => {
328
+ return bytes.slice(start, end);
329
+ }
330
+ );
331
+ var concat = useBuffer ? (
332
+ // eslint-disable-line operator-linebreak
333
+ /**
334
+ * @param {Uint8Array[]} chunks
335
+ * @param {number} length
336
+ * @returns {Uint8Array}
337
+ */
338
+ (chunks, length) => {
339
+ chunks = chunks.map((c) => c instanceof Uint8Array ? c : (
340
+ // eslint-disable-line operator-linebreak
341
+ // @ts-ignore
342
+ globalThis.Buffer.from(c)
343
+ ));
344
+ return asU8A(globalThis.Buffer.concat(chunks, length));
345
+ }
346
+ ) : (
347
+ // eslint-disable-line operator-linebreak
348
+ /**
349
+ * @param {Uint8Array[]} chunks
350
+ * @param {number} length
351
+ * @returns {Uint8Array}
352
+ */
353
+ (chunks, length) => {
354
+ const out = new Uint8Array(length);
355
+ let off = 0;
356
+ for (let b of chunks) {
357
+ if (off + b.length > out.length) {
358
+ b = b.subarray(0, out.length - off);
359
+ }
360
+ out.set(b, off);
361
+ off += b.length;
362
+ }
363
+ return out;
364
+ }
365
+ );
366
+ var alloc = useBuffer ? (
367
+ // eslint-disable-line operator-linebreak
368
+ /**
369
+ * @param {number} size
370
+ * @returns {Uint8Array}
371
+ */
372
+ (size) => {
373
+ return globalThis.Buffer.allocUnsafe(size);
374
+ }
375
+ ) : (
376
+ // eslint-disable-line operator-linebreak
377
+ /**
378
+ * @param {number} size
379
+ * @returns {Uint8Array}
380
+ */
381
+ (size) => {
382
+ return new Uint8Array(size);
383
+ }
384
+ );
273
385
  function compare(b1, b2) {
274
386
  if (isBuffer2(b1) && isBuffer2(b2)) {
275
387
  return b1.compare(b2);
@@ -385,9 +497,12 @@ function decodeCodePointsArray(codePoints) {
385
497
  }
386
498
  __name(decodeCodePointsArray, "decodeCodePointsArray");
387
499
 
388
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/bl.js
500
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/bl.js
389
501
  var defaultChunkSize = 256;
390
- var Bl = class {
502
+ var _Bl = class _Bl {
503
+ /**
504
+ * @param {number} [chunkSize]
505
+ */
391
506
  constructor(chunkSize = defaultChunkSize) {
392
507
  this.chunkSize = chunkSize;
393
508
  this.cursor = 0;
@@ -406,6 +521,9 @@ var Bl = class {
406
521
  this.maxCursor = this._initReuseChunk.length - 1;
407
522
  }
408
523
  }
524
+ /**
525
+ * @param {Uint8Array|number[]} bytes
526
+ */
409
527
  push(bytes) {
410
528
  let topChunk = this.chunks[this.chunks.length - 1];
411
529
  const newMax = this.cursor + bytes.length;
@@ -435,6 +553,10 @@ var Bl = class {
435
553
  }
436
554
  this.cursor += bytes.length;
437
555
  }
556
+ /**
557
+ * @param {boolean} [reset]
558
+ * @returns {Uint8Array}
559
+ */
438
560
  toBytes(reset = false) {
439
561
  let byts;
440
562
  if (this.chunks.length === 1) {
@@ -455,9 +577,10 @@ var Bl = class {
455
577
  return byts;
456
578
  }
457
579
  };
458
- __name(Bl, "Bl");
580
+ __name(_Bl, "Bl");
581
+ var Bl = _Bl;
459
582
 
460
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/common.js
583
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/common.js
461
584
  var decodeErrPrefix = "CBOR decode error:";
462
585
  var encodeErrPrefix = "CBOR encode error:";
463
586
  var uintMinorPrefixBytes = [];
@@ -473,7 +596,7 @@ function assertEnoughData(data, pos, need) {
473
596
  }
474
597
  __name(assertEnoughData, "assertEnoughData");
475
598
 
476
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/0uint.js
599
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/0uint.js
477
600
  var uintBoundaries = [24, 256, 65536, 4294967296, BigInt("18446744073709551616")];
478
601
  function readUint8(data, offset, options) {
479
602
  assertEnoughData(data, offset, 1);
@@ -598,10 +721,13 @@ encodeUintValue.encodedSize = /* @__PURE__ */ __name(function encodedSize2(uint)
598
721
  return 9;
599
722
  }, "encodedSize");
600
723
  encodeUint.compareTokens = /* @__PURE__ */ __name(function compareTokens(tok1, tok2) {
601
- return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0;
724
+ return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : (
725
+ /* c8 ignore next */
726
+ 0
727
+ );
602
728
  }, "compareTokens");
603
729
 
604
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/1negint.js
730
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/1negint.js
605
731
  function decodeNegint8(data, pos, _minor, options) {
606
732
  return new Token(Type.negint, -1 - readUint8(data, pos + 1, options), 2);
607
733
  }
@@ -654,10 +780,13 @@ encodeNegint.encodedSize = /* @__PURE__ */ __name(function encodedSize3(token) {
654
780
  return 9;
655
781
  }, "encodedSize");
656
782
  encodeNegint.compareTokens = /* @__PURE__ */ __name(function compareTokens2(tok1, tok2) {
657
- return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : 0;
783
+ return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : (
784
+ /* c8 ignore next */
785
+ 0
786
+ );
658
787
  }, "compareTokens");
659
788
 
660
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/2bytes.js
789
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/2bytes.js
661
790
  function toToken(data, pos, prefix, length) {
662
791
  assertEnoughData(data, pos, prefix + length);
663
792
  const buf2 = slice(data, pos + prefix, pos + prefix + length);
@@ -713,7 +842,7 @@ function compareBytes(b1, b2) {
713
842
  }
714
843
  __name(compareBytes, "compareBytes");
715
844
 
716
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/3string.js
845
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/3string.js
717
846
  function toToken2(data, pos, prefix, length, options) {
718
847
  const totLength = prefix + length;
719
848
  assertEnoughData(data, pos, totLength);
@@ -750,7 +879,7 @@ function decodeString64(data, pos, _minor, options) {
750
879
  __name(decodeString64, "decodeString64");
751
880
  var encodeString = encodeBytes;
752
881
 
753
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/4array.js
882
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/4array.js
754
883
  function toToken3(_data, _pos, prefix, length) {
755
884
  return new Token(Type.array, length, prefix);
756
885
  }
@@ -795,7 +924,7 @@ encodeArray.encodedSize = /* @__PURE__ */ __name(function encodedSize5(token) {
795
924
  return encodeUintValue.encodedSize(token.value);
796
925
  }, "encodedSize");
797
926
 
798
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/5map.js
927
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/5map.js
799
928
  function toToken4(_data, _pos, prefix, length) {
800
929
  return new Token(Type.map, length, prefix);
801
930
  }
@@ -840,7 +969,7 @@ encodeMap.encodedSize = /* @__PURE__ */ __name(function encodedSize6(token) {
840
969
  return encodeUintValue.encodedSize(token.value);
841
970
  }, "encodedSize");
842
971
 
843
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/6tag.js
972
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/6tag.js
844
973
  function decodeTagCompact(_data, _pos, minor, _options) {
845
974
  return new Token(Type.tag, minor, 1);
846
975
  }
@@ -870,7 +999,7 @@ encodeTag.encodedSize = /* @__PURE__ */ __name(function encodedSize7(token) {
870
999
  return encodeUintValue.encodedSize(token.value);
871
1000
  }, "encodedSize");
872
1001
 
873
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/7float.js
1002
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/7float.js
874
1003
  var MINOR_FALSE = 20;
875
1004
  var MINOR_TRUE = 21;
876
1005
  var MINOR_NULL = 22;
@@ -997,7 +1126,8 @@ function encodeFloat16(inp) {
997
1126
  if (logicalExponent < -24) {
998
1127
  dataView.setUint16(0, 0);
999
1128
  } else if (logicalExponent < -14) {
1000
- dataView.setUint16(0, (valu32 & 2147483648) >> 16 | 1 << 24 + logicalExponent, false);
1129
+ dataView.setUint16(0, (valu32 & 2147483648) >> 16 | /* sign bit */
1130
+ 1 << 24 + logicalExponent, false);
1001
1131
  } else {
1002
1132
  dataView.setUint16(0, (valu32 & 2147483648) >> 16 | logicalExponent + 15 << 10 | mantissa >> 13, false);
1003
1133
  }
@@ -1058,7 +1188,7 @@ function readFloat64(ui8a2, pos) {
1058
1188
  __name(readFloat64, "readFloat64");
1059
1189
  encodeFloat.compareTokens = encodeUint.compareTokens;
1060
1190
 
1061
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/jump.js
1191
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/jump.js
1062
1192
  function invalidMinor(data, pos, minor) {
1063
1193
  throw new Error(`${decodeErrPrefix} encountered invalid minor (${minor}) for major ${data[pos] >>> 5}`);
1064
1194
  }
@@ -1217,12 +1347,17 @@ function quickEncodeToken(token) {
1217
1347
  }
1218
1348
  __name(quickEncodeToken, "quickEncodeToken");
1219
1349
 
1220
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/encode.js
1350
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/encode.js
1221
1351
  var defaultEncodeOptions = {
1222
1352
  float64: false,
1223
1353
  mapSorter,
1224
1354
  quickEncodeToken
1225
1355
  };
1356
+ var rfc8949EncodeOptions = Object.freeze({
1357
+ float64: true,
1358
+ mapSorter: rfc8949MapSorter,
1359
+ quickEncodeToken
1360
+ });
1226
1361
  function makeCborEncoders() {
1227
1362
  const encoders = [];
1228
1363
  encoders[Type.uint.major] = encodeUint;
@@ -1238,11 +1373,19 @@ function makeCborEncoders() {
1238
1373
  __name(makeCborEncoders, "makeCborEncoders");
1239
1374
  var cborEncoders = makeCborEncoders();
1240
1375
  var buf = new Bl();
1241
- var Ref = class {
1376
+ var _Ref = class _Ref {
1377
+ /**
1378
+ * @param {object|any[]} obj
1379
+ * @param {Reference|undefined} parent
1380
+ */
1242
1381
  constructor(obj, parent) {
1243
1382
  this.obj = obj;
1244
1383
  this.parent = parent;
1245
1384
  }
1385
+ /**
1386
+ * @param {object|any[]} obj
1387
+ * @returns {boolean}
1388
+ */
1246
1389
  includes(obj) {
1247
1390
  let p = this;
1248
1391
  do {
@@ -1252,14 +1395,20 @@ var Ref = class {
1252
1395
  } while (p = p.parent);
1253
1396
  return false;
1254
1397
  }
1398
+ /**
1399
+ * @param {Reference|undefined} stack
1400
+ * @param {object|any[]} obj
1401
+ * @returns {Reference}
1402
+ */
1255
1403
  static createCheck(stack, obj) {
1256
1404
  if (stack && stack.includes(obj)) {
1257
1405
  throw new Error(`${encodeErrPrefix} object contains circular references`);
1258
1406
  }
1259
- return new Ref(obj, stack);
1407
+ return new _Ref(obj, stack);
1260
1408
  }
1261
1409
  };
1262
- __name(Ref, "Ref");
1410
+ __name(_Ref, "Ref");
1411
+ var Ref = _Ref;
1263
1412
  var simpleTokens = {
1264
1413
  null: new Token(Type.null, null),
1265
1414
  undefined: new Token(Type.undefined, void 0),
@@ -1269,6 +1418,13 @@ var simpleTokens = {
1269
1418
  emptyMap: new Token(Type.map, 0)
1270
1419
  };
1271
1420
  var typeEncoders = {
1421
+ /**
1422
+ * @param {any} obj
1423
+ * @param {string} _typ
1424
+ * @param {EncodeOptions} _options
1425
+ * @param {Reference} [_refStack]
1426
+ * @returns {TokenOrNestedTokens}
1427
+ */
1272
1428
  number(obj, _typ, _options, _refStack) {
1273
1429
  if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) {
1274
1430
  return new Token(Type.float, obj);
@@ -1278,6 +1434,13 @@ var typeEncoders = {
1278
1434
  return new Token(Type.negint, obj);
1279
1435
  }
1280
1436
  },
1437
+ /**
1438
+ * @param {any} obj
1439
+ * @param {string} _typ
1440
+ * @param {EncodeOptions} _options
1441
+ * @param {Reference} [_refStack]
1442
+ * @returns {TokenOrNestedTokens}
1443
+ */
1281
1444
  bigint(obj, _typ, _options, _refStack) {
1282
1445
  if (obj >= BigInt(0)) {
1283
1446
  return new Token(Type.uint, obj);
@@ -1285,27 +1448,83 @@ var typeEncoders = {
1285
1448
  return new Token(Type.negint, obj);
1286
1449
  }
1287
1450
  },
1451
+ /**
1452
+ * @param {any} obj
1453
+ * @param {string} _typ
1454
+ * @param {EncodeOptions} _options
1455
+ * @param {Reference} [_refStack]
1456
+ * @returns {TokenOrNestedTokens}
1457
+ */
1288
1458
  Uint8Array(obj, _typ, _options, _refStack) {
1289
1459
  return new Token(Type.bytes, obj);
1290
1460
  },
1461
+ /**
1462
+ * @param {any} obj
1463
+ * @param {string} _typ
1464
+ * @param {EncodeOptions} _options
1465
+ * @param {Reference} [_refStack]
1466
+ * @returns {TokenOrNestedTokens}
1467
+ */
1291
1468
  string(obj, _typ, _options, _refStack) {
1292
1469
  return new Token(Type.string, obj);
1293
1470
  },
1471
+ /**
1472
+ * @param {any} obj
1473
+ * @param {string} _typ
1474
+ * @param {EncodeOptions} _options
1475
+ * @param {Reference} [_refStack]
1476
+ * @returns {TokenOrNestedTokens}
1477
+ */
1294
1478
  boolean(obj, _typ, _options, _refStack) {
1295
1479
  return obj ? simpleTokens.true : simpleTokens.false;
1296
1480
  },
1481
+ /**
1482
+ * @param {any} _obj
1483
+ * @param {string} _typ
1484
+ * @param {EncodeOptions} _options
1485
+ * @param {Reference} [_refStack]
1486
+ * @returns {TokenOrNestedTokens}
1487
+ */
1297
1488
  null(_obj, _typ, _options, _refStack) {
1298
1489
  return simpleTokens.null;
1299
1490
  },
1491
+ /**
1492
+ * @param {any} _obj
1493
+ * @param {string} _typ
1494
+ * @param {EncodeOptions} _options
1495
+ * @param {Reference} [_refStack]
1496
+ * @returns {TokenOrNestedTokens}
1497
+ */
1300
1498
  undefined(_obj, _typ, _options, _refStack) {
1301
1499
  return simpleTokens.undefined;
1302
1500
  },
1501
+ /**
1502
+ * @param {any} obj
1503
+ * @param {string} _typ
1504
+ * @param {EncodeOptions} _options
1505
+ * @param {Reference} [_refStack]
1506
+ * @returns {TokenOrNestedTokens}
1507
+ */
1303
1508
  ArrayBuffer(obj, _typ, _options, _refStack) {
1304
1509
  return new Token(Type.bytes, new Uint8Array(obj));
1305
1510
  },
1511
+ /**
1512
+ * @param {any} obj
1513
+ * @param {string} _typ
1514
+ * @param {EncodeOptions} _options
1515
+ * @param {Reference} [_refStack]
1516
+ * @returns {TokenOrNestedTokens}
1517
+ */
1306
1518
  DataView(obj, _typ, _options, _refStack) {
1307
1519
  return new Token(Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));
1308
1520
  },
1521
+ /**
1522
+ * @param {any} obj
1523
+ * @param {string} _typ
1524
+ * @param {EncodeOptions} options
1525
+ * @param {Reference} [refStack]
1526
+ * @returns {TokenOrNestedTokens}
1527
+ */
1309
1528
  Array(obj, _typ, options, refStack) {
1310
1529
  if (!obj.length) {
1311
1530
  if (options.addBreakTokens === true) {
@@ -1324,6 +1543,13 @@ var typeEncoders = {
1324
1543
  }
1325
1544
  return [new Token(Type.array, obj.length), entries];
1326
1545
  },
1546
+ /**
1547
+ * @param {any} obj
1548
+ * @param {string} typ
1549
+ * @param {EncodeOptions} options
1550
+ * @param {Reference} [refStack]
1551
+ * @returns {TokenOrNestedTokens}
1552
+ */
1327
1553
  Object(obj, typ, options, refStack) {
1328
1554
  const isMap = typ !== "Object";
1329
1555
  const keys = isMap ? obj.keys() : Object.keys(obj);
@@ -1357,7 +1583,8 @@ for (const typ of "Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt6
1357
1583
  }
1358
1584
  function objectToTokens(obj, options = {}, refStack) {
1359
1585
  const typ = is(obj);
1360
- const customTypeEncoder = options && options.typeEncoders && options.typeEncoders[typ] || typeEncoders[typ];
1586
+ const customTypeEncoder = options && options.typeEncoders && /** @type {OptionalTypeEncoder} */
1587
+ options.typeEncoders[typ] || typeEncoders[typ];
1361
1588
  if (typeof customTypeEncoder === "function") {
1362
1589
  const tokens = customTypeEncoder(obj, typ, options, refStack);
1363
1590
  if (tokens != null) {
@@ -1391,6 +1618,31 @@ function mapSorter(e1, e2) {
1391
1618
  return tcmp;
1392
1619
  }
1393
1620
  __name(mapSorter, "mapSorter");
1621
+ function rfc8949MapSorter(e1, e2) {
1622
+ if (e1[0] instanceof Token && e2[0] instanceof Token) {
1623
+ const t1 = (
1624
+ /** @type {TokenEx} */
1625
+ e1[0]
1626
+ );
1627
+ const t2 = (
1628
+ /** @type {TokenEx} */
1629
+ e2[0]
1630
+ );
1631
+ if (!t1._keyBytes) {
1632
+ t1._keyBytes = encodeRfc8949(t1.value);
1633
+ }
1634
+ if (!t2._keyBytes) {
1635
+ t2._keyBytes = encodeRfc8949(t2.value);
1636
+ }
1637
+ return compare(t1._keyBytes, t2._keyBytes);
1638
+ }
1639
+ throw new Error("rfc8949MapSorter: complex key types are not supported yet");
1640
+ }
1641
+ __name(rfc8949MapSorter, "rfc8949MapSorter");
1642
+ function encodeRfc8949(data) {
1643
+ return encodeCustom(data, cborEncoders, rfc8949EncodeOptions);
1644
+ }
1645
+ __name(encodeRfc8949, "encodeRfc8949");
1394
1646
  function tokensToEncoded(buf2, tokens, encoders, options) {
1395
1647
  if (Array.isArray(tokens)) {
1396
1648
  for (const token of tokens) {
@@ -1430,14 +1682,18 @@ function encode(data, options) {
1430
1682
  }
1431
1683
  __name(encode, "encode");
1432
1684
 
1433
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/decode.js
1685
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/decode.js
1434
1686
  var defaultDecodeOptions = {
1435
1687
  strict: false,
1436
1688
  allowIndefinite: true,
1437
1689
  allowUndefined: true,
1438
1690
  allowBigInt: true
1439
1691
  };
1440
- var Tokeniser = class {
1692
+ var _Tokeniser = class _Tokeniser {
1693
+ /**
1694
+ * @param {Uint8Array} data
1695
+ * @param {DecodeOptions} options
1696
+ */
1441
1697
  constructor(data, options = {}) {
1442
1698
  this._pos = 0;
1443
1699
  this.data = data;
@@ -1464,9 +1720,10 @@ var Tokeniser = class {
1464
1720
  return token;
1465
1721
  }
1466
1722
  };
1467
- __name(Tokeniser, "Tokeniser");
1468
- var DONE = Symbol.for("DONE");
1469
- var BREAK = Symbol.for("BREAK");
1723
+ __name(_Tokeniser, "Tokeniser");
1724
+ var Tokeniser = _Tokeniser;
1725
+ var DONE = /* @__PURE__ */ Symbol.for("DONE");
1726
+ var BREAK = /* @__PURE__ */ Symbol.for("BREAK");
1470
1727
  function tokenToArray(token, tokeniser, options) {
1471
1728
  const arr = [];
1472
1729
  for (let i = 0; i < token.value; i++) {
@@ -1574,7 +1831,7 @@ function decode(data, options) {
1574
1831
  __name(decode, "decode");
1575
1832
 
1576
1833
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/CborldError.js
1577
- var CborldError = class extends Error {
1834
+ var _CborldError = class _CborldError extends Error {
1578
1835
  constructor(value, message) {
1579
1836
  super();
1580
1837
  this.message = message;
@@ -1583,14 +1840,18 @@ var CborldError = class extends Error {
1583
1840
  this.name = this.constructor.name;
1584
1841
  }
1585
1842
  };
1586
- __name(CborldError, "CborldError");
1843
+ __name(_CborldError, "CborldError");
1844
+ var CborldError = _CborldError;
1587
1845
 
1588
1846
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/keywords.js
1589
1847
  var KEYWORDS = /* @__PURE__ */ new Map([
1848
+ // ordered is important, do not change
1590
1849
  ["@context", 0],
1591
1850
  ["@type", 2],
1592
1851
  ["@id", 4],
1593
1852
  ["@value", 6],
1853
+ // alphabetized after `@context`, `@type`, `@id`, `@value`
1854
+ // IDs <= 24 represented with 1 byte, IDs > 24 use 2+ bytes
1594
1855
  ["@direction", 8],
1595
1856
  ["@graph", 10],
1596
1857
  ["@included", 12],
@@ -1600,6 +1861,7 @@ var KEYWORDS = /* @__PURE__ */ new Map([
1600
1861
  ["@list", 20],
1601
1862
  ["@nest", 22],
1602
1863
  ["@reverse", 24],
1864
+ // TODO: remove these? these only appear in frames and contexts
1603
1865
  ["@base", 26],
1604
1866
  ["@container", 28],
1605
1867
  ["@default", 30],
@@ -1618,15 +1880,18 @@ var KEYWORDS = /* @__PURE__ */ new Map([
1618
1880
  var FIRST_CUSTOM_TERM_ID = 100;
1619
1881
 
1620
1882
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/CborldDecoder.js
1621
- var CborldDecoder = class {
1883
+ var _CborldDecoder = class _CborldDecoder {
1884
+ // eslint-disable-next-line no-unused-vars
1622
1885
  decode({ value } = {}) {
1623
1886
  throw new Error("Must be implemented by derived class.");
1624
1887
  }
1888
+ // eslint-disable-next-line no-unused-vars
1625
1889
  static createDecoder({ value, transformer } = {}) {
1626
1890
  throw new Error("Must be implemented by derived class.");
1627
1891
  }
1628
1892
  };
1629
- __name(CborldDecoder, "CborldDecoder");
1893
+ __name(_CborldDecoder, "CborldDecoder");
1894
+ var CborldDecoder = _CborldDecoder;
1630
1895
 
1631
1896
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/registeredContexts.js
1632
1897
  var ID_TO_URL = /* @__PURE__ */ new Map();
@@ -1659,7 +1924,7 @@ function _addRegistration(id, url) {
1659
1924
  __name(_addRegistration, "_addRegistration");
1660
1925
 
1661
1926
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/ContextDecoder.js
1662
- var ContextDecoder = class extends CborldDecoder {
1927
+ var _ContextDecoder = class _ContextDecoder extends CborldDecoder {
1663
1928
  constructor({ reverseAppContextMap } = {}) {
1664
1929
  super();
1665
1930
  this.reverseAppContextMap = reverseAppContextMap;
@@ -1679,10 +1944,11 @@ var ContextDecoder = class extends CborldDecoder {
1679
1944
  }
1680
1945
  static createDecoder({ transformer } = {}) {
1681
1946
  const { reverseAppContextMap } = transformer;
1682
- return new ContextDecoder({ reverseAppContextMap });
1947
+ return new _ContextDecoder({ reverseAppContextMap });
1683
1948
  }
1684
1949
  };
1685
- __name(ContextDecoder, "ContextDecoder");
1950
+ __name(_ContextDecoder, "ContextDecoder");
1951
+ var ContextDecoder = _ContextDecoder;
1686
1952
  function _mapToObject(map) {
1687
1953
  if (Array.isArray(map)) {
1688
1954
  return map.map(_mapToObject);
@@ -1704,8 +1970,8 @@ function inspect(data, options) {
1704
1970
  }
1705
1971
  __name(inspect, "inspect");
1706
1972
 
1707
- // ../../../node_modules/.pnpm/js-base64@3.7.7/node_modules/js-base64/base64.mjs
1708
- var version = "3.7.7";
1973
+ // ../../../node_modules/.pnpm/js-base64@3.7.8/node_modules/js-base64/base64.mjs
1974
+ var version = "3.7.8";
1709
1975
  var VERSION = version;
1710
1976
  var _hasBuffer = typeof Buffer === "function";
1711
1977
  var _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0;
@@ -1775,12 +2041,19 @@ var atobPolyfill = /* @__PURE__ */ __name((asc) => {
1775
2041
  if (!b64re.test(asc))
1776
2042
  throw new TypeError("malformed base64.");
1777
2043
  asc += "==".slice(2 - (asc.length & 3));
1778
- let u24, bin = "", r1, r2;
2044
+ let u24, r1, r2;
2045
+ let binArray = [];
1779
2046
  for (let i = 0; i < asc.length; ) {
1780
2047
  u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);
1781
- bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
2048
+ if (r1 === 64) {
2049
+ binArray.push(_fromCC(u24 >> 16 & 255));
2050
+ } else if (r2 === 64) {
2051
+ binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));
2052
+ } else {
2053
+ binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));
2054
+ }
1782
2055
  }
1783
- return bin;
2056
+ return binArray.join("");
1784
2057
  }, "atobPolyfill");
1785
2058
  var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
1786
2059
  var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
@@ -1960,7 +2233,7 @@ function decode4(input) {
1960
2233
  __name(decode4, "decode");
1961
2234
 
1962
2235
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/MultibaseDecoder.js
1963
- var MultibaseDecoder = class extends CborldDecoder {
2236
+ var _MultibaseDecoder = class _MultibaseDecoder extends CborldDecoder {
1964
2237
  decode({ value } = {}) {
1965
2238
  const { buffer: buffer2, byteOffset, length } = value;
1966
2239
  const suffix = new Uint8Array(buffer2, byteOffset + 1, length - 1);
@@ -1977,24 +2250,95 @@ var MultibaseDecoder = class extends CborldDecoder {
1977
2250
  return false;
1978
2251
  }
1979
2252
  if (value[0] === 122 || value[0] === 77) {
1980
- return new MultibaseDecoder();
2253
+ return new _MultibaseDecoder();
1981
2254
  }
1982
2255
  }
1983
2256
  };
1984
- __name(MultibaseDecoder, "MultibaseDecoder");
2257
+ __name(_MultibaseDecoder, "MultibaseDecoder");
2258
+ var MultibaseDecoder = _MultibaseDecoder;
1985
2259
 
1986
2260
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/Transformer.js
1987
- var Transformer = class {
2261
+ var _Transformer = class _Transformer {
2262
+ /**
2263
+ * Creates a new Transformer for transforming CBOR-LD <=> JSON-LD.
2264
+ *
2265
+ * @param {object} options - The options to use when encoding to CBOR-LD.
2266
+ * @param {documentLoaderFunction} options.documentLoader -The document
2267
+ * loader to use when resolving JSON-LD Context URLs.
2268
+ * @param {Map} [options.appContextMap] - A map of JSON-LD Context URLs and
2269
+ * their encoded CBOR-LD values (must be values greater than 32767
2270
+ * (0x7FFF)).
2271
+ */
1988
2272
  constructor({ appContextMap, documentLoader } = {}) {
1989
2273
  this.appContextMap = appContextMap;
1990
2274
  this.documentLoader = documentLoader;
1991
2275
  }
2276
+ // default no-op hook functions
1992
2277
  _beforeObjectContexts() {
1993
2278
  }
1994
2279
  _afterObjectContexts() {
1995
2280
  }
1996
2281
  _beforeTypeScopedContexts() {
1997
2282
  }
2283
+ /**
2284
+ * CBOR-LD is a semantic compression format; it uses the contextual
2285
+ * information provided by JSON-LD contexts to compress JSON-LD objects
2286
+ * to CBOR-LD (and vice versa).
2287
+ *
2288
+ * The purpose of this internal transform function is to either enable
2289
+ * transformation of a JSON-LD object to CBOR-LD (compression) or vice versa
2290
+ * (decompression). It does this by:
2291
+ *
2292
+ * 1. Finding the matching term definition from the active JSON-LD
2293
+ * context for each encountered term in the data that is being
2294
+ * transformed.
2295
+ * 2. Mapping each term to the target format (compressed / decompressed) and
2296
+ * creating value codec (encoder / decoder) for each value associate with
2297
+ * the term.
2298
+ *
2299
+ * When compressing, the transform function maps JSON keys (strings)
2300
+ * encountered in the JSON-LD object to term IDs (integers) and value
2301
+ * encoders.
2302
+ *
2303
+ * When decompressing, the transform function maps term IDs (integers) to
2304
+ * JSON keys (strings) and value decoders.
2305
+ *
2306
+ * The transform process will populate the given `transformMap` (a `Map`)
2307
+ * with keys (strings or IDs based on compression / decompression) and values
2308
+ * (the associated encoders / decoders). This `transformMap` can then be
2309
+ * passed to the `cborg` library to output JSON or CBOR.
2310
+ *
2311
+ * In order to match each JSON key / term ID with the right term
2312
+ * definition, it's important to understand how context is applied in
2313
+ * JSON-LD, i.e., which context is "active" at a certain place in the
2314
+ * object. There are three ways contexts become active to consider in
2315
+ * JSON-LD:
2316
+ *
2317
+ * 1. Embedded contexts. An embedded context is expressed by using the
2318
+ * `@context` keyword in a JSON-LD object. It is active on the object
2319
+ * where it appears and propagates to any nested objects.
2320
+ * 2. Type-scoped contexts. Such a context is defined in another context
2321
+ * and bound to a particular type. It will become active based on the
2322
+ * presence of the `@type` property (or an alias of it) and a matching
2323
+ * type value. By default, it *does not* propagate to nested objects,
2324
+ * i.e., it becomes inactive when a nested object does not have a matching
2325
+ * type.
2326
+ * 3. Property-scoped contexts. Such a context is defined in another context
2327
+ * and bound to a particular property. It will become active based on the
2328
+ * presence of a particular term, i.e., JSON key. By default, it
2329
+ * propagates, i.e., all terms defined by the context will be applicable
2330
+ * to the whole subtree associated with the property in the JSON object.
2331
+ *
2332
+ * The transform function maintains a stack of active contexts based on the
2333
+ * above rules to ensure that the right term definitions are matched up with
2334
+ * each JSON key in the JSON-LD object (when compressing) and each term ID in
2335
+ * the CBOR-LD object (when decompressing).
2336
+ *
2337
+ * @param {object} options - The options to use.
2338
+ * @param {object} options.obj - The object to transform.
2339
+ * @param {Map} options.transformMap - The transformation map to populate.
2340
+ * @param {Array} [options.contextStack] - The current context stack.
2341
+ */
1998
2342
  async _transform({ obj, transformMap, contextStack = [] }) {
1999
2343
  this._beforeObjectContexts({ obj, transformMap });
2000
2344
  let activeCtx = await this._applyEmbeddedContexts({ obj, contextStack });
@@ -2063,6 +2407,16 @@ var Transformer = class {
2063
2407
  }
2064
2408
  activeCtx.revert();
2065
2409
  }
2410
+ /**
2411
+ * Apply the embedded contexts in the given object to produce an
2412
+ * active context.
2413
+ *
2414
+ * @param {object} options - The options to use.
2415
+ * @param {object} options.obj - The object to get the active context for.
2416
+ * @param {Array} [options.contextStack] - The stack of active contexts.
2417
+ *
2418
+ * @returns {Promise<object>} - The active context instance.
2419
+ */
2066
2420
  async _applyEmbeddedContexts({ obj, contextStack }) {
2067
2421
  const stackTop = contextStack.length;
2068
2422
  const localContexts = obj["@context"];
@@ -2280,14 +2634,16 @@ var Transformer = class {
2280
2634
  return { term, plural };
2281
2635
  }
2282
2636
  };
2283
- __name(Transformer, "Transformer");
2637
+ __name(_Transformer, "Transformer");
2638
+ var Transformer = _Transformer;
2284
2639
 
2285
2640
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/Base58DidUrlDecoder.js
2286
2641
  var ID_TO_SCHEME = /* @__PURE__ */ new Map([
2642
+ // Note: only v1 mainnet is supported
2287
2643
  [1024, "did:v1:nym:"],
2288
2644
  [1025, "did:key:"]
2289
2645
  ]);
2290
- var Base58DidUrlDecoder = class extends CborldDecoder {
2646
+ var _Base58DidUrlDecoder = class _Base58DidUrlDecoder extends CborldDecoder {
2291
2647
  decode({ value } = {}) {
2292
2648
  let url = ID_TO_SCHEME.get(value[0]);
2293
2649
  if (typeof value[1] === "string") {
@@ -2311,13 +2667,14 @@ var Base58DidUrlDecoder = class extends CborldDecoder {
2311
2667
  if (!ID_TO_SCHEME.has(value[0])) {
2312
2668
  return false;
2313
2669
  }
2314
- return new Base58DidUrlDecoder();
2670
+ return new _Base58DidUrlDecoder();
2315
2671
  }
2316
2672
  };
2317
- __name(Base58DidUrlDecoder, "Base58DidUrlDecoder");
2673
+ __name(_Base58DidUrlDecoder, "Base58DidUrlDecoder");
2674
+ var Base58DidUrlDecoder = _Base58DidUrlDecoder;
2318
2675
 
2319
2676
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/HttpUrlDecoder.js
2320
- var HttpUrlDecoder = class extends CborldDecoder {
2677
+ var _HttpUrlDecoder = class _HttpUrlDecoder extends CborldDecoder {
2321
2678
  constructor({ secure } = {}) {
2322
2679
  super();
2323
2680
  this.secure = secure;
@@ -2330,10 +2687,11 @@ var HttpUrlDecoder = class extends CborldDecoder {
2330
2687
  if (!(value.length === 2 && typeof value[1] === "string")) {
2331
2688
  return false;
2332
2689
  }
2333
- return new HttpUrlDecoder({ secure: value[0] === 2 });
2690
+ return new _HttpUrlDecoder({ secure: value[0] === 2 });
2334
2691
  }
2335
2692
  };
2336
- __name(HttpUrlDecoder, "HttpUrlDecoder");
2693
+ __name(_HttpUrlDecoder, "HttpUrlDecoder");
2694
+ var HttpUrlDecoder = _HttpUrlDecoder;
2337
2695
 
2338
2696
  // ../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js
2339
2697
  var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
@@ -2393,18 +2751,19 @@ __name(parse, "parse");
2393
2751
  var parse_default = parse;
2394
2752
 
2395
2753
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UuidUrnDecoder.js
2396
- var UuidUrnDecoder = class extends CborldDecoder {
2754
+ var _UuidUrnDecoder = class _UuidUrnDecoder extends CborldDecoder {
2397
2755
  decode({ value } = {}) {
2398
2756
  const uuid = typeof value[1] === "string" ? value[1] : stringify_default(value[1]);
2399
2757
  return `urn:uuid:${uuid}`;
2400
2758
  }
2401
2759
  static createDecoder({ value } = {}) {
2402
2760
  if (value.length === 2 && (typeof value[1] === "string" || value[1] instanceof Uint8Array)) {
2403
- return new UuidUrnDecoder();
2761
+ return new _UuidUrnDecoder();
2404
2762
  }
2405
2763
  }
2406
2764
  };
2407
- __name(UuidUrnDecoder, "UuidUrnDecoder");
2765
+ __name(_UuidUrnDecoder, "UuidUrnDecoder");
2766
+ var UuidUrnDecoder = _UuidUrnDecoder;
2408
2767
 
2409
2768
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UriDecoder.js
2410
2769
  var SCHEME_ID_TO_DECODER = /* @__PURE__ */ new Map([
@@ -2414,7 +2773,7 @@ var SCHEME_ID_TO_DECODER = /* @__PURE__ */ new Map([
2414
2773
  [1024, Base58DidUrlDecoder],
2415
2774
  [1025, Base58DidUrlDecoder]
2416
2775
  ]);
2417
- var UriDecoder = class extends CborldDecoder {
2776
+ var _UriDecoder = class _UriDecoder extends CborldDecoder {
2418
2777
  static createDecoder({ value } = {}) {
2419
2778
  if (!(Array.isArray(value) || value.length > 1)) {
2420
2779
  return false;
@@ -2423,10 +2782,11 @@ var UriDecoder = class extends CborldDecoder {
2423
2782
  return DecoderClass && DecoderClass.createDecoder({ value });
2424
2783
  }
2425
2784
  };
2426
- __name(UriDecoder, "UriDecoder");
2785
+ __name(_UriDecoder, "UriDecoder");
2786
+ var UriDecoder = _UriDecoder;
2427
2787
 
2428
2788
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/VocabTermDecoder.js
2429
- var VocabTermDecoder = class extends CborldDecoder {
2789
+ var _VocabTermDecoder = class _VocabTermDecoder extends CborldDecoder {
2430
2790
  constructor({ term } = {}) {
2431
2791
  super();
2432
2792
  this.term = term;
@@ -2440,28 +2800,30 @@ var VocabTermDecoder = class extends CborldDecoder {
2440
2800
  }
2441
2801
  const term = transformer.idToTerm.get(value);
2442
2802
  if (term !== void 0) {
2443
- return new VocabTermDecoder({ term });
2803
+ return new _VocabTermDecoder({ term });
2444
2804
  }
2445
2805
  }
2446
2806
  };
2447
- __name(VocabTermDecoder, "VocabTermDecoder");
2807
+ __name(_VocabTermDecoder, "VocabTermDecoder");
2808
+ var VocabTermDecoder = _VocabTermDecoder;
2448
2809
 
2449
2810
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateDecoder.js
2450
- var XsdDateDecoder = class extends CborldDecoder {
2811
+ var _XsdDateDecoder = class _XsdDateDecoder extends CborldDecoder {
2451
2812
  decode({ value } = {}) {
2452
2813
  const dateString = new Date(value * 1e3).toISOString();
2453
2814
  return dateString.substring(0, dateString.indexOf("T"));
2454
2815
  }
2455
2816
  static createDecoder({ value } = {}) {
2456
2817
  if (typeof value === "number") {
2457
- return new XsdDateDecoder();
2818
+ return new _XsdDateDecoder();
2458
2819
  }
2459
2820
  }
2460
2821
  };
2461
- __name(XsdDateDecoder, "XsdDateDecoder");
2822
+ __name(_XsdDateDecoder, "XsdDateDecoder");
2823
+ var XsdDateDecoder = _XsdDateDecoder;
2462
2824
 
2463
2825
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateTimeDecoder.js
2464
- var XsdDateTimeDecoder = class extends CborldDecoder {
2826
+ var _XsdDateTimeDecoder = class _XsdDateTimeDecoder extends CborldDecoder {
2465
2827
  constructor({ value } = {}) {
2466
2828
  super();
2467
2829
  this.value = value;
@@ -2474,14 +2836,15 @@ var XsdDateTimeDecoder = class extends CborldDecoder {
2474
2836
  }
2475
2837
  static createDecoder({ value } = {}) {
2476
2838
  if (typeof value === "number") {
2477
- return new XsdDateTimeDecoder();
2839
+ return new _XsdDateTimeDecoder();
2478
2840
  }
2479
2841
  if (Array.isArray(value) && value.length === 2 && (typeof value[0] === "number" || typeof value[1] === "number")) {
2480
- return new XsdDateTimeDecoder();
2842
+ return new _XsdDateTimeDecoder();
2481
2843
  }
2482
2844
  }
2483
2845
  };
2484
- __name(XsdDateTimeDecoder, "XsdDateTimeDecoder");
2846
+ __name(_XsdDateTimeDecoder, "XsdDateTimeDecoder");
2847
+ var XsdDateTimeDecoder = _XsdDateTimeDecoder;
2485
2848
 
2486
2849
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/Decompressor.js
2487
2850
  var TYPE_DECODERS = /* @__PURE__ */ new Map([
@@ -2493,7 +2856,19 @@ var TYPE_DECODERS = /* @__PURE__ */ new Map([
2493
2856
  ]);
2494
2857
  var CONTEXT_TERM_ID = KEYWORDS.get("@context");
2495
2858
  var CONTEXT_TERM_ID_PLURAL = CONTEXT_TERM_ID + 1;
2496
- var Decompressor = class extends Transformer {
2859
+ var _Decompressor = class _Decompressor extends Transformer {
2860
+ /**
2861
+ * Creates a new Decompressor for generating a JSON-LD document from
2862
+ * compressed CBOR-LD. The created instance may only be used on a single
2863
+ * CBOR-LD input at a time.
2864
+ *
2865
+ * @param {object} options - The options to use when encoding to CBOR-LD.
2866
+ * @param {documentLoaderFunction} options.documentLoader - The document
2867
+ * loader to use when resolving JSON-LD Context URLs.
2868
+ * @param {Map} [options.appContextMap] - A map of JSON-LD Context URLs and
2869
+ * their encoded CBOR-LD values (must be values greater than 32767
2870
+ * (0x7FFF)).
2871
+ */
2497
2872
  constructor({ documentLoader, appContextMap } = {}) {
2498
2873
  super({ documentLoader, appContextMap });
2499
2874
  this.reverseAppContextMap = /* @__PURE__ */ new Map();
@@ -2503,6 +2878,17 @@ var Decompressor = class extends Transformer {
2503
2878
  }
2504
2879
  }
2505
2880
  }
2881
+ /**
2882
+ * Decompresses the given CBOR-LD byte array to a JSON-LD document.
2883
+ *
2884
+ * @param {object} options - The options to use.
2885
+ * @param {Uint8Array} options.compressedBytes - The CBOR-LD compressed
2886
+ * bytes that follow the compressed CBOR-LD CBOR tag.
2887
+ * @param {diagnosticFunction} [options.diagnose] - A function that, if
2888
+ * provided, is called with diagnostic information.
2889
+ *
2890
+ * @returns {Promise<object>} - The JSON-LD document.
2891
+ */
2506
2892
  async decompress({ compressedBytes, diagnose } = {}) {
2507
2893
  this.contextMap = /* @__PURE__ */ new Map();
2508
2894
  this.termToId = new Map(KEYWORDS);
@@ -2670,7 +3056,8 @@ var Decompressor = class extends Transformer {
2670
3056
  obj[term] = plural ? entries : entries[0];
2671
3057
  }
2672
3058
  };
2673
- __name(Decompressor, "Decompressor");
3059
+ __name(_Decompressor, "Decompressor");
3060
+ var Decompressor = _Decompressor;
2674
3061
  function _sortEntriesByTerm([{ term: t1 }], [{ term: t2 }]) {
2675
3062
  return t1 < t2 ? -1 : t1 > t2 ? 1 : 0;
2676
3063
  }
@@ -2731,18 +3118,20 @@ async function decode5({
2731
3118
  __name(decode5, "decode");
2732
3119
 
2733
3120
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/CborldEncoder.js
2734
- var CborldEncoder = class {
3121
+ var _CborldEncoder = class _CborldEncoder {
2735
3122
  encode() {
2736
3123
  throw new Error("Must be implemented by derived class.");
2737
3124
  }
3125
+ // eslint-disable-next-line no-unused-vars
2738
3126
  static createEncoder({ value } = {}) {
2739
3127
  throw new Error("Must be implemented by derived class.");
2740
3128
  }
2741
3129
  };
2742
- __name(CborldEncoder, "CborldEncoder");
3130
+ __name(_CborldEncoder, "CborldEncoder");
3131
+ var CborldEncoder = _CborldEncoder;
2743
3132
 
2744
3133
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/ContextEncoder.js
2745
- var ContextEncoder = class extends CborldEncoder {
3134
+ var _ContextEncoder = class _ContextEncoder extends CborldEncoder {
2746
3135
  constructor({ context, appContextMap } = {}) {
2747
3136
  super();
2748
3137
  this.context = context;
@@ -2761,13 +3150,14 @@ var ContextEncoder = class extends CborldEncoder {
2761
3150
  return false;
2762
3151
  }
2763
3152
  const { appContextMap } = transformer;
2764
- return new ContextEncoder({ context: value, appContextMap });
3153
+ return new _ContextEncoder({ context: value, appContextMap });
2765
3154
  }
2766
3155
  };
2767
- __name(ContextEncoder, "ContextEncoder");
3156
+ __name(_ContextEncoder, "ContextEncoder");
3157
+ var ContextEncoder = _ContextEncoder;
2768
3158
 
2769
3159
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/MultibaseEncoder.js
2770
- var MultibaseEncoder = class extends CborldEncoder {
3160
+ var _MultibaseEncoder = class _MultibaseEncoder extends CborldEncoder {
2771
3161
  constructor({ value } = {}) {
2772
3162
  super();
2773
3163
  this.value = value;
@@ -2793,18 +3183,19 @@ var MultibaseEncoder = class extends CborldEncoder {
2793
3183
  return false;
2794
3184
  }
2795
3185
  if (value[0] === "z" || value[0] === "M") {
2796
- return new MultibaseEncoder({ value });
3186
+ return new _MultibaseEncoder({ value });
2797
3187
  }
2798
3188
  }
2799
3189
  };
2800
- __name(MultibaseEncoder, "MultibaseEncoder");
3190
+ __name(_MultibaseEncoder, "MultibaseEncoder");
3191
+ var MultibaseEncoder = _MultibaseEncoder;
2801
3192
 
2802
3193
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/Base58DidUrlEncoder.js
2803
3194
  var SCHEME_TO_ID = /* @__PURE__ */ new Map([
2804
3195
  ["did:v1:nym:", 1024],
2805
3196
  ["did:key:", 1025]
2806
3197
  ]);
2807
- var Base58DidUrlEncoder = class extends CborldEncoder {
3198
+ var _Base58DidUrlEncoder = class _Base58DidUrlEncoder extends CborldEncoder {
2808
3199
  constructor({ value, scheme } = {}) {
2809
3200
  super();
2810
3201
  this.value = value;
@@ -2827,12 +3218,13 @@ var Base58DidUrlEncoder = class extends CborldEncoder {
2827
3218
  const keys = [...SCHEME_TO_ID.keys()];
2828
3219
  for (const key of keys) {
2829
3220
  if (value.startsWith(key)) {
2830
- return new Base58DidUrlEncoder({ value, scheme: key });
3221
+ return new _Base58DidUrlEncoder({ value, scheme: key });
2831
3222
  }
2832
3223
  }
2833
3224
  }
2834
3225
  };
2835
- __name(Base58DidUrlEncoder, "Base58DidUrlEncoder");
3226
+ __name(_Base58DidUrlEncoder, "Base58DidUrlEncoder");
3227
+ var Base58DidUrlEncoder = _Base58DidUrlEncoder;
2836
3228
  function _multibase58ToToken(str) {
2837
3229
  if (str.startsWith("z")) {
2838
3230
  const decoded = decode4(str.substr(1));
@@ -2845,7 +3237,7 @@ function _multibase58ToToken(str) {
2845
3237
  __name(_multibase58ToToken, "_multibase58ToToken");
2846
3238
 
2847
3239
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/HttpUrlEncoder.js
2848
- var HttpUrlEncoder = class extends CborldEncoder {
3240
+ var _HttpUrlEncoder = class _HttpUrlEncoder extends CborldEncoder {
2849
3241
  constructor({ value, secure } = {}) {
2850
3242
  super();
2851
3243
  this.value = value;
@@ -2862,17 +3254,18 @@ var HttpUrlEncoder = class extends CborldEncoder {
2862
3254
  }
2863
3255
  static createEncoder({ value } = {}) {
2864
3256
  if (value.startsWith("https://")) {
2865
- return new HttpUrlEncoder({ value, secure: true });
3257
+ return new _HttpUrlEncoder({ value, secure: true });
2866
3258
  }
2867
3259
  if (value.startsWith("http://")) {
2868
- return new HttpUrlEncoder({ value, secure: false });
3260
+ return new _HttpUrlEncoder({ value, secure: false });
2869
3261
  }
2870
3262
  }
2871
3263
  };
2872
- __name(HttpUrlEncoder, "HttpUrlEncoder");
3264
+ __name(_HttpUrlEncoder, "HttpUrlEncoder");
3265
+ var HttpUrlEncoder = _HttpUrlEncoder;
2873
3266
 
2874
3267
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UuidUrnEncoder.js
2875
- var UuidUrnEncoder = class extends CborldEncoder {
3268
+ var _UuidUrnEncoder = class _UuidUrnEncoder extends CborldEncoder {
2876
3269
  constructor({ value } = {}) {
2877
3270
  super();
2878
3271
  this.value = value;
@@ -2891,11 +3284,12 @@ var UuidUrnEncoder = class extends CborldEncoder {
2891
3284
  }
2892
3285
  static createEncoder({ value } = {}) {
2893
3286
  if (value.startsWith("urn:uuid:")) {
2894
- return new UuidUrnEncoder({ value });
3287
+ return new _UuidUrnEncoder({ value });
2895
3288
  }
2896
3289
  }
2897
3290
  };
2898
- __name(UuidUrnEncoder, "UuidUrnEncoder");
3291
+ __name(_UuidUrnEncoder, "UuidUrnEncoder");
3292
+ var UuidUrnEncoder = _UuidUrnEncoder;
2899
3293
 
2900
3294
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UriEncoder.js
2901
3295
  var SCHEME_TO_ENCODER = /* @__PURE__ */ new Map([
@@ -2905,7 +3299,7 @@ var SCHEME_TO_ENCODER = /* @__PURE__ */ new Map([
2905
3299
  ["did:v1:nym", Base58DidUrlEncoder],
2906
3300
  ["did:key", Base58DidUrlEncoder]
2907
3301
  ]);
2908
- var UriEncoder = class extends CborldEncoder {
3302
+ var _UriEncoder = class _UriEncoder extends CborldEncoder {
2909
3303
  static createEncoder({ value } = {}) {
2910
3304
  if (typeof value !== "string") {
2911
3305
  return false;
@@ -2927,10 +3321,11 @@ var UriEncoder = class extends CborldEncoder {
2927
3321
  return EncoderClass && EncoderClass.createEncoder({ value });
2928
3322
  }
2929
3323
  };
2930
- __name(UriEncoder, "UriEncoder");
3324
+ __name(_UriEncoder, "UriEncoder");
3325
+ var UriEncoder = _UriEncoder;
2931
3326
 
2932
3327
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/VocabTermEncoder.js
2933
- var VocabTermEncoder = class extends CborldEncoder {
3328
+ var _VocabTermEncoder = class _VocabTermEncoder extends CborldEncoder {
2934
3329
  constructor({ termId } = {}) {
2935
3330
  super();
2936
3331
  this.termId = termId;
@@ -2942,15 +3337,16 @@ var VocabTermEncoder = class extends CborldEncoder {
2942
3337
  const { termToId } = transformer;
2943
3338
  const termId = termToId.get(value);
2944
3339
  if (termId !== void 0) {
2945
- return new VocabTermEncoder({ termId });
3340
+ return new _VocabTermEncoder({ termId });
2946
3341
  }
2947
3342
  return UriEncoder.createEncoder({ value });
2948
3343
  }
2949
3344
  };
2950
- __name(VocabTermEncoder, "VocabTermEncoder");
3345
+ __name(_VocabTermEncoder, "VocabTermEncoder");
3346
+ var VocabTermEncoder = _VocabTermEncoder;
2951
3347
 
2952
3348
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateEncoder.js
2953
- var XsdDateEncoder = class extends CborldEncoder {
3349
+ var _XsdDateEncoder = class _XsdDateEncoder extends CborldEncoder {
2954
3350
  constructor({ value, parsed } = {}) {
2955
3351
  super();
2956
3352
  this.value = value;
@@ -2974,13 +3370,14 @@ var XsdDateEncoder = class extends CborldEncoder {
2974
3370
  if (isNaN(parsed)) {
2975
3371
  return false;
2976
3372
  }
2977
- return new XsdDateEncoder({ value, parsed });
3373
+ return new _XsdDateEncoder({ value, parsed });
2978
3374
  }
2979
3375
  };
2980
- __name(XsdDateEncoder, "XsdDateEncoder");
3376
+ __name(_XsdDateEncoder, "XsdDateEncoder");
3377
+ var XsdDateEncoder = _XsdDateEncoder;
2981
3378
 
2982
3379
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateTimeEncoder.js
2983
- var XsdDateTimeEncoder = class extends CborldEncoder {
3380
+ var _XsdDateTimeEncoder = class _XsdDateTimeEncoder extends CborldEncoder {
2984
3381
  constructor({ value, parsed } = {}) {
2985
3382
  super();
2986
3383
  this.value = value;
@@ -3021,10 +3418,11 @@ var XsdDateTimeEncoder = class extends CborldEncoder {
3021
3418
  if (isNaN(parsed)) {
3022
3419
  return false;
3023
3420
  }
3024
- return new XsdDateTimeEncoder({ value, parsed });
3421
+ return new _XsdDateTimeEncoder({ value, parsed });
3025
3422
  }
3026
3423
  };
3027
- __name(XsdDateTimeEncoder, "XsdDateTimeEncoder");
3424
+ __name(_XsdDateTimeEncoder, "XsdDateTimeEncoder");
3425
+ var XsdDateTimeEncoder = _XsdDateTimeEncoder;
3028
3426
 
3029
3427
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/Compressor.js
3030
3428
  var TYPE_ENCODERS = /* @__PURE__ */ new Map([
@@ -3043,10 +3441,34 @@ var typeEncoders2 = {
3043
3441
  }
3044
3442
  }
3045
3443
  };
3046
- var Compressor = class extends Transformer {
3444
+ var _Compressor = class _Compressor extends Transformer {
3445
+ /**
3446
+ * Creates a new Compressor for generating compressed CBOR-LD from a
3447
+ * JSON-LD document. The created instance may only be used on a single
3448
+ * JSON-LD document at a time.
3449
+ *
3450
+ * @param {object} options - The options to use when encoding to CBOR-LD.
3451
+ * @param {documentLoaderFunction} options.documentLoader -The document
3452
+ * loader to use when resolving JSON-LD Context URLs.
3453
+ * @param {Map} [options.appContextMap] - A map of JSON-LD Context URLs and
3454
+ * their encoded CBOR-LD values (must be values greater than 32767
3455
+ * (0x7FFF)).
3456
+ */
3047
3457
  constructor({ documentLoader, appContextMap } = {}) {
3048
3458
  super({ documentLoader, appContextMap });
3049
3459
  }
3460
+ /**
3461
+ * Compresses the given JSON-LD document into a CBOR-LD byte array of
3462
+ * compressed bytes that should follow the compressed CBOR-LD CBOR tag.
3463
+ *
3464
+ * @param {object} options - The options to use.
3465
+ * @param {object} options.jsonldDocument - The JSON-LD Document to convert
3466
+ * to CBOR-LD bytes.
3467
+ * @param {diagnosticFunction} [options.diagnose] - A function that, if
3468
+ * provided, is called with diagnostic information.
3469
+ *
3470
+ * @returns {Promise<Uint8Array>} - The compressed CBOR-LD bytes.
3471
+ */
3050
3472
  async compress({ jsonldDocument, diagnose } = {}) {
3051
3473
  const transformMaps = await this._createTransformMaps({ jsonldDocument });
3052
3474
  if (diagnose) {
@@ -3155,7 +3577,8 @@ var Compressor = class extends Transformer {
3155
3577
  transformMap.set(termId, plural ? entries : entries[0]);
3156
3578
  }
3157
3579
  };
3158
- __name(Compressor, "Compressor");
3580
+ __name(_Compressor, "Compressor");
3581
+ var Compressor = _Compressor;
3159
3582
 
3160
3583
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/encode.js
3161
3584
  async function encode5({
@@ -3267,7 +3690,7 @@ var Mode;
3267
3690
  })(Mode || (Mode = {}));
3268
3691
 
3269
3692
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRData.js
3270
- var QRData = class {
3693
+ var _QRData = class _QRData {
3271
3694
  constructor(mode, data) {
3272
3695
  this.bytes = [];
3273
3696
  this.mode = mode;
@@ -3323,7 +3746,8 @@ var QRData = class {
3323
3746
  }
3324
3747
  }
3325
3748
  };
3326
- __name(QRData, "QRData");
3749
+ __name(_QRData, "QRData");
3750
+ var QRData = _QRData;
3327
3751
 
3328
3752
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/encoding/UTF8.js
3329
3753
  function encode6(text) {
@@ -3354,7 +3778,11 @@ function encode6(text) {
3354
3778
  __name(encode6, "encode");
3355
3779
 
3356
3780
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRByte.js
3357
- var QRByte = class extends QRData {
3781
+ var _QRByte = class _QRByte extends QRData {
3782
+ /**
3783
+ * @constructor
3784
+ * @param {string} data
3785
+ */
3358
3786
  constructor(data, encode$1) {
3359
3787
  super(Mode.Byte, data);
3360
3788
  this.encoding = -1;
@@ -3367,6 +3795,11 @@ var QRByte = class extends QRData {
3367
3795
  this.encoding = 26;
3368
3796
  }
3369
3797
  }
3798
+ /**
3799
+ * @public
3800
+ * @method writeTo
3801
+ * @param {BitBuffer} buffer
3802
+ */
3370
3803
  writeTo(buffer2) {
3371
3804
  const { bytes } = this;
3372
3805
  for (const byte of bytes) {
@@ -3374,7 +3807,8 @@ var QRByte = class extends QRData {
3374
3807
  }
3375
3808
  }
3376
3809
  };
3377
- __name(QRByte, "QRByte");
3810
+ __name(_QRByte, "QRByte");
3811
+ var QRByte = _QRByte;
3378
3812
 
3379
3813
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRMath.js
3380
3814
  var EXP_TABLE = [];
@@ -3405,7 +3839,7 @@ function gexp(n) {
3405
3839
  __name(gexp, "gexp");
3406
3840
 
3407
3841
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/Polynomial.js
3408
- var Polynomial = class {
3842
+ var _Polynomial = class _Polynomial {
3409
3843
  constructor(num, shift = 0) {
3410
3844
  let offset = 0;
3411
3845
  let { length } = num;
@@ -3441,7 +3875,7 @@ var Polynomial = class {
3441
3875
  num[i + j] ^= gexp(glog(this.getAt(i)) + glog(e.getAt(j)));
3442
3876
  }
3443
3877
  }
3444
- return new Polynomial(num);
3878
+ return new _Polynomial(num);
3445
3879
  }
3446
3880
  mod(e) {
3447
3881
  const eLength = e.getLength();
@@ -3457,10 +3891,11 @@ var Polynomial = class {
3457
3891
  for (let i = 0; i < eLength; i++) {
3458
3892
  num[i] ^= gexp(glog(e.getAt(i)) + ratio);
3459
3893
  }
3460
- return new Polynomial(num).mod(e);
3894
+ return new _Polynomial(num).mod(e);
3461
3895
  }
3462
3896
  };
3463
- __name(Polynomial, "Polynomial");
3897
+ __name(_Polynomial, "Polynomial");
3898
+ var Polynomial = _Polynomial;
3464
3899
 
3465
3900
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRUtil.js
3466
3901
  var N1 = 3;
@@ -3651,7 +4086,7 @@ var ErrorCorrectionLevel;
3651
4086
  })(ErrorCorrectionLevel || (ErrorCorrectionLevel = {}));
3652
4087
 
3653
4088
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/RSBlock.js
3654
- var RSBlock = class {
4089
+ var _RSBlock = class _RSBlock {
3655
4090
  constructor(totalCount, dataCount) {
3656
4091
  this.dataCount = dataCount;
3657
4092
  this.totalCount = totalCount;
@@ -3664,14 +4099,14 @@ var RSBlock = class {
3664
4099
  }
3665
4100
  static getRSBlocks(version2, errorCorrectionLevel) {
3666
4101
  const rsBlocks = [];
3667
- const rsBlock = RSBlock.getRSBlockTable(version2, errorCorrectionLevel);
4102
+ const rsBlock = _RSBlock.getRSBlockTable(version2, errorCorrectionLevel);
3668
4103
  const length = rsBlock.length / 3;
3669
4104
  for (let i = 0; i < length; i++) {
3670
4105
  const count = rsBlock[i * 3 + 0];
3671
4106
  const totalCount = rsBlock[i * 3 + 1];
3672
4107
  const dataCount = rsBlock[i * 3 + 2];
3673
4108
  for (let j = 0; j < count; j++) {
3674
- rsBlocks.push(new RSBlock(totalCount, dataCount));
4109
+ rsBlocks.push(new _RSBlock(totalCount, dataCount));
3675
4110
  }
3676
4111
  }
3677
4112
  return rsBlocks;
@@ -3679,176 +4114,221 @@ var RSBlock = class {
3679
4114
  static getRSBlockTable(version2, errorCorrectionLevel) {
3680
4115
  switch (errorCorrectionLevel) {
3681
4116
  case ErrorCorrectionLevel.L:
3682
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 0];
4117
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 0];
3683
4118
  case ErrorCorrectionLevel.M:
3684
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 1];
4119
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 1];
3685
4120
  case ErrorCorrectionLevel.Q:
3686
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 2];
4121
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 2];
3687
4122
  case ErrorCorrectionLevel.H:
3688
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 3];
4123
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 3];
3689
4124
  default:
3690
4125
  throw new Error(`illegal error correction level: ${errorCorrectionLevel}`);
3691
4126
  }
3692
4127
  }
3693
4128
  };
3694
- __name(RSBlock, "RSBlock");
4129
+ __name(_RSBlock, "RSBlock");
4130
+ var RSBlock = _RSBlock;
3695
4131
  RSBlock.RS_BLOCK_TABLE = [
4132
+ // L
4133
+ // M
4134
+ // Q
4135
+ // H
4136
+ // 1
3696
4137
  [1, 26, 19],
3697
4138
  [1, 26, 16],
3698
4139
  [1, 26, 13],
3699
4140
  [1, 26, 9],
4141
+ // 2
3700
4142
  [1, 44, 34],
3701
4143
  [1, 44, 28],
3702
4144
  [1, 44, 22],
3703
4145
  [1, 44, 16],
4146
+ // 3
3704
4147
  [1, 70, 55],
3705
4148
  [1, 70, 44],
3706
4149
  [2, 35, 17],
3707
4150
  [2, 35, 13],
4151
+ // 4
3708
4152
  [1, 100, 80],
3709
4153
  [2, 50, 32],
3710
4154
  [2, 50, 24],
3711
4155
  [4, 25, 9],
4156
+ // 5
3712
4157
  [1, 134, 108],
3713
4158
  [2, 67, 43],
3714
4159
  [2, 33, 15, 2, 34, 16],
3715
4160
  [2, 33, 11, 2, 34, 12],
4161
+ // 6
3716
4162
  [2, 86, 68],
3717
4163
  [4, 43, 27],
3718
4164
  [4, 43, 19],
3719
4165
  [4, 43, 15],
4166
+ // 7
3720
4167
  [2, 98, 78],
3721
4168
  [4, 49, 31],
3722
4169
  [2, 32, 14, 4, 33, 15],
3723
4170
  [4, 39, 13, 1, 40, 14],
4171
+ // 8
3724
4172
  [2, 121, 97],
3725
4173
  [2, 60, 38, 2, 61, 39],
3726
4174
  [4, 40, 18, 2, 41, 19],
3727
4175
  [4, 40, 14, 2, 41, 15],
4176
+ // 9
3728
4177
  [2, 146, 116],
3729
4178
  [3, 58, 36, 2, 59, 37],
3730
4179
  [4, 36, 16, 4, 37, 17],
3731
4180
  [4, 36, 12, 4, 37, 13],
4181
+ // 10
3732
4182
  [2, 86, 68, 2, 87, 69],
3733
4183
  [4, 69, 43, 1, 70, 44],
3734
4184
  [6, 43, 19, 2, 44, 20],
3735
4185
  [6, 43, 15, 2, 44, 16],
4186
+ // 11
3736
4187
  [4, 101, 81],
3737
4188
  [1, 80, 50, 4, 81, 51],
3738
4189
  [4, 50, 22, 4, 51, 23],
3739
4190
  [3, 36, 12, 8, 37, 13],
4191
+ // 12
3740
4192
  [2, 116, 92, 2, 117, 93],
3741
4193
  [6, 58, 36, 2, 59, 37],
3742
4194
  [4, 46, 20, 6, 47, 21],
3743
4195
  [7, 42, 14, 4, 43, 15],
4196
+ // 13
3744
4197
  [4, 133, 107],
3745
4198
  [8, 59, 37, 1, 60, 38],
3746
4199
  [8, 44, 20, 4, 45, 21],
3747
4200
  [12, 33, 11, 4, 34, 12],
4201
+ // 14
3748
4202
  [3, 145, 115, 1, 146, 116],
3749
4203
  [4, 64, 40, 5, 65, 41],
3750
4204
  [11, 36, 16, 5, 37, 17],
3751
4205
  [11, 36, 12, 5, 37, 13],
4206
+ // 15
3752
4207
  [5, 109, 87, 1, 110, 88],
3753
4208
  [5, 65, 41, 5, 66, 42],
3754
4209
  [5, 54, 24, 7, 55, 25],
3755
4210
  [11, 36, 12, 7, 37, 13],
4211
+ // 16
3756
4212
  [5, 122, 98, 1, 123, 99],
3757
4213
  [7, 73, 45, 3, 74, 46],
3758
4214
  [15, 43, 19, 2, 44, 20],
3759
4215
  [3, 45, 15, 13, 46, 16],
4216
+ // 17
3760
4217
  [1, 135, 107, 5, 136, 108],
3761
4218
  [10, 74, 46, 1, 75, 47],
3762
4219
  [1, 50, 22, 15, 51, 23],
3763
4220
  [2, 42, 14, 17, 43, 15],
4221
+ // 18
3764
4222
  [5, 150, 120, 1, 151, 121],
3765
4223
  [9, 69, 43, 4, 70, 44],
3766
4224
  [17, 50, 22, 1, 51, 23],
3767
4225
  [2, 42, 14, 19, 43, 15],
4226
+ // 19
3768
4227
  [3, 141, 113, 4, 142, 114],
3769
4228
  [3, 70, 44, 11, 71, 45],
3770
4229
  [17, 47, 21, 4, 48, 22],
3771
4230
  [9, 39, 13, 16, 40, 14],
4231
+ // 20
3772
4232
  [3, 135, 107, 5, 136, 108],
3773
4233
  [3, 67, 41, 13, 68, 42],
3774
4234
  [15, 54, 24, 5, 55, 25],
3775
4235
  [15, 43, 15, 10, 44, 16],
4236
+ // 21
3776
4237
  [4, 144, 116, 4, 145, 117],
3777
4238
  [17, 68, 42],
3778
4239
  [17, 50, 22, 6, 51, 23],
3779
4240
  [19, 46, 16, 6, 47, 17],
4241
+ // 22
3780
4242
  [2, 139, 111, 7, 140, 112],
3781
4243
  [17, 74, 46],
3782
4244
  [7, 54, 24, 16, 55, 25],
3783
4245
  [34, 37, 13],
4246
+ // 23
3784
4247
  [4, 151, 121, 5, 152, 122],
3785
4248
  [4, 75, 47, 14, 76, 48],
3786
4249
  [11, 54, 24, 14, 55, 25],
3787
4250
  [16, 45, 15, 14, 46, 16],
4251
+ // 24
3788
4252
  [6, 147, 117, 4, 148, 118],
3789
4253
  [6, 73, 45, 14, 74, 46],
3790
4254
  [11, 54, 24, 16, 55, 25],
3791
4255
  [30, 46, 16, 2, 47, 17],
4256
+ // 25
3792
4257
  [8, 132, 106, 4, 133, 107],
3793
4258
  [8, 75, 47, 13, 76, 48],
3794
4259
  [7, 54, 24, 22, 55, 25],
3795
4260
  [22, 45, 15, 13, 46, 16],
4261
+ // 26
3796
4262
  [10, 142, 114, 2, 143, 115],
3797
4263
  [19, 74, 46, 4, 75, 47],
3798
4264
  [28, 50, 22, 6, 51, 23],
3799
4265
  [33, 46, 16, 4, 47, 17],
4266
+ // 27
3800
4267
  [8, 152, 122, 4, 153, 123],
3801
4268
  [22, 73, 45, 3, 74, 46],
3802
4269
  [8, 53, 23, 26, 54, 24],
3803
4270
  [12, 45, 15, 28, 46, 16],
4271
+ // 28
3804
4272
  [3, 147, 117, 10, 148, 118],
3805
4273
  [3, 73, 45, 23, 74, 46],
3806
4274
  [4, 54, 24, 31, 55, 25],
3807
4275
  [11, 45, 15, 31, 46, 16],
4276
+ // 29
3808
4277
  [7, 146, 116, 7, 147, 117],
3809
4278
  [21, 73, 45, 7, 74, 46],
3810
4279
  [1, 53, 23, 37, 54, 24],
3811
4280
  [19, 45, 15, 26, 46, 16],
4281
+ // 30
3812
4282
  [5, 145, 115, 10, 146, 116],
3813
4283
  [19, 75, 47, 10, 76, 48],
3814
4284
  [15, 54, 24, 25, 55, 25],
3815
4285
  [23, 45, 15, 25, 46, 16],
4286
+ // 31
3816
4287
  [13, 145, 115, 3, 146, 116],
3817
4288
  [2, 74, 46, 29, 75, 47],
3818
4289
  [42, 54, 24, 1, 55, 25],
3819
4290
  [23, 45, 15, 28, 46, 16],
4291
+ // 32
3820
4292
  [17, 145, 115],
3821
4293
  [10, 74, 46, 23, 75, 47],
3822
4294
  [10, 54, 24, 35, 55, 25],
3823
4295
  [19, 45, 15, 35, 46, 16],
4296
+ // 33
3824
4297
  [17, 145, 115, 1, 146, 116],
3825
4298
  [14, 74, 46, 21, 75, 47],
3826
4299
  [29, 54, 24, 19, 55, 25],
3827
4300
  [11, 45, 15, 46, 46, 16],
4301
+ // 34
3828
4302
  [13, 145, 115, 6, 146, 116],
3829
4303
  [14, 74, 46, 23, 75, 47],
3830
4304
  [44, 54, 24, 7, 55, 25],
3831
4305
  [59, 46, 16, 1, 47, 17],
4306
+ // 35
3832
4307
  [12, 151, 121, 7, 152, 122],
3833
4308
  [12, 75, 47, 26, 76, 48],
3834
4309
  [39, 54, 24, 14, 55, 25],
3835
4310
  [22, 45, 15, 41, 46, 16],
4311
+ // 36
3836
4312
  [6, 151, 121, 14, 152, 122],
3837
4313
  [6, 75, 47, 34, 76, 48],
3838
4314
  [46, 54, 24, 10, 55, 25],
3839
4315
  [2, 45, 15, 64, 46, 16],
4316
+ // 37
3840
4317
  [17, 152, 122, 4, 153, 123],
3841
4318
  [29, 74, 46, 14, 75, 47],
3842
4319
  [49, 54, 24, 10, 55, 25],
3843
4320
  [24, 45, 15, 46, 46, 16],
4321
+ // 38
3844
4322
  [4, 152, 122, 18, 153, 123],
3845
4323
  [13, 74, 46, 32, 75, 47],
3846
4324
  [48, 54, 24, 14, 55, 25],
3847
4325
  [42, 45, 15, 32, 46, 16],
4326
+ // 39
3848
4327
  [20, 147, 117, 4, 148, 118],
3849
4328
  [40, 75, 47, 7, 76, 48],
3850
4329
  [43, 54, 24, 22, 55, 25],
3851
4330
  [10, 45, 15, 67, 46, 16],
4331
+ // 40
3852
4332
  [19, 148, 118, 6, 149, 119],
3853
4333
  [18, 75, 47, 31, 76, 48],
3854
4334
  [34, 54, 24, 34, 55, 25],
@@ -3856,7 +4336,7 @@ RSBlock.RS_BLOCK_TABLE = [
3856
4336
  ];
3857
4337
 
3858
4338
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/BitBuffer.js
3859
- var BitBuffer = class {
4339
+ var _BitBuffer = class _BitBuffer {
3860
4340
  constructor() {
3861
4341
  this.length = 0;
3862
4342
  this.buffer = [];
@@ -3886,11 +4366,12 @@ var BitBuffer = class {
3886
4366
  this.length++;
3887
4367
  }
3888
4368
  };
3889
- __name(BitBuffer, "BitBuffer");
4369
+ __name(_BitBuffer, "BitBuffer");
4370
+ var BitBuffer = _BitBuffer;
3890
4371
 
3891
4372
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/lzw/Dict.js
3892
4373
  var MAX_CODE = (1 << 12) - 1;
3893
- var Dict = class {
4374
+ var _Dict = class _Dict {
3894
4375
  constructor(depth) {
3895
4376
  const bof = 1 << depth;
3896
4377
  const eof = bof + 1;
@@ -3925,10 +4406,11 @@ var Dict = class {
3925
4406
  return this.codes.get(code << 8 | index);
3926
4407
  }
3927
4408
  };
3928
- __name(Dict, "Dict");
4409
+ __name(_Dict, "Dict");
4410
+ var Dict = _Dict;
3929
4411
 
3930
4412
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/lzw/DictStream.js
3931
- var DictStream = class {
4413
+ var _DictStream = class _DictStream {
3932
4414
  constructor(dict) {
3933
4415
  this.bits = 0;
3934
4416
  this.buffer = 0;
@@ -3970,7 +4452,8 @@ var DictStream = class {
3970
4452
  stream.writeByte(0);
3971
4453
  }
3972
4454
  };
3973
- __name(DictStream, "DictStream");
4455
+ __name(_DictStream, "DictStream");
4456
+ var DictStream = _DictStream;
3974
4457
 
3975
4458
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/lzw/index.js
3976
4459
  function compress(pixels, depth, stream) {
@@ -4002,7 +4485,7 @@ function compress(pixels, depth, stream) {
4002
4485
  __name(compress, "compress");
4003
4486
 
4004
4487
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/ByteStream.js
4005
- var ByteStream = class {
4488
+ var _ByteStream = class _ByteStream {
4006
4489
  constructor() {
4007
4490
  this.bytes = [];
4008
4491
  }
@@ -4019,7 +4502,8 @@ var ByteStream = class {
4019
4502
  }
4020
4503
  }
4021
4504
  };
4022
- __name(ByteStream, "ByteStream");
4505
+ __name(_ByteStream, "ByteStream");
4506
+ var ByteStream = _ByteStream;
4023
4507
 
4024
4508
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/Base64Stream.js
4025
4509
  var { fromCharCode } = String;
@@ -4041,7 +4525,7 @@ function encode7(byte) {
4041
4525
  throw new Error(`illegal char: ${fromCharCode(byte)}`);
4042
4526
  }
4043
4527
  __name(encode7, "encode");
4044
- var Base64Stream = class {
4528
+ var _Base64Stream = class _Base64Stream {
4045
4529
  constructor() {
4046
4530
  this.bits = 0;
4047
4531
  this.buffer = 0;
@@ -4078,10 +4562,11 @@ var Base64Stream = class {
4078
4562
  }
4079
4563
  }
4080
4564
  };
4081
- __name(Base64Stream, "Base64Stream");
4565
+ __name(_Base64Stream, "Base64Stream");
4566
+ var Base64Stream = _Base64Stream;
4082
4567
 
4083
4568
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/GIFImage.js
4084
- var GIFImage = class {
4569
+ var _GIFImage = class _GIFImage {
4085
4570
  constructor(width, height, { foreground = [0, 0, 0], background = [255, 255, 255] } = {}) {
4086
4571
  this.pixels = [];
4087
4572
  this.width = width;
@@ -4126,7 +4611,8 @@ var GIFImage = class {
4126
4611
  return url;
4127
4612
  }
4128
4613
  };
4129
- __name(GIFImage, "GIFImage");
4614
+ __name(_GIFImage, "GIFImage");
4615
+ var GIFImage = _GIFImage;
4130
4616
 
4131
4617
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/common/MaskPattern.js
4132
4618
  function getMaskFunc(maskPattern) {
@@ -4261,7 +4747,7 @@ function createData(buffer2, rsBlocks, maxDataCount) {
4261
4747
  return createBytes(buffer2, rsBlocks);
4262
4748
  }
4263
4749
  __name(createData, "createData");
4264
- var Encoder = class {
4750
+ var _Encoder = class _Encoder {
4265
4751
  constructor(options = {}) {
4266
4752
  this.matrixSize = 0;
4267
4753
  this.chunks = [];
@@ -4271,23 +4757,54 @@ var Encoder = class {
4271
4757
  this.setEncodingHint(encodingHint);
4272
4758
  this.setErrorCorrectionLevel(errorCorrectionLevel);
4273
4759
  }
4760
+ /**
4761
+ * @public
4762
+ * @method getMatrix
4763
+ * @returns {boolean[][]}
4764
+ */
4274
4765
  getMatrix() {
4275
4766
  return this.matrix;
4276
4767
  }
4768
+ /**
4769
+ * @public
4770
+ * @method getMatrixSize
4771
+ * @returns {number}
4772
+ */
4277
4773
  getMatrixSize() {
4278
4774
  return this.matrixSize;
4279
4775
  }
4776
+ /**
4777
+ * @public
4778
+ * @method getVersion
4779
+ * @returns {number}
4780
+ */
4280
4781
  getVersion() {
4281
4782
  return this.version;
4282
4783
  }
4784
+ /**
4785
+ * @public
4786
+ * @method setVersion
4787
+ * @param {number} version
4788
+ * @returns {Encoder}
4789
+ */
4283
4790
  setVersion(version2) {
4284
4791
  this.version = Math.min(40, Math.max(0, version2 >> 0));
4285
4792
  this.auto = this.version === 0;
4286
4793
  return this;
4287
4794
  }
4795
+ /**
4796
+ * @public
4797
+ * @method getErrorCorrectionLevel
4798
+ * @returns {ErrorCorrectionLevel}
4799
+ */
4288
4800
  getErrorCorrectionLevel() {
4289
4801
  return this.errorCorrectionLevel;
4290
4802
  }
4803
+ /**
4804
+ * @public
4805
+ * @method setErrorCorrectionLevel
4806
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel
4807
+ */
4291
4808
  setErrorCorrectionLevel(errorCorrectionLevel) {
4292
4809
  switch (errorCorrectionLevel) {
4293
4810
  case ErrorCorrectionLevel.L:
@@ -4298,13 +4815,30 @@ var Encoder = class {
4298
4815
  }
4299
4816
  return this;
4300
4817
  }
4818
+ /**
4819
+ * @public
4820
+ * @method getEncodingHint
4821
+ * @returns {boolean}
4822
+ */
4301
4823
  getEncodingHint() {
4302
4824
  return this.encodingHint;
4303
4825
  }
4826
+ /**
4827
+ * @public
4828
+ * @method setEncodingHint
4829
+ * @param {boolean} encodingHint
4830
+ * @returns {Encoder}
4831
+ */
4304
4832
  setEncodingHint(encodingHint) {
4305
4833
  this.encodingHint = encodingHint;
4306
4834
  return this;
4307
4835
  }
4836
+ /**
4837
+ * @public
4838
+ * @method write
4839
+ * @param {QRData} data
4840
+ * @returns {Encoder}
4841
+ */
4308
4842
  write(data) {
4309
4843
  const { chunks } = this;
4310
4844
  if (data instanceof QRData) {
@@ -4319,6 +4853,13 @@ var Encoder = class {
4319
4853
  }
4320
4854
  return this;
4321
4855
  }
4856
+ /**
4857
+ * @public
4858
+ * @method isDark
4859
+ * @param {number} row
4860
+ * @param {number} col
4861
+ * @returns {boolean}
4862
+ */
4322
4863
  isDark(row, col) {
4323
4864
  return this.matrix[row][col] === true;
4324
4865
  }
@@ -4460,6 +5001,11 @@ var Encoder = class {
4460
5001
  this.setupVersionInfo();
4461
5002
  this.setupCodewords(data, maskPattern);
4462
5003
  }
5004
+ /**
5005
+ * @public
5006
+ * @method make
5007
+ * @returns {Encoder}
5008
+ */
4463
5009
  make() {
4464
5010
  let buffer2;
4465
5011
  let rsBlocks;
@@ -4497,6 +5043,13 @@ var Encoder = class {
4497
5043
  this.matrix = matrices[bestMaskPattern];
4498
5044
  return this;
4499
5045
  }
5046
+ /**
5047
+ * @public
5048
+ * @method toDataURL
5049
+ * @param {number} moduleSize
5050
+ * @param {number} margin
5051
+ * @returns {string}
5052
+ */
4500
5053
  toDataURL(moduleSize = 2, margin = moduleSize * 4, colors) {
4501
5054
  moduleSize = Math.max(1, moduleSize >> 0);
4502
5055
  margin = Math.max(0, margin >> 0);
@@ -4518,11 +5071,16 @@ var Encoder = class {
4518
5071
  }
4519
5072
  return gif.toDataURL();
4520
5073
  }
5074
+ /**
5075
+ * @public
5076
+ * @method clear
5077
+ */
4521
5078
  clear() {
4522
5079
  this.chunks = [];
4523
5080
  }
4524
5081
  };
4525
- __name(Encoder, "Encoder");
5082
+ __name(_Encoder, "Encoder");
5083
+ var Encoder = _Encoder;
4526
5084
 
4527
5085
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/encoding/UTF16.js
4528
5086
  function encode8(text) {
@@ -4543,22 +5101,31 @@ function getByte(byte) {
4543
5101
  return byte - 65 + 10;
4544
5102
  } else {
4545
5103
  switch (byte) {
5104
+ // space
4546
5105
  case 32:
4547
5106
  return 36;
5107
+ // $
4548
5108
  case 36:
4549
5109
  return 37;
5110
+ // %
4550
5111
  case 37:
4551
5112
  return 38;
5113
+ // *
4552
5114
  case 42:
4553
5115
  return 39;
5116
+ // +
4554
5117
  case 43:
4555
5118
  return 40;
5119
+ // -
4556
5120
  case 45:
4557
5121
  return 41;
5122
+ // .
4558
5123
  case 46:
4559
5124
  return 42;
5125
+ // /
4560
5126
  case 47:
4561
5127
  return 43;
5128
+ // :
4562
5129
  case 58:
4563
5130
  return 44;
4564
5131
  default:
@@ -4567,11 +5134,20 @@ function getByte(byte) {
4567
5134
  }
4568
5135
  }
4569
5136
  __name(getByte, "getByte");
4570
- var QRAlphanumeric = class extends QRData {
5137
+ var _QRAlphanumeric = class _QRAlphanumeric extends QRData {
5138
+ /**
5139
+ * @constructor
5140
+ * @param {string} data
5141
+ */
4571
5142
  constructor(data) {
4572
5143
  super(Mode.Alphanumeric, data);
4573
5144
  this.bytes = encode8(data);
4574
5145
  }
5146
+ /**
5147
+ * @public
5148
+ * @method writeTo
5149
+ * @param {BitBuffer} buffer
5150
+ */
4575
5151
  writeTo(buffer2) {
4576
5152
  let i = 0;
4577
5153
  const { bytes } = this;
@@ -4585,7 +5161,8 @@ var QRAlphanumeric = class extends QRData {
4585
5161
  }
4586
5162
  }
4587
5163
  };
4588
- __name(QRAlphanumeric, "QRAlphanumeric");
5164
+ __name(_QRAlphanumeric, "QRAlphanumeric");
5165
+ var QRAlphanumeric = _QRAlphanumeric;
4589
5166
 
4590
5167
  // ../../../node_modules/.pnpm/@digitalbazaar+vpqr@3.0.0/node_modules/@digitalbazaar/vpqr/lib/vpqr.js
4591
5168
  var VP_QR_VERSION = "VP1";
@@ -4614,6 +5191,7 @@ async function toQrCode({
4614
5191
  const cborldBytes = await encode5({
4615
5192
  jsonldDocument: vp,
4616
5193
  documentLoader,
5194
+ // to debug, set diagnose: console.log
4617
5195
  diagnose
4618
5196
  });
4619
5197
  const {
@@ -4652,6 +5230,7 @@ async function fromQrCode({
4652
5230
  const vp = await decode5({
4653
5231
  cborldBytes,
4654
5232
  documentLoader,
5233
+ // to debug, set diagnose: console.log
4655
5234
  diagnose
4656
5235
  });
4657
5236
  return { vp };
@@ -4665,50 +5244,112 @@ var getVpqrPlugin = /* @__PURE__ */ __name((learnCard) => {
4665
5244
  displayName: "VP QR",
4666
5245
  description: "Allows reading and creating QR codes with Verifiable Presentations in them",
4667
5246
  methods: {
4668
- vpFromQrCode: async (_learnCard, text) => {
5247
+ vpFromQrCode: /* @__PURE__ */ __name(async (_learnCard, text) => {
4669
5248
  return (await fromQrCode({
4670
5249
  text,
4671
- documentLoader: async (url) => ({
5250
+ documentLoader: /* @__PURE__ */ __name(async (url) => ({
4672
5251
  document: await learnCard.invoke.contextLoader(url)
4673
- })
5252
+ }), "documentLoader")
4674
5253
  }))?.vp;
4675
- },
4676
- vpToQrCode: async (_learnCard, vp) => {
5254
+ }, "vpFromQrCode"),
5255
+ vpToQrCode: /* @__PURE__ */ __name(async (_learnCard, vp) => {
4677
5256
  return (await toQrCode({
4678
5257
  vp,
4679
- documentLoader: async (url) => ({
5258
+ documentLoader: /* @__PURE__ */ __name(async (url) => ({
4680
5259
  document: await learnCard.invoke.contextLoader(url)
4681
- })
5260
+ }), "documentLoader")
4682
5261
  }))?.imageDataUrl;
4683
- }
5262
+ }, "vpToQrCode")
4684
5263
  }
4685
5264
  };
4686
5265
  }, "getVpqrPlugin");
4687
- /*!
4688
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
4689
- */
4690
- /*!
4691
- * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
4692
- */
4693
- /*!
4694
- * Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved.
4695
- */
4696
- /*!
4697
- * Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
4698
- */
4699
- /*!
4700
- * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
4701
- */
4702
- /*!
4703
- * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved.
4704
- */
4705
- /**
4706
- * @module QRCode
4707
- * @package @nuintun/qrcode
4708
- * @license MIT
4709
- * @version 3.4.0
4710
- * @author nuintun <nuintun@qq.com>
4711
- * @description A pure JavaScript QRCode encode and decode library.
4712
- * @see https://github.com/nuintun/qrcode#readme
4713
- */
5266
+ /*! Bundled license information:
5267
+
5268
+ @digitalbazaar/cborld/lib/CborldError.js:
5269
+ (*!
5270
+ * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
5271
+ *)
5272
+
5273
+ @digitalbazaar/cborld/lib/keywords.js:
5274
+ @digitalbazaar/cborld/lib/codecs/CborldDecoder.js:
5275
+ @digitalbazaar/cborld/lib/codecs/registeredContexts.js:
5276
+ @digitalbazaar/cborld/lib/codecs/ContextDecoder.js:
5277
+ @digitalbazaar/cborld/lib/Transformer.js:
5278
+ @digitalbazaar/cborld/lib/codecs/Base58DidUrlDecoder.js:
5279
+ @digitalbazaar/cborld/lib/codecs/HttpUrlDecoder.js:
5280
+ @digitalbazaar/cborld/lib/codecs/UuidUrnDecoder.js:
5281
+ @digitalbazaar/cborld/lib/codecs/VocabTermDecoder.js:
5282
+ @digitalbazaar/cborld/lib/codecs/XsdDateDecoder.js:
5283
+ @digitalbazaar/cborld/lib/codecs/XsdDateTimeDecoder.js:
5284
+ @digitalbazaar/cborld/lib/codecs/CborldEncoder.js:
5285
+ @digitalbazaar/vpqr/lib/vpqr.js:
5286
+ @digitalbazaar/vpqr/lib/index.js:
5287
+ (*!
5288
+ * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
5289
+ *)
5290
+
5291
+ base58-universal/lib/index.js:
5292
+ (*!
5293
+ * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
5294
+ *)
5295
+
5296
+ @digitalbazaar/cborld/lib/codecs/MultibaseDecoder.js:
5297
+ @digitalbazaar/cborld/lib/codecs/UriDecoder.js:
5298
+ @digitalbazaar/cborld/lib/Decompressor.js:
5299
+ @digitalbazaar/cborld/lib/codecs/ContextEncoder.js:
5300
+ @digitalbazaar/cborld/lib/codecs/MultibaseEncoder.js:
5301
+ @digitalbazaar/cborld/lib/codecs/Base58DidUrlEncoder.js:
5302
+ @digitalbazaar/cborld/lib/codecs/HttpUrlEncoder.js:
5303
+ @digitalbazaar/cborld/lib/codecs/UuidUrnEncoder.js:
5304
+ @digitalbazaar/cborld/lib/codecs/UriEncoder.js:
5305
+ @digitalbazaar/cborld/lib/codecs/VocabTermEncoder.js:
5306
+ @digitalbazaar/cborld/lib/codecs/XsdDateEncoder.js:
5307
+ @digitalbazaar/cborld/lib/codecs/XsdDateTimeEncoder.js:
5308
+ @digitalbazaar/cborld/lib/Compressor.js:
5309
+ (*!
5310
+ * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved.
5311
+ *)
5312
+
5313
+ @digitalbazaar/cborld/lib/decode.js:
5314
+ @digitalbazaar/cborld/lib/index.js:
5315
+ (*!
5316
+ * Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved.
5317
+ *)
5318
+
5319
+ @digitalbazaar/cborld/lib/encode.js:
5320
+ (*!
5321
+ * Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
5322
+ *)
5323
+
5324
+ @nuintun/qrcode/esm/qrcode/common/Mode.js:
5325
+ @nuintun/qrcode/esm/qrcode/encoder/QRData.js:
5326
+ @nuintun/qrcode/esm/encoding/UTF8.js:
5327
+ @nuintun/qrcode/esm/qrcode/encoder/QRByte.js:
5328
+ @nuintun/qrcode/esm/qrcode/encoder/QRMath.js:
5329
+ @nuintun/qrcode/esm/qrcode/encoder/Polynomial.js:
5330
+ @nuintun/qrcode/esm/qrcode/encoder/QRUtil.js:
5331
+ @nuintun/qrcode/esm/qrcode/common/ErrorCorrectionLevel.js:
5332
+ @nuintun/qrcode/esm/qrcode/encoder/RSBlock.js:
5333
+ @nuintun/qrcode/esm/qrcode/encoder/BitBuffer.js:
5334
+ @nuintun/qrcode/esm/image/lzw/Dict.js:
5335
+ @nuintun/qrcode/esm/image/lzw/DictStream.js:
5336
+ @nuintun/qrcode/esm/image/lzw/index.js:
5337
+ @nuintun/qrcode/esm/image/ByteStream.js:
5338
+ @nuintun/qrcode/esm/image/Base64Stream.js:
5339
+ @nuintun/qrcode/esm/image/GIFImage.js:
5340
+ @nuintun/qrcode/esm/qrcode/common/MaskPattern.js:
5341
+ @nuintun/qrcode/esm/qrcode/encoder/Writer.js:
5342
+ @nuintun/qrcode/esm/encoding/UTF16.js:
5343
+ @nuintun/qrcode/esm/qrcode/encoder/QRAlphanumeric.js:
5344
+ @nuintun/qrcode/esm/index.js:
5345
+ (**
5346
+ * @module QRCode
5347
+ * @package @nuintun/qrcode
5348
+ * @license MIT
5349
+ * @version 3.4.0
5350
+ * @author nuintun <nuintun@qq.com>
5351
+ * @description A pure JavaScript QRCode encode and decode library.
5352
+ * @see https://github.com/nuintun/qrcode#readme
5353
+ *)
5354
+ */
4714
5355
  //# sourceMappingURL=vpqr-plugin.cjs.development.js.map