@learncard/vpqr-plugin 1.0.55 → 1.1.2

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.
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -24,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
28
  // ../../../node_modules/.pnpm/base32-decode@1.0.0/node_modules/base32-decode/index.js
25
29
  var require_base32_decode = __commonJS({
26
30
  "../../../node_modules/.pnpm/base32-decode@1.0.0/node_modules/base32-decode/index.js"(exports, module) {
31
+ "use strict";
27
32
  var RFC46482 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
28
33
  var RFC4648_HEX2 = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
29
34
  var CROCKFORD2 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
@@ -72,7 +77,7 @@ var require_base32_decode = __commonJS({
72
77
  }
73
78
  });
74
79
 
75
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/is.js
80
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/is.js
76
81
  var typeofs = [
77
82
  "string",
78
83
  "number",
@@ -158,22 +163,33 @@ function getObjectType(value) {
158
163
  }
159
164
  __name(getObjectType, "getObjectType");
160
165
 
161
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/token.js
162
- var Type = class {
166
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/token.js
167
+ var _Type = class _Type {
168
+ /**
169
+ * @param {number} major
170
+ * @param {string} name
171
+ * @param {boolean} terminal
172
+ */
163
173
  constructor(major, name, terminal) {
164
174
  this.major = major;
165
175
  this.majorEncoded = major << 5;
166
176
  this.name = name;
167
177
  this.terminal = terminal;
168
178
  }
179
+ /* c8 ignore next 3 */
169
180
  toString() {
170
181
  return `Type[${this.major}].${this.name}`;
171
182
  }
183
+ /**
184
+ * @param {Type} typ
185
+ * @returns {number}
186
+ */
172
187
  compare(typ) {
173
188
  return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;
174
189
  }
175
190
  };
176
- __name(Type, "Type");
191
+ __name(_Type, "Type");
192
+ var Type = _Type;
177
193
  Type.uint = new Type(0, "uint", true);
178
194
  Type.negint = new Type(1, "negint", true);
179
195
  Type.bytes = new Type(2, "bytes", true);
@@ -187,7 +203,12 @@ Type.true = new Type(7, "true", true);
187
203
  Type.null = new Type(7, "null", true);
188
204
  Type.undefined = new Type(7, "undefined", true);
189
205
  Type.break = new Type(7, "break", true);
190
- var Token = class {
206
+ var _Token = class _Token {
207
+ /**
208
+ * @param {Type} type
209
+ * @param {any} [value]
210
+ * @param {number} [encodedLength]
211
+ */
191
212
  constructor(type, value, encodedLength) {
192
213
  this.type = type;
193
214
  this.value = value;
@@ -195,14 +216,19 @@ var Token = class {
195
216
  this.encodedBytes = void 0;
196
217
  this.byteValue = void 0;
197
218
  }
219
+ /* c8 ignore next 3 */
198
220
  toString() {
199
221
  return `Token[${this.type}].${this.value}`;
200
222
  }
201
223
  };
202
- __name(Token, "Token");
224
+ __name(_Token, "Token");
225
+ var Token = _Token;
203
226
 
204
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/byte-utils.js
205
- var useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === "function";
227
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/byte-utils.js
228
+ var useBuffer = globalThis.process && // @ts-ignore
229
+ !globalThis.process.browser && // @ts-ignore
230
+ globalThis.Buffer && // @ts-ignore
231
+ typeof globalThis.Buffer.isBuffer === "function";
206
232
  var textDecoder = new TextDecoder();
207
233
  var textEncoder = new TextEncoder();
208
234
  function isBuffer2(buf2) {
@@ -216,47 +242,133 @@ function asU8A(buf2) {
216
242
  return isBuffer2(buf2) ? new Uint8Array(buf2.buffer, buf2.byteOffset, buf2.byteLength) : buf2;
217
243
  }
218
244
  __name(asU8A, "asU8A");
219
- var toString = useBuffer ? (bytes, start, end) => {
220
- return end - start > 64 ? globalThis.Buffer.from(bytes.subarray(start, end)).toString("utf8") : utf8Slice(bytes, start, end);
221
- } : (bytes, start, end) => {
222
- return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end);
223
- };
224
- var fromString = useBuffer ? (string) => {
225
- return string.length > 64 ? globalThis.Buffer.from(string) : utf8ToBytes(string);
226
- } : (string) => {
227
- return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string);
228
- };
245
+ var toString = useBuffer ? (
246
+ // eslint-disable-line operator-linebreak
247
+ /**
248
+ * @param {Uint8Array} bytes
249
+ * @param {number} start
250
+ * @param {number} end
251
+ */
252
+ (bytes, start, end) => {
253
+ return end - start > 64 ? (
254
+ // eslint-disable-line operator-linebreak
255
+ // @ts-ignore
256
+ globalThis.Buffer.from(bytes.subarray(start, end)).toString("utf8")
257
+ ) : utf8Slice(bytes, start, end);
258
+ }
259
+ ) : (
260
+ // eslint-disable-line operator-linebreak
261
+ /**
262
+ * @param {Uint8Array} bytes
263
+ * @param {number} start
264
+ * @param {number} end
265
+ */
266
+ (bytes, start, end) => {
267
+ return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end);
268
+ }
269
+ );
270
+ var fromString = useBuffer ? (
271
+ // eslint-disable-line operator-linebreak
272
+ /**
273
+ * @param {string} string
274
+ */
275
+ (string) => {
276
+ return string.length > 64 ? (
277
+ // eslint-disable-line operator-linebreak
278
+ // @ts-ignore
279
+ globalThis.Buffer.from(string)
280
+ ) : utf8ToBytes(string);
281
+ }
282
+ ) : (
283
+ // eslint-disable-line operator-linebreak
284
+ /**
285
+ * @param {string} string
286
+ */
287
+ (string) => {
288
+ return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string);
289
+ }
290
+ );
229
291
  var fromArray = /* @__PURE__ */ __name((arr) => {
230
292
  return Uint8Array.from(arr);
231
293
  }, "fromArray");
232
- var slice = useBuffer ? (bytes, start, end) => {
233
- if (isBuffer2(bytes)) {
234
- return new Uint8Array(bytes.subarray(start, end));
235
- }
236
- return bytes.slice(start, end);
237
- } : (bytes, start, end) => {
238
- return bytes.slice(start, end);
239
- };
240
- var concat = useBuffer ? (chunks, length) => {
241
- chunks = chunks.map((c) => c instanceof Uint8Array ? c : globalThis.Buffer.from(c));
242
- return asU8A(globalThis.Buffer.concat(chunks, length));
243
- } : (chunks, length) => {
244
- const out = new Uint8Array(length);
245
- let off = 0;
246
- for (let b of chunks) {
247
- if (off + b.length > out.length) {
248
- b = b.subarray(0, out.length - off);
249
- }
250
- out.set(b, off);
251
- off += b.length;
252
- }
253
- return out;
254
- };
255
- var alloc = useBuffer ? (size) => {
256
- return globalThis.Buffer.allocUnsafe(size);
257
- } : (size) => {
258
- return new Uint8Array(size);
259
- };
294
+ var slice = useBuffer ? (
295
+ // eslint-disable-line operator-linebreak
296
+ /**
297
+ * @param {Uint8Array} bytes
298
+ * @param {number} start
299
+ * @param {number} end
300
+ */
301
+ (bytes, start, end) => {
302
+ if (isBuffer2(bytes)) {
303
+ return new Uint8Array(bytes.subarray(start, end));
304
+ }
305
+ return bytes.slice(start, end);
306
+ }
307
+ ) : (
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
+ return bytes.slice(start, end);
316
+ }
317
+ );
318
+ var concat = useBuffer ? (
319
+ // eslint-disable-line operator-linebreak
320
+ /**
321
+ * @param {Uint8Array[]} chunks
322
+ * @param {number} length
323
+ * @returns {Uint8Array}
324
+ */
325
+ (chunks, length) => {
326
+ chunks = chunks.map((c) => c instanceof Uint8Array ? c : (
327
+ // eslint-disable-line operator-linebreak
328
+ // @ts-ignore
329
+ globalThis.Buffer.from(c)
330
+ ));
331
+ return asU8A(globalThis.Buffer.concat(chunks, length));
332
+ }
333
+ ) : (
334
+ // eslint-disable-line operator-linebreak
335
+ /**
336
+ * @param {Uint8Array[]} chunks
337
+ * @param {number} length
338
+ * @returns {Uint8Array}
339
+ */
340
+ (chunks, length) => {
341
+ const out = new Uint8Array(length);
342
+ let off = 0;
343
+ for (let b of chunks) {
344
+ if (off + b.length > out.length) {
345
+ b = b.subarray(0, out.length - off);
346
+ }
347
+ out.set(b, off);
348
+ off += b.length;
349
+ }
350
+ return out;
351
+ }
352
+ );
353
+ var alloc = useBuffer ? (
354
+ // eslint-disable-line operator-linebreak
355
+ /**
356
+ * @param {number} size
357
+ * @returns {Uint8Array}
358
+ */
359
+ (size) => {
360
+ return globalThis.Buffer.allocUnsafe(size);
361
+ }
362
+ ) : (
363
+ // eslint-disable-line operator-linebreak
364
+ /**
365
+ * @param {number} size
366
+ * @returns {Uint8Array}
367
+ */
368
+ (size) => {
369
+ return new Uint8Array(size);
370
+ }
371
+ );
260
372
  function compare(b1, b2) {
261
373
  if (isBuffer2(b1) && isBuffer2(b2)) {
262
374
  return b1.compare(b2);
@@ -372,9 +484,12 @@ function decodeCodePointsArray(codePoints) {
372
484
  }
373
485
  __name(decodeCodePointsArray, "decodeCodePointsArray");
374
486
 
375
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/bl.js
487
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/bl.js
376
488
  var defaultChunkSize = 256;
377
- var Bl = class {
489
+ var _Bl = class _Bl {
490
+ /**
491
+ * @param {number} [chunkSize]
492
+ */
378
493
  constructor(chunkSize = defaultChunkSize) {
379
494
  this.chunkSize = chunkSize;
380
495
  this.cursor = 0;
@@ -393,6 +508,9 @@ var Bl = class {
393
508
  this.maxCursor = this._initReuseChunk.length - 1;
394
509
  }
395
510
  }
511
+ /**
512
+ * @param {Uint8Array|number[]} bytes
513
+ */
396
514
  push(bytes) {
397
515
  let topChunk = this.chunks[this.chunks.length - 1];
398
516
  const newMax = this.cursor + bytes.length;
@@ -422,6 +540,10 @@ var Bl = class {
422
540
  }
423
541
  this.cursor += bytes.length;
424
542
  }
543
+ /**
544
+ * @param {boolean} [reset]
545
+ * @returns {Uint8Array}
546
+ */
425
547
  toBytes(reset = false) {
426
548
  let byts;
427
549
  if (this.chunks.length === 1) {
@@ -442,9 +564,10 @@ var Bl = class {
442
564
  return byts;
443
565
  }
444
566
  };
445
- __name(Bl, "Bl");
567
+ __name(_Bl, "Bl");
568
+ var Bl = _Bl;
446
569
 
447
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/common.js
570
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/common.js
448
571
  var decodeErrPrefix = "CBOR decode error:";
449
572
  var encodeErrPrefix = "CBOR encode error:";
450
573
  var uintMinorPrefixBytes = [];
@@ -460,7 +583,7 @@ function assertEnoughData(data, pos, need) {
460
583
  }
461
584
  __name(assertEnoughData, "assertEnoughData");
462
585
 
463
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/0uint.js
586
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/0uint.js
464
587
  var uintBoundaries = [24, 256, 65536, 4294967296, BigInt("18446744073709551616")];
465
588
  function readUint8(data, offset, options) {
466
589
  assertEnoughData(data, offset, 1);
@@ -585,10 +708,13 @@ encodeUintValue.encodedSize = /* @__PURE__ */ __name(function encodedSize2(uint)
585
708
  return 9;
586
709
  }, "encodedSize");
587
710
  encodeUint.compareTokens = /* @__PURE__ */ __name(function compareTokens(tok1, tok2) {
588
- return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0;
711
+ return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : (
712
+ /* c8 ignore next */
713
+ 0
714
+ );
589
715
  }, "compareTokens");
590
716
 
591
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/1negint.js
717
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/1negint.js
592
718
  function decodeNegint8(data, pos, _minor, options) {
593
719
  return new Token(Type.negint, -1 - readUint8(data, pos + 1, options), 2);
594
720
  }
@@ -641,10 +767,13 @@ encodeNegint.encodedSize = /* @__PURE__ */ __name(function encodedSize3(token) {
641
767
  return 9;
642
768
  }, "encodedSize");
643
769
  encodeNegint.compareTokens = /* @__PURE__ */ __name(function compareTokens2(tok1, tok2) {
644
- return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : 0;
770
+ return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : (
771
+ /* c8 ignore next */
772
+ 0
773
+ );
645
774
  }, "compareTokens");
646
775
 
647
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/2bytes.js
776
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/2bytes.js
648
777
  function toToken(data, pos, prefix, length) {
649
778
  assertEnoughData(data, pos, prefix + length);
650
779
  const buf2 = slice(data, pos + prefix, pos + prefix + length);
@@ -700,7 +829,7 @@ function compareBytes(b1, b2) {
700
829
  }
701
830
  __name(compareBytes, "compareBytes");
702
831
 
703
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/3string.js
832
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/3string.js
704
833
  function toToken2(data, pos, prefix, length, options) {
705
834
  const totLength = prefix + length;
706
835
  assertEnoughData(data, pos, totLength);
@@ -737,7 +866,7 @@ function decodeString64(data, pos, _minor, options) {
737
866
  __name(decodeString64, "decodeString64");
738
867
  var encodeString = encodeBytes;
739
868
 
740
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/4array.js
869
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/4array.js
741
870
  function toToken3(_data, _pos, prefix, length) {
742
871
  return new Token(Type.array, length, prefix);
743
872
  }
@@ -782,7 +911,7 @@ encodeArray.encodedSize = /* @__PURE__ */ __name(function encodedSize5(token) {
782
911
  return encodeUintValue.encodedSize(token.value);
783
912
  }, "encodedSize");
784
913
 
785
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/5map.js
914
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/5map.js
786
915
  function toToken4(_data, _pos, prefix, length) {
787
916
  return new Token(Type.map, length, prefix);
788
917
  }
@@ -827,7 +956,7 @@ encodeMap.encodedSize = /* @__PURE__ */ __name(function encodedSize6(token) {
827
956
  return encodeUintValue.encodedSize(token.value);
828
957
  }, "encodedSize");
829
958
 
830
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/6tag.js
959
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/6tag.js
831
960
  function decodeTagCompact(_data, _pos, minor, _options) {
832
961
  return new Token(Type.tag, minor, 1);
833
962
  }
@@ -857,7 +986,7 @@ encodeTag.encodedSize = /* @__PURE__ */ __name(function encodedSize7(token) {
857
986
  return encodeUintValue.encodedSize(token.value);
858
987
  }, "encodedSize");
859
988
 
860
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/7float.js
989
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/7float.js
861
990
  var MINOR_FALSE = 20;
862
991
  var MINOR_TRUE = 21;
863
992
  var MINOR_NULL = 22;
@@ -984,7 +1113,8 @@ function encodeFloat16(inp) {
984
1113
  if (logicalExponent < -24) {
985
1114
  dataView.setUint16(0, 0);
986
1115
  } else if (logicalExponent < -14) {
987
- dataView.setUint16(0, (valu32 & 2147483648) >> 16 | 1 << 24 + logicalExponent, false);
1116
+ dataView.setUint16(0, (valu32 & 2147483648) >> 16 | /* sign bit */
1117
+ 1 << 24 + logicalExponent, false);
988
1118
  } else {
989
1119
  dataView.setUint16(0, (valu32 & 2147483648) >> 16 | logicalExponent + 15 << 10 | mantissa >> 13, false);
990
1120
  }
@@ -1045,7 +1175,7 @@ function readFloat64(ui8a2, pos) {
1045
1175
  __name(readFloat64, "readFloat64");
1046
1176
  encodeFloat.compareTokens = encodeUint.compareTokens;
1047
1177
 
1048
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/jump.js
1178
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/jump.js
1049
1179
  function invalidMinor(data, pos, minor) {
1050
1180
  throw new Error(`${decodeErrPrefix} encountered invalid minor (${minor}) for major ${data[pos] >>> 5}`);
1051
1181
  }
@@ -1204,12 +1334,17 @@ function quickEncodeToken(token) {
1204
1334
  }
1205
1335
  __name(quickEncodeToken, "quickEncodeToken");
1206
1336
 
1207
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/encode.js
1337
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/encode.js
1208
1338
  var defaultEncodeOptions = {
1209
1339
  float64: false,
1210
1340
  mapSorter,
1211
1341
  quickEncodeToken
1212
1342
  };
1343
+ var rfc8949EncodeOptions = Object.freeze({
1344
+ float64: true,
1345
+ mapSorter: rfc8949MapSorter,
1346
+ quickEncodeToken
1347
+ });
1213
1348
  function makeCborEncoders() {
1214
1349
  const encoders = [];
1215
1350
  encoders[Type.uint.major] = encodeUint;
@@ -1225,11 +1360,19 @@ function makeCborEncoders() {
1225
1360
  __name(makeCborEncoders, "makeCborEncoders");
1226
1361
  var cborEncoders = makeCborEncoders();
1227
1362
  var buf = new Bl();
1228
- var Ref = class {
1363
+ var _Ref = class _Ref {
1364
+ /**
1365
+ * @param {object|any[]} obj
1366
+ * @param {Reference|undefined} parent
1367
+ */
1229
1368
  constructor(obj, parent) {
1230
1369
  this.obj = obj;
1231
1370
  this.parent = parent;
1232
1371
  }
1372
+ /**
1373
+ * @param {object|any[]} obj
1374
+ * @returns {boolean}
1375
+ */
1233
1376
  includes(obj) {
1234
1377
  let p = this;
1235
1378
  do {
@@ -1239,14 +1382,20 @@ var Ref = class {
1239
1382
  } while (p = p.parent);
1240
1383
  return false;
1241
1384
  }
1385
+ /**
1386
+ * @param {Reference|undefined} stack
1387
+ * @param {object|any[]} obj
1388
+ * @returns {Reference}
1389
+ */
1242
1390
  static createCheck(stack, obj) {
1243
1391
  if (stack && stack.includes(obj)) {
1244
1392
  throw new Error(`${encodeErrPrefix} object contains circular references`);
1245
1393
  }
1246
- return new Ref(obj, stack);
1394
+ return new _Ref(obj, stack);
1247
1395
  }
1248
1396
  };
1249
- __name(Ref, "Ref");
1397
+ __name(_Ref, "Ref");
1398
+ var Ref = _Ref;
1250
1399
  var simpleTokens = {
1251
1400
  null: new Token(Type.null, null),
1252
1401
  undefined: new Token(Type.undefined, void 0),
@@ -1256,6 +1405,13 @@ var simpleTokens = {
1256
1405
  emptyMap: new Token(Type.map, 0)
1257
1406
  };
1258
1407
  var typeEncoders = {
1408
+ /**
1409
+ * @param {any} obj
1410
+ * @param {string} _typ
1411
+ * @param {EncodeOptions} _options
1412
+ * @param {Reference} [_refStack]
1413
+ * @returns {TokenOrNestedTokens}
1414
+ */
1259
1415
  number(obj, _typ, _options, _refStack) {
1260
1416
  if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) {
1261
1417
  return new Token(Type.float, obj);
@@ -1265,6 +1421,13 @@ var typeEncoders = {
1265
1421
  return new Token(Type.negint, obj);
1266
1422
  }
1267
1423
  },
1424
+ /**
1425
+ * @param {any} obj
1426
+ * @param {string} _typ
1427
+ * @param {EncodeOptions} _options
1428
+ * @param {Reference} [_refStack]
1429
+ * @returns {TokenOrNestedTokens}
1430
+ */
1268
1431
  bigint(obj, _typ, _options, _refStack) {
1269
1432
  if (obj >= BigInt(0)) {
1270
1433
  return new Token(Type.uint, obj);
@@ -1272,27 +1435,83 @@ var typeEncoders = {
1272
1435
  return new Token(Type.negint, obj);
1273
1436
  }
1274
1437
  },
1438
+ /**
1439
+ * @param {any} obj
1440
+ * @param {string} _typ
1441
+ * @param {EncodeOptions} _options
1442
+ * @param {Reference} [_refStack]
1443
+ * @returns {TokenOrNestedTokens}
1444
+ */
1275
1445
  Uint8Array(obj, _typ, _options, _refStack) {
1276
1446
  return new Token(Type.bytes, obj);
1277
1447
  },
1448
+ /**
1449
+ * @param {any} obj
1450
+ * @param {string} _typ
1451
+ * @param {EncodeOptions} _options
1452
+ * @param {Reference} [_refStack]
1453
+ * @returns {TokenOrNestedTokens}
1454
+ */
1278
1455
  string(obj, _typ, _options, _refStack) {
1279
1456
  return new Token(Type.string, obj);
1280
1457
  },
1458
+ /**
1459
+ * @param {any} obj
1460
+ * @param {string} _typ
1461
+ * @param {EncodeOptions} _options
1462
+ * @param {Reference} [_refStack]
1463
+ * @returns {TokenOrNestedTokens}
1464
+ */
1281
1465
  boolean(obj, _typ, _options, _refStack) {
1282
1466
  return obj ? simpleTokens.true : simpleTokens.false;
1283
1467
  },
1468
+ /**
1469
+ * @param {any} _obj
1470
+ * @param {string} _typ
1471
+ * @param {EncodeOptions} _options
1472
+ * @param {Reference} [_refStack]
1473
+ * @returns {TokenOrNestedTokens}
1474
+ */
1284
1475
  null(_obj, _typ, _options, _refStack) {
1285
1476
  return simpleTokens.null;
1286
1477
  },
1478
+ /**
1479
+ * @param {any} _obj
1480
+ * @param {string} _typ
1481
+ * @param {EncodeOptions} _options
1482
+ * @param {Reference} [_refStack]
1483
+ * @returns {TokenOrNestedTokens}
1484
+ */
1287
1485
  undefined(_obj, _typ, _options, _refStack) {
1288
1486
  return simpleTokens.undefined;
1289
1487
  },
1488
+ /**
1489
+ * @param {any} obj
1490
+ * @param {string} _typ
1491
+ * @param {EncodeOptions} _options
1492
+ * @param {Reference} [_refStack]
1493
+ * @returns {TokenOrNestedTokens}
1494
+ */
1290
1495
  ArrayBuffer(obj, _typ, _options, _refStack) {
1291
1496
  return new Token(Type.bytes, new Uint8Array(obj));
1292
1497
  },
1498
+ /**
1499
+ * @param {any} obj
1500
+ * @param {string} _typ
1501
+ * @param {EncodeOptions} _options
1502
+ * @param {Reference} [_refStack]
1503
+ * @returns {TokenOrNestedTokens}
1504
+ */
1293
1505
  DataView(obj, _typ, _options, _refStack) {
1294
1506
  return new Token(Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));
1295
1507
  },
1508
+ /**
1509
+ * @param {any} obj
1510
+ * @param {string} _typ
1511
+ * @param {EncodeOptions} options
1512
+ * @param {Reference} [refStack]
1513
+ * @returns {TokenOrNestedTokens}
1514
+ */
1296
1515
  Array(obj, _typ, options, refStack) {
1297
1516
  if (!obj.length) {
1298
1517
  if (options.addBreakTokens === true) {
@@ -1311,6 +1530,13 @@ var typeEncoders = {
1311
1530
  }
1312
1531
  return [new Token(Type.array, obj.length), entries];
1313
1532
  },
1533
+ /**
1534
+ * @param {any} obj
1535
+ * @param {string} typ
1536
+ * @param {EncodeOptions} options
1537
+ * @param {Reference} [refStack]
1538
+ * @returns {TokenOrNestedTokens}
1539
+ */
1314
1540
  Object(obj, typ, options, refStack) {
1315
1541
  const isMap = typ !== "Object";
1316
1542
  const keys = isMap ? obj.keys() : Object.keys(obj);
@@ -1344,7 +1570,8 @@ for (const typ of "Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt6
1344
1570
  }
1345
1571
  function objectToTokens(obj, options = {}, refStack) {
1346
1572
  const typ = is(obj);
1347
- const customTypeEncoder = options && options.typeEncoders && options.typeEncoders[typ] || typeEncoders[typ];
1573
+ const customTypeEncoder = options && options.typeEncoders && /** @type {OptionalTypeEncoder} */
1574
+ options.typeEncoders[typ] || typeEncoders[typ];
1348
1575
  if (typeof customTypeEncoder === "function") {
1349
1576
  const tokens = customTypeEncoder(obj, typ, options, refStack);
1350
1577
  if (tokens != null) {
@@ -1378,6 +1605,31 @@ function mapSorter(e1, e2) {
1378
1605
  return tcmp;
1379
1606
  }
1380
1607
  __name(mapSorter, "mapSorter");
1608
+ function rfc8949MapSorter(e1, e2) {
1609
+ if (e1[0] instanceof Token && e2[0] instanceof Token) {
1610
+ const t1 = (
1611
+ /** @type {TokenEx} */
1612
+ e1[0]
1613
+ );
1614
+ const t2 = (
1615
+ /** @type {TokenEx} */
1616
+ e2[0]
1617
+ );
1618
+ if (!t1._keyBytes) {
1619
+ t1._keyBytes = encodeRfc8949(t1.value);
1620
+ }
1621
+ if (!t2._keyBytes) {
1622
+ t2._keyBytes = encodeRfc8949(t2.value);
1623
+ }
1624
+ return compare(t1._keyBytes, t2._keyBytes);
1625
+ }
1626
+ throw new Error("rfc8949MapSorter: complex key types are not supported yet");
1627
+ }
1628
+ __name(rfc8949MapSorter, "rfc8949MapSorter");
1629
+ function encodeRfc8949(data) {
1630
+ return encodeCustom(data, cborEncoders, rfc8949EncodeOptions);
1631
+ }
1632
+ __name(encodeRfc8949, "encodeRfc8949");
1381
1633
  function tokensToEncoded(buf2, tokens, encoders, options) {
1382
1634
  if (Array.isArray(tokens)) {
1383
1635
  for (const token of tokens) {
@@ -1417,14 +1669,18 @@ function encode(data, options) {
1417
1669
  }
1418
1670
  __name(encode, "encode");
1419
1671
 
1420
- // ../../../node_modules/.pnpm/cborg@4.2.9/node_modules/cborg/lib/decode.js
1672
+ // ../../../node_modules/.pnpm/cborg@4.3.0/node_modules/cborg/lib/decode.js
1421
1673
  var defaultDecodeOptions = {
1422
1674
  strict: false,
1423
1675
  allowIndefinite: true,
1424
1676
  allowUndefined: true,
1425
1677
  allowBigInt: true
1426
1678
  };
1427
- var Tokeniser = class {
1679
+ var _Tokeniser = class _Tokeniser {
1680
+ /**
1681
+ * @param {Uint8Array} data
1682
+ * @param {DecodeOptions} options
1683
+ */
1428
1684
  constructor(data, options = {}) {
1429
1685
  this._pos = 0;
1430
1686
  this.data = data;
@@ -1451,9 +1707,10 @@ var Tokeniser = class {
1451
1707
  return token;
1452
1708
  }
1453
1709
  };
1454
- __name(Tokeniser, "Tokeniser");
1455
- var DONE = Symbol.for("DONE");
1456
- var BREAK = Symbol.for("BREAK");
1710
+ __name(_Tokeniser, "Tokeniser");
1711
+ var Tokeniser = _Tokeniser;
1712
+ var DONE = /* @__PURE__ */ Symbol.for("DONE");
1713
+ var BREAK = /* @__PURE__ */ Symbol.for("BREAK");
1457
1714
  function tokenToArray(token, tokeniser, options) {
1458
1715
  const arr = [];
1459
1716
  for (let i = 0; i < token.value; i++) {
@@ -1561,7 +1818,7 @@ function decode(data, options) {
1561
1818
  __name(decode, "decode");
1562
1819
 
1563
1820
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/CborldError.js
1564
- var CborldError = class extends Error {
1821
+ var _CborldError = class _CborldError extends Error {
1565
1822
  constructor(value, message) {
1566
1823
  super();
1567
1824
  this.message = message;
@@ -1570,14 +1827,18 @@ var CborldError = class extends Error {
1570
1827
  this.name = this.constructor.name;
1571
1828
  }
1572
1829
  };
1573
- __name(CborldError, "CborldError");
1830
+ __name(_CborldError, "CborldError");
1831
+ var CborldError = _CborldError;
1574
1832
 
1575
1833
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/keywords.js
1576
1834
  var KEYWORDS = /* @__PURE__ */ new Map([
1835
+ // ordered is important, do not change
1577
1836
  ["@context", 0],
1578
1837
  ["@type", 2],
1579
1838
  ["@id", 4],
1580
1839
  ["@value", 6],
1840
+ // alphabetized after `@context`, `@type`, `@id`, `@value`
1841
+ // IDs <= 24 represented with 1 byte, IDs > 24 use 2+ bytes
1581
1842
  ["@direction", 8],
1582
1843
  ["@graph", 10],
1583
1844
  ["@included", 12],
@@ -1587,6 +1848,7 @@ var KEYWORDS = /* @__PURE__ */ new Map([
1587
1848
  ["@list", 20],
1588
1849
  ["@nest", 22],
1589
1850
  ["@reverse", 24],
1851
+ // TODO: remove these? these only appear in frames and contexts
1590
1852
  ["@base", 26],
1591
1853
  ["@container", 28],
1592
1854
  ["@default", 30],
@@ -1605,15 +1867,18 @@ var KEYWORDS = /* @__PURE__ */ new Map([
1605
1867
  var FIRST_CUSTOM_TERM_ID = 100;
1606
1868
 
1607
1869
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/CborldDecoder.js
1608
- var CborldDecoder = class {
1870
+ var _CborldDecoder = class _CborldDecoder {
1871
+ // eslint-disable-next-line no-unused-vars
1609
1872
  decode({ value } = {}) {
1610
1873
  throw new Error("Must be implemented by derived class.");
1611
1874
  }
1875
+ // eslint-disable-next-line no-unused-vars
1612
1876
  static createDecoder({ value, transformer } = {}) {
1613
1877
  throw new Error("Must be implemented by derived class.");
1614
1878
  }
1615
1879
  };
1616
- __name(CborldDecoder, "CborldDecoder");
1880
+ __name(_CborldDecoder, "CborldDecoder");
1881
+ var CborldDecoder = _CborldDecoder;
1617
1882
 
1618
1883
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/registeredContexts.js
1619
1884
  var ID_TO_URL = /* @__PURE__ */ new Map();
@@ -1646,7 +1911,7 @@ function _addRegistration(id, url) {
1646
1911
  __name(_addRegistration, "_addRegistration");
1647
1912
 
1648
1913
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/ContextDecoder.js
1649
- var ContextDecoder = class extends CborldDecoder {
1914
+ var _ContextDecoder = class _ContextDecoder extends CborldDecoder {
1650
1915
  constructor({ reverseAppContextMap } = {}) {
1651
1916
  super();
1652
1917
  this.reverseAppContextMap = reverseAppContextMap;
@@ -1666,10 +1931,11 @@ var ContextDecoder = class extends CborldDecoder {
1666
1931
  }
1667
1932
  static createDecoder({ transformer } = {}) {
1668
1933
  const { reverseAppContextMap } = transformer;
1669
- return new ContextDecoder({ reverseAppContextMap });
1934
+ return new _ContextDecoder({ reverseAppContextMap });
1670
1935
  }
1671
1936
  };
1672
- __name(ContextDecoder, "ContextDecoder");
1937
+ __name(_ContextDecoder, "ContextDecoder");
1938
+ var ContextDecoder = _ContextDecoder;
1673
1939
  function _mapToObject(map) {
1674
1940
  if (Array.isArray(map)) {
1675
1941
  return map.map(_mapToObject);
@@ -1691,8 +1957,8 @@ function inspect(data, options) {
1691
1957
  }
1692
1958
  __name(inspect, "inspect");
1693
1959
 
1694
- // ../../../node_modules/.pnpm/js-base64@3.7.7/node_modules/js-base64/base64.mjs
1695
- var version = "3.7.7";
1960
+ // ../../../node_modules/.pnpm/js-base64@3.7.8/node_modules/js-base64/base64.mjs
1961
+ var version = "3.7.8";
1696
1962
  var VERSION = version;
1697
1963
  var _hasBuffer = typeof Buffer === "function";
1698
1964
  var _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0;
@@ -1762,12 +2028,19 @@ var atobPolyfill = /* @__PURE__ */ __name((asc) => {
1762
2028
  if (!b64re.test(asc))
1763
2029
  throw new TypeError("malformed base64.");
1764
2030
  asc += "==".slice(2 - (asc.length & 3));
1765
- let u24, bin = "", r1, r2;
2031
+ let u24, r1, r2;
2032
+ let binArray = [];
1766
2033
  for (let i = 0; i < asc.length; ) {
1767
2034
  u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);
1768
- 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);
2035
+ if (r1 === 64) {
2036
+ binArray.push(_fromCC(u24 >> 16 & 255));
2037
+ } else if (r2 === 64) {
2038
+ binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));
2039
+ } else {
2040
+ binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));
2041
+ }
1769
2042
  }
1770
- return bin;
2043
+ return binArray.join("");
1771
2044
  }, "atobPolyfill");
1772
2045
  var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
1773
2046
  var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
@@ -1947,7 +2220,7 @@ function decode4(input) {
1947
2220
  __name(decode4, "decode");
1948
2221
 
1949
2222
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/MultibaseDecoder.js
1950
- var MultibaseDecoder = class extends CborldDecoder {
2223
+ var _MultibaseDecoder = class _MultibaseDecoder extends CborldDecoder {
1951
2224
  decode({ value } = {}) {
1952
2225
  const { buffer: buffer2, byteOffset, length } = value;
1953
2226
  const suffix = new Uint8Array(buffer2, byteOffset + 1, length - 1);
@@ -1964,24 +2237,95 @@ var MultibaseDecoder = class extends CborldDecoder {
1964
2237
  return false;
1965
2238
  }
1966
2239
  if (value[0] === 122 || value[0] === 77) {
1967
- return new MultibaseDecoder();
2240
+ return new _MultibaseDecoder();
1968
2241
  }
1969
2242
  }
1970
2243
  };
1971
- __name(MultibaseDecoder, "MultibaseDecoder");
2244
+ __name(_MultibaseDecoder, "MultibaseDecoder");
2245
+ var MultibaseDecoder = _MultibaseDecoder;
1972
2246
 
1973
2247
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/Transformer.js
1974
- var Transformer = class {
2248
+ var _Transformer = class _Transformer {
2249
+ /**
2250
+ * Creates a new Transformer for transforming CBOR-LD <=> JSON-LD.
2251
+ *
2252
+ * @param {object} options - The options to use when encoding to CBOR-LD.
2253
+ * @param {documentLoaderFunction} options.documentLoader -The document
2254
+ * loader to use when resolving JSON-LD Context URLs.
2255
+ * @param {Map} [options.appContextMap] - A map of JSON-LD Context URLs and
2256
+ * their encoded CBOR-LD values (must be values greater than 32767
2257
+ * (0x7FFF)).
2258
+ */
1975
2259
  constructor({ appContextMap, documentLoader } = {}) {
1976
2260
  this.appContextMap = appContextMap;
1977
2261
  this.documentLoader = documentLoader;
1978
2262
  }
2263
+ // default no-op hook functions
1979
2264
  _beforeObjectContexts() {
1980
2265
  }
1981
2266
  _afterObjectContexts() {
1982
2267
  }
1983
2268
  _beforeTypeScopedContexts() {
1984
2269
  }
2270
+ /**
2271
+ * CBOR-LD is a semantic compression format; it uses the contextual
2272
+ * information provided by JSON-LD contexts to compress JSON-LD objects
2273
+ * to CBOR-LD (and vice versa).
2274
+ *
2275
+ * The purpose of this internal transform function is to either enable
2276
+ * transformation of a JSON-LD object to CBOR-LD (compression) or vice versa
2277
+ * (decompression). It does this by:
2278
+ *
2279
+ * 1. Finding the matching term definition from the active JSON-LD
2280
+ * context for each encountered term in the data that is being
2281
+ * transformed.
2282
+ * 2. Mapping each term to the target format (compressed / decompressed) and
2283
+ * creating value codec (encoder / decoder) for each value associate with
2284
+ * the term.
2285
+ *
2286
+ * When compressing, the transform function maps JSON keys (strings)
2287
+ * encountered in the JSON-LD object to term IDs (integers) and value
2288
+ * encoders.
2289
+ *
2290
+ * When decompressing, the transform function maps term IDs (integers) to
2291
+ * JSON keys (strings) and value decoders.
2292
+ *
2293
+ * The transform process will populate the given `transformMap` (a `Map`)
2294
+ * with keys (strings or IDs based on compression / decompression) and values
2295
+ * (the associated encoders / decoders). This `transformMap` can then be
2296
+ * passed to the `cborg` library to output JSON or CBOR.
2297
+ *
2298
+ * In order to match each JSON key / term ID with the right term
2299
+ * definition, it's important to understand how context is applied in
2300
+ * JSON-LD, i.e., which context is "active" at a certain place in the
2301
+ * object. There are three ways contexts become active to consider in
2302
+ * JSON-LD:
2303
+ *
2304
+ * 1. Embedded contexts. An embedded context is expressed by using the
2305
+ * `@context` keyword in a JSON-LD object. It is active on the object
2306
+ * where it appears and propagates to any nested objects.
2307
+ * 2. Type-scoped contexts. Such a context is defined in another context
2308
+ * and bound to a particular type. It will become active based on the
2309
+ * presence of the `@type` property (or an alias of it) and a matching
2310
+ * type value. By default, it *does not* propagate to nested objects,
2311
+ * i.e., it becomes inactive when a nested object does not have a matching
2312
+ * type.
2313
+ * 3. Property-scoped contexts. Such a context is defined in another context
2314
+ * and bound to a particular property. It will become active based on the
2315
+ * presence of a particular term, i.e., JSON key. By default, it
2316
+ * propagates, i.e., all terms defined by the context will be applicable
2317
+ * to the whole subtree associated with the property in the JSON object.
2318
+ *
2319
+ * The transform function maintains a stack of active contexts based on the
2320
+ * above rules to ensure that the right term definitions are matched up with
2321
+ * each JSON key in the JSON-LD object (when compressing) and each term ID in
2322
+ * the CBOR-LD object (when decompressing).
2323
+ *
2324
+ * @param {object} options - The options to use.
2325
+ * @param {object} options.obj - The object to transform.
2326
+ * @param {Map} options.transformMap - The transformation map to populate.
2327
+ * @param {Array} [options.contextStack] - The current context stack.
2328
+ */
1985
2329
  async _transform({ obj, transformMap, contextStack = [] }) {
1986
2330
  this._beforeObjectContexts({ obj, transformMap });
1987
2331
  let activeCtx = await this._applyEmbeddedContexts({ obj, contextStack });
@@ -2050,6 +2394,16 @@ var Transformer = class {
2050
2394
  }
2051
2395
  activeCtx.revert();
2052
2396
  }
2397
+ /**
2398
+ * Apply the embedded contexts in the given object to produce an
2399
+ * active context.
2400
+ *
2401
+ * @param {object} options - The options to use.
2402
+ * @param {object} options.obj - The object to get the active context for.
2403
+ * @param {Array} [options.contextStack] - The stack of active contexts.
2404
+ *
2405
+ * @returns {Promise<object>} - The active context instance.
2406
+ */
2053
2407
  async _applyEmbeddedContexts({ obj, contextStack }) {
2054
2408
  const stackTop = contextStack.length;
2055
2409
  const localContexts = obj["@context"];
@@ -2267,14 +2621,16 @@ var Transformer = class {
2267
2621
  return { term, plural };
2268
2622
  }
2269
2623
  };
2270
- __name(Transformer, "Transformer");
2624
+ __name(_Transformer, "Transformer");
2625
+ var Transformer = _Transformer;
2271
2626
 
2272
2627
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/Base58DidUrlDecoder.js
2273
2628
  var ID_TO_SCHEME = /* @__PURE__ */ new Map([
2629
+ // Note: only v1 mainnet is supported
2274
2630
  [1024, "did:v1:nym:"],
2275
2631
  [1025, "did:key:"]
2276
2632
  ]);
2277
- var Base58DidUrlDecoder = class extends CborldDecoder {
2633
+ var _Base58DidUrlDecoder = class _Base58DidUrlDecoder extends CborldDecoder {
2278
2634
  decode({ value } = {}) {
2279
2635
  let url = ID_TO_SCHEME.get(value[0]);
2280
2636
  if (typeof value[1] === "string") {
@@ -2298,13 +2654,14 @@ var Base58DidUrlDecoder = class extends CborldDecoder {
2298
2654
  if (!ID_TO_SCHEME.has(value[0])) {
2299
2655
  return false;
2300
2656
  }
2301
- return new Base58DidUrlDecoder();
2657
+ return new _Base58DidUrlDecoder();
2302
2658
  }
2303
2659
  };
2304
- __name(Base58DidUrlDecoder, "Base58DidUrlDecoder");
2660
+ __name(_Base58DidUrlDecoder, "Base58DidUrlDecoder");
2661
+ var Base58DidUrlDecoder = _Base58DidUrlDecoder;
2305
2662
 
2306
2663
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/HttpUrlDecoder.js
2307
- var HttpUrlDecoder = class extends CborldDecoder {
2664
+ var _HttpUrlDecoder = class _HttpUrlDecoder extends CborldDecoder {
2308
2665
  constructor({ secure } = {}) {
2309
2666
  super();
2310
2667
  this.secure = secure;
@@ -2317,10 +2674,11 @@ var HttpUrlDecoder = class extends CborldDecoder {
2317
2674
  if (!(value.length === 2 && typeof value[1] === "string")) {
2318
2675
  return false;
2319
2676
  }
2320
- return new HttpUrlDecoder({ secure: value[0] === 2 });
2677
+ return new _HttpUrlDecoder({ secure: value[0] === 2 });
2321
2678
  }
2322
2679
  };
2323
- __name(HttpUrlDecoder, "HttpUrlDecoder");
2680
+ __name(_HttpUrlDecoder, "HttpUrlDecoder");
2681
+ var HttpUrlDecoder = _HttpUrlDecoder;
2324
2682
 
2325
2683
  // ../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js
2326
2684
  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;
@@ -2380,18 +2738,19 @@ __name(parse, "parse");
2380
2738
  var parse_default = parse;
2381
2739
 
2382
2740
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UuidUrnDecoder.js
2383
- var UuidUrnDecoder = class extends CborldDecoder {
2741
+ var _UuidUrnDecoder = class _UuidUrnDecoder extends CborldDecoder {
2384
2742
  decode({ value } = {}) {
2385
2743
  const uuid = typeof value[1] === "string" ? value[1] : stringify_default(value[1]);
2386
2744
  return `urn:uuid:${uuid}`;
2387
2745
  }
2388
2746
  static createDecoder({ value } = {}) {
2389
2747
  if (value.length === 2 && (typeof value[1] === "string" || value[1] instanceof Uint8Array)) {
2390
- return new UuidUrnDecoder();
2748
+ return new _UuidUrnDecoder();
2391
2749
  }
2392
2750
  }
2393
2751
  };
2394
- __name(UuidUrnDecoder, "UuidUrnDecoder");
2752
+ __name(_UuidUrnDecoder, "UuidUrnDecoder");
2753
+ var UuidUrnDecoder = _UuidUrnDecoder;
2395
2754
 
2396
2755
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UriDecoder.js
2397
2756
  var SCHEME_ID_TO_DECODER = /* @__PURE__ */ new Map([
@@ -2401,7 +2760,7 @@ var SCHEME_ID_TO_DECODER = /* @__PURE__ */ new Map([
2401
2760
  [1024, Base58DidUrlDecoder],
2402
2761
  [1025, Base58DidUrlDecoder]
2403
2762
  ]);
2404
- var UriDecoder = class extends CborldDecoder {
2763
+ var _UriDecoder = class _UriDecoder extends CborldDecoder {
2405
2764
  static createDecoder({ value } = {}) {
2406
2765
  if (!(Array.isArray(value) || value.length > 1)) {
2407
2766
  return false;
@@ -2410,10 +2769,11 @@ var UriDecoder = class extends CborldDecoder {
2410
2769
  return DecoderClass && DecoderClass.createDecoder({ value });
2411
2770
  }
2412
2771
  };
2413
- __name(UriDecoder, "UriDecoder");
2772
+ __name(_UriDecoder, "UriDecoder");
2773
+ var UriDecoder = _UriDecoder;
2414
2774
 
2415
2775
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/VocabTermDecoder.js
2416
- var VocabTermDecoder = class extends CborldDecoder {
2776
+ var _VocabTermDecoder = class _VocabTermDecoder extends CborldDecoder {
2417
2777
  constructor({ term } = {}) {
2418
2778
  super();
2419
2779
  this.term = term;
@@ -2427,28 +2787,30 @@ var VocabTermDecoder = class extends CborldDecoder {
2427
2787
  }
2428
2788
  const term = transformer.idToTerm.get(value);
2429
2789
  if (term !== void 0) {
2430
- return new VocabTermDecoder({ term });
2790
+ return new _VocabTermDecoder({ term });
2431
2791
  }
2432
2792
  }
2433
2793
  };
2434
- __name(VocabTermDecoder, "VocabTermDecoder");
2794
+ __name(_VocabTermDecoder, "VocabTermDecoder");
2795
+ var VocabTermDecoder = _VocabTermDecoder;
2435
2796
 
2436
2797
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateDecoder.js
2437
- var XsdDateDecoder = class extends CborldDecoder {
2798
+ var _XsdDateDecoder = class _XsdDateDecoder extends CborldDecoder {
2438
2799
  decode({ value } = {}) {
2439
2800
  const dateString = new Date(value * 1e3).toISOString();
2440
2801
  return dateString.substring(0, dateString.indexOf("T"));
2441
2802
  }
2442
2803
  static createDecoder({ value } = {}) {
2443
2804
  if (typeof value === "number") {
2444
- return new XsdDateDecoder();
2805
+ return new _XsdDateDecoder();
2445
2806
  }
2446
2807
  }
2447
2808
  };
2448
- __name(XsdDateDecoder, "XsdDateDecoder");
2809
+ __name(_XsdDateDecoder, "XsdDateDecoder");
2810
+ var XsdDateDecoder = _XsdDateDecoder;
2449
2811
 
2450
2812
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateTimeDecoder.js
2451
- var XsdDateTimeDecoder = class extends CborldDecoder {
2813
+ var _XsdDateTimeDecoder = class _XsdDateTimeDecoder extends CborldDecoder {
2452
2814
  constructor({ value } = {}) {
2453
2815
  super();
2454
2816
  this.value = value;
@@ -2461,14 +2823,15 @@ var XsdDateTimeDecoder = class extends CborldDecoder {
2461
2823
  }
2462
2824
  static createDecoder({ value } = {}) {
2463
2825
  if (typeof value === "number") {
2464
- return new XsdDateTimeDecoder();
2826
+ return new _XsdDateTimeDecoder();
2465
2827
  }
2466
2828
  if (Array.isArray(value) && value.length === 2 && (typeof value[0] === "number" || typeof value[1] === "number")) {
2467
- return new XsdDateTimeDecoder();
2829
+ return new _XsdDateTimeDecoder();
2468
2830
  }
2469
2831
  }
2470
2832
  };
2471
- __name(XsdDateTimeDecoder, "XsdDateTimeDecoder");
2833
+ __name(_XsdDateTimeDecoder, "XsdDateTimeDecoder");
2834
+ var XsdDateTimeDecoder = _XsdDateTimeDecoder;
2472
2835
 
2473
2836
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/Decompressor.js
2474
2837
  var TYPE_DECODERS = /* @__PURE__ */ new Map([
@@ -2480,7 +2843,19 @@ var TYPE_DECODERS = /* @__PURE__ */ new Map([
2480
2843
  ]);
2481
2844
  var CONTEXT_TERM_ID = KEYWORDS.get("@context");
2482
2845
  var CONTEXT_TERM_ID_PLURAL = CONTEXT_TERM_ID + 1;
2483
- var Decompressor = class extends Transformer {
2846
+ var _Decompressor = class _Decompressor extends Transformer {
2847
+ /**
2848
+ * Creates a new Decompressor for generating a JSON-LD document from
2849
+ * compressed CBOR-LD. The created instance may only be used on a single
2850
+ * CBOR-LD input at a time.
2851
+ *
2852
+ * @param {object} options - The options to use when encoding to CBOR-LD.
2853
+ * @param {documentLoaderFunction} options.documentLoader - The document
2854
+ * loader to use when resolving JSON-LD Context URLs.
2855
+ * @param {Map} [options.appContextMap] - A map of JSON-LD Context URLs and
2856
+ * their encoded CBOR-LD values (must be values greater than 32767
2857
+ * (0x7FFF)).
2858
+ */
2484
2859
  constructor({ documentLoader, appContextMap } = {}) {
2485
2860
  super({ documentLoader, appContextMap });
2486
2861
  this.reverseAppContextMap = /* @__PURE__ */ new Map();
@@ -2490,6 +2865,17 @@ var Decompressor = class extends Transformer {
2490
2865
  }
2491
2866
  }
2492
2867
  }
2868
+ /**
2869
+ * Decompresses the given CBOR-LD byte array to a JSON-LD document.
2870
+ *
2871
+ * @param {object} options - The options to use.
2872
+ * @param {Uint8Array} options.compressedBytes - The CBOR-LD compressed
2873
+ * bytes that follow the compressed CBOR-LD CBOR tag.
2874
+ * @param {diagnosticFunction} [options.diagnose] - A function that, if
2875
+ * provided, is called with diagnostic information.
2876
+ *
2877
+ * @returns {Promise<object>} - The JSON-LD document.
2878
+ */
2493
2879
  async decompress({ compressedBytes, diagnose } = {}) {
2494
2880
  this.contextMap = /* @__PURE__ */ new Map();
2495
2881
  this.termToId = new Map(KEYWORDS);
@@ -2657,7 +3043,8 @@ var Decompressor = class extends Transformer {
2657
3043
  obj[term] = plural ? entries : entries[0];
2658
3044
  }
2659
3045
  };
2660
- __name(Decompressor, "Decompressor");
3046
+ __name(_Decompressor, "Decompressor");
3047
+ var Decompressor = _Decompressor;
2661
3048
  function _sortEntriesByTerm([{ term: t1 }], [{ term: t2 }]) {
2662
3049
  return t1 < t2 ? -1 : t1 > t2 ? 1 : 0;
2663
3050
  }
@@ -2718,18 +3105,20 @@ async function decode5({
2718
3105
  __name(decode5, "decode");
2719
3106
 
2720
3107
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/CborldEncoder.js
2721
- var CborldEncoder = class {
3108
+ var _CborldEncoder = class _CborldEncoder {
2722
3109
  encode() {
2723
3110
  throw new Error("Must be implemented by derived class.");
2724
3111
  }
3112
+ // eslint-disable-next-line no-unused-vars
2725
3113
  static createEncoder({ value } = {}) {
2726
3114
  throw new Error("Must be implemented by derived class.");
2727
3115
  }
2728
3116
  };
2729
- __name(CborldEncoder, "CborldEncoder");
3117
+ __name(_CborldEncoder, "CborldEncoder");
3118
+ var CborldEncoder = _CborldEncoder;
2730
3119
 
2731
3120
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/ContextEncoder.js
2732
- var ContextEncoder = class extends CborldEncoder {
3121
+ var _ContextEncoder = class _ContextEncoder extends CborldEncoder {
2733
3122
  constructor({ context, appContextMap } = {}) {
2734
3123
  super();
2735
3124
  this.context = context;
@@ -2748,13 +3137,14 @@ var ContextEncoder = class extends CborldEncoder {
2748
3137
  return false;
2749
3138
  }
2750
3139
  const { appContextMap } = transformer;
2751
- return new ContextEncoder({ context: value, appContextMap });
3140
+ return new _ContextEncoder({ context: value, appContextMap });
2752
3141
  }
2753
3142
  };
2754
- __name(ContextEncoder, "ContextEncoder");
3143
+ __name(_ContextEncoder, "ContextEncoder");
3144
+ var ContextEncoder = _ContextEncoder;
2755
3145
 
2756
3146
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/MultibaseEncoder.js
2757
- var MultibaseEncoder = class extends CborldEncoder {
3147
+ var _MultibaseEncoder = class _MultibaseEncoder extends CborldEncoder {
2758
3148
  constructor({ value } = {}) {
2759
3149
  super();
2760
3150
  this.value = value;
@@ -2780,18 +3170,19 @@ var MultibaseEncoder = class extends CborldEncoder {
2780
3170
  return false;
2781
3171
  }
2782
3172
  if (value[0] === "z" || value[0] === "M") {
2783
- return new MultibaseEncoder({ value });
3173
+ return new _MultibaseEncoder({ value });
2784
3174
  }
2785
3175
  }
2786
3176
  };
2787
- __name(MultibaseEncoder, "MultibaseEncoder");
3177
+ __name(_MultibaseEncoder, "MultibaseEncoder");
3178
+ var MultibaseEncoder = _MultibaseEncoder;
2788
3179
 
2789
3180
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/Base58DidUrlEncoder.js
2790
3181
  var SCHEME_TO_ID = /* @__PURE__ */ new Map([
2791
3182
  ["did:v1:nym:", 1024],
2792
3183
  ["did:key:", 1025]
2793
3184
  ]);
2794
- var Base58DidUrlEncoder = class extends CborldEncoder {
3185
+ var _Base58DidUrlEncoder = class _Base58DidUrlEncoder extends CborldEncoder {
2795
3186
  constructor({ value, scheme } = {}) {
2796
3187
  super();
2797
3188
  this.value = value;
@@ -2814,12 +3205,13 @@ var Base58DidUrlEncoder = class extends CborldEncoder {
2814
3205
  const keys = [...SCHEME_TO_ID.keys()];
2815
3206
  for (const key of keys) {
2816
3207
  if (value.startsWith(key)) {
2817
- return new Base58DidUrlEncoder({ value, scheme: key });
3208
+ return new _Base58DidUrlEncoder({ value, scheme: key });
2818
3209
  }
2819
3210
  }
2820
3211
  }
2821
3212
  };
2822
- __name(Base58DidUrlEncoder, "Base58DidUrlEncoder");
3213
+ __name(_Base58DidUrlEncoder, "Base58DidUrlEncoder");
3214
+ var Base58DidUrlEncoder = _Base58DidUrlEncoder;
2823
3215
  function _multibase58ToToken(str) {
2824
3216
  if (str.startsWith("z")) {
2825
3217
  const decoded = decode4(str.substr(1));
@@ -2832,7 +3224,7 @@ function _multibase58ToToken(str) {
2832
3224
  __name(_multibase58ToToken, "_multibase58ToToken");
2833
3225
 
2834
3226
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/HttpUrlEncoder.js
2835
- var HttpUrlEncoder = class extends CborldEncoder {
3227
+ var _HttpUrlEncoder = class _HttpUrlEncoder extends CborldEncoder {
2836
3228
  constructor({ value, secure } = {}) {
2837
3229
  super();
2838
3230
  this.value = value;
@@ -2849,17 +3241,18 @@ var HttpUrlEncoder = class extends CborldEncoder {
2849
3241
  }
2850
3242
  static createEncoder({ value } = {}) {
2851
3243
  if (value.startsWith("https://")) {
2852
- return new HttpUrlEncoder({ value, secure: true });
3244
+ return new _HttpUrlEncoder({ value, secure: true });
2853
3245
  }
2854
3246
  if (value.startsWith("http://")) {
2855
- return new HttpUrlEncoder({ value, secure: false });
3247
+ return new _HttpUrlEncoder({ value, secure: false });
2856
3248
  }
2857
3249
  }
2858
3250
  };
2859
- __name(HttpUrlEncoder, "HttpUrlEncoder");
3251
+ __name(_HttpUrlEncoder, "HttpUrlEncoder");
3252
+ var HttpUrlEncoder = _HttpUrlEncoder;
2860
3253
 
2861
3254
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UuidUrnEncoder.js
2862
- var UuidUrnEncoder = class extends CborldEncoder {
3255
+ var _UuidUrnEncoder = class _UuidUrnEncoder extends CborldEncoder {
2863
3256
  constructor({ value } = {}) {
2864
3257
  super();
2865
3258
  this.value = value;
@@ -2878,11 +3271,12 @@ var UuidUrnEncoder = class extends CborldEncoder {
2878
3271
  }
2879
3272
  static createEncoder({ value } = {}) {
2880
3273
  if (value.startsWith("urn:uuid:")) {
2881
- return new UuidUrnEncoder({ value });
3274
+ return new _UuidUrnEncoder({ value });
2882
3275
  }
2883
3276
  }
2884
3277
  };
2885
- __name(UuidUrnEncoder, "UuidUrnEncoder");
3278
+ __name(_UuidUrnEncoder, "UuidUrnEncoder");
3279
+ var UuidUrnEncoder = _UuidUrnEncoder;
2886
3280
 
2887
3281
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/UriEncoder.js
2888
3282
  var SCHEME_TO_ENCODER = /* @__PURE__ */ new Map([
@@ -2892,7 +3286,7 @@ var SCHEME_TO_ENCODER = /* @__PURE__ */ new Map([
2892
3286
  ["did:v1:nym", Base58DidUrlEncoder],
2893
3287
  ["did:key", Base58DidUrlEncoder]
2894
3288
  ]);
2895
- var UriEncoder = class extends CborldEncoder {
3289
+ var _UriEncoder = class _UriEncoder extends CborldEncoder {
2896
3290
  static createEncoder({ value } = {}) {
2897
3291
  if (typeof value !== "string") {
2898
3292
  return false;
@@ -2914,10 +3308,11 @@ var UriEncoder = class extends CborldEncoder {
2914
3308
  return EncoderClass && EncoderClass.createEncoder({ value });
2915
3309
  }
2916
3310
  };
2917
- __name(UriEncoder, "UriEncoder");
3311
+ __name(_UriEncoder, "UriEncoder");
3312
+ var UriEncoder = _UriEncoder;
2918
3313
 
2919
3314
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/VocabTermEncoder.js
2920
- var VocabTermEncoder = class extends CborldEncoder {
3315
+ var _VocabTermEncoder = class _VocabTermEncoder extends CborldEncoder {
2921
3316
  constructor({ termId } = {}) {
2922
3317
  super();
2923
3318
  this.termId = termId;
@@ -2929,15 +3324,16 @@ var VocabTermEncoder = class extends CborldEncoder {
2929
3324
  const { termToId } = transformer;
2930
3325
  const termId = termToId.get(value);
2931
3326
  if (termId !== void 0) {
2932
- return new VocabTermEncoder({ termId });
3327
+ return new _VocabTermEncoder({ termId });
2933
3328
  }
2934
3329
  return UriEncoder.createEncoder({ value });
2935
3330
  }
2936
3331
  };
2937
- __name(VocabTermEncoder, "VocabTermEncoder");
3332
+ __name(_VocabTermEncoder, "VocabTermEncoder");
3333
+ var VocabTermEncoder = _VocabTermEncoder;
2938
3334
 
2939
3335
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateEncoder.js
2940
- var XsdDateEncoder = class extends CborldEncoder {
3336
+ var _XsdDateEncoder = class _XsdDateEncoder extends CborldEncoder {
2941
3337
  constructor({ value, parsed } = {}) {
2942
3338
  super();
2943
3339
  this.value = value;
@@ -2961,13 +3357,14 @@ var XsdDateEncoder = class extends CborldEncoder {
2961
3357
  if (isNaN(parsed)) {
2962
3358
  return false;
2963
3359
  }
2964
- return new XsdDateEncoder({ value, parsed });
3360
+ return new _XsdDateEncoder({ value, parsed });
2965
3361
  }
2966
3362
  };
2967
- __name(XsdDateEncoder, "XsdDateEncoder");
3363
+ __name(_XsdDateEncoder, "XsdDateEncoder");
3364
+ var XsdDateEncoder = _XsdDateEncoder;
2968
3365
 
2969
3366
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/codecs/XsdDateTimeEncoder.js
2970
- var XsdDateTimeEncoder = class extends CborldEncoder {
3367
+ var _XsdDateTimeEncoder = class _XsdDateTimeEncoder extends CborldEncoder {
2971
3368
  constructor({ value, parsed } = {}) {
2972
3369
  super();
2973
3370
  this.value = value;
@@ -3008,10 +3405,11 @@ var XsdDateTimeEncoder = class extends CborldEncoder {
3008
3405
  if (isNaN(parsed)) {
3009
3406
  return false;
3010
3407
  }
3011
- return new XsdDateTimeEncoder({ value, parsed });
3408
+ return new _XsdDateTimeEncoder({ value, parsed });
3012
3409
  }
3013
3410
  };
3014
- __name(XsdDateTimeEncoder, "XsdDateTimeEncoder");
3411
+ __name(_XsdDateTimeEncoder, "XsdDateTimeEncoder");
3412
+ var XsdDateTimeEncoder = _XsdDateTimeEncoder;
3015
3413
 
3016
3414
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/Compressor.js
3017
3415
  var TYPE_ENCODERS = /* @__PURE__ */ new Map([
@@ -3030,10 +3428,34 @@ var typeEncoders2 = {
3030
3428
  }
3031
3429
  }
3032
3430
  };
3033
- var Compressor = class extends Transformer {
3431
+ var _Compressor = class _Compressor extends Transformer {
3432
+ /**
3433
+ * Creates a new Compressor for generating compressed CBOR-LD from a
3434
+ * JSON-LD document. The created instance may only be used on a single
3435
+ * JSON-LD document at a time.
3436
+ *
3437
+ * @param {object} options - The options to use when encoding to CBOR-LD.
3438
+ * @param {documentLoaderFunction} options.documentLoader -The document
3439
+ * loader to use when resolving JSON-LD Context URLs.
3440
+ * @param {Map} [options.appContextMap] - A map of JSON-LD Context URLs and
3441
+ * their encoded CBOR-LD values (must be values greater than 32767
3442
+ * (0x7FFF)).
3443
+ */
3034
3444
  constructor({ documentLoader, appContextMap } = {}) {
3035
3445
  super({ documentLoader, appContextMap });
3036
3446
  }
3447
+ /**
3448
+ * Compresses the given JSON-LD document into a CBOR-LD byte array of
3449
+ * compressed bytes that should follow the compressed CBOR-LD CBOR tag.
3450
+ *
3451
+ * @param {object} options - The options to use.
3452
+ * @param {object} options.jsonldDocument - The JSON-LD Document to convert
3453
+ * to CBOR-LD bytes.
3454
+ * @param {diagnosticFunction} [options.diagnose] - A function that, if
3455
+ * provided, is called with diagnostic information.
3456
+ *
3457
+ * @returns {Promise<Uint8Array>} - The compressed CBOR-LD bytes.
3458
+ */
3037
3459
  async compress({ jsonldDocument, diagnose } = {}) {
3038
3460
  const transformMaps = await this._createTransformMaps({ jsonldDocument });
3039
3461
  if (diagnose) {
@@ -3142,7 +3564,8 @@ var Compressor = class extends Transformer {
3142
3564
  transformMap.set(termId, plural ? entries : entries[0]);
3143
3565
  }
3144
3566
  };
3145
- __name(Compressor, "Compressor");
3567
+ __name(_Compressor, "Compressor");
3568
+ var Compressor = _Compressor;
3146
3569
 
3147
3570
  // ../../../node_modules/.pnpm/@digitalbazaar+cborld@5.2.0/node_modules/@digitalbazaar/cborld/lib/encode.js
3148
3571
  async function encode5({
@@ -3254,7 +3677,7 @@ var Mode;
3254
3677
  })(Mode || (Mode = {}));
3255
3678
 
3256
3679
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRData.js
3257
- var QRData = class {
3680
+ var _QRData = class _QRData {
3258
3681
  constructor(mode, data) {
3259
3682
  this.bytes = [];
3260
3683
  this.mode = mode;
@@ -3310,7 +3733,8 @@ var QRData = class {
3310
3733
  }
3311
3734
  }
3312
3735
  };
3313
- __name(QRData, "QRData");
3736
+ __name(_QRData, "QRData");
3737
+ var QRData = _QRData;
3314
3738
 
3315
3739
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/encoding/UTF8.js
3316
3740
  function encode6(text) {
@@ -3341,7 +3765,11 @@ function encode6(text) {
3341
3765
  __name(encode6, "encode");
3342
3766
 
3343
3767
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRByte.js
3344
- var QRByte = class extends QRData {
3768
+ var _QRByte = class _QRByte extends QRData {
3769
+ /**
3770
+ * @constructor
3771
+ * @param {string} data
3772
+ */
3345
3773
  constructor(data, encode$1) {
3346
3774
  super(Mode.Byte, data);
3347
3775
  this.encoding = -1;
@@ -3354,6 +3782,11 @@ var QRByte = class extends QRData {
3354
3782
  this.encoding = 26;
3355
3783
  }
3356
3784
  }
3785
+ /**
3786
+ * @public
3787
+ * @method writeTo
3788
+ * @param {BitBuffer} buffer
3789
+ */
3357
3790
  writeTo(buffer2) {
3358
3791
  const { bytes } = this;
3359
3792
  for (const byte of bytes) {
@@ -3361,7 +3794,8 @@ var QRByte = class extends QRData {
3361
3794
  }
3362
3795
  }
3363
3796
  };
3364
- __name(QRByte, "QRByte");
3797
+ __name(_QRByte, "QRByte");
3798
+ var QRByte = _QRByte;
3365
3799
 
3366
3800
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRMath.js
3367
3801
  var EXP_TABLE = [];
@@ -3392,7 +3826,7 @@ function gexp(n) {
3392
3826
  __name(gexp, "gexp");
3393
3827
 
3394
3828
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/Polynomial.js
3395
- var Polynomial = class {
3829
+ var _Polynomial = class _Polynomial {
3396
3830
  constructor(num, shift = 0) {
3397
3831
  let offset = 0;
3398
3832
  let { length } = num;
@@ -3428,7 +3862,7 @@ var Polynomial = class {
3428
3862
  num[i + j] ^= gexp(glog(this.getAt(i)) + glog(e.getAt(j)));
3429
3863
  }
3430
3864
  }
3431
- return new Polynomial(num);
3865
+ return new _Polynomial(num);
3432
3866
  }
3433
3867
  mod(e) {
3434
3868
  const eLength = e.getLength();
@@ -3444,10 +3878,11 @@ var Polynomial = class {
3444
3878
  for (let i = 0; i < eLength; i++) {
3445
3879
  num[i] ^= gexp(glog(e.getAt(i)) + ratio);
3446
3880
  }
3447
- return new Polynomial(num).mod(e);
3881
+ return new _Polynomial(num).mod(e);
3448
3882
  }
3449
3883
  };
3450
- __name(Polynomial, "Polynomial");
3884
+ __name(_Polynomial, "Polynomial");
3885
+ var Polynomial = _Polynomial;
3451
3886
 
3452
3887
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/QRUtil.js
3453
3888
  var N1 = 3;
@@ -3638,7 +4073,7 @@ var ErrorCorrectionLevel;
3638
4073
  })(ErrorCorrectionLevel || (ErrorCorrectionLevel = {}));
3639
4074
 
3640
4075
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/RSBlock.js
3641
- var RSBlock = class {
4076
+ var _RSBlock = class _RSBlock {
3642
4077
  constructor(totalCount, dataCount) {
3643
4078
  this.dataCount = dataCount;
3644
4079
  this.totalCount = totalCount;
@@ -3651,14 +4086,14 @@ var RSBlock = class {
3651
4086
  }
3652
4087
  static getRSBlocks(version2, errorCorrectionLevel) {
3653
4088
  const rsBlocks = [];
3654
- const rsBlock = RSBlock.getRSBlockTable(version2, errorCorrectionLevel);
4089
+ const rsBlock = _RSBlock.getRSBlockTable(version2, errorCorrectionLevel);
3655
4090
  const length = rsBlock.length / 3;
3656
4091
  for (let i = 0; i < length; i++) {
3657
4092
  const count = rsBlock[i * 3 + 0];
3658
4093
  const totalCount = rsBlock[i * 3 + 1];
3659
4094
  const dataCount = rsBlock[i * 3 + 2];
3660
4095
  for (let j = 0; j < count; j++) {
3661
- rsBlocks.push(new RSBlock(totalCount, dataCount));
4096
+ rsBlocks.push(new _RSBlock(totalCount, dataCount));
3662
4097
  }
3663
4098
  }
3664
4099
  return rsBlocks;
@@ -3666,176 +4101,221 @@ var RSBlock = class {
3666
4101
  static getRSBlockTable(version2, errorCorrectionLevel) {
3667
4102
  switch (errorCorrectionLevel) {
3668
4103
  case ErrorCorrectionLevel.L:
3669
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 0];
4104
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 0];
3670
4105
  case ErrorCorrectionLevel.M:
3671
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 1];
4106
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 1];
3672
4107
  case ErrorCorrectionLevel.Q:
3673
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 2];
4108
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 2];
3674
4109
  case ErrorCorrectionLevel.H:
3675
- return RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 3];
4110
+ return _RSBlock.RS_BLOCK_TABLE[(version2 - 1) * 4 + 3];
3676
4111
  default:
3677
4112
  throw new Error(`illegal error correction level: ${errorCorrectionLevel}`);
3678
4113
  }
3679
4114
  }
3680
4115
  };
3681
- __name(RSBlock, "RSBlock");
4116
+ __name(_RSBlock, "RSBlock");
4117
+ var RSBlock = _RSBlock;
3682
4118
  RSBlock.RS_BLOCK_TABLE = [
4119
+ // L
4120
+ // M
4121
+ // Q
4122
+ // H
4123
+ // 1
3683
4124
  [1, 26, 19],
3684
4125
  [1, 26, 16],
3685
4126
  [1, 26, 13],
3686
4127
  [1, 26, 9],
4128
+ // 2
3687
4129
  [1, 44, 34],
3688
4130
  [1, 44, 28],
3689
4131
  [1, 44, 22],
3690
4132
  [1, 44, 16],
4133
+ // 3
3691
4134
  [1, 70, 55],
3692
4135
  [1, 70, 44],
3693
4136
  [2, 35, 17],
3694
4137
  [2, 35, 13],
4138
+ // 4
3695
4139
  [1, 100, 80],
3696
4140
  [2, 50, 32],
3697
4141
  [2, 50, 24],
3698
4142
  [4, 25, 9],
4143
+ // 5
3699
4144
  [1, 134, 108],
3700
4145
  [2, 67, 43],
3701
4146
  [2, 33, 15, 2, 34, 16],
3702
4147
  [2, 33, 11, 2, 34, 12],
4148
+ // 6
3703
4149
  [2, 86, 68],
3704
4150
  [4, 43, 27],
3705
4151
  [4, 43, 19],
3706
4152
  [4, 43, 15],
4153
+ // 7
3707
4154
  [2, 98, 78],
3708
4155
  [4, 49, 31],
3709
4156
  [2, 32, 14, 4, 33, 15],
3710
4157
  [4, 39, 13, 1, 40, 14],
4158
+ // 8
3711
4159
  [2, 121, 97],
3712
4160
  [2, 60, 38, 2, 61, 39],
3713
4161
  [4, 40, 18, 2, 41, 19],
3714
4162
  [4, 40, 14, 2, 41, 15],
4163
+ // 9
3715
4164
  [2, 146, 116],
3716
4165
  [3, 58, 36, 2, 59, 37],
3717
4166
  [4, 36, 16, 4, 37, 17],
3718
4167
  [4, 36, 12, 4, 37, 13],
4168
+ // 10
3719
4169
  [2, 86, 68, 2, 87, 69],
3720
4170
  [4, 69, 43, 1, 70, 44],
3721
4171
  [6, 43, 19, 2, 44, 20],
3722
4172
  [6, 43, 15, 2, 44, 16],
4173
+ // 11
3723
4174
  [4, 101, 81],
3724
4175
  [1, 80, 50, 4, 81, 51],
3725
4176
  [4, 50, 22, 4, 51, 23],
3726
4177
  [3, 36, 12, 8, 37, 13],
4178
+ // 12
3727
4179
  [2, 116, 92, 2, 117, 93],
3728
4180
  [6, 58, 36, 2, 59, 37],
3729
4181
  [4, 46, 20, 6, 47, 21],
3730
4182
  [7, 42, 14, 4, 43, 15],
4183
+ // 13
3731
4184
  [4, 133, 107],
3732
4185
  [8, 59, 37, 1, 60, 38],
3733
4186
  [8, 44, 20, 4, 45, 21],
3734
4187
  [12, 33, 11, 4, 34, 12],
4188
+ // 14
3735
4189
  [3, 145, 115, 1, 146, 116],
3736
4190
  [4, 64, 40, 5, 65, 41],
3737
4191
  [11, 36, 16, 5, 37, 17],
3738
4192
  [11, 36, 12, 5, 37, 13],
4193
+ // 15
3739
4194
  [5, 109, 87, 1, 110, 88],
3740
4195
  [5, 65, 41, 5, 66, 42],
3741
4196
  [5, 54, 24, 7, 55, 25],
3742
4197
  [11, 36, 12, 7, 37, 13],
4198
+ // 16
3743
4199
  [5, 122, 98, 1, 123, 99],
3744
4200
  [7, 73, 45, 3, 74, 46],
3745
4201
  [15, 43, 19, 2, 44, 20],
3746
4202
  [3, 45, 15, 13, 46, 16],
4203
+ // 17
3747
4204
  [1, 135, 107, 5, 136, 108],
3748
4205
  [10, 74, 46, 1, 75, 47],
3749
4206
  [1, 50, 22, 15, 51, 23],
3750
4207
  [2, 42, 14, 17, 43, 15],
4208
+ // 18
3751
4209
  [5, 150, 120, 1, 151, 121],
3752
4210
  [9, 69, 43, 4, 70, 44],
3753
4211
  [17, 50, 22, 1, 51, 23],
3754
4212
  [2, 42, 14, 19, 43, 15],
4213
+ // 19
3755
4214
  [3, 141, 113, 4, 142, 114],
3756
4215
  [3, 70, 44, 11, 71, 45],
3757
4216
  [17, 47, 21, 4, 48, 22],
3758
4217
  [9, 39, 13, 16, 40, 14],
4218
+ // 20
3759
4219
  [3, 135, 107, 5, 136, 108],
3760
4220
  [3, 67, 41, 13, 68, 42],
3761
4221
  [15, 54, 24, 5, 55, 25],
3762
4222
  [15, 43, 15, 10, 44, 16],
4223
+ // 21
3763
4224
  [4, 144, 116, 4, 145, 117],
3764
4225
  [17, 68, 42],
3765
4226
  [17, 50, 22, 6, 51, 23],
3766
4227
  [19, 46, 16, 6, 47, 17],
4228
+ // 22
3767
4229
  [2, 139, 111, 7, 140, 112],
3768
4230
  [17, 74, 46],
3769
4231
  [7, 54, 24, 16, 55, 25],
3770
4232
  [34, 37, 13],
4233
+ // 23
3771
4234
  [4, 151, 121, 5, 152, 122],
3772
4235
  [4, 75, 47, 14, 76, 48],
3773
4236
  [11, 54, 24, 14, 55, 25],
3774
4237
  [16, 45, 15, 14, 46, 16],
4238
+ // 24
3775
4239
  [6, 147, 117, 4, 148, 118],
3776
4240
  [6, 73, 45, 14, 74, 46],
3777
4241
  [11, 54, 24, 16, 55, 25],
3778
4242
  [30, 46, 16, 2, 47, 17],
4243
+ // 25
3779
4244
  [8, 132, 106, 4, 133, 107],
3780
4245
  [8, 75, 47, 13, 76, 48],
3781
4246
  [7, 54, 24, 22, 55, 25],
3782
4247
  [22, 45, 15, 13, 46, 16],
4248
+ // 26
3783
4249
  [10, 142, 114, 2, 143, 115],
3784
4250
  [19, 74, 46, 4, 75, 47],
3785
4251
  [28, 50, 22, 6, 51, 23],
3786
4252
  [33, 46, 16, 4, 47, 17],
4253
+ // 27
3787
4254
  [8, 152, 122, 4, 153, 123],
3788
4255
  [22, 73, 45, 3, 74, 46],
3789
4256
  [8, 53, 23, 26, 54, 24],
3790
4257
  [12, 45, 15, 28, 46, 16],
4258
+ // 28
3791
4259
  [3, 147, 117, 10, 148, 118],
3792
4260
  [3, 73, 45, 23, 74, 46],
3793
4261
  [4, 54, 24, 31, 55, 25],
3794
4262
  [11, 45, 15, 31, 46, 16],
4263
+ // 29
3795
4264
  [7, 146, 116, 7, 147, 117],
3796
4265
  [21, 73, 45, 7, 74, 46],
3797
4266
  [1, 53, 23, 37, 54, 24],
3798
4267
  [19, 45, 15, 26, 46, 16],
4268
+ // 30
3799
4269
  [5, 145, 115, 10, 146, 116],
3800
4270
  [19, 75, 47, 10, 76, 48],
3801
4271
  [15, 54, 24, 25, 55, 25],
3802
4272
  [23, 45, 15, 25, 46, 16],
4273
+ // 31
3803
4274
  [13, 145, 115, 3, 146, 116],
3804
4275
  [2, 74, 46, 29, 75, 47],
3805
4276
  [42, 54, 24, 1, 55, 25],
3806
4277
  [23, 45, 15, 28, 46, 16],
4278
+ // 32
3807
4279
  [17, 145, 115],
3808
4280
  [10, 74, 46, 23, 75, 47],
3809
4281
  [10, 54, 24, 35, 55, 25],
3810
4282
  [19, 45, 15, 35, 46, 16],
4283
+ // 33
3811
4284
  [17, 145, 115, 1, 146, 116],
3812
4285
  [14, 74, 46, 21, 75, 47],
3813
4286
  [29, 54, 24, 19, 55, 25],
3814
4287
  [11, 45, 15, 46, 46, 16],
4288
+ // 34
3815
4289
  [13, 145, 115, 6, 146, 116],
3816
4290
  [14, 74, 46, 23, 75, 47],
3817
4291
  [44, 54, 24, 7, 55, 25],
3818
4292
  [59, 46, 16, 1, 47, 17],
4293
+ // 35
3819
4294
  [12, 151, 121, 7, 152, 122],
3820
4295
  [12, 75, 47, 26, 76, 48],
3821
4296
  [39, 54, 24, 14, 55, 25],
3822
4297
  [22, 45, 15, 41, 46, 16],
4298
+ // 36
3823
4299
  [6, 151, 121, 14, 152, 122],
3824
4300
  [6, 75, 47, 34, 76, 48],
3825
4301
  [46, 54, 24, 10, 55, 25],
3826
4302
  [2, 45, 15, 64, 46, 16],
4303
+ // 37
3827
4304
  [17, 152, 122, 4, 153, 123],
3828
4305
  [29, 74, 46, 14, 75, 47],
3829
4306
  [49, 54, 24, 10, 55, 25],
3830
4307
  [24, 45, 15, 46, 46, 16],
4308
+ // 38
3831
4309
  [4, 152, 122, 18, 153, 123],
3832
4310
  [13, 74, 46, 32, 75, 47],
3833
4311
  [48, 54, 24, 14, 55, 25],
3834
4312
  [42, 45, 15, 32, 46, 16],
4313
+ // 39
3835
4314
  [20, 147, 117, 4, 148, 118],
3836
4315
  [40, 75, 47, 7, 76, 48],
3837
4316
  [43, 54, 24, 22, 55, 25],
3838
4317
  [10, 45, 15, 67, 46, 16],
4318
+ // 40
3839
4319
  [19, 148, 118, 6, 149, 119],
3840
4320
  [18, 75, 47, 31, 76, 48],
3841
4321
  [34, 54, 24, 34, 55, 25],
@@ -3843,7 +4323,7 @@ RSBlock.RS_BLOCK_TABLE = [
3843
4323
  ];
3844
4324
 
3845
4325
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/encoder/BitBuffer.js
3846
- var BitBuffer = class {
4326
+ var _BitBuffer = class _BitBuffer {
3847
4327
  constructor() {
3848
4328
  this.length = 0;
3849
4329
  this.buffer = [];
@@ -3873,11 +4353,12 @@ var BitBuffer = class {
3873
4353
  this.length++;
3874
4354
  }
3875
4355
  };
3876
- __name(BitBuffer, "BitBuffer");
4356
+ __name(_BitBuffer, "BitBuffer");
4357
+ var BitBuffer = _BitBuffer;
3877
4358
 
3878
4359
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/lzw/Dict.js
3879
4360
  var MAX_CODE = (1 << 12) - 1;
3880
- var Dict = class {
4361
+ var _Dict = class _Dict {
3881
4362
  constructor(depth) {
3882
4363
  const bof = 1 << depth;
3883
4364
  const eof = bof + 1;
@@ -3912,10 +4393,11 @@ var Dict = class {
3912
4393
  return this.codes.get(code << 8 | index);
3913
4394
  }
3914
4395
  };
3915
- __name(Dict, "Dict");
4396
+ __name(_Dict, "Dict");
4397
+ var Dict = _Dict;
3916
4398
 
3917
4399
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/lzw/DictStream.js
3918
- var DictStream = class {
4400
+ var _DictStream = class _DictStream {
3919
4401
  constructor(dict) {
3920
4402
  this.bits = 0;
3921
4403
  this.buffer = 0;
@@ -3957,7 +4439,8 @@ var DictStream = class {
3957
4439
  stream.writeByte(0);
3958
4440
  }
3959
4441
  };
3960
- __name(DictStream, "DictStream");
4442
+ __name(_DictStream, "DictStream");
4443
+ var DictStream = _DictStream;
3961
4444
 
3962
4445
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/lzw/index.js
3963
4446
  function compress(pixels, depth, stream) {
@@ -3989,7 +4472,7 @@ function compress(pixels, depth, stream) {
3989
4472
  __name(compress, "compress");
3990
4473
 
3991
4474
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/ByteStream.js
3992
- var ByteStream = class {
4475
+ var _ByteStream = class _ByteStream {
3993
4476
  constructor() {
3994
4477
  this.bytes = [];
3995
4478
  }
@@ -4006,7 +4489,8 @@ var ByteStream = class {
4006
4489
  }
4007
4490
  }
4008
4491
  };
4009
- __name(ByteStream, "ByteStream");
4492
+ __name(_ByteStream, "ByteStream");
4493
+ var ByteStream = _ByteStream;
4010
4494
 
4011
4495
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/Base64Stream.js
4012
4496
  var { fromCharCode } = String;
@@ -4028,7 +4512,7 @@ function encode7(byte) {
4028
4512
  throw new Error(`illegal char: ${fromCharCode(byte)}`);
4029
4513
  }
4030
4514
  __name(encode7, "encode");
4031
- var Base64Stream = class {
4515
+ var _Base64Stream = class _Base64Stream {
4032
4516
  constructor() {
4033
4517
  this.bits = 0;
4034
4518
  this.buffer = 0;
@@ -4065,10 +4549,11 @@ var Base64Stream = class {
4065
4549
  }
4066
4550
  }
4067
4551
  };
4068
- __name(Base64Stream, "Base64Stream");
4552
+ __name(_Base64Stream, "Base64Stream");
4553
+ var Base64Stream = _Base64Stream;
4069
4554
 
4070
4555
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/image/GIFImage.js
4071
- var GIFImage = class {
4556
+ var _GIFImage = class _GIFImage {
4072
4557
  constructor(width, height, { foreground = [0, 0, 0], background = [255, 255, 255] } = {}) {
4073
4558
  this.pixels = [];
4074
4559
  this.width = width;
@@ -4113,7 +4598,8 @@ var GIFImage = class {
4113
4598
  return url;
4114
4599
  }
4115
4600
  };
4116
- __name(GIFImage, "GIFImage");
4601
+ __name(_GIFImage, "GIFImage");
4602
+ var GIFImage = _GIFImage;
4117
4603
 
4118
4604
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/qrcode/common/MaskPattern.js
4119
4605
  function getMaskFunc(maskPattern) {
@@ -4248,7 +4734,7 @@ function createData(buffer2, rsBlocks, maxDataCount) {
4248
4734
  return createBytes(buffer2, rsBlocks);
4249
4735
  }
4250
4736
  __name(createData, "createData");
4251
- var Encoder = class {
4737
+ var _Encoder = class _Encoder {
4252
4738
  constructor(options = {}) {
4253
4739
  this.matrixSize = 0;
4254
4740
  this.chunks = [];
@@ -4258,23 +4744,54 @@ var Encoder = class {
4258
4744
  this.setEncodingHint(encodingHint);
4259
4745
  this.setErrorCorrectionLevel(errorCorrectionLevel);
4260
4746
  }
4747
+ /**
4748
+ * @public
4749
+ * @method getMatrix
4750
+ * @returns {boolean[][]}
4751
+ */
4261
4752
  getMatrix() {
4262
4753
  return this.matrix;
4263
4754
  }
4755
+ /**
4756
+ * @public
4757
+ * @method getMatrixSize
4758
+ * @returns {number}
4759
+ */
4264
4760
  getMatrixSize() {
4265
4761
  return this.matrixSize;
4266
4762
  }
4763
+ /**
4764
+ * @public
4765
+ * @method getVersion
4766
+ * @returns {number}
4767
+ */
4267
4768
  getVersion() {
4268
4769
  return this.version;
4269
4770
  }
4771
+ /**
4772
+ * @public
4773
+ * @method setVersion
4774
+ * @param {number} version
4775
+ * @returns {Encoder}
4776
+ */
4270
4777
  setVersion(version2) {
4271
4778
  this.version = Math.min(40, Math.max(0, version2 >> 0));
4272
4779
  this.auto = this.version === 0;
4273
4780
  return this;
4274
4781
  }
4782
+ /**
4783
+ * @public
4784
+ * @method getErrorCorrectionLevel
4785
+ * @returns {ErrorCorrectionLevel}
4786
+ */
4275
4787
  getErrorCorrectionLevel() {
4276
4788
  return this.errorCorrectionLevel;
4277
4789
  }
4790
+ /**
4791
+ * @public
4792
+ * @method setErrorCorrectionLevel
4793
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel
4794
+ */
4278
4795
  setErrorCorrectionLevel(errorCorrectionLevel) {
4279
4796
  switch (errorCorrectionLevel) {
4280
4797
  case ErrorCorrectionLevel.L:
@@ -4285,13 +4802,30 @@ var Encoder = class {
4285
4802
  }
4286
4803
  return this;
4287
4804
  }
4805
+ /**
4806
+ * @public
4807
+ * @method getEncodingHint
4808
+ * @returns {boolean}
4809
+ */
4288
4810
  getEncodingHint() {
4289
4811
  return this.encodingHint;
4290
4812
  }
4813
+ /**
4814
+ * @public
4815
+ * @method setEncodingHint
4816
+ * @param {boolean} encodingHint
4817
+ * @returns {Encoder}
4818
+ */
4291
4819
  setEncodingHint(encodingHint) {
4292
4820
  this.encodingHint = encodingHint;
4293
4821
  return this;
4294
4822
  }
4823
+ /**
4824
+ * @public
4825
+ * @method write
4826
+ * @param {QRData} data
4827
+ * @returns {Encoder}
4828
+ */
4295
4829
  write(data) {
4296
4830
  const { chunks } = this;
4297
4831
  if (data instanceof QRData) {
@@ -4306,6 +4840,13 @@ var Encoder = class {
4306
4840
  }
4307
4841
  return this;
4308
4842
  }
4843
+ /**
4844
+ * @public
4845
+ * @method isDark
4846
+ * @param {number} row
4847
+ * @param {number} col
4848
+ * @returns {boolean}
4849
+ */
4309
4850
  isDark(row, col) {
4310
4851
  return this.matrix[row][col] === true;
4311
4852
  }
@@ -4447,6 +4988,11 @@ var Encoder = class {
4447
4988
  this.setupVersionInfo();
4448
4989
  this.setupCodewords(data, maskPattern);
4449
4990
  }
4991
+ /**
4992
+ * @public
4993
+ * @method make
4994
+ * @returns {Encoder}
4995
+ */
4450
4996
  make() {
4451
4997
  let buffer2;
4452
4998
  let rsBlocks;
@@ -4484,6 +5030,13 @@ var Encoder = class {
4484
5030
  this.matrix = matrices[bestMaskPattern];
4485
5031
  return this;
4486
5032
  }
5033
+ /**
5034
+ * @public
5035
+ * @method toDataURL
5036
+ * @param {number} moduleSize
5037
+ * @param {number} margin
5038
+ * @returns {string}
5039
+ */
4487
5040
  toDataURL(moduleSize = 2, margin = moduleSize * 4, colors) {
4488
5041
  moduleSize = Math.max(1, moduleSize >> 0);
4489
5042
  margin = Math.max(0, margin >> 0);
@@ -4505,11 +5058,16 @@ var Encoder = class {
4505
5058
  }
4506
5059
  return gif.toDataURL();
4507
5060
  }
5061
+ /**
5062
+ * @public
5063
+ * @method clear
5064
+ */
4508
5065
  clear() {
4509
5066
  this.chunks = [];
4510
5067
  }
4511
5068
  };
4512
- __name(Encoder, "Encoder");
5069
+ __name(_Encoder, "Encoder");
5070
+ var Encoder = _Encoder;
4513
5071
 
4514
5072
  // ../../../node_modules/.pnpm/@nuintun+qrcode@3.4.0/node_modules/@nuintun/qrcode/esm/encoding/UTF16.js
4515
5073
  function encode8(text) {
@@ -4530,22 +5088,31 @@ function getByte(byte) {
4530
5088
  return byte - 65 + 10;
4531
5089
  } else {
4532
5090
  switch (byte) {
5091
+ // space
4533
5092
  case 32:
4534
5093
  return 36;
5094
+ // $
4535
5095
  case 36:
4536
5096
  return 37;
5097
+ // %
4537
5098
  case 37:
4538
5099
  return 38;
5100
+ // *
4539
5101
  case 42:
4540
5102
  return 39;
5103
+ // +
4541
5104
  case 43:
4542
5105
  return 40;
5106
+ // -
4543
5107
  case 45:
4544
5108
  return 41;
5109
+ // .
4545
5110
  case 46:
4546
5111
  return 42;
5112
+ // /
4547
5113
  case 47:
4548
5114
  return 43;
5115
+ // :
4549
5116
  case 58:
4550
5117
  return 44;
4551
5118
  default:
@@ -4554,11 +5121,20 @@ function getByte(byte) {
4554
5121
  }
4555
5122
  }
4556
5123
  __name(getByte, "getByte");
4557
- var QRAlphanumeric = class extends QRData {
5124
+ var _QRAlphanumeric = class _QRAlphanumeric extends QRData {
5125
+ /**
5126
+ * @constructor
5127
+ * @param {string} data
5128
+ */
4558
5129
  constructor(data) {
4559
5130
  super(Mode.Alphanumeric, data);
4560
5131
  this.bytes = encode8(data);
4561
5132
  }
5133
+ /**
5134
+ * @public
5135
+ * @method writeTo
5136
+ * @param {BitBuffer} buffer
5137
+ */
4562
5138
  writeTo(buffer2) {
4563
5139
  let i = 0;
4564
5140
  const { bytes } = this;
@@ -4572,7 +5148,8 @@ var QRAlphanumeric = class extends QRData {
4572
5148
  }
4573
5149
  }
4574
5150
  };
4575
- __name(QRAlphanumeric, "QRAlphanumeric");
5151
+ __name(_QRAlphanumeric, "QRAlphanumeric");
5152
+ var QRAlphanumeric = _QRAlphanumeric;
4576
5153
 
4577
5154
  // ../../../node_modules/.pnpm/@digitalbazaar+vpqr@3.0.0/node_modules/@digitalbazaar/vpqr/lib/vpqr.js
4578
5155
  var VP_QR_VERSION = "VP1";
@@ -4601,6 +5178,7 @@ async function toQrCode({
4601
5178
  const cborldBytes = await encode5({
4602
5179
  jsonldDocument: vp,
4603
5180
  documentLoader,
5181
+ // to debug, set diagnose: console.log
4604
5182
  diagnose
4605
5183
  });
4606
5184
  const {
@@ -4639,6 +5217,7 @@ async function fromQrCode({
4639
5217
  const vp = await decode5({
4640
5218
  cborldBytes,
4641
5219
  documentLoader,
5220
+ // to debug, set diagnose: console.log
4642
5221
  diagnose
4643
5222
  });
4644
5223
  return { vp };
@@ -4652,53 +5231,115 @@ var getVpqrPlugin = /* @__PURE__ */ __name((learnCard) => {
4652
5231
  displayName: "VP QR",
4653
5232
  description: "Allows reading and creating QR codes with Verifiable Presentations in them",
4654
5233
  methods: {
4655
- vpFromQrCode: async (_learnCard, text) => {
5234
+ vpFromQrCode: /* @__PURE__ */ __name(async (_learnCard, text) => {
4656
5235
  return (await fromQrCode({
4657
5236
  text,
4658
- documentLoader: async (url) => ({
5237
+ documentLoader: /* @__PURE__ */ __name(async (url) => ({
4659
5238
  document: await learnCard.invoke.contextLoader(url)
4660
- })
5239
+ }), "documentLoader")
4661
5240
  }))?.vp;
4662
- },
4663
- vpToQrCode: async (_learnCard, vp) => {
5241
+ }, "vpFromQrCode"),
5242
+ vpToQrCode: /* @__PURE__ */ __name(async (_learnCard, vp) => {
4664
5243
  return (await toQrCode({
4665
5244
  vp,
4666
- documentLoader: async (url) => ({
5245
+ documentLoader: /* @__PURE__ */ __name(async (url) => ({
4667
5246
  document: await learnCard.invoke.contextLoader(url)
4668
- })
5247
+ }), "documentLoader")
4669
5248
  }))?.imageDataUrl;
4670
- }
5249
+ }, "vpToQrCode")
4671
5250
  }
4672
5251
  };
4673
5252
  }, "getVpqrPlugin");
4674
5253
  export {
4675
5254
  getVpqrPlugin
4676
5255
  };
4677
- /*!
4678
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
4679
- */
4680
- /*!
4681
- * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
4682
- */
4683
- /*!
4684
- * Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved.
4685
- */
4686
- /*!
4687
- * Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
4688
- */
4689
- /*!
4690
- * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
4691
- */
4692
- /*!
4693
- * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved.
4694
- */
4695
- /**
4696
- * @module QRCode
4697
- * @package @nuintun/qrcode
4698
- * @license MIT
4699
- * @version 3.4.0
4700
- * @author nuintun <nuintun@qq.com>
4701
- * @description A pure JavaScript QRCode encode and decode library.
4702
- * @see https://github.com/nuintun/qrcode#readme
4703
- */
5256
+ /*! Bundled license information:
5257
+
5258
+ @digitalbazaar/cborld/lib/CborldError.js:
5259
+ (*!
5260
+ * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
5261
+ *)
5262
+
5263
+ @digitalbazaar/cborld/lib/keywords.js:
5264
+ @digitalbazaar/cborld/lib/codecs/CborldDecoder.js:
5265
+ @digitalbazaar/cborld/lib/codecs/registeredContexts.js:
5266
+ @digitalbazaar/cborld/lib/codecs/ContextDecoder.js:
5267
+ @digitalbazaar/cborld/lib/Transformer.js:
5268
+ @digitalbazaar/cborld/lib/codecs/Base58DidUrlDecoder.js:
5269
+ @digitalbazaar/cborld/lib/codecs/HttpUrlDecoder.js:
5270
+ @digitalbazaar/cborld/lib/codecs/UuidUrnDecoder.js:
5271
+ @digitalbazaar/cborld/lib/codecs/VocabTermDecoder.js:
5272
+ @digitalbazaar/cborld/lib/codecs/XsdDateDecoder.js:
5273
+ @digitalbazaar/cborld/lib/codecs/XsdDateTimeDecoder.js:
5274
+ @digitalbazaar/cborld/lib/codecs/CborldEncoder.js:
5275
+ @digitalbazaar/vpqr/lib/vpqr.js:
5276
+ @digitalbazaar/vpqr/lib/index.js:
5277
+ (*!
5278
+ * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
5279
+ *)
5280
+
5281
+ base58-universal/lib/index.js:
5282
+ (*!
5283
+ * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
5284
+ *)
5285
+
5286
+ @digitalbazaar/cborld/lib/codecs/MultibaseDecoder.js:
5287
+ @digitalbazaar/cborld/lib/codecs/UriDecoder.js:
5288
+ @digitalbazaar/cborld/lib/Decompressor.js:
5289
+ @digitalbazaar/cborld/lib/codecs/ContextEncoder.js:
5290
+ @digitalbazaar/cborld/lib/codecs/MultibaseEncoder.js:
5291
+ @digitalbazaar/cborld/lib/codecs/Base58DidUrlEncoder.js:
5292
+ @digitalbazaar/cborld/lib/codecs/HttpUrlEncoder.js:
5293
+ @digitalbazaar/cborld/lib/codecs/UuidUrnEncoder.js:
5294
+ @digitalbazaar/cborld/lib/codecs/UriEncoder.js:
5295
+ @digitalbazaar/cborld/lib/codecs/VocabTermEncoder.js:
5296
+ @digitalbazaar/cborld/lib/codecs/XsdDateEncoder.js:
5297
+ @digitalbazaar/cborld/lib/codecs/XsdDateTimeEncoder.js:
5298
+ @digitalbazaar/cborld/lib/Compressor.js:
5299
+ (*!
5300
+ * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved.
5301
+ *)
5302
+
5303
+ @digitalbazaar/cborld/lib/decode.js:
5304
+ @digitalbazaar/cborld/lib/index.js:
5305
+ (*!
5306
+ * Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved.
5307
+ *)
5308
+
5309
+ @digitalbazaar/cborld/lib/encode.js:
5310
+ (*!
5311
+ * Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
5312
+ *)
5313
+
5314
+ @nuintun/qrcode/esm/qrcode/common/Mode.js:
5315
+ @nuintun/qrcode/esm/qrcode/encoder/QRData.js:
5316
+ @nuintun/qrcode/esm/encoding/UTF8.js:
5317
+ @nuintun/qrcode/esm/qrcode/encoder/QRByte.js:
5318
+ @nuintun/qrcode/esm/qrcode/encoder/QRMath.js:
5319
+ @nuintun/qrcode/esm/qrcode/encoder/Polynomial.js:
5320
+ @nuintun/qrcode/esm/qrcode/encoder/QRUtil.js:
5321
+ @nuintun/qrcode/esm/qrcode/common/ErrorCorrectionLevel.js:
5322
+ @nuintun/qrcode/esm/qrcode/encoder/RSBlock.js:
5323
+ @nuintun/qrcode/esm/qrcode/encoder/BitBuffer.js:
5324
+ @nuintun/qrcode/esm/image/lzw/Dict.js:
5325
+ @nuintun/qrcode/esm/image/lzw/DictStream.js:
5326
+ @nuintun/qrcode/esm/image/lzw/index.js:
5327
+ @nuintun/qrcode/esm/image/ByteStream.js:
5328
+ @nuintun/qrcode/esm/image/Base64Stream.js:
5329
+ @nuintun/qrcode/esm/image/GIFImage.js:
5330
+ @nuintun/qrcode/esm/qrcode/common/MaskPattern.js:
5331
+ @nuintun/qrcode/esm/qrcode/encoder/Writer.js:
5332
+ @nuintun/qrcode/esm/encoding/UTF16.js:
5333
+ @nuintun/qrcode/esm/qrcode/encoder/QRAlphanumeric.js:
5334
+ @nuintun/qrcode/esm/index.js:
5335
+ (**
5336
+ * @module QRCode
5337
+ * @package @nuintun/qrcode
5338
+ * @license MIT
5339
+ * @version 3.4.0
5340
+ * @author nuintun <nuintun@qq.com>
5341
+ * @description A pure JavaScript QRCode encode and decode library.
5342
+ * @see https://github.com/nuintun/qrcode#readme
5343
+ *)
5344
+ */
4704
5345
  //# sourceMappingURL=vpqr-plugin.esm.js.map