@nhtio/validation 0.1.0-master-cb87a6f9 → 0.1.0-master-952eca46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +868 -627
- package/index.cjs.map +1 -1
- package/index.d.ts +0 -1
- package/index.mjs +868 -627
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -48,13 +48,13 @@ var require_stringify = __commonJSMin((exports, module) => {
|
|
|
48
48
|
var require_assert$1 = __commonJSMin((exports, module) => {
|
|
49
49
|
const AssertError$2 = require_assertError();
|
|
50
50
|
const Stringify = require_stringify();
|
|
51
|
-
const assert$
|
|
51
|
+
const assert$54 = module.exports = function(condition, ...args$1) {
|
|
52
52
|
if (condition) return;
|
|
53
53
|
if (args$1.length === 1 && args$1[0] instanceof Error) throw args$1[0];
|
|
54
54
|
const msgs = args$1.filter((arg) => arg !== "").map((arg) => {
|
|
55
55
|
return typeof arg === "string" ? arg : arg instanceof Error ? arg.message : Stringify(arg);
|
|
56
56
|
});
|
|
57
|
-
throw new AssertError$2(msgs.join(" "), assert$
|
|
57
|
+
throw new AssertError$2(msgs.join(" "), assert$54);
|
|
58
58
|
};
|
|
59
59
|
});
|
|
60
60
|
var dist_exports = {};
|
|
@@ -246,14 +246,14 @@ var init_dist$1 = __esmMin(() => {
|
|
|
246
246
|
const base64 = base64Js$1;
|
|
247
247
|
const ieee754$1$1 = ieee754$1;
|
|
248
248
|
const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
|
|
249
|
-
exports$1.Buffer = Buffer$
|
|
249
|
+
exports$1.Buffer = Buffer$29;
|
|
250
250
|
exports$1.SlowBuffer = SlowBuffer$1;
|
|
251
251
|
exports$1.INSPECT_MAX_BYTES = 50;
|
|
252
252
|
const K_MAX_LENGTH = 2147483647;
|
|
253
253
|
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
254
254
|
const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
|
|
255
|
-
Buffer$
|
|
256
|
-
if (!Buffer$
|
|
255
|
+
Buffer$29.TYPED_ARRAY_SUPPORT = typedArraySupport();
|
|
256
|
+
if (!Buffer$29.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
|
|
257
257
|
function typedArraySupport() {
|
|
258
258
|
try {
|
|
259
259
|
const arr = new GlobalUint8Array(1);
|
|
@@ -267,34 +267,34 @@ var init_dist$1 = __esmMin(() => {
|
|
|
267
267
|
return false;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
Object.defineProperty(Buffer$
|
|
270
|
+
Object.defineProperty(Buffer$29.prototype, "parent", {
|
|
271
271
|
enumerable: true,
|
|
272
272
|
get: function() {
|
|
273
|
-
if (!Buffer$
|
|
273
|
+
if (!Buffer$29.isBuffer(this)) return void 0;
|
|
274
274
|
return this.buffer;
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
|
-
Object.defineProperty(Buffer$
|
|
277
|
+
Object.defineProperty(Buffer$29.prototype, "offset", {
|
|
278
278
|
enumerable: true,
|
|
279
279
|
get: function() {
|
|
280
|
-
if (!Buffer$
|
|
280
|
+
if (!Buffer$29.isBuffer(this)) return void 0;
|
|
281
281
|
return this.byteOffset;
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
284
|
function createBuffer(length) {
|
|
285
285
|
if (length > K_MAX_LENGTH) throw new RangeError("The value \"" + length + "\" is invalid for option \"size\"");
|
|
286
286
|
const buf = new GlobalUint8Array(length);
|
|
287
|
-
Object.setPrototypeOf(buf, Buffer$
|
|
287
|
+
Object.setPrototypeOf(buf, Buffer$29.prototype);
|
|
288
288
|
return buf;
|
|
289
289
|
}
|
|
290
|
-
function Buffer$
|
|
290
|
+
function Buffer$29(arg, encodingOrOffset, length) {
|
|
291
291
|
if (typeof arg === "number") {
|
|
292
292
|
if (typeof encodingOrOffset === "string") throw new TypeError("The \"string\" argument must be of type string. Received type number");
|
|
293
293
|
return allocUnsafe$1(arg);
|
|
294
294
|
}
|
|
295
295
|
return from$2(arg, encodingOrOffset, length);
|
|
296
296
|
}
|
|
297
|
-
Buffer$
|
|
297
|
+
Buffer$29.poolSize = 8192;
|
|
298
298
|
function from$2(value, encodingOrOffset, length) {
|
|
299
299
|
if (typeof value === "string") return fromString(value, encodingOrOffset);
|
|
300
300
|
if (GlobalArrayBuffer.isView(value)) return fromArrayView(value);
|
|
@@ -303,17 +303,17 @@ var init_dist$1 = __esmMin(() => {
|
|
|
303
303
|
if (typeof GlobalSharedArrayBuffer !== "undefined" && (isInstance(value, GlobalSharedArrayBuffer) || value && isInstance(value.buffer, GlobalSharedArrayBuffer))) return fromArrayBuffer(value, encodingOrOffset, length);
|
|
304
304
|
if (typeof value === "number") throw new TypeError("The \"value\" argument must not be of type number. Received type number");
|
|
305
305
|
const valueOf = value.valueOf && value.valueOf();
|
|
306
|
-
if (valueOf != null && valueOf !== value) return Buffer$
|
|
306
|
+
if (valueOf != null && valueOf !== value) return Buffer$29.from(valueOf, encodingOrOffset, length);
|
|
307
307
|
const b = fromObject(value);
|
|
308
308
|
if (b) return b;
|
|
309
|
-
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer$
|
|
309
|
+
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer$29.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
|
|
310
310
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
|
|
311
311
|
}
|
|
312
|
-
Buffer$
|
|
312
|
+
Buffer$29.from = function(value, encodingOrOffset, length) {
|
|
313
313
|
return from$2(value, encodingOrOffset, length);
|
|
314
314
|
};
|
|
315
|
-
Object.setPrototypeOf(Buffer$
|
|
316
|
-
Object.setPrototypeOf(Buffer$
|
|
315
|
+
Object.setPrototypeOf(Buffer$29.prototype, GlobalUint8Array.prototype);
|
|
316
|
+
Object.setPrototypeOf(Buffer$29, GlobalUint8Array);
|
|
317
317
|
function assertSize$1(size) {
|
|
318
318
|
if (typeof size !== "number") throw new TypeError("\"size\" argument must be of type number");
|
|
319
319
|
else if (size < 0) throw new RangeError("The value \"" + size + "\" is invalid for option \"size\"");
|
|
@@ -324,22 +324,22 @@ var init_dist$1 = __esmMin(() => {
|
|
|
324
324
|
if (fill !== void 0) return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
|
|
325
325
|
return createBuffer(size);
|
|
326
326
|
}
|
|
327
|
-
Buffer$
|
|
327
|
+
Buffer$29.alloc = function(size, fill, encoding) {
|
|
328
328
|
return alloc(size, fill, encoding);
|
|
329
329
|
};
|
|
330
330
|
function allocUnsafe$1(size) {
|
|
331
331
|
assertSize$1(size);
|
|
332
332
|
return createBuffer(size < 0 ? 0 : checked(size) | 0);
|
|
333
333
|
}
|
|
334
|
-
Buffer$
|
|
334
|
+
Buffer$29.allocUnsafe = function(size) {
|
|
335
335
|
return allocUnsafe$1(size);
|
|
336
336
|
};
|
|
337
|
-
Buffer$
|
|
337
|
+
Buffer$29.allocUnsafeSlow = function(size) {
|
|
338
338
|
return allocUnsafe$1(size);
|
|
339
339
|
};
|
|
340
340
|
function fromString(string, encoding) {
|
|
341
341
|
if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
|
|
342
|
-
if (!Buffer$
|
|
342
|
+
if (!Buffer$29.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
|
|
343
343
|
const length = byteLength$2(string, encoding) | 0;
|
|
344
344
|
let buf = createBuffer(length);
|
|
345
345
|
const actual = buf.write(string, encoding);
|
|
@@ -366,11 +366,11 @@ var init_dist$1 = __esmMin(() => {
|
|
|
366
366
|
if (byteOffset === void 0 && length === void 0) buf = new GlobalUint8Array(array);
|
|
367
367
|
else if (length === void 0) buf = new GlobalUint8Array(array, byteOffset);
|
|
368
368
|
else buf = new GlobalUint8Array(array, byteOffset, length);
|
|
369
|
-
Object.setPrototypeOf(buf, Buffer$
|
|
369
|
+
Object.setPrototypeOf(buf, Buffer$29.prototype);
|
|
370
370
|
return buf;
|
|
371
371
|
}
|
|
372
372
|
function fromObject(obj) {
|
|
373
|
-
if (Buffer$
|
|
373
|
+
if (Buffer$29.isBuffer(obj)) {
|
|
374
374
|
const len$2 = checked(obj.length) | 0;
|
|
375
375
|
const buf = createBuffer(len$2);
|
|
376
376
|
if (buf.length === 0) return buf;
|
|
@@ -389,15 +389,15 @@ var init_dist$1 = __esmMin(() => {
|
|
|
389
389
|
}
|
|
390
390
|
function SlowBuffer$1(length) {
|
|
391
391
|
if (+length != length) length = 0;
|
|
392
|
-
return Buffer$
|
|
392
|
+
return Buffer$29.alloc(+length);
|
|
393
393
|
}
|
|
394
|
-
Buffer$
|
|
395
|
-
return b != null && b._isBuffer === true && b !== Buffer$
|
|
394
|
+
Buffer$29.isBuffer = function isBuffer$6(b) {
|
|
395
|
+
return b != null && b._isBuffer === true && b !== Buffer$29.prototype;
|
|
396
396
|
};
|
|
397
|
-
Buffer$
|
|
398
|
-
if (isInstance(a$2, GlobalUint8Array)) a$2 = Buffer$
|
|
399
|
-
if (isInstance(b, GlobalUint8Array)) b = Buffer$
|
|
400
|
-
if (!Buffer$
|
|
397
|
+
Buffer$29.compare = function compare$16(a$2, b) {
|
|
398
|
+
if (isInstance(a$2, GlobalUint8Array)) a$2 = Buffer$29.from(a$2, a$2.offset, a$2.byteLength);
|
|
399
|
+
if (isInstance(b, GlobalUint8Array)) b = Buffer$29.from(b, b.offset, b.byteLength);
|
|
400
|
+
if (!Buffer$29.isBuffer(a$2) || !Buffer$29.isBuffer(b)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
|
|
401
401
|
if (a$2 === b) return 0;
|
|
402
402
|
let x$1 = a$2.length;
|
|
403
403
|
let y$1 = b.length;
|
|
@@ -410,7 +410,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
410
410
|
if (y$1 < x$1) return 1;
|
|
411
411
|
return 0;
|
|
412
412
|
};
|
|
413
|
-
Buffer$
|
|
413
|
+
Buffer$29.isEncoding = function isEncoding$1(encoding) {
|
|
414
414
|
switch (String(encoding).toLowerCase()) {
|
|
415
415
|
case "hex":
|
|
416
416
|
case "utf8":
|
|
@@ -426,30 +426,30 @@ var init_dist$1 = __esmMin(() => {
|
|
|
426
426
|
default: return false;
|
|
427
427
|
}
|
|
428
428
|
};
|
|
429
|
-
Buffer$
|
|
429
|
+
Buffer$29.concat = function concat$1(list, length) {
|
|
430
430
|
if (!Array.isArray(list)) throw new TypeError("\"list\" argument must be an Array of Buffers");
|
|
431
|
-
if (list.length === 0) return Buffer$
|
|
431
|
+
if (list.length === 0) return Buffer$29.alloc(0);
|
|
432
432
|
let i$4;
|
|
433
433
|
if (length === void 0) {
|
|
434
434
|
length = 0;
|
|
435
435
|
for (i$4 = 0; i$4 < list.length; ++i$4) length += list[i$4].length;
|
|
436
436
|
}
|
|
437
|
-
const buffer$3 = Buffer$
|
|
437
|
+
const buffer$3 = Buffer$29.allocUnsafe(length);
|
|
438
438
|
let pos = 0;
|
|
439
439
|
for (i$4 = 0; i$4 < list.length; ++i$4) {
|
|
440
440
|
let buf = list[i$4];
|
|
441
441
|
if (isInstance(buf, GlobalUint8Array)) if (pos + buf.length > buffer$3.length) {
|
|
442
|
-
if (!Buffer$
|
|
442
|
+
if (!Buffer$29.isBuffer(buf)) buf = Buffer$29.from(buf);
|
|
443
443
|
buf.copy(buffer$3, pos);
|
|
444
444
|
} else GlobalUint8Array.prototype.set.call(buffer$3, buf, pos);
|
|
445
|
-
else if (!Buffer$
|
|
445
|
+
else if (!Buffer$29.isBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers");
|
|
446
446
|
else buf.copy(buffer$3, pos);
|
|
447
447
|
pos += buf.length;
|
|
448
448
|
}
|
|
449
449
|
return buffer$3;
|
|
450
450
|
};
|
|
451
451
|
function byteLength$2(string, encoding) {
|
|
452
|
-
if (Buffer$
|
|
452
|
+
if (Buffer$29.isBuffer(string)) return string.length;
|
|
453
453
|
if (GlobalArrayBuffer.isView(string) || isInstance(string, GlobalArrayBuffer)) return string.byteLength;
|
|
454
454
|
if (typeof string !== "string") throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string);
|
|
455
455
|
const len$2 = string.length;
|
|
@@ -474,7 +474,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
474
474
|
loweredCase = true;
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
Buffer$
|
|
477
|
+
Buffer$29.byteLength = byteLength$2;
|
|
478
478
|
function slowToString(encoding, start, end) {
|
|
479
479
|
let loweredCase = false;
|
|
480
480
|
if (start === void 0 || start < 0) start = 0;
|
|
@@ -503,19 +503,19 @@ var init_dist$1 = __esmMin(() => {
|
|
|
503
503
|
loweredCase = true;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
Buffer$
|
|
506
|
+
Buffer$29.prototype._isBuffer = true;
|
|
507
507
|
function swap(b, n$4, m$3) {
|
|
508
508
|
const i$4 = b[n$4];
|
|
509
509
|
b[n$4] = b[m$3];
|
|
510
510
|
b[m$3] = i$4;
|
|
511
511
|
}
|
|
512
|
-
Buffer$
|
|
512
|
+
Buffer$29.prototype.swap16 = function swap16() {
|
|
513
513
|
const len$2 = this.length;
|
|
514
514
|
if (len$2 % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
515
515
|
for (let i$4 = 0; i$4 < len$2; i$4 += 2) swap(this, i$4, i$4 + 1);
|
|
516
516
|
return this;
|
|
517
517
|
};
|
|
518
|
-
Buffer$
|
|
518
|
+
Buffer$29.prototype.swap32 = function swap32() {
|
|
519
519
|
const len$2 = this.length;
|
|
520
520
|
if (len$2 % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
521
521
|
for (let i$4 = 0; i$4 < len$2; i$4 += 4) {
|
|
@@ -524,7 +524,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
524
524
|
}
|
|
525
525
|
return this;
|
|
526
526
|
};
|
|
527
|
-
Buffer$
|
|
527
|
+
Buffer$29.prototype.swap64 = function swap64() {
|
|
528
528
|
const len$2 = this.length;
|
|
529
529
|
if (len$2 % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
530
530
|
for (let i$4 = 0; i$4 < len$2; i$4 += 8) {
|
|
@@ -535,29 +535,29 @@ var init_dist$1 = __esmMin(() => {
|
|
|
535
535
|
}
|
|
536
536
|
return this;
|
|
537
537
|
};
|
|
538
|
-
Buffer$
|
|
538
|
+
Buffer$29.prototype.toString = function toString$4() {
|
|
539
539
|
const length = this.length;
|
|
540
540
|
if (length === 0) return "";
|
|
541
541
|
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
542
542
|
return slowToString.apply(this, arguments);
|
|
543
543
|
};
|
|
544
|
-
Buffer$
|
|
545
|
-
Buffer$
|
|
546
|
-
if (!Buffer$
|
|
544
|
+
Buffer$29.prototype.toLocaleString = Buffer$29.prototype.toString;
|
|
545
|
+
Buffer$29.prototype.equals = function equals(b) {
|
|
546
|
+
if (!Buffer$29.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
|
|
547
547
|
if (this === b) return true;
|
|
548
|
-
return Buffer$
|
|
548
|
+
return Buffer$29.compare(this, b) === 0;
|
|
549
549
|
};
|
|
550
|
-
Buffer$
|
|
550
|
+
Buffer$29.prototype.inspect = function inspect$4() {
|
|
551
551
|
let str = "";
|
|
552
552
|
const max$3 = exports$1.INSPECT_MAX_BYTES;
|
|
553
553
|
str = this.toString("hex", 0, max$3).replace(/(.{2})/g, "$1 ").trim();
|
|
554
554
|
if (this.length > max$3) str += " ... ";
|
|
555
555
|
return "<Buffer " + str + ">";
|
|
556
556
|
};
|
|
557
|
-
if (customInspectSymbol) Buffer$
|
|
558
|
-
Buffer$
|
|
559
|
-
if (isInstance(target, GlobalUint8Array)) target = Buffer$
|
|
560
|
-
if (!Buffer$
|
|
557
|
+
if (customInspectSymbol) Buffer$29.prototype[customInspectSymbol] = Buffer$29.prototype.inspect;
|
|
558
|
+
Buffer$29.prototype.compare = function compare$16(target, start, end, thisStart, thisEnd) {
|
|
559
|
+
if (isInstance(target, GlobalUint8Array)) target = Buffer$29.from(target, target.offset, target.byteLength);
|
|
560
|
+
if (!Buffer$29.isBuffer(target)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof target);
|
|
561
561
|
if (start === void 0) start = 0;
|
|
562
562
|
if (end === void 0) end = target ? target.length : 0;
|
|
563
563
|
if (thisStart === void 0) thisStart = 0;
|
|
@@ -599,8 +599,8 @@ var init_dist$1 = __esmMin(() => {
|
|
|
599
599
|
else byteOffset = buffer$3.length - 1;
|
|
600
600
|
else if (byteOffset < 0) if (dir) byteOffset = 0;
|
|
601
601
|
else return -1;
|
|
602
|
-
if (typeof val === "string") val = Buffer$
|
|
603
|
-
if (Buffer$
|
|
602
|
+
if (typeof val === "string") val = Buffer$29.from(val, encoding);
|
|
603
|
+
if (Buffer$29.isBuffer(val)) {
|
|
604
604
|
if (val.length === 0) return -1;
|
|
605
605
|
return arrayIndexOf(buffer$3, val, byteOffset, encoding, dir);
|
|
606
606
|
} else if (typeof val === "number") {
|
|
@@ -652,13 +652,13 @@ var init_dist$1 = __esmMin(() => {
|
|
|
652
652
|
}
|
|
653
653
|
return -1;
|
|
654
654
|
}
|
|
655
|
-
Buffer$
|
|
655
|
+
Buffer$29.prototype.includes = function includes$2(val, byteOffset, encoding) {
|
|
656
656
|
return this.indexOf(val, byteOffset, encoding) !== -1;
|
|
657
657
|
};
|
|
658
|
-
Buffer$
|
|
658
|
+
Buffer$29.prototype.indexOf = function indexOf$3(val, byteOffset, encoding) {
|
|
659
659
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
|
|
660
660
|
};
|
|
661
|
-
Buffer$
|
|
661
|
+
Buffer$29.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
662
662
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
663
663
|
};
|
|
664
664
|
function hexWrite(buf, string, offset$2, length) {
|
|
@@ -691,7 +691,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
691
691
|
function ucs2Write(buf, string, offset$2, length) {
|
|
692
692
|
return blitBuffer(utf16leToBytes(string, buf.length - offset$2), buf, offset$2, length);
|
|
693
693
|
}
|
|
694
|
-
Buffer$
|
|
694
|
+
Buffer$29.prototype.write = function write(string, offset$2, length, encoding) {
|
|
695
695
|
if (offset$2 === void 0) {
|
|
696
696
|
encoding = "utf8";
|
|
697
697
|
length = this.length;
|
|
@@ -733,7 +733,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
733
733
|
loweredCase = true;
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
|
-
Buffer$
|
|
736
|
+
Buffer$29.prototype.toJSON = function toJSON() {
|
|
737
737
|
return {
|
|
738
738
|
type: "Buffer",
|
|
739
739
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
@@ -830,7 +830,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
830
830
|
for (let i$4 = 0; i$4 < bytes.length - 1; i$4 += 2) res += String.fromCharCode(bytes[i$4] + bytes[i$4 + 1] * 256);
|
|
831
831
|
return res;
|
|
832
832
|
}
|
|
833
|
-
Buffer$
|
|
833
|
+
Buffer$29.prototype.slice = function slice$1(start, end) {
|
|
834
834
|
const len$2 = this.length;
|
|
835
835
|
start = ~~start;
|
|
836
836
|
end = end === void 0 ? len$2 : ~~end;
|
|
@@ -844,14 +844,14 @@ var init_dist$1 = __esmMin(() => {
|
|
|
844
844
|
} else if (end > len$2) end = len$2;
|
|
845
845
|
if (end < start) end = start;
|
|
846
846
|
const newBuf = this.subarray(start, end);
|
|
847
|
-
Object.setPrototypeOf(newBuf, Buffer$
|
|
847
|
+
Object.setPrototypeOf(newBuf, Buffer$29.prototype);
|
|
848
848
|
return newBuf;
|
|
849
849
|
};
|
|
850
850
|
function checkOffset(offset$2, ext, length) {
|
|
851
851
|
if (offset$2 % 1 !== 0 || offset$2 < 0) throw new RangeError("offset is not uint");
|
|
852
852
|
if (offset$2 + ext > length) throw new RangeError("Trying to access beyond buffer length");
|
|
853
853
|
}
|
|
854
|
-
Buffer$
|
|
854
|
+
Buffer$29.prototype.readUintLE = Buffer$29.prototype.readUIntLE = function readUIntLE(offset$2, byteLength$3, noAssert) {
|
|
855
855
|
offset$2 = offset$2 >>> 0;
|
|
856
856
|
byteLength$3 = byteLength$3 >>> 0;
|
|
857
857
|
if (!noAssert) checkOffset(offset$2, byteLength$3, this.length);
|
|
@@ -861,7 +861,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
861
861
|
while (++i$4 < byteLength$3 && (mul *= 256)) val += this[offset$2 + i$4] * mul;
|
|
862
862
|
return val;
|
|
863
863
|
};
|
|
864
|
-
Buffer$
|
|
864
|
+
Buffer$29.prototype.readUintBE = Buffer$29.prototype.readUIntBE = function readUIntBE(offset$2, byteLength$3, noAssert) {
|
|
865
865
|
offset$2 = offset$2 >>> 0;
|
|
866
866
|
byteLength$3 = byteLength$3 >>> 0;
|
|
867
867
|
if (!noAssert) checkOffset(offset$2, byteLength$3, this.length);
|
|
@@ -870,32 +870,32 @@ var init_dist$1 = __esmMin(() => {
|
|
|
870
870
|
while (byteLength$3 > 0 && (mul *= 256)) val += this[offset$2 + --byteLength$3] * mul;
|
|
871
871
|
return val;
|
|
872
872
|
};
|
|
873
|
-
Buffer$
|
|
873
|
+
Buffer$29.prototype.readUint8 = Buffer$29.prototype.readUInt8 = function readUInt8(offset$2, noAssert) {
|
|
874
874
|
offset$2 = offset$2 >>> 0;
|
|
875
875
|
if (!noAssert) checkOffset(offset$2, 1, this.length);
|
|
876
876
|
return this[offset$2];
|
|
877
877
|
};
|
|
878
|
-
Buffer$
|
|
878
|
+
Buffer$29.prototype.readUint16LE = Buffer$29.prototype.readUInt16LE = function readUInt16LE(offset$2, noAssert) {
|
|
879
879
|
offset$2 = offset$2 >>> 0;
|
|
880
880
|
if (!noAssert) checkOffset(offset$2, 2, this.length);
|
|
881
881
|
return this[offset$2] | this[offset$2 + 1] << 8;
|
|
882
882
|
};
|
|
883
|
-
Buffer$
|
|
883
|
+
Buffer$29.prototype.readUint16BE = Buffer$29.prototype.readUInt16BE = function readUInt16BE(offset$2, noAssert) {
|
|
884
884
|
offset$2 = offset$2 >>> 0;
|
|
885
885
|
if (!noAssert) checkOffset(offset$2, 2, this.length);
|
|
886
886
|
return this[offset$2] << 8 | this[offset$2 + 1];
|
|
887
887
|
};
|
|
888
|
-
Buffer$
|
|
888
|
+
Buffer$29.prototype.readUint32LE = Buffer$29.prototype.readUInt32LE = function readUInt32LE(offset$2, noAssert) {
|
|
889
889
|
offset$2 = offset$2 >>> 0;
|
|
890
890
|
if (!noAssert) checkOffset(offset$2, 4, this.length);
|
|
891
891
|
return (this[offset$2] | this[offset$2 + 1] << 8 | this[offset$2 + 2] << 16) + this[offset$2 + 3] * 16777216;
|
|
892
892
|
};
|
|
893
|
-
Buffer$
|
|
893
|
+
Buffer$29.prototype.readUint32BE = Buffer$29.prototype.readUInt32BE = function readUInt32BE(offset$2, noAssert) {
|
|
894
894
|
offset$2 = offset$2 >>> 0;
|
|
895
895
|
if (!noAssert) checkOffset(offset$2, 4, this.length);
|
|
896
896
|
return this[offset$2] * 16777216 + (this[offset$2 + 1] << 16 | this[offset$2 + 2] << 8 | this[offset$2 + 3]);
|
|
897
897
|
};
|
|
898
|
-
Buffer$
|
|
898
|
+
Buffer$29.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset$2) {
|
|
899
899
|
offset$2 = offset$2 >>> 0;
|
|
900
900
|
validateNumber(offset$2, "offset");
|
|
901
901
|
const first$1 = this[offset$2];
|
|
@@ -905,7 +905,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
905
905
|
const hi = this[++offset$2] + this[++offset$2] * 2 ** 8 + this[++offset$2] * 2 ** 16 + last$2 * 2 ** 24;
|
|
906
906
|
return BigInt(lo) + (BigInt(hi) << BigInt(32));
|
|
907
907
|
});
|
|
908
|
-
Buffer$
|
|
908
|
+
Buffer$29.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset$2) {
|
|
909
909
|
offset$2 = offset$2 >>> 0;
|
|
910
910
|
validateNumber(offset$2, "offset");
|
|
911
911
|
const first$1 = this[offset$2];
|
|
@@ -915,7 +915,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
915
915
|
const lo = this[++offset$2] * 2 ** 24 + this[++offset$2] * 2 ** 16 + this[++offset$2] * 2 ** 8 + last$2;
|
|
916
916
|
return (BigInt(hi) << BigInt(32)) + BigInt(lo);
|
|
917
917
|
});
|
|
918
|
-
Buffer$
|
|
918
|
+
Buffer$29.prototype.readIntLE = function readIntLE(offset$2, byteLength$3, noAssert) {
|
|
919
919
|
offset$2 = offset$2 >>> 0;
|
|
920
920
|
byteLength$3 = byteLength$3 >>> 0;
|
|
921
921
|
if (!noAssert) checkOffset(offset$2, byteLength$3, this.length);
|
|
@@ -927,7 +927,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
927
927
|
if (val >= mul) val -= Math.pow(2, 8 * byteLength$3);
|
|
928
928
|
return val;
|
|
929
929
|
};
|
|
930
|
-
Buffer$
|
|
930
|
+
Buffer$29.prototype.readIntBE = function readIntBE(offset$2, byteLength$3, noAssert) {
|
|
931
931
|
offset$2 = offset$2 >>> 0;
|
|
932
932
|
byteLength$3 = byteLength$3 >>> 0;
|
|
933
933
|
if (!noAssert) checkOffset(offset$2, byteLength$3, this.length);
|
|
@@ -939,35 +939,35 @@ var init_dist$1 = __esmMin(() => {
|
|
|
939
939
|
if (val >= mul) val -= Math.pow(2, 8 * byteLength$3);
|
|
940
940
|
return val;
|
|
941
941
|
};
|
|
942
|
-
Buffer$
|
|
942
|
+
Buffer$29.prototype.readInt8 = function readInt8(offset$2, noAssert) {
|
|
943
943
|
offset$2 = offset$2 >>> 0;
|
|
944
944
|
if (!noAssert) checkOffset(offset$2, 1, this.length);
|
|
945
945
|
if (!(this[offset$2] & 128)) return this[offset$2];
|
|
946
946
|
return (255 - this[offset$2] + 1) * -1;
|
|
947
947
|
};
|
|
948
|
-
Buffer$
|
|
948
|
+
Buffer$29.prototype.readInt16LE = function readInt16LE(offset$2, noAssert) {
|
|
949
949
|
offset$2 = offset$2 >>> 0;
|
|
950
950
|
if (!noAssert) checkOffset(offset$2, 2, this.length);
|
|
951
951
|
const val = this[offset$2] | this[offset$2 + 1] << 8;
|
|
952
952
|
return val & 32768 ? val | 4294901760 : val;
|
|
953
953
|
};
|
|
954
|
-
Buffer$
|
|
954
|
+
Buffer$29.prototype.readInt16BE = function readInt16BE(offset$2, noAssert) {
|
|
955
955
|
offset$2 = offset$2 >>> 0;
|
|
956
956
|
if (!noAssert) checkOffset(offset$2, 2, this.length);
|
|
957
957
|
const val = this[offset$2 + 1] | this[offset$2] << 8;
|
|
958
958
|
return val & 32768 ? val | 4294901760 : val;
|
|
959
959
|
};
|
|
960
|
-
Buffer$
|
|
960
|
+
Buffer$29.prototype.readInt32LE = function readInt32LE(offset$2, noAssert) {
|
|
961
961
|
offset$2 = offset$2 >>> 0;
|
|
962
962
|
if (!noAssert) checkOffset(offset$2, 4, this.length);
|
|
963
963
|
return this[offset$2] | this[offset$2 + 1] << 8 | this[offset$2 + 2] << 16 | this[offset$2 + 3] << 24;
|
|
964
964
|
};
|
|
965
|
-
Buffer$
|
|
965
|
+
Buffer$29.prototype.readInt32BE = function readInt32BE(offset$2, noAssert) {
|
|
966
966
|
offset$2 = offset$2 >>> 0;
|
|
967
967
|
if (!noAssert) checkOffset(offset$2, 4, this.length);
|
|
968
968
|
return this[offset$2] << 24 | this[offset$2 + 1] << 16 | this[offset$2 + 2] << 8 | this[offset$2 + 3];
|
|
969
969
|
};
|
|
970
|
-
Buffer$
|
|
970
|
+
Buffer$29.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset$2) {
|
|
971
971
|
offset$2 = offset$2 >>> 0;
|
|
972
972
|
validateNumber(offset$2, "offset");
|
|
973
973
|
const first$1 = this[offset$2];
|
|
@@ -976,7 +976,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
976
976
|
const val = this[offset$2 + 4] + this[offset$2 + 5] * 2 ** 8 + this[offset$2 + 6] * 2 ** 16 + (last$2 << 24);
|
|
977
977
|
return (BigInt(val) << BigInt(32)) + BigInt(first$1 + this[++offset$2] * 2 ** 8 + this[++offset$2] * 2 ** 16 + this[++offset$2] * 2 ** 24);
|
|
978
978
|
});
|
|
979
|
-
Buffer$
|
|
979
|
+
Buffer$29.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset$2) {
|
|
980
980
|
offset$2 = offset$2 >>> 0;
|
|
981
981
|
validateNumber(offset$2, "offset");
|
|
982
982
|
const first$1 = this[offset$2];
|
|
@@ -985,32 +985,32 @@ var init_dist$1 = __esmMin(() => {
|
|
|
985
985
|
const val = (first$1 << 24) + this[++offset$2] * 2 ** 16 + this[++offset$2] * 2 ** 8 + this[++offset$2];
|
|
986
986
|
return (BigInt(val) << BigInt(32)) + BigInt(this[++offset$2] * 2 ** 24 + this[++offset$2] * 2 ** 16 + this[++offset$2] * 2 ** 8 + last$2);
|
|
987
987
|
});
|
|
988
|
-
Buffer$
|
|
988
|
+
Buffer$29.prototype.readFloatLE = function readFloatLE(offset$2, noAssert) {
|
|
989
989
|
offset$2 = offset$2 >>> 0;
|
|
990
990
|
if (!noAssert) checkOffset(offset$2, 4, this.length);
|
|
991
991
|
return ieee754$1$1.read(this, offset$2, true, 23, 4);
|
|
992
992
|
};
|
|
993
|
-
Buffer$
|
|
993
|
+
Buffer$29.prototype.readFloatBE = function readFloatBE(offset$2, noAssert) {
|
|
994
994
|
offset$2 = offset$2 >>> 0;
|
|
995
995
|
if (!noAssert) checkOffset(offset$2, 4, this.length);
|
|
996
996
|
return ieee754$1$1.read(this, offset$2, false, 23, 4);
|
|
997
997
|
};
|
|
998
|
-
Buffer$
|
|
998
|
+
Buffer$29.prototype.readDoubleLE = function readDoubleLE(offset$2, noAssert) {
|
|
999
999
|
offset$2 = offset$2 >>> 0;
|
|
1000
1000
|
if (!noAssert) checkOffset(offset$2, 8, this.length);
|
|
1001
1001
|
return ieee754$1$1.read(this, offset$2, true, 52, 8);
|
|
1002
1002
|
};
|
|
1003
|
-
Buffer$
|
|
1003
|
+
Buffer$29.prototype.readDoubleBE = function readDoubleBE(offset$2, noAssert) {
|
|
1004
1004
|
offset$2 = offset$2 >>> 0;
|
|
1005
1005
|
if (!noAssert) checkOffset(offset$2, 8, this.length);
|
|
1006
1006
|
return ieee754$1$1.read(this, offset$2, false, 52, 8);
|
|
1007
1007
|
};
|
|
1008
1008
|
function checkInt(buf, value, offset$2, ext, max$3, min$1) {
|
|
1009
|
-
if (!Buffer$
|
|
1009
|
+
if (!Buffer$29.isBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
|
|
1010
1010
|
if (value > max$3 || value < min$1) throw new RangeError("\"value\" argument is out of bounds");
|
|
1011
1011
|
if (offset$2 + ext > buf.length) throw new RangeError("Index out of range");
|
|
1012
1012
|
}
|
|
1013
|
-
Buffer$
|
|
1013
|
+
Buffer$29.prototype.writeUintLE = Buffer$29.prototype.writeUIntLE = function writeUIntLE(value, offset$2, byteLength$3, noAssert) {
|
|
1014
1014
|
value = +value;
|
|
1015
1015
|
offset$2 = offset$2 >>> 0;
|
|
1016
1016
|
byteLength$3 = byteLength$3 >>> 0;
|
|
@@ -1024,7 +1024,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1024
1024
|
while (++i$4 < byteLength$3 && (mul *= 256)) this[offset$2 + i$4] = value / mul & 255;
|
|
1025
1025
|
return offset$2 + byteLength$3;
|
|
1026
1026
|
};
|
|
1027
|
-
Buffer$
|
|
1027
|
+
Buffer$29.prototype.writeUintBE = Buffer$29.prototype.writeUIntBE = function writeUIntBE(value, offset$2, byteLength$3, noAssert) {
|
|
1028
1028
|
value = +value;
|
|
1029
1029
|
offset$2 = offset$2 >>> 0;
|
|
1030
1030
|
byteLength$3 = byteLength$3 >>> 0;
|
|
@@ -1038,14 +1038,14 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1038
1038
|
while (--i$4 >= 0 && (mul *= 256)) this[offset$2 + i$4] = value / mul & 255;
|
|
1039
1039
|
return offset$2 + byteLength$3;
|
|
1040
1040
|
};
|
|
1041
|
-
Buffer$
|
|
1041
|
+
Buffer$29.prototype.writeUint8 = Buffer$29.prototype.writeUInt8 = function writeUInt8(value, offset$2, noAssert) {
|
|
1042
1042
|
value = +value;
|
|
1043
1043
|
offset$2 = offset$2 >>> 0;
|
|
1044
1044
|
if (!noAssert) checkInt(this, value, offset$2, 1, 255, 0);
|
|
1045
1045
|
this[offset$2] = value & 255;
|
|
1046
1046
|
return offset$2 + 1;
|
|
1047
1047
|
};
|
|
1048
|
-
Buffer$
|
|
1048
|
+
Buffer$29.prototype.writeUint16LE = Buffer$29.prototype.writeUInt16LE = function writeUInt16LE(value, offset$2, noAssert) {
|
|
1049
1049
|
value = +value;
|
|
1050
1050
|
offset$2 = offset$2 >>> 0;
|
|
1051
1051
|
if (!noAssert) checkInt(this, value, offset$2, 2, 65535, 0);
|
|
@@ -1053,7 +1053,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1053
1053
|
this[offset$2 + 1] = value >>> 8;
|
|
1054
1054
|
return offset$2 + 2;
|
|
1055
1055
|
};
|
|
1056
|
-
Buffer$
|
|
1056
|
+
Buffer$29.prototype.writeUint16BE = Buffer$29.prototype.writeUInt16BE = function writeUInt16BE(value, offset$2, noAssert) {
|
|
1057
1057
|
value = +value;
|
|
1058
1058
|
offset$2 = offset$2 >>> 0;
|
|
1059
1059
|
if (!noAssert) checkInt(this, value, offset$2, 2, 65535, 0);
|
|
@@ -1061,7 +1061,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1061
1061
|
this[offset$2 + 1] = value & 255;
|
|
1062
1062
|
return offset$2 + 2;
|
|
1063
1063
|
};
|
|
1064
|
-
Buffer$
|
|
1064
|
+
Buffer$29.prototype.writeUint32LE = Buffer$29.prototype.writeUInt32LE = function writeUInt32LE(value, offset$2, noAssert) {
|
|
1065
1065
|
value = +value;
|
|
1066
1066
|
offset$2 = offset$2 >>> 0;
|
|
1067
1067
|
if (!noAssert) checkInt(this, value, offset$2, 4, 4294967295, 0);
|
|
@@ -1071,7 +1071,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1071
1071
|
this[offset$2] = value & 255;
|
|
1072
1072
|
return offset$2 + 4;
|
|
1073
1073
|
};
|
|
1074
|
-
Buffer$
|
|
1074
|
+
Buffer$29.prototype.writeUint32BE = Buffer$29.prototype.writeUInt32BE = function writeUInt32BE(value, offset$2, noAssert) {
|
|
1075
1075
|
value = +value;
|
|
1076
1076
|
offset$2 = offset$2 >>> 0;
|
|
1077
1077
|
if (!noAssert) checkInt(this, value, offset$2, 4, 4294967295, 0);
|
|
@@ -1121,13 +1121,13 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1121
1121
|
buf[offset$2] = hi;
|
|
1122
1122
|
return offset$2 + 8;
|
|
1123
1123
|
}
|
|
1124
|
-
Buffer$
|
|
1124
|
+
Buffer$29.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset$2 = 0) {
|
|
1125
1125
|
return wrtBigUInt64LE(this, value, offset$2, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1126
1126
|
});
|
|
1127
|
-
Buffer$
|
|
1127
|
+
Buffer$29.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset$2 = 0) {
|
|
1128
1128
|
return wrtBigUInt64BE(this, value, offset$2, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1129
1129
|
});
|
|
1130
|
-
Buffer$
|
|
1130
|
+
Buffer$29.prototype.writeIntLE = function writeIntLE(value, offset$2, byteLength$3, noAssert) {
|
|
1131
1131
|
value = +value;
|
|
1132
1132
|
offset$2 = offset$2 >>> 0;
|
|
1133
1133
|
if (!noAssert) {
|
|
@@ -1144,7 +1144,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
return offset$2 + byteLength$3;
|
|
1146
1146
|
};
|
|
1147
|
-
Buffer$
|
|
1147
|
+
Buffer$29.prototype.writeIntBE = function writeIntBE(value, offset$2, byteLength$3, noAssert) {
|
|
1148
1148
|
value = +value;
|
|
1149
1149
|
offset$2 = offset$2 >>> 0;
|
|
1150
1150
|
if (!noAssert) {
|
|
@@ -1161,7 +1161,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
return offset$2 + byteLength$3;
|
|
1163
1163
|
};
|
|
1164
|
-
Buffer$
|
|
1164
|
+
Buffer$29.prototype.writeInt8 = function writeInt8(value, offset$2, noAssert) {
|
|
1165
1165
|
value = +value;
|
|
1166
1166
|
offset$2 = offset$2 >>> 0;
|
|
1167
1167
|
if (!noAssert) checkInt(this, value, offset$2, 1, 127, -128);
|
|
@@ -1169,7 +1169,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1169
1169
|
this[offset$2] = value & 255;
|
|
1170
1170
|
return offset$2 + 1;
|
|
1171
1171
|
};
|
|
1172
|
-
Buffer$
|
|
1172
|
+
Buffer$29.prototype.writeInt16LE = function writeInt16LE(value, offset$2, noAssert) {
|
|
1173
1173
|
value = +value;
|
|
1174
1174
|
offset$2 = offset$2 >>> 0;
|
|
1175
1175
|
if (!noAssert) checkInt(this, value, offset$2, 2, 32767, -32768);
|
|
@@ -1177,7 +1177,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1177
1177
|
this[offset$2 + 1] = value >>> 8;
|
|
1178
1178
|
return offset$2 + 2;
|
|
1179
1179
|
};
|
|
1180
|
-
Buffer$
|
|
1180
|
+
Buffer$29.prototype.writeInt16BE = function writeInt16BE(value, offset$2, noAssert) {
|
|
1181
1181
|
value = +value;
|
|
1182
1182
|
offset$2 = offset$2 >>> 0;
|
|
1183
1183
|
if (!noAssert) checkInt(this, value, offset$2, 2, 32767, -32768);
|
|
@@ -1185,7 +1185,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1185
1185
|
this[offset$2 + 1] = value & 255;
|
|
1186
1186
|
return offset$2 + 2;
|
|
1187
1187
|
};
|
|
1188
|
-
Buffer$
|
|
1188
|
+
Buffer$29.prototype.writeInt32LE = function writeInt32LE(value, offset$2, noAssert) {
|
|
1189
1189
|
value = +value;
|
|
1190
1190
|
offset$2 = offset$2 >>> 0;
|
|
1191
1191
|
if (!noAssert) checkInt(this, value, offset$2, 4, 2147483647, -2147483648);
|
|
@@ -1195,7 +1195,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1195
1195
|
this[offset$2 + 3] = value >>> 24;
|
|
1196
1196
|
return offset$2 + 4;
|
|
1197
1197
|
};
|
|
1198
|
-
Buffer$
|
|
1198
|
+
Buffer$29.prototype.writeInt32BE = function writeInt32BE(value, offset$2, noAssert) {
|
|
1199
1199
|
value = +value;
|
|
1200
1200
|
offset$2 = offset$2 >>> 0;
|
|
1201
1201
|
if (!noAssert) checkInt(this, value, offset$2, 4, 2147483647, -2147483648);
|
|
@@ -1206,10 +1206,10 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1206
1206
|
this[offset$2 + 3] = value & 255;
|
|
1207
1207
|
return offset$2 + 4;
|
|
1208
1208
|
};
|
|
1209
|
-
Buffer$
|
|
1209
|
+
Buffer$29.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset$2 = 0) {
|
|
1210
1210
|
return wrtBigUInt64LE(this, value, offset$2, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1211
1211
|
});
|
|
1212
|
-
Buffer$
|
|
1212
|
+
Buffer$29.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset$2 = 0) {
|
|
1213
1213
|
return wrtBigUInt64BE(this, value, offset$2, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1214
1214
|
});
|
|
1215
1215
|
function checkIEEE754(buf, value, offset$2, ext, max$3, min$1) {
|
|
@@ -1223,10 +1223,10 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1223
1223
|
ieee754$1$1.write(buf, value, offset$2, littleEndian, 23, 4);
|
|
1224
1224
|
return offset$2 + 4;
|
|
1225
1225
|
}
|
|
1226
|
-
Buffer$
|
|
1226
|
+
Buffer$29.prototype.writeFloatLE = function writeFloatLE(value, offset$2, noAssert) {
|
|
1227
1227
|
return writeFloat(this, value, offset$2, true, noAssert);
|
|
1228
1228
|
};
|
|
1229
|
-
Buffer$
|
|
1229
|
+
Buffer$29.prototype.writeFloatBE = function writeFloatBE(value, offset$2, noAssert) {
|
|
1230
1230
|
return writeFloat(this, value, offset$2, false, noAssert);
|
|
1231
1231
|
};
|
|
1232
1232
|
function writeDouble(buf, value, offset$2, littleEndian, noAssert) {
|
|
@@ -1236,14 +1236,14 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1236
1236
|
ieee754$1$1.write(buf, value, offset$2, littleEndian, 52, 8);
|
|
1237
1237
|
return offset$2 + 8;
|
|
1238
1238
|
}
|
|
1239
|
-
Buffer$
|
|
1239
|
+
Buffer$29.prototype.writeDoubleLE = function writeDoubleLE(value, offset$2, noAssert) {
|
|
1240
1240
|
return writeDouble(this, value, offset$2, true, noAssert);
|
|
1241
1241
|
};
|
|
1242
|
-
Buffer$
|
|
1242
|
+
Buffer$29.prototype.writeDoubleBE = function writeDoubleBE(value, offset$2, noAssert) {
|
|
1243
1243
|
return writeDouble(this, value, offset$2, false, noAssert);
|
|
1244
1244
|
};
|
|
1245
|
-
Buffer$
|
|
1246
|
-
if (!Buffer$
|
|
1245
|
+
Buffer$29.prototype.copy = function copy(target, targetStart, start, end) {
|
|
1246
|
+
if (!Buffer$29.isBuffer(target)) throw new TypeError("argument should be a Buffer");
|
|
1247
1247
|
if (!start) start = 0;
|
|
1248
1248
|
if (!end && end !== 0) end = this.length;
|
|
1249
1249
|
if (targetStart >= target.length) targetStart = target.length;
|
|
@@ -1261,7 +1261,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1261
1261
|
else GlobalUint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);
|
|
1262
1262
|
return len$2;
|
|
1263
1263
|
};
|
|
1264
|
-
Buffer$
|
|
1264
|
+
Buffer$29.prototype.fill = function fill(val, start, end, encoding) {
|
|
1265
1265
|
if (typeof val === "string") {
|
|
1266
1266
|
if (typeof start === "string") {
|
|
1267
1267
|
encoding = start;
|
|
@@ -1272,7 +1272,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1272
1272
|
end = this.length;
|
|
1273
1273
|
}
|
|
1274
1274
|
if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string");
|
|
1275
|
-
if (typeof encoding === "string" && !Buffer$
|
|
1275
|
+
if (typeof encoding === "string" && !Buffer$29.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
|
|
1276
1276
|
if (val.length === 1) {
|
|
1277
1277
|
const code$2 = val.charCodeAt(0);
|
|
1278
1278
|
if (encoding === "utf8" && code$2 < 128 || encoding === "latin1") val = code$2;
|
|
@@ -1287,7 +1287,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1287
1287
|
let i$4;
|
|
1288
1288
|
if (typeof val === "number") for (i$4 = start; i$4 < end; ++i$4) this[i$4] = val;
|
|
1289
1289
|
else {
|
|
1290
|
-
const bytes = Buffer$
|
|
1290
|
+
const bytes = Buffer$29.isBuffer(val) ? val : Buffer$29.from(val, encoding);
|
|
1291
1291
|
const len$2 = bytes.length;
|
|
1292
1292
|
if (len$2 === 0) throw new TypeError("The value \"" + val + "\" is invalid for argument \"value\"");
|
|
1293
1293
|
for (i$4 = 0; i$4 < end - start; ++i$4) this[i$4 + start] = bytes[i$4 % len$2];
|
|
@@ -1502,7 +1502,7 @@ var init_dist$1 = __esmMin(() => {
|
|
|
1502
1502
|
});
|
|
1503
1503
|
var require_reach = __commonJSMin((exports, module) => {
|
|
1504
1504
|
const Assert$5 = require_assert$1();
|
|
1505
|
-
const internals$
|
|
1505
|
+
const internals$41 = {};
|
|
1506
1506
|
module.exports = function(obj, chain, options) {
|
|
1507
1507
|
if (chain === false || chain === null || chain === void 0) return obj;
|
|
1508
1508
|
options = options || {};
|
|
@@ -1513,7 +1513,7 @@ var require_reach = __commonJSMin((exports, module) => {
|
|
|
1513
1513
|
let ref = obj;
|
|
1514
1514
|
for (let i$4 = 0; i$4 < path.length; ++i$4) {
|
|
1515
1515
|
let key = path[i$4];
|
|
1516
|
-
const type = options.iterables && internals$
|
|
1516
|
+
const type = options.iterables && internals$41.iterables(ref);
|
|
1517
1517
|
if (Array.isArray(ref) || type === "set") {
|
|
1518
1518
|
const number = Number(key);
|
|
1519
1519
|
if (Number.isInteger(number)) key = number < 0 ? ref.length + number : number;
|
|
@@ -1530,14 +1530,14 @@ var require_reach = __commonJSMin((exports, module) => {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
return ref;
|
|
1532
1532
|
};
|
|
1533
|
-
internals$
|
|
1533
|
+
internals$41.iterables = function(ref) {
|
|
1534
1534
|
if (ref instanceof Set) return "set";
|
|
1535
1535
|
if (ref instanceof Map) return "map";
|
|
1536
1536
|
};
|
|
1537
1537
|
});
|
|
1538
1538
|
var require_types$1 = __commonJSMin((exports, module) => {
|
|
1539
1539
|
init_dist$1();
|
|
1540
|
-
const internals$
|
|
1540
|
+
const internals$40 = {};
|
|
1541
1541
|
exports = module.exports = {
|
|
1542
1542
|
array: Array.prototype,
|
|
1543
1543
|
buffer: Buffer$1 && Buffer$1.prototype,
|
|
@@ -1552,7 +1552,7 @@ var require_types$1 = __commonJSMin((exports, module) => {
|
|
|
1552
1552
|
weakMap: WeakMap.prototype,
|
|
1553
1553
|
weakSet: WeakSet.prototype
|
|
1554
1554
|
};
|
|
1555
|
-
internals$
|
|
1555
|
+
internals$40.typeMap = new Map([
|
|
1556
1556
|
["[object Error]", exports.error],
|
|
1557
1557
|
["[object Map]", exports.map],
|
|
1558
1558
|
["[object Promise]", exports.promise],
|
|
@@ -1568,7 +1568,7 @@ var require_types$1 = __commonJSMin((exports, module) => {
|
|
|
1568
1568
|
if (obj instanceof RegExp) return exports.regex;
|
|
1569
1569
|
if (obj instanceof Error) return exports.error;
|
|
1570
1570
|
const objName = Object.prototype.toString.call(obj);
|
|
1571
|
-
return internals$
|
|
1571
|
+
return internals$40.typeMap.get(objName) || exports.generic;
|
|
1572
1572
|
};
|
|
1573
1573
|
});
|
|
1574
1574
|
var require_utils$7 = __commonJSMin((exports) => {
|
|
@@ -1581,7 +1581,7 @@ var require_clone$1 = __commonJSMin((exports, module) => {
|
|
|
1581
1581
|
const Reach$2 = require_reach();
|
|
1582
1582
|
const Types$1 = require_types$1();
|
|
1583
1583
|
const Utils$3 = require_utils$7();
|
|
1584
|
-
const internals$
|
|
1584
|
+
const internals$39 = {
|
|
1585
1585
|
needsProtoHack: new Set([
|
|
1586
1586
|
Types$1.set,
|
|
1587
1587
|
Types$1.map,
|
|
@@ -1590,13 +1590,13 @@ var require_clone$1 = __commonJSMin((exports, module) => {
|
|
|
1590
1590
|
]),
|
|
1591
1591
|
structuredCloneExists: typeof structuredClone === "function"
|
|
1592
1592
|
};
|
|
1593
|
-
module.exports = internals$
|
|
1593
|
+
module.exports = internals$39.clone = function(obj, options = {}, _seen = null) {
|
|
1594
1594
|
if (typeof obj !== "object" || obj === null) return obj;
|
|
1595
|
-
let clone$
|
|
1595
|
+
let clone$21 = internals$39.clone;
|
|
1596
1596
|
let seen = _seen;
|
|
1597
1597
|
if (options.shallow) {
|
|
1598
|
-
if (options.shallow !== true) return internals$
|
|
1599
|
-
clone$
|
|
1598
|
+
if (options.shallow !== true) return internals$39.cloneWithShallow(obj, options);
|
|
1599
|
+
clone$21 = (value) => value;
|
|
1600
1600
|
} else if (seen) {
|
|
1601
1601
|
const lookup$2 = seen.get(obj);
|
|
1602
1602
|
if (lookup$2) return lookup$2;
|
|
@@ -1608,11 +1608,11 @@ var require_clone$1 = __commonJSMin((exports, module) => {
|
|
|
1608
1608
|
case Types$1.regex:
|
|
1609
1609
|
case Types$1.url: return new baseProto.constructor(obj);
|
|
1610
1610
|
}
|
|
1611
|
-
const newObj = internals$
|
|
1611
|
+
const newObj = internals$39.base(obj, baseProto, options);
|
|
1612
1612
|
if (newObj === obj) return obj;
|
|
1613
1613
|
if (seen) seen.set(obj, newObj);
|
|
1614
|
-
if (baseProto === Types$1.set) for (const value of obj) newObj.add(clone$
|
|
1615
|
-
else if (baseProto === Types$1.map) for (const [key, value] of obj) newObj.set(key, clone$
|
|
1614
|
+
if (baseProto === Types$1.set) for (const value of obj) newObj.add(clone$21(value, options, seen));
|
|
1615
|
+
else if (baseProto === Types$1.map) for (const [key, value] of obj) newObj.set(key, clone$21(value, options, seen));
|
|
1616
1616
|
const keys$10 = Utils$3.keys(obj, options);
|
|
1617
1617
|
for (const key of keys$10) {
|
|
1618
1618
|
if (key === "__proto__") continue;
|
|
@@ -1620,26 +1620,26 @@ var require_clone$1 = __commonJSMin((exports, module) => {
|
|
|
1620
1620
|
newObj.length = obj.length;
|
|
1621
1621
|
continue;
|
|
1622
1622
|
}
|
|
1623
|
-
if (internals$
|
|
1623
|
+
if (internals$39.structuredCloneExists && baseProto === Types$1.error && key === "stack") continue;
|
|
1624
1624
|
const descriptor = Object.getOwnPropertyDescriptor(obj, key);
|
|
1625
1625
|
if (descriptor) if (descriptor.get || descriptor.set) Object.defineProperty(newObj, key, descriptor);
|
|
1626
|
-
else if (descriptor.enumerable) newObj[key] = clone$
|
|
1626
|
+
else if (descriptor.enumerable) newObj[key] = clone$21(obj[key], options, seen);
|
|
1627
1627
|
else Object.defineProperty(newObj, key, {
|
|
1628
1628
|
enumerable: false,
|
|
1629
1629
|
writable: true,
|
|
1630
1630
|
configurable: true,
|
|
1631
|
-
value: clone$
|
|
1631
|
+
value: clone$21(obj[key], options, seen)
|
|
1632
1632
|
});
|
|
1633
1633
|
else Object.defineProperty(newObj, key, {
|
|
1634
1634
|
enumerable: true,
|
|
1635
1635
|
writable: true,
|
|
1636
1636
|
configurable: true,
|
|
1637
|
-
value: clone$
|
|
1637
|
+
value: clone$21(obj[key], options, seen)
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
1640
1640
|
return newObj;
|
|
1641
1641
|
};
|
|
1642
|
-
internals$
|
|
1642
|
+
internals$39.cloneWithShallow = function(source, options) {
|
|
1643
1643
|
const keys$10 = options.shallow;
|
|
1644
1644
|
options = Object.assign({}, options);
|
|
1645
1645
|
options.shallow = false;
|
|
@@ -1648,11 +1648,11 @@ var require_clone$1 = __commonJSMin((exports, module) => {
|
|
|
1648
1648
|
const ref = Reach$2(source, key);
|
|
1649
1649
|
if (typeof ref === "object" || typeof ref === "function") seen.set(ref, ref);
|
|
1650
1650
|
}
|
|
1651
|
-
return internals$
|
|
1651
|
+
return internals$39.clone(source, options, seen);
|
|
1652
1652
|
};
|
|
1653
|
-
internals$
|
|
1653
|
+
internals$39.base = function(obj, baseProto, options) {
|
|
1654
1654
|
if (options.prototype === false) {
|
|
1655
|
-
if (internals$
|
|
1655
|
+
if (internals$39.needsProtoHack.has(baseProto)) return new baseProto.constructor();
|
|
1656
1656
|
return baseProto === Types$1.array ? [] : {};
|
|
1657
1657
|
}
|
|
1658
1658
|
const proto = Object.getPrototypeOf(obj);
|
|
@@ -1661,12 +1661,12 @@ var require_clone$1 = __commonJSMin((exports, module) => {
|
|
|
1661
1661
|
const newObj = [];
|
|
1662
1662
|
if (proto !== baseProto) Object.setPrototypeOf(newObj, proto);
|
|
1663
1663
|
return newObj;
|
|
1664
|
-
} else if (baseProto === Types$1.error && internals$
|
|
1664
|
+
} else if (baseProto === Types$1.error && internals$39.structuredCloneExists && (proto === baseProto || Error.isPrototypeOf(proto.constructor))) {
|
|
1665
1665
|
const err$1 = structuredClone(obj);
|
|
1666
1666
|
if (Object.getPrototypeOf(err$1) !== proto) Object.setPrototypeOf(err$1, proto);
|
|
1667
1667
|
return err$1;
|
|
1668
1668
|
}
|
|
1669
|
-
if (internals$
|
|
1669
|
+
if (internals$39.needsProtoHack.has(baseProto)) {
|
|
1670
1670
|
const newObj = new proto.constructor();
|
|
1671
1671
|
if (proto !== baseProto) Object.setPrototypeOf(newObj, proto);
|
|
1672
1672
|
return newObj;
|
|
@@ -1679,8 +1679,8 @@ var require_merge = __commonJSMin((exports, module) => {
|
|
|
1679
1679
|
const Assert$4 = require_assert$1();
|
|
1680
1680
|
const Clone$2 = require_clone$1();
|
|
1681
1681
|
const Utils$2 = require_utils$7();
|
|
1682
|
-
const internals$
|
|
1683
|
-
module.exports = internals$
|
|
1682
|
+
const internals$38 = {};
|
|
1683
|
+
module.exports = internals$38.merge = function(target, source, options) {
|
|
1684
1684
|
Assert$4(target && typeof target === "object", "Invalid target value: must be an object");
|
|
1685
1685
|
Assert$4(source === null || source === void 0 || typeof source === "object", "Invalid source value: must be null, undefined, or an object");
|
|
1686
1686
|
if (!source) return target;
|
|
@@ -1702,7 +1702,7 @@ var require_merge = __commonJSMin((exports, module) => {
|
|
|
1702
1702
|
if (value && typeof value === "object") {
|
|
1703
1703
|
if (target[key] === value) continue;
|
|
1704
1704
|
if (!target[key] || typeof target[key] !== "object" || Array.isArray(target[key]) !== Array.isArray(value) || value instanceof Date || Buffer$1 && Buffer$1.isBuffer(value) || value instanceof RegExp) target[key] = Clone$2(value, { symbols: options.symbols });
|
|
1705
|
-
else internals$
|
|
1705
|
+
else internals$38.merge(target[key], value, options);
|
|
1706
1706
|
} else if (value !== null && value !== void 0) target[key] = value;
|
|
1707
1707
|
else if (options.nullOverride) target[key] = value;
|
|
1708
1708
|
}
|
|
@@ -1714,13 +1714,13 @@ var require_applyToDefaults = __commonJSMin((exports, module) => {
|
|
|
1714
1714
|
const Clone$1 = require_clone$1();
|
|
1715
1715
|
const Merge = require_merge();
|
|
1716
1716
|
const Reach$1 = require_reach();
|
|
1717
|
-
const internals$
|
|
1717
|
+
const internals$37 = {};
|
|
1718
1718
|
module.exports = function(defaults$3, source, options = {}) {
|
|
1719
1719
|
Assert$3(defaults$3 && typeof defaults$3 === "object", "Invalid defaults value: must be an object");
|
|
1720
1720
|
Assert$3(!source || source === true || typeof source === "object", "Invalid source value: must be true, falsy or an object");
|
|
1721
1721
|
Assert$3(typeof options === "object", "Invalid options: must be an object");
|
|
1722
1722
|
if (!source) return null;
|
|
1723
|
-
if (options.shallow) return internals$
|
|
1723
|
+
if (options.shallow) return internals$37.applyToDefaultsWithShallow(defaults$3, source, options);
|
|
1724
1724
|
const copy = Clone$1(defaults$3);
|
|
1725
1725
|
if (source === true) return copy;
|
|
1726
1726
|
const nullOverride = options.nullOverride !== void 0 ? options.nullOverride : false;
|
|
@@ -1729,7 +1729,7 @@ var require_applyToDefaults = __commonJSMin((exports, module) => {
|
|
|
1729
1729
|
mergeArrays: false
|
|
1730
1730
|
});
|
|
1731
1731
|
};
|
|
1732
|
-
internals$
|
|
1732
|
+
internals$37.applyToDefaultsWithShallow = function(defaults$3, source, options) {
|
|
1733
1733
|
const keys$10 = options.shallow;
|
|
1734
1734
|
Assert$3(Array.isArray(keys$10), "Invalid keys");
|
|
1735
1735
|
const seen = new Map();
|
|
@@ -1742,14 +1742,14 @@ var require_applyToDefaults = __commonJSMin((exports, module) => {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
const copy = Clone$1(defaults$3, {}, seen);
|
|
1744
1744
|
if (!merge$4) return copy;
|
|
1745
|
-
for (const key of merge$4) internals$
|
|
1745
|
+
for (const key of merge$4) internals$37.reachCopy(copy, source, key);
|
|
1746
1746
|
const nullOverride = options.nullOverride !== void 0 ? options.nullOverride : false;
|
|
1747
1747
|
return Merge(copy, source, {
|
|
1748
1748
|
nullOverride,
|
|
1749
1749
|
mergeArrays: false
|
|
1750
1750
|
});
|
|
1751
1751
|
};
|
|
1752
|
-
internals$
|
|
1752
|
+
internals$37.reachCopy = function(dst, src$1, path) {
|
|
1753
1753
|
for (const segment of path) {
|
|
1754
1754
|
if (!(segment in src$1)) return;
|
|
1755
1755
|
const val = src$1[segment];
|
|
@@ -1900,17 +1900,17 @@ var init_dist = __esmMin(() => {
|
|
|
1900
1900
|
});
|
|
1901
1901
|
var require_bench = __commonJSMin((exports, module) => {
|
|
1902
1902
|
init_dist();
|
|
1903
|
-
const internals$
|
|
1904
|
-
module.exports = internals$
|
|
1903
|
+
const internals$36 = {};
|
|
1904
|
+
module.exports = internals$36.Bench = class {
|
|
1905
1905
|
constructor() {
|
|
1906
1906
|
this.ts = 0;
|
|
1907
1907
|
this.reset();
|
|
1908
1908
|
}
|
|
1909
1909
|
reset() {
|
|
1910
|
-
this.ts = internals$
|
|
1910
|
+
this.ts = internals$36.Bench.now();
|
|
1911
1911
|
}
|
|
1912
1912
|
elapsed() {
|
|
1913
|
-
return internals$
|
|
1913
|
+
return internals$36.Bench.now() - this.ts;
|
|
1914
1914
|
}
|
|
1915
1915
|
static now() {
|
|
1916
1916
|
const ts = process$1.hrtime();
|
|
@@ -1930,12 +1930,12 @@ var require_block = __commonJSMin((exports, module) => {
|
|
|
1930
1930
|
var require_deepEqual = __commonJSMin((exports, module) => {
|
|
1931
1931
|
init_dist$1();
|
|
1932
1932
|
const Types = require_types$1();
|
|
1933
|
-
const internals$
|
|
1933
|
+
const internals$35 = { mismatched: null };
|
|
1934
1934
|
module.exports = function(obj, ref, options) {
|
|
1935
1935
|
options = Object.assign({ prototype: true }, options);
|
|
1936
|
-
return !!internals$
|
|
1936
|
+
return !!internals$35.isDeepEqual(obj, ref, options, []);
|
|
1937
1937
|
};
|
|
1938
|
-
internals$
|
|
1938
|
+
internals$35.isDeepEqual = function(obj, ref, options, seen) {
|
|
1939
1939
|
if (obj === ref) return obj !== 0 || 1 / obj === 1 / ref;
|
|
1940
1940
|
const type = typeof obj;
|
|
1941
1941
|
if (type !== typeof ref) return false;
|
|
@@ -1943,32 +1943,32 @@ var require_deepEqual = __commonJSMin((exports, module) => {
|
|
|
1943
1943
|
if (type === "function") {
|
|
1944
1944
|
if (!options.deepFunction || obj.toString() !== ref.toString()) return false;
|
|
1945
1945
|
} else if (type !== "object") return obj !== obj && ref !== ref;
|
|
1946
|
-
const instanceType = internals$
|
|
1946
|
+
const instanceType = internals$35.getSharedType(obj, ref, !!options.prototype);
|
|
1947
1947
|
switch (instanceType) {
|
|
1948
1948
|
case Types.buffer: return Buffer$1 && Buffer$1.prototype.equals.call(obj, ref);
|
|
1949
1949
|
case Types.promise: return obj === ref;
|
|
1950
1950
|
case Types.regex:
|
|
1951
1951
|
case Types.url: return obj.toString() === ref.toString();
|
|
1952
|
-
case internals$
|
|
1952
|
+
case internals$35.mismatched: return false;
|
|
1953
1953
|
}
|
|
1954
1954
|
for (let i$4 = seen.length - 1; i$4 >= 0; --i$4) if (seen[i$4].isSame(obj, ref)) return true;
|
|
1955
|
-
seen.push(new internals$
|
|
1955
|
+
seen.push(new internals$35.SeenEntry(obj, ref));
|
|
1956
1956
|
try {
|
|
1957
|
-
return !!internals$
|
|
1957
|
+
return !!internals$35.isDeepEqualObj(instanceType, obj, ref, options, seen);
|
|
1958
1958
|
} finally {
|
|
1959
1959
|
seen.pop();
|
|
1960
1960
|
}
|
|
1961
1961
|
};
|
|
1962
|
-
internals$
|
|
1962
|
+
internals$35.getSharedType = function(obj, ref, checkPrototype) {
|
|
1963
1963
|
if (checkPrototype) {
|
|
1964
|
-
if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) return internals$
|
|
1964
|
+
if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) return internals$35.mismatched;
|
|
1965
1965
|
return Types.getInternalProto(obj);
|
|
1966
1966
|
}
|
|
1967
1967
|
const type = Types.getInternalProto(obj);
|
|
1968
|
-
if (type !== Types.getInternalProto(ref)) return internals$
|
|
1968
|
+
if (type !== Types.getInternalProto(ref)) return internals$35.mismatched;
|
|
1969
1969
|
return type;
|
|
1970
1970
|
};
|
|
1971
|
-
internals$
|
|
1971
|
+
internals$35.valueOf = function(obj) {
|
|
1972
1972
|
const objValueOf = obj.valueOf;
|
|
1973
1973
|
if (objValueOf === void 0) return obj;
|
|
1974
1974
|
try {
|
|
@@ -1977,15 +1977,15 @@ var require_deepEqual = __commonJSMin((exports, module) => {
|
|
|
1977
1977
|
return err$1;
|
|
1978
1978
|
}
|
|
1979
1979
|
};
|
|
1980
|
-
internals$
|
|
1980
|
+
internals$35.hasOwnEnumerableProperty = function(obj, key) {
|
|
1981
1981
|
return Object.prototype.propertyIsEnumerable.call(obj, key);
|
|
1982
1982
|
};
|
|
1983
|
-
internals$
|
|
1983
|
+
internals$35.isSetSimpleEqual = function(obj, ref) {
|
|
1984
1984
|
for (const entry of Set.prototype.values.call(obj)) if (!Set.prototype.has.call(ref, entry)) return false;
|
|
1985
1985
|
return true;
|
|
1986
1986
|
};
|
|
1987
|
-
internals$
|
|
1988
|
-
const { isDeepEqual: isDeepEqual$2, valueOf, hasOwnEnumerableProperty } = internals$
|
|
1987
|
+
internals$35.isDeepEqualObj = function(instanceType, obj, ref, options, seen) {
|
|
1988
|
+
const { isDeepEqual: isDeepEqual$2, valueOf, hasOwnEnumerableProperty } = internals$35;
|
|
1989
1989
|
const { keys: keys$10, getOwnPropertySymbols } = Object;
|
|
1990
1990
|
if (instanceType === Types.array) if (options.part) {
|
|
1991
1991
|
for (const objValue of obj) for (const refValue of ref) if (isDeepEqual$2(objValue, refValue, options, seen)) return true;
|
|
@@ -1996,7 +1996,7 @@ var require_deepEqual = __commonJSMin((exports, module) => {
|
|
|
1996
1996
|
}
|
|
1997
1997
|
else if (instanceType === Types.set) {
|
|
1998
1998
|
if (obj.size !== ref.size) return false;
|
|
1999
|
-
if (!internals$
|
|
1999
|
+
if (!internals$35.isSetSimpleEqual(obj, ref)) {
|
|
2000
2000
|
const ref2 = new Set(Set.prototype.values.call(ref));
|
|
2001
2001
|
for (const objEntry of Set.prototype.values.call(obj)) {
|
|
2002
2002
|
if (ref2.delete(objEntry)) continue;
|
|
@@ -2049,7 +2049,7 @@ var require_deepEqual = __commonJSMin((exports, module) => {
|
|
|
2049
2049
|
}
|
|
2050
2050
|
return true;
|
|
2051
2051
|
};
|
|
2052
|
-
internals$
|
|
2052
|
+
internals$35.SeenEntry = class {
|
|
2053
2053
|
constructor(obj, ref) {
|
|
2054
2054
|
this.obj = obj;
|
|
2055
2055
|
this.ref = ref;
|
|
@@ -2069,16 +2069,16 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2069
2069
|
const DeepEqual = require_deepEqual();
|
|
2070
2070
|
const EscapeRegex = require_escapeRegex();
|
|
2071
2071
|
const Utils$1 = require_utils$7();
|
|
2072
|
-
const internals$
|
|
2072
|
+
const internals$34 = {};
|
|
2073
2073
|
module.exports = function(ref, values$3, options = {}) {
|
|
2074
2074
|
if (typeof values$3 !== "object") values$3 = [values$3];
|
|
2075
2075
|
Assert$2(!Array.isArray(values$3) || values$3.length, "Values array cannot be empty");
|
|
2076
|
-
if (typeof ref === "string") return internals$
|
|
2077
|
-
if (Array.isArray(ref)) return internals$
|
|
2076
|
+
if (typeof ref === "string") return internals$34.string(ref, values$3, options);
|
|
2077
|
+
if (Array.isArray(ref)) return internals$34.array(ref, values$3, options);
|
|
2078
2078
|
Assert$2(typeof ref === "object", "Reference must be string or an object");
|
|
2079
|
-
return internals$
|
|
2079
|
+
return internals$34.object(ref, values$3, options);
|
|
2080
2080
|
};
|
|
2081
|
-
internals$
|
|
2081
|
+
internals$34.array = function(ref, values$3, options) {
|
|
2082
2082
|
if (!Array.isArray(values$3)) values$3 = [values$3];
|
|
2083
2083
|
if (!ref.length) return false;
|
|
2084
2084
|
if (options.only && options.once && ref.length !== values$3.length) return false;
|
|
@@ -2092,7 +2092,7 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2092
2092
|
hits: 0
|
|
2093
2093
|
});
|
|
2094
2094
|
} else {
|
|
2095
|
-
compare$16 = compare$16 ?? internals$
|
|
2095
|
+
compare$16 = compare$16 ?? internals$34.compare(options);
|
|
2096
2096
|
let found = false;
|
|
2097
2097
|
for (const [key, existing] of map$8.entries()) if (compare$16(key, value)) {
|
|
2098
2098
|
++existing.allowed;
|
|
@@ -2109,7 +2109,7 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2109
2109
|
let match$2;
|
|
2110
2110
|
if (!options.deep || !item || typeof item !== "object") match$2 = map$8.get(item);
|
|
2111
2111
|
else {
|
|
2112
|
-
compare$16 = compare$16 ?? internals$
|
|
2112
|
+
compare$16 = compare$16 ?? internals$34.compare(options);
|
|
2113
2113
|
for (const [key, existing] of map$8.entries()) if (compare$16(key, item)) {
|
|
2114
2114
|
match$2 = existing;
|
|
2115
2115
|
break;
|
|
@@ -2128,14 +2128,14 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
return !!hits;
|
|
2130
2130
|
};
|
|
2131
|
-
internals$
|
|
2131
|
+
internals$34.object = function(ref, values$3, options) {
|
|
2132
2132
|
Assert$2(options.once === void 0, "Cannot use option once with object");
|
|
2133
2133
|
const keys$10 = Utils$1.keys(ref, options);
|
|
2134
2134
|
if (!keys$10.length) return false;
|
|
2135
|
-
if (Array.isArray(values$3)) return internals$
|
|
2135
|
+
if (Array.isArray(values$3)) return internals$34.array(keys$10, values$3, options);
|
|
2136
2136
|
const symbols = Object.getOwnPropertySymbols(values$3).filter((sym) => values$3.propertyIsEnumerable(sym));
|
|
2137
2137
|
const targets = [...Object.keys(values$3), ...symbols];
|
|
2138
|
-
const compare$16 = internals$
|
|
2138
|
+
const compare$16 = internals$34.compare(options);
|
|
2139
2139
|
const set = new Set(targets);
|
|
2140
2140
|
for (const key of keys$10) {
|
|
2141
2141
|
if (!set.has(key)) {
|
|
@@ -2148,7 +2148,7 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2148
2148
|
if (set.size) return options.part ? set.size < targets.length : false;
|
|
2149
2149
|
return true;
|
|
2150
2150
|
};
|
|
2151
|
-
internals$
|
|
2151
|
+
internals$34.string = function(ref, values$3, options) {
|
|
2152
2152
|
if (ref === "") return values$3.length === 1 && values$3[0] === "" || !options.once && !values$3.some((v$1) => v$1 !== "");
|
|
2153
2153
|
const map$8 = new Map();
|
|
2154
2154
|
const patterns = [];
|
|
@@ -2182,8 +2182,8 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2182
2182
|
}
|
|
2183
2183
|
return !!any;
|
|
2184
2184
|
};
|
|
2185
|
-
internals$
|
|
2186
|
-
if (!options.deep) return internals$
|
|
2185
|
+
internals$34.compare = function(options) {
|
|
2186
|
+
if (!options.deep) return internals$34.shallow;
|
|
2187
2187
|
const hasOnly = options.only !== void 0;
|
|
2188
2188
|
const hasPart = options.part !== void 0;
|
|
2189
2189
|
const flags = {
|
|
@@ -2192,7 +2192,7 @@ var require_contain = __commonJSMin((exports, module) => {
|
|
|
2192
2192
|
};
|
|
2193
2193
|
return (a$2, b) => DeepEqual(a$2, b, flags);
|
|
2194
2194
|
};
|
|
2195
|
-
internals$
|
|
2195
|
+
internals$34.shallow = function(a$2, b) {
|
|
2196
2196
|
return a$2 === b;
|
|
2197
2197
|
};
|
|
2198
2198
|
});
|
|
@@ -2204,28 +2204,28 @@ var require_escapeHeaderAttribute = __commonJSMin((exports, module) => {
|
|
|
2204
2204
|
};
|
|
2205
2205
|
});
|
|
2206
2206
|
var require_escapeHtml = __commonJSMin((exports, module) => {
|
|
2207
|
-
const internals$
|
|
2207
|
+
const internals$33 = {};
|
|
2208
2208
|
module.exports = function(input) {
|
|
2209
2209
|
if (!input) return "";
|
|
2210
2210
|
let escaped = "";
|
|
2211
2211
|
for (let i$4 = 0; i$4 < input.length; ++i$4) {
|
|
2212
2212
|
const charCode = input.charCodeAt(i$4);
|
|
2213
|
-
if (internals$
|
|
2214
|
-
else escaped += internals$
|
|
2213
|
+
if (internals$33.isSafe(charCode)) escaped += input[i$4];
|
|
2214
|
+
else escaped += internals$33.escapeHtmlChar(charCode);
|
|
2215
2215
|
}
|
|
2216
2216
|
return escaped;
|
|
2217
2217
|
};
|
|
2218
|
-
internals$
|
|
2219
|
-
const namedEscape = internals$
|
|
2218
|
+
internals$33.escapeHtmlChar = function(charCode) {
|
|
2219
|
+
const namedEscape = internals$33.namedHtml.get(charCode);
|
|
2220
2220
|
if (namedEscape) return namedEscape;
|
|
2221
2221
|
if (charCode >= 256) return "&#" + charCode + ";";
|
|
2222
2222
|
const hexValue = charCode.toString(16).padStart(2, "0");
|
|
2223
2223
|
return `&#x${hexValue};`;
|
|
2224
2224
|
};
|
|
2225
|
-
internals$
|
|
2226
|
-
return internals$
|
|
2225
|
+
internals$33.isSafe = function(charCode) {
|
|
2226
|
+
return internals$33.safeCharCodes.has(charCode);
|
|
2227
2227
|
};
|
|
2228
|
-
internals$
|
|
2228
|
+
internals$33.namedHtml = new Map([
|
|
2229
2229
|
[38, "&"],
|
|
2230
2230
|
[60, "<"],
|
|
2231
2231
|
[62, ">"],
|
|
@@ -2237,22 +2237,22 @@ var require_escapeHtml = __commonJSMin((exports, module) => {
|
|
|
2237
2237
|
[169, "©"],
|
|
2238
2238
|
[174, "®"]
|
|
2239
2239
|
]);
|
|
2240
|
-
internals$
|
|
2240
|
+
internals$33.safeCharCodes = function() {
|
|
2241
2241
|
const safe = new Set();
|
|
2242
2242
|
for (let i$4 = 32; i$4 < 123; ++i$4) if (i$4 >= 97 || i$4 >= 65 && i$4 <= 90 || i$4 >= 48 && i$4 <= 57 || i$4 === 32 || i$4 === 46 || i$4 === 44 || i$4 === 45 || i$4 === 58 || i$4 === 95) safe.add(i$4);
|
|
2243
2243
|
return safe;
|
|
2244
2244
|
}();
|
|
2245
2245
|
});
|
|
2246
2246
|
var require_escapeJson = __commonJSMin((exports, module) => {
|
|
2247
|
-
const internals$
|
|
2247
|
+
const internals$32 = {};
|
|
2248
2248
|
module.exports = function(input) {
|
|
2249
2249
|
if (!input) return "";
|
|
2250
|
-
return input.replace(/[<>&\u2028\u2029]/g, internals$
|
|
2250
|
+
return input.replace(/[<>&\u2028\u2029]/g, internals$32.escape);
|
|
2251
2251
|
};
|
|
2252
|
-
internals$
|
|
2253
|
-
return internals$
|
|
2252
|
+
internals$32.escape = function(char) {
|
|
2253
|
+
return internals$32.replacements.get(char);
|
|
2254
2254
|
};
|
|
2255
|
-
internals$
|
|
2255
|
+
internals$32.replacements = new Map([
|
|
2256
2256
|
["<", "\\u003c"],
|
|
2257
2257
|
[">", "\\u003e"],
|
|
2258
2258
|
["&", "\\u0026"],
|
|
@@ -2261,29 +2261,29 @@ var require_escapeJson = __commonJSMin((exports, module) => {
|
|
|
2261
2261
|
]);
|
|
2262
2262
|
});
|
|
2263
2263
|
var require_flatten$1 = __commonJSMin((exports, module) => {
|
|
2264
|
-
const internals$
|
|
2265
|
-
module.exports = internals$
|
|
2264
|
+
const internals$31 = {};
|
|
2265
|
+
module.exports = internals$31.flatten = function(array, target) {
|
|
2266
2266
|
const result = target || [];
|
|
2267
|
-
for (const entry of array) if (Array.isArray(entry)) internals$
|
|
2267
|
+
for (const entry of array) if (Array.isArray(entry)) internals$31.flatten(entry, result);
|
|
2268
2268
|
else result.push(entry);
|
|
2269
2269
|
return result;
|
|
2270
2270
|
};
|
|
2271
2271
|
});
|
|
2272
2272
|
var require_intersect = __commonJSMin((exports, module) => {
|
|
2273
|
-
const internals$
|
|
2273
|
+
const internals$30 = {};
|
|
2274
2274
|
module.exports = function(array1, array2, options = {}) {
|
|
2275
2275
|
if (!array1 || !array2) return options.first ? null : [];
|
|
2276
2276
|
const common$4 = [];
|
|
2277
2277
|
const hash$4 = Array.isArray(array1) ? new Set(array1) : array1;
|
|
2278
2278
|
const found = new Set();
|
|
2279
|
-
for (const value of array2) if (internals$
|
|
2279
|
+
for (const value of array2) if (internals$30.has(hash$4, value) && !found.has(value)) {
|
|
2280
2280
|
if (options.first) return value;
|
|
2281
2281
|
common$4.push(value);
|
|
2282
2282
|
found.add(value);
|
|
2283
2283
|
}
|
|
2284
2284
|
return options.first ? null : common$4;
|
|
2285
2285
|
};
|
|
2286
|
-
internals$
|
|
2286
|
+
internals$30.has = function(ref, key) {
|
|
2287
2287
|
if (typeof ref.has === "function") return ref.has(key);
|
|
2288
2288
|
return ref[key] !== void 0;
|
|
2289
2289
|
};
|
|
@@ -2294,9 +2294,9 @@ var require_isPromise = __commonJSMin((exports, module) => {
|
|
|
2294
2294
|
};
|
|
2295
2295
|
});
|
|
2296
2296
|
var require_once = __commonJSMin((exports, module) => {
|
|
2297
|
-
const internals$
|
|
2297
|
+
const internals$29 = { wrapped: Symbol("wrapped") };
|
|
2298
2298
|
module.exports = function(method$1) {
|
|
2299
|
-
if (method$1[internals$
|
|
2299
|
+
if (method$1[internals$29.wrapped]) return method$1;
|
|
2300
2300
|
let once$4 = false;
|
|
2301
2301
|
const wrappedFn = function(...args$1) {
|
|
2302
2302
|
if (!once$4) {
|
|
@@ -2304,7 +2304,7 @@ var require_once = __commonJSMin((exports, module) => {
|
|
|
2304
2304
|
method$1(...args$1);
|
|
2305
2305
|
}
|
|
2306
2306
|
};
|
|
2307
|
-
wrappedFn[internals$
|
|
2307
|
+
wrappedFn[internals$29.wrapped] = true;
|
|
2308
2308
|
return wrappedFn;
|
|
2309
2309
|
};
|
|
2310
2310
|
});
|
|
@@ -2318,7 +2318,7 @@ var require_reachTemplate = __commonJSMin((exports, module) => {
|
|
|
2318
2318
|
};
|
|
2319
2319
|
});
|
|
2320
2320
|
var require_wait = __commonJSMin((exports, module) => {
|
|
2321
|
-
const internals$
|
|
2321
|
+
const internals$28 = { maxTimer: 2 ** 31 - 1 };
|
|
2322
2322
|
module.exports = function(timeout$5, returnValue, options) {
|
|
2323
2323
|
if (typeof timeout$5 === "bigint") timeout$5 = Number(timeout$5);
|
|
2324
2324
|
if (timeout$5 >= Number.MAX_SAFE_INTEGER) timeout$5 = Infinity;
|
|
@@ -2326,7 +2326,7 @@ var require_wait = __commonJSMin((exports, module) => {
|
|
|
2326
2326
|
return new Promise((resolve) => {
|
|
2327
2327
|
const _setTimeout = options ? options.setTimeout : setTimeout;
|
|
2328
2328
|
const activate = () => {
|
|
2329
|
-
const time = Math.min(timeout$5, internals$
|
|
2329
|
+
const time = Math.min(timeout$5, internals$28.maxTimer);
|
|
2330
2330
|
timeout$5 -= time;
|
|
2331
2331
|
_setTimeout(() => timeout$5 > 0 ? activate() : resolve(returnValue), time);
|
|
2332
2332
|
};
|
|
@@ -2433,9 +2433,9 @@ var init_package$1 = __esmMin(() => {
|
|
|
2433
2433
|
};
|
|
2434
2434
|
});
|
|
2435
2435
|
var require_cache = __commonJSMin((exports) => {
|
|
2436
|
-
const { assert: assert$
|
|
2437
|
-
const Common$
|
|
2438
|
-
const internals$
|
|
2436
|
+
const { assert: assert$53, clone: clone$20 } = require_lib$4();
|
|
2437
|
+
const Common$25 = require_common$3();
|
|
2438
|
+
const internals$27 = {
|
|
2439
2439
|
max: 1e3,
|
|
2440
2440
|
supported: new Set([
|
|
2441
2441
|
"undefined",
|
|
@@ -2445,21 +2445,21 @@ var require_cache = __commonJSMin((exports) => {
|
|
|
2445
2445
|
])
|
|
2446
2446
|
};
|
|
2447
2447
|
exports.provider = { provision(options) {
|
|
2448
|
-
return new internals$
|
|
2448
|
+
return new internals$27.Cache(options);
|
|
2449
2449
|
} };
|
|
2450
|
-
internals$
|
|
2450
|
+
internals$27.Cache = class {
|
|
2451
2451
|
constructor(options = {}) {
|
|
2452
|
-
Common$
|
|
2453
|
-
assert$
|
|
2454
|
-
this._max = options.max || internals$
|
|
2452
|
+
Common$25.assertOptions(options, ["max"]);
|
|
2453
|
+
assert$53(options.max === void 0 || options.max && options.max > 0 && isFinite(options.max), "Invalid max cache size");
|
|
2454
|
+
this._max = options.max || internals$27.max;
|
|
2455
2455
|
this._map = new Map();
|
|
2456
|
-
this._list = new internals$
|
|
2456
|
+
this._list = new internals$27.List();
|
|
2457
2457
|
}
|
|
2458
2458
|
get length() {
|
|
2459
2459
|
return this._map.size;
|
|
2460
2460
|
}
|
|
2461
2461
|
set(key, value) {
|
|
2462
|
-
if (key !== null && !internals$
|
|
2462
|
+
if (key !== null && !internals$27.supported.has(typeof key)) return;
|
|
2463
2463
|
let node = this._map.get(key);
|
|
2464
2464
|
if (node) {
|
|
2465
2465
|
node.value = value;
|
|
@@ -2477,7 +2477,7 @@ var require_cache = __commonJSMin((exports) => {
|
|
|
2477
2477
|
const node = this._map.get(key);
|
|
2478
2478
|
if (node) {
|
|
2479
2479
|
this._list.first(node);
|
|
2480
|
-
return clone$
|
|
2480
|
+
return clone$20(node.value);
|
|
2481
2481
|
}
|
|
2482
2482
|
}
|
|
2483
2483
|
_compact() {
|
|
@@ -2487,7 +2487,7 @@ var require_cache = __commonJSMin((exports) => {
|
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
2489
|
};
|
|
2490
|
-
internals$
|
|
2490
|
+
internals$27.List = class {
|
|
2491
2491
|
constructor() {
|
|
2492
2492
|
this.tail = null;
|
|
2493
2493
|
this.head = null;
|
|
@@ -2520,7 +2520,7 @@ var require_cache = __commonJSMin((exports) => {
|
|
|
2520
2520
|
};
|
|
2521
2521
|
});
|
|
2522
2522
|
var require_lib$3 = __commonJSMin((exports) => {
|
|
2523
|
-
const internals$
|
|
2523
|
+
const internals$26 = {
|
|
2524
2524
|
operators: [
|
|
2525
2525
|
"!",
|
|
2526
2526
|
"^",
|
|
@@ -2586,7 +2586,7 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2586
2586
|
};
|
|
2587
2587
|
exports.Parser = class {
|
|
2588
2588
|
constructor(string, options = {}) {
|
|
2589
|
-
if (!options[internals$
|
|
2589
|
+
if (!options[internals$26.settings] && options.constants) for (const constant$3 in options.constants) {
|
|
2590
2590
|
const value = options.constants[constant$3];
|
|
2591
2591
|
if (value !== null && ![
|
|
2592
2592
|
"boolean",
|
|
@@ -2594,8 +2594,8 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2594
2594
|
"string"
|
|
2595
2595
|
].includes(typeof value)) throw new Error(`Formula constant ${constant$3} contains invalid ${typeof value} value type`);
|
|
2596
2596
|
}
|
|
2597
|
-
this.settings = options[internals$
|
|
2598
|
-
[internals$
|
|
2597
|
+
this.settings = options[internals$26.settings] ? options : Object.assign({
|
|
2598
|
+
[internals$26.settings]: true,
|
|
2599
2599
|
constants: {},
|
|
2600
2600
|
functions: {}
|
|
2601
2601
|
}, options);
|
|
@@ -2637,12 +2637,12 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2637
2637
|
type: "literal",
|
|
2638
2638
|
value: current
|
|
2639
2639
|
});
|
|
2640
|
-
} else if (internals$
|
|
2640
|
+
} else if (internals$26.operatorCharacters.includes(current)) if (last$2 && last$2.type === "operator" && internals$26.operators.includes(last$2.value + current)) last$2.value += current;
|
|
2641
2641
|
else parts.push({
|
|
2642
2642
|
type: "operator",
|
|
2643
2643
|
value: current
|
|
2644
2644
|
});
|
|
2645
|
-
else if (current.match(internals$
|
|
2645
|
+
else if (current.match(internals$26.numberRx)) parts.push({
|
|
2646
2646
|
type: "constant",
|
|
2647
2647
|
value: parseFloat(current)
|
|
2648
2648
|
});
|
|
@@ -2651,7 +2651,7 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2651
2651
|
value: this.settings.constants[current]
|
|
2652
2652
|
});
|
|
2653
2653
|
else {
|
|
2654
|
-
if (!current.match(internals$
|
|
2654
|
+
if (!current.match(internals$26.tokenRx)) throw new Error(`Formula contains invalid token: ${current}`);
|
|
2655
2655
|
parts.push({
|
|
2656
2656
|
type: "reference",
|
|
2657
2657
|
value: current
|
|
@@ -2671,11 +2671,11 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2671
2671
|
if (!parenthesis) flush(c$1);
|
|
2672
2672
|
else current += c$1;
|
|
2673
2673
|
} else current += c$1;
|
|
2674
|
-
else if (c$1 in internals$
|
|
2674
|
+
else if (c$1 in internals$26.literals) literal = internals$26.literals[c$1];
|
|
2675
2675
|
else if (c$1 === "(") {
|
|
2676
2676
|
flush();
|
|
2677
2677
|
++parenthesis;
|
|
2678
|
-
} else if (internals$
|
|
2678
|
+
} else if (internals$26.operatorCharacters.includes(c$1)) {
|
|
2679
2679
|
flush();
|
|
2680
2680
|
current = c$1;
|
|
2681
2681
|
flush();
|
|
@@ -2692,9 +2692,9 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2692
2692
|
let operator$1 = false;
|
|
2693
2693
|
for (const part of parts) {
|
|
2694
2694
|
if (part.type === "operator") {
|
|
2695
|
-
if (internals$
|
|
2695
|
+
if (internals$26.operatorsPrefix.includes(part.value)) continue;
|
|
2696
2696
|
if (!operator$1) throw new Error("Formula contains an operator in invalid position");
|
|
2697
|
-
if (!internals$
|
|
2697
|
+
if (!internals$26.operators.includes(part.value)) throw new Error(`Formula contains an unknown operator ${part.value}`);
|
|
2698
2698
|
} else if (operator$1) throw new Error("Formula missing expected operator");
|
|
2699
2699
|
operator$1 = !operator$1;
|
|
2700
2700
|
}
|
|
@@ -2708,11 +2708,11 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2708
2708
|
value: parts[0].value
|
|
2709
2709
|
};
|
|
2710
2710
|
this._parts = parts.map((part) => {
|
|
2711
|
-
if (part.type === "operator") return internals$
|
|
2711
|
+
if (part.type === "operator") return internals$26.operatorsPrefix.includes(part.value) ? part : part.value;
|
|
2712
2712
|
if (part.type !== "reference") return part.value;
|
|
2713
2713
|
if (this.settings.tokenRx && !this.settings.tokenRx.test(part.value)) throw new Error(`Formula contains invalid reference ${part.value}`);
|
|
2714
2714
|
if (this.settings.reference) return this.settings.reference(part.value);
|
|
2715
|
-
return internals$
|
|
2715
|
+
return internals$26.reference(part.value);
|
|
2716
2716
|
});
|
|
2717
2717
|
}
|
|
2718
2718
|
_subFormula(string, name$2) {
|
|
@@ -2733,9 +2733,9 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2733
2733
|
if (literal) {
|
|
2734
2734
|
current += c$1;
|
|
2735
2735
|
if (c$1 === literal) literal = false;
|
|
2736
|
-
} else if (c$1 in internals$
|
|
2736
|
+
} else if (c$1 in internals$26.literals && !parenthesis) {
|
|
2737
2737
|
current += c$1;
|
|
2738
|
-
literal = internals$
|
|
2738
|
+
literal = internals$26.literals[c$1];
|
|
2739
2739
|
} else if (c$1 === "," && !parenthesis) flush();
|
|
2740
2740
|
else {
|
|
2741
2741
|
current += c$1;
|
|
@@ -2759,47 +2759,47 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2759
2759
|
if (part && part.type === "operator") {
|
|
2760
2760
|
const current = parts[i$4 + 1];
|
|
2761
2761
|
parts.splice(i$4 + 1, 1);
|
|
2762
|
-
const value = internals$
|
|
2763
|
-
parts[i$4] = internals$
|
|
2762
|
+
const value = internals$26.evaluate(current, context);
|
|
2763
|
+
parts[i$4] = internals$26.single(part.value, value);
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
|
-
internals$
|
|
2766
|
+
internals$26.operatorsOrder.forEach((set) => {
|
|
2767
2767
|
for (let i$4 = 1; i$4 < parts.length - 1;) if (set.includes(parts[i$4])) {
|
|
2768
2768
|
const operator$1 = parts[i$4];
|
|
2769
|
-
const left = internals$
|
|
2770
|
-
const right = internals$
|
|
2769
|
+
const left = internals$26.evaluate(parts[i$4 - 1], context);
|
|
2770
|
+
const right = internals$26.evaluate(parts[i$4 + 1], context);
|
|
2771
2771
|
parts.splice(i$4, 2);
|
|
2772
|
-
const result = internals$
|
|
2772
|
+
const result = internals$26.calculate(operator$1, left, right);
|
|
2773
2773
|
parts[i$4 - 1] = result === 0 ? 0 : result;
|
|
2774
2774
|
} else i$4 += 2;
|
|
2775
2775
|
});
|
|
2776
|
-
return internals$
|
|
2776
|
+
return internals$26.evaluate(parts[0], context);
|
|
2777
2777
|
}
|
|
2778
2778
|
};
|
|
2779
|
-
exports.Parser.prototype[internals$
|
|
2780
|
-
internals$
|
|
2779
|
+
exports.Parser.prototype[internals$26.symbol] = true;
|
|
2780
|
+
internals$26.reference = function(name$2) {
|
|
2781
2781
|
return function(context) {
|
|
2782
2782
|
return context && context[name$2] !== void 0 ? context[name$2] : null;
|
|
2783
2783
|
};
|
|
2784
2784
|
};
|
|
2785
|
-
internals$
|
|
2785
|
+
internals$26.evaluate = function(part, context) {
|
|
2786
2786
|
if (part === null) return null;
|
|
2787
2787
|
if (typeof part === "function") return part(context);
|
|
2788
|
-
if (part[internals$
|
|
2788
|
+
if (part[internals$26.symbol]) return part.evaluate(context);
|
|
2789
2789
|
return part;
|
|
2790
2790
|
};
|
|
2791
|
-
internals$
|
|
2791
|
+
internals$26.single = function(operator$1, value) {
|
|
2792
2792
|
if (operator$1 === "!") return value ? false : true;
|
|
2793
2793
|
const negative = -value;
|
|
2794
2794
|
if (negative === 0) return 0;
|
|
2795
2795
|
return negative;
|
|
2796
2796
|
};
|
|
2797
|
-
internals$
|
|
2798
|
-
if (operator$1 === "??") return internals$
|
|
2797
|
+
internals$26.calculate = function(operator$1, left, right) {
|
|
2798
|
+
if (operator$1 === "??") return internals$26.exists(left) ? left : right;
|
|
2799
2799
|
if (typeof left === "string" || typeof right === "string") {
|
|
2800
2800
|
if (operator$1 === "+") {
|
|
2801
|
-
left = internals$
|
|
2802
|
-
right = internals$
|
|
2801
|
+
left = internals$26.exists(left) ? left : "";
|
|
2802
|
+
right = internals$26.exists(right) ? right : "";
|
|
2803
2803
|
return left + right;
|
|
2804
2804
|
}
|
|
2805
2805
|
} else switch (operator$1) {
|
|
@@ -2822,17 +2822,17 @@ var require_lib$3 = __commonJSMin((exports) => {
|
|
|
2822
2822
|
}
|
|
2823
2823
|
return null;
|
|
2824
2824
|
};
|
|
2825
|
-
internals$
|
|
2825
|
+
internals$26.exists = function(value) {
|
|
2826
2826
|
return value !== null && value !== void 0;
|
|
2827
2827
|
};
|
|
2828
2828
|
});
|
|
2829
2829
|
var require_template = __commonJSMin((exports, module) => {
|
|
2830
|
-
const { assert: assert$
|
|
2830
|
+
const { assert: assert$52, clone: clone$19, escapeHtml: escapeHtml$1 } = require_lib$4();
|
|
2831
2831
|
const Formula = require_lib$3();
|
|
2832
|
-
const Common$
|
|
2832
|
+
const Common$24 = require_common$3();
|
|
2833
2833
|
const Errors$8 = require_errors$2();
|
|
2834
|
-
const Ref$
|
|
2835
|
-
const internals$
|
|
2834
|
+
const Ref$12 = require_ref$2();
|
|
2835
|
+
const internals$25 = {
|
|
2836
2836
|
symbol: Symbol("template"),
|
|
2837
2837
|
opens: new Array(1e3).join("\0"),
|
|
2838
2838
|
closes: new Array(1e3).join(""),
|
|
@@ -2844,20 +2844,20 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2844
2844
|
utc: Date.prototype.toUTCString
|
|
2845
2845
|
}
|
|
2846
2846
|
};
|
|
2847
|
-
module.exports = exports = internals$
|
|
2847
|
+
module.exports = exports = internals$25.Template = class {
|
|
2848
2848
|
constructor(source, options) {
|
|
2849
|
-
assert$
|
|
2850
|
-
assert$
|
|
2849
|
+
assert$52(typeof source === "string", "Template source must be a string");
|
|
2850
|
+
assert$52(!source.includes("\0") && !source.includes(""), "Template source cannot contain reserved control characters");
|
|
2851
2851
|
this.source = source;
|
|
2852
2852
|
this.rendered = source;
|
|
2853
2853
|
this._template = null;
|
|
2854
2854
|
if (options) {
|
|
2855
2855
|
const { functions,...opts } = options;
|
|
2856
|
-
this._settings = Object.keys(opts).length ? clone$
|
|
2856
|
+
this._settings = Object.keys(opts).length ? clone$19(opts) : void 0;
|
|
2857
2857
|
this._functions = functions;
|
|
2858
2858
|
if (this._functions) {
|
|
2859
|
-
assert$
|
|
2860
|
-
assert$
|
|
2859
|
+
assert$52(Object.keys(this._functions).every((key) => typeof key === "string"), "Functions keys must be strings");
|
|
2860
|
+
assert$52(Object.values(this._functions).every((key) => typeof key === "function"), "Functions values must be functions");
|
|
2861
2861
|
}
|
|
2862
2862
|
} else {
|
|
2863
2863
|
this._settings = void 0;
|
|
@@ -2867,8 +2867,8 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2867
2867
|
}
|
|
2868
2868
|
_parse() {
|
|
2869
2869
|
if (!this.source.includes("{")) return;
|
|
2870
|
-
const encoded = internals$
|
|
2871
|
-
const parts = internals$
|
|
2870
|
+
const encoded = internals$25.encode(this.source);
|
|
2871
|
+
const parts = internals$25.split(encoded);
|
|
2872
2872
|
let refs = false;
|
|
2873
2873
|
const processed = [];
|
|
2874
2874
|
const head$1 = parts.shift();
|
|
@@ -2878,20 +2878,20 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2878
2878
|
const ender = raw ? "}" : "}}";
|
|
2879
2879
|
const end = part.indexOf(ender);
|
|
2880
2880
|
if (end === -1 || part[1] === "{") {
|
|
2881
|
-
processed.push(`{${internals$
|
|
2881
|
+
processed.push(`{${internals$25.decode(part)}`);
|
|
2882
2882
|
continue;
|
|
2883
2883
|
}
|
|
2884
2884
|
let variable = part.slice(raw ? 0 : 1, end);
|
|
2885
2885
|
const wrapped = variable[0] === ":";
|
|
2886
2886
|
if (wrapped) variable = variable.slice(1);
|
|
2887
|
-
const dynamic = this._ref(internals$
|
|
2887
|
+
const dynamic = this._ref(internals$25.decode(variable), {
|
|
2888
2888
|
raw,
|
|
2889
2889
|
wrapped
|
|
2890
2890
|
});
|
|
2891
2891
|
processed.push(dynamic);
|
|
2892
2892
|
if (typeof dynamic !== "string") refs = true;
|
|
2893
2893
|
const rest = part.slice(end + ender.length);
|
|
2894
|
-
if (rest) processed.push(internals$
|
|
2894
|
+
if (rest) processed.push(internals$25.decode(rest));
|
|
2895
2895
|
}
|
|
2896
2896
|
if (!refs) {
|
|
2897
2897
|
this.rendered = processed.join("");
|
|
@@ -2900,7 +2900,7 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2900
2900
|
this._template = processed;
|
|
2901
2901
|
}
|
|
2902
2902
|
static date(date, prefs) {
|
|
2903
|
-
return internals$
|
|
2903
|
+
return internals$25.dateFormat[prefs.dateFormat].call(date);
|
|
2904
2904
|
}
|
|
2905
2905
|
describe(options = {}) {
|
|
2906
2906
|
if (!this._settings && options.compact) return this.source;
|
|
@@ -2910,7 +2910,7 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2910
2910
|
return desc$1;
|
|
2911
2911
|
}
|
|
2912
2912
|
static build(desc$1) {
|
|
2913
|
-
return new internals$
|
|
2913
|
+
return new internals$25.Template(desc$1.template, desc$1.options || desc$1.functions ? {
|
|
2914
2914
|
...desc$1.options,
|
|
2915
2915
|
functions: desc$1.functions
|
|
2916
2916
|
} : void 0);
|
|
@@ -2919,7 +2919,7 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2919
2919
|
return !!this._template;
|
|
2920
2920
|
}
|
|
2921
2921
|
static isTemplate(template) {
|
|
2922
|
-
return template ? !!template[Common$
|
|
2922
|
+
return template ? !!template[Common$24.symbols.template] : false;
|
|
2923
2923
|
}
|
|
2924
2924
|
refs() {
|
|
2925
2925
|
if (!this._template) return;
|
|
@@ -2941,10 +2941,10 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2941
2941
|
for (const part of this._template) if (typeof part === "string") parts.push(part);
|
|
2942
2942
|
else {
|
|
2943
2943
|
const rendered = this._part(part, value, state, prefs, local, options);
|
|
2944
|
-
const string = internals$
|
|
2944
|
+
const string = internals$25.stringify(rendered, value, state, prefs, local, options);
|
|
2945
2945
|
if (string !== void 0) {
|
|
2946
2946
|
const result = part.raw || (options.errors && options.errors.escapeHtml) === false ? string : escapeHtml$1(string);
|
|
2947
|
-
parts.push(internals$
|
|
2947
|
+
parts.push(internals$25.wrap(result, part.wrapped && prefs.errors.wrap.label));
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
2950
|
return parts.join("");
|
|
@@ -2952,7 +2952,7 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2952
2952
|
_ref(content, { raw, wrapped }) {
|
|
2953
2953
|
const refs = [];
|
|
2954
2954
|
const reference = (variable) => {
|
|
2955
|
-
const ref = Ref$
|
|
2955
|
+
const ref = Ref$12.create(variable, this._settings);
|
|
2956
2956
|
refs.push(ref);
|
|
2957
2957
|
return (context) => {
|
|
2958
2958
|
const resolved = ref.resolve(...context);
|
|
@@ -2961,13 +2961,13 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2961
2961
|
};
|
|
2962
2962
|
try {
|
|
2963
2963
|
const functions = this._functions ? {
|
|
2964
|
-
...internals$
|
|
2964
|
+
...internals$25.functions,
|
|
2965
2965
|
...this._functions
|
|
2966
|
-
} : internals$
|
|
2966
|
+
} : internals$25.functions;
|
|
2967
2967
|
var formula = new Formula.Parser(content, {
|
|
2968
2968
|
reference,
|
|
2969
2969
|
functions,
|
|
2970
|
-
constants: internals$
|
|
2970
|
+
constants: internals$25.constants
|
|
2971
2971
|
});
|
|
2972
2972
|
} catch (err$1) {
|
|
2973
2973
|
err$1.message = `Invalid template variable "${content}" fails due to: ${err$1.message}`;
|
|
@@ -2983,7 +2983,7 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2983
2983
|
wrapped: wrapped || ref.type === "local" && ref.key === "label"
|
|
2984
2984
|
};
|
|
2985
2985
|
}
|
|
2986
|
-
return internals$
|
|
2986
|
+
return internals$25.stringify(formula.single.value);
|
|
2987
2987
|
}
|
|
2988
2988
|
return {
|
|
2989
2989
|
formula,
|
|
@@ -2995,19 +2995,19 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
2995
2995
|
return this.source;
|
|
2996
2996
|
}
|
|
2997
2997
|
};
|
|
2998
|
-
internals$
|
|
2999
|
-
internals$
|
|
3000
|
-
internals$
|
|
2998
|
+
internals$25.Template.prototype[Common$24.symbols.template] = true;
|
|
2999
|
+
internals$25.Template.prototype.isImmutable = true;
|
|
3000
|
+
internals$25.encode = function(string) {
|
|
3001
3001
|
return string.replace(/\\(\{+)/g, ($0, $1) => {
|
|
3002
|
-
return internals$
|
|
3002
|
+
return internals$25.opens.slice(0, $1.length);
|
|
3003
3003
|
}).replace(/\\(\}+)/g, ($0, $1) => {
|
|
3004
|
-
return internals$
|
|
3004
|
+
return internals$25.closes.slice(0, $1.length);
|
|
3005
3005
|
});
|
|
3006
3006
|
};
|
|
3007
|
-
internals$
|
|
3007
|
+
internals$25.decode = function(string) {
|
|
3008
3008
|
return string.replace(/\u0000/g, "{").replace(/\u0001/g, "}");
|
|
3009
3009
|
};
|
|
3010
|
-
internals$
|
|
3010
|
+
internals$25.split = function(string) {
|
|
3011
3011
|
const parts = [];
|
|
3012
3012
|
let current = "";
|
|
3013
3013
|
for (let i$4 = 0; i$4 < string.length; ++i$4) {
|
|
@@ -3025,16 +3025,16 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
3025
3025
|
parts.push(current);
|
|
3026
3026
|
return parts;
|
|
3027
3027
|
};
|
|
3028
|
-
internals$
|
|
3028
|
+
internals$25.wrap = function(value, ends) {
|
|
3029
3029
|
if (!ends) return value;
|
|
3030
3030
|
if (ends.length === 1) return `${ends}${value}${ends}`;
|
|
3031
3031
|
return `${ends[0]}${value}${ends[1]}`;
|
|
3032
3032
|
};
|
|
3033
|
-
internals$
|
|
3033
|
+
internals$25.stringify = function(value, original, state, prefs, local, options = {}) {
|
|
3034
3034
|
const type = typeof value;
|
|
3035
3035
|
const wrap$2 = prefs && prefs.errors && prefs.errors.wrap || {};
|
|
3036
3036
|
let skipWrap = false;
|
|
3037
|
-
if (Ref$
|
|
3037
|
+
if (Ref$12.isRef(value) && value.render) {
|
|
3038
3038
|
skipWrap = value.in;
|
|
3039
3039
|
value = value.resolve(original, state, prefs, local, {
|
|
3040
3040
|
in: value.in,
|
|
@@ -3042,10 +3042,10 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
3042
3042
|
});
|
|
3043
3043
|
}
|
|
3044
3044
|
if (value === null) return "null";
|
|
3045
|
-
if (type === "string") return internals$
|
|
3045
|
+
if (type === "string") return internals$25.wrap(value, options.arrayItems && wrap$2.string);
|
|
3046
3046
|
if (type === "number" || type === "function" || type === "symbol") return value.toString();
|
|
3047
3047
|
if (type !== "object") return JSON.stringify(value);
|
|
3048
|
-
if (value instanceof Date) return internals$
|
|
3048
|
+
if (value instanceof Date) return internals$25.Template.date(value, prefs);
|
|
3049
3049
|
if (value instanceof Map) {
|
|
3050
3050
|
const pairs = [];
|
|
3051
3051
|
for (const [key, sym] of value.entries()) pairs.push(`${key.toString()} -> ${sym.toString()}`);
|
|
@@ -3053,13 +3053,13 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
3053
3053
|
}
|
|
3054
3054
|
if (!Array.isArray(value)) return value.toString();
|
|
3055
3055
|
const values$3 = [];
|
|
3056
|
-
for (const item of value) values$3.push(internals$
|
|
3056
|
+
for (const item of value) values$3.push(internals$25.stringify(item, original, state, prefs, local, {
|
|
3057
3057
|
arrayItems: true,
|
|
3058
3058
|
...options
|
|
3059
3059
|
}));
|
|
3060
|
-
return internals$
|
|
3060
|
+
return internals$25.wrap(values$3.join(", "), !skipWrap && wrap$2.array);
|
|
3061
3061
|
};
|
|
3062
|
-
internals$
|
|
3062
|
+
internals$25.constants = {
|
|
3063
3063
|
true: true,
|
|
3064
3064
|
false: false,
|
|
3065
3065
|
null: null,
|
|
@@ -3068,7 +3068,7 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
3068
3068
|
hour: 60 * 60 * 1e3,
|
|
3069
3069
|
day: 24 * 60 * 60 * 1e3
|
|
3070
3070
|
};
|
|
3071
|
-
internals$
|
|
3071
|
+
internals$25.functions = {
|
|
3072
3072
|
if(condition, then, otherwise) {
|
|
3073
3073
|
return condition ? then : otherwise;
|
|
3074
3074
|
},
|
|
@@ -3096,10 +3096,10 @@ var require_template = __commonJSMin((exports, module) => {
|
|
|
3096
3096
|
};
|
|
3097
3097
|
});
|
|
3098
3098
|
var require_ref$2 = __commonJSMin((exports) => {
|
|
3099
|
-
const { assert: assert$
|
|
3100
|
-
const Common$
|
|
3101
|
-
let Template$
|
|
3102
|
-
const internals$
|
|
3099
|
+
const { assert: assert$51, clone: clone$18, reach: reach$4 } = require_lib$4();
|
|
3100
|
+
const Common$23 = require_common$3();
|
|
3101
|
+
let Template$8;
|
|
3102
|
+
const internals$24 = {
|
|
3103
3103
|
symbol: Symbol("ref"),
|
|
3104
3104
|
defaults: {
|
|
3105
3105
|
adjust: null,
|
|
@@ -3111,8 +3111,8 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
};
|
|
3113
3113
|
exports.create = function(key, options = {}) {
|
|
3114
|
-
assert$
|
|
3115
|
-
Common$
|
|
3114
|
+
assert$51(typeof key === "string", "Invalid reference key:", key);
|
|
3115
|
+
Common$23.assertOptions(options, [
|
|
3116
3116
|
"adjust",
|
|
3117
3117
|
"ancestor",
|
|
3118
3118
|
"in",
|
|
@@ -3122,25 +3122,25 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3122
3122
|
"render",
|
|
3123
3123
|
"separator"
|
|
3124
3124
|
]);
|
|
3125
|
-
assert$
|
|
3126
|
-
const ref = Object.assign({}, internals$
|
|
3125
|
+
assert$51(!options.prefix || typeof options.prefix === "object", "options.prefix must be of type object");
|
|
3126
|
+
const ref = Object.assign({}, internals$24.defaults, options);
|
|
3127
3127
|
delete ref.prefix;
|
|
3128
3128
|
const separator = ref.separator;
|
|
3129
|
-
const context = internals$
|
|
3129
|
+
const context = internals$24.context(key, separator, options.prefix);
|
|
3130
3130
|
ref.type = context.type;
|
|
3131
3131
|
key = context.key;
|
|
3132
3132
|
if (ref.type === "value") {
|
|
3133
3133
|
if (context.root) {
|
|
3134
|
-
assert$
|
|
3134
|
+
assert$51(!separator || key[0] !== separator, "Cannot specify relative path with root prefix");
|
|
3135
3135
|
ref.ancestor = "root";
|
|
3136
3136
|
if (!key) key = null;
|
|
3137
3137
|
}
|
|
3138
3138
|
if (separator && separator === key) {
|
|
3139
3139
|
key = null;
|
|
3140
3140
|
ref.ancestor = 0;
|
|
3141
|
-
} else if (ref.ancestor !== void 0) assert$
|
|
3141
|
+
} else if (ref.ancestor !== void 0) assert$51(!separator || !key || key[0] !== separator, "Cannot combine prefix with ancestor option");
|
|
3142
3142
|
else {
|
|
3143
|
-
const [ancestor, slice$1] = internals$
|
|
3143
|
+
const [ancestor, slice$1] = internals$24.ancestor(key, separator);
|
|
3144
3144
|
if (slice$1) {
|
|
3145
3145
|
key = key.slice(slice$1);
|
|
3146
3146
|
if (key === "") key = null;
|
|
@@ -3149,7 +3149,7 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3149
3149
|
}
|
|
3150
3150
|
}
|
|
3151
3151
|
ref.path = separator ? key === null ? [] : key.split(separator) : [key];
|
|
3152
|
-
return new internals$
|
|
3152
|
+
return new internals$24.Ref(ref);
|
|
3153
3153
|
};
|
|
3154
3154
|
exports.in = function(key, options = {}) {
|
|
3155
3155
|
return exports.create(key, {
|
|
@@ -3158,12 +3158,12 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3158
3158
|
});
|
|
3159
3159
|
};
|
|
3160
3160
|
exports.isRef = function(ref) {
|
|
3161
|
-
return ref ? !!ref[Common$
|
|
3161
|
+
return ref ? !!ref[Common$23.symbols.ref] : false;
|
|
3162
3162
|
};
|
|
3163
|
-
internals$
|
|
3163
|
+
internals$24.Ref = class {
|
|
3164
3164
|
constructor(options) {
|
|
3165
|
-
assert$
|
|
3166
|
-
Common$
|
|
3165
|
+
assert$51(typeof options === "object", "Invalid reference construction");
|
|
3166
|
+
Common$23.assertOptions(options, [
|
|
3167
3167
|
"adjust",
|
|
3168
3168
|
"ancestor",
|
|
3169
3169
|
"in",
|
|
@@ -3178,12 +3178,12 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3178
3178
|
"root",
|
|
3179
3179
|
"display"
|
|
3180
3180
|
]);
|
|
3181
|
-
assert$
|
|
3182
|
-
assert$
|
|
3183
|
-
assert$
|
|
3184
|
-
assert$
|
|
3185
|
-
Object.assign(this, internals$
|
|
3186
|
-
assert$
|
|
3181
|
+
assert$51([false, void 0].includes(options.separator) || typeof options.separator === "string" && options.separator.length === 1, "Invalid separator");
|
|
3182
|
+
assert$51(!options.adjust || typeof options.adjust === "function", "options.adjust must be a function");
|
|
3183
|
+
assert$51(!options.map || Array.isArray(options.map), "options.map must be an array");
|
|
3184
|
+
assert$51(!options.map || !options.adjust, "Cannot set both map and adjust options");
|
|
3185
|
+
Object.assign(this, internals$24.defaults, options);
|
|
3186
|
+
assert$51(this.type === "value" || this.ancestor === void 0, "Non-value references cannot reference ancestors");
|
|
3187
3187
|
if (Array.isArray(this.map)) this.map = new Map(this.map);
|
|
3188
3188
|
this.depth = this.path.length;
|
|
3189
3189
|
this.key = this.path.length ? this.path.join(this.separator) : null;
|
|
@@ -3191,12 +3191,12 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3191
3191
|
this.updateDisplay();
|
|
3192
3192
|
}
|
|
3193
3193
|
resolve(value, state, prefs, local, options = {}) {
|
|
3194
|
-
assert$
|
|
3194
|
+
assert$51(!this.in || options.in, "Invalid in() reference usage");
|
|
3195
3195
|
if (this.type === "global") return this._resolve(prefs.context, state, options);
|
|
3196
3196
|
if (this.type === "local") return this._resolve(local, state, options);
|
|
3197
3197
|
if (!this.ancestor) return this._resolve(value, state, options);
|
|
3198
3198
|
if (this.ancestor === "root") return this._resolve(state.ancestors[state.ancestors.length - 1], state, options);
|
|
3199
|
-
assert$
|
|
3199
|
+
assert$51(this.ancestor <= state.ancestors.length, "Invalid reference exceeds the schema root:", this.display);
|
|
3200
3200
|
return this._resolve(state.ancestors[this.ancestor - 1], state, options);
|
|
3201
3201
|
}
|
|
3202
3202
|
_resolve(target, state, options) {
|
|
@@ -3221,7 +3221,7 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3221
3221
|
return [...state.path.slice(0, -this.ancestor), ...this.path];
|
|
3222
3222
|
}
|
|
3223
3223
|
clone() {
|
|
3224
|
-
return new internals$
|
|
3224
|
+
return new internals$24.Ref(this);
|
|
3225
3225
|
}
|
|
3226
3226
|
describe() {
|
|
3227
3227
|
const ref = { path: this.path };
|
|
@@ -3263,13 +3263,13 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3263
3263
|
this.display = `ref:${lead}${key || ""}`;
|
|
3264
3264
|
}
|
|
3265
3265
|
};
|
|
3266
|
-
internals$
|
|
3266
|
+
internals$24.Ref.prototype[Common$23.symbols.ref] = true;
|
|
3267
3267
|
exports.build = function(desc$1) {
|
|
3268
|
-
desc$1 = Object.assign({}, internals$
|
|
3268
|
+
desc$1 = Object.assign({}, internals$24.defaults, desc$1);
|
|
3269
3269
|
if (desc$1.type === "value" && desc$1.ancestor === void 0) desc$1.ancestor = 1;
|
|
3270
|
-
return new internals$
|
|
3270
|
+
return new internals$24.Ref(desc$1);
|
|
3271
3271
|
};
|
|
3272
|
-
internals$
|
|
3272
|
+
internals$24.context = function(key, separator, prefix = {}) {
|
|
3273
3273
|
key = key.trim();
|
|
3274
3274
|
if (prefix) {
|
|
3275
3275
|
const globalp = prefix.global === void 0 ? "$" : prefix.global;
|
|
@@ -3294,7 +3294,7 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3294
3294
|
type: "value"
|
|
3295
3295
|
};
|
|
3296
3296
|
};
|
|
3297
|
-
internals$
|
|
3297
|
+
internals$24.ancestor = function(key, separator) {
|
|
3298
3298
|
if (!separator) return [1, 0];
|
|
3299
3299
|
if (key[0] !== separator) return [1, 0];
|
|
3300
3300
|
if (key[1] !== separator) return [0, 1];
|
|
@@ -3315,7 +3315,7 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3315
3315
|
for (const ref of source) this.register(ref, target);
|
|
3316
3316
|
return;
|
|
3317
3317
|
}
|
|
3318
|
-
if (Common$
|
|
3318
|
+
if (Common$23.isSchema(source)) {
|
|
3319
3319
|
for (const item of source._refs.refs) if (item.ancestor - target >= 0) this.refs.push({
|
|
3320
3320
|
ancestor: item.ancestor - target,
|
|
3321
3321
|
root: item.root
|
|
@@ -3326,15 +3326,15 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3326
3326
|
ancestor: source.ancestor - target,
|
|
3327
3327
|
root: source.root
|
|
3328
3328
|
});
|
|
3329
|
-
Template$
|
|
3330
|
-
if (Template$
|
|
3329
|
+
Template$8 = Template$8 || require_template();
|
|
3330
|
+
if (Template$8.isTemplate(source)) this.register(source.refs(), target);
|
|
3331
3331
|
}
|
|
3332
3332
|
get length() {
|
|
3333
3333
|
return this.refs.length;
|
|
3334
3334
|
}
|
|
3335
3335
|
clone() {
|
|
3336
3336
|
const copy = new exports.Manager();
|
|
3337
|
-
copy.refs = clone$
|
|
3337
|
+
copy.refs = clone$18(this.refs);
|
|
3338
3338
|
return copy;
|
|
3339
3339
|
}
|
|
3340
3340
|
reset() {
|
|
@@ -3346,80 +3346,80 @@ var require_ref$2 = __commonJSMin((exports) => {
|
|
|
3346
3346
|
};
|
|
3347
3347
|
});
|
|
3348
3348
|
var require_compile = __commonJSMin((exports) => {
|
|
3349
|
-
const { assert: assert$
|
|
3350
|
-
const Common$
|
|
3351
|
-
const Ref$
|
|
3352
|
-
const internals$
|
|
3349
|
+
const { assert: assert$50 } = require_lib$4();
|
|
3350
|
+
const Common$22 = require_common$3();
|
|
3351
|
+
const Ref$11 = require_ref$2();
|
|
3352
|
+
const internals$23 = {};
|
|
3353
3353
|
exports.schema = function(Joi$2, config, options = {}) {
|
|
3354
|
-
Common$
|
|
3354
|
+
Common$22.assertOptions(options, ["appendPath", "override"]);
|
|
3355
3355
|
try {
|
|
3356
|
-
return internals$
|
|
3356
|
+
return internals$23.schema(Joi$2, config, options);
|
|
3357
3357
|
} catch (err$1) {
|
|
3358
3358
|
if (options.appendPath && err$1.path !== void 0) err$1.message = `${err$1.message} (${err$1.path})`;
|
|
3359
3359
|
throw err$1;
|
|
3360
3360
|
}
|
|
3361
3361
|
};
|
|
3362
|
-
internals$
|
|
3363
|
-
assert$
|
|
3362
|
+
internals$23.schema = function(Joi$2, config, options) {
|
|
3363
|
+
assert$50(config !== void 0, "Invalid undefined schema");
|
|
3364
3364
|
if (Array.isArray(config)) {
|
|
3365
|
-
assert$
|
|
3365
|
+
assert$50(config.length, "Invalid empty array schema");
|
|
3366
3366
|
if (config.length === 1) config = config[0];
|
|
3367
3367
|
}
|
|
3368
3368
|
const valid$2 = (base$3, ...values$3) => {
|
|
3369
3369
|
if (options.override !== false) return base$3.valid(Joi$2.override, ...values$3);
|
|
3370
3370
|
return base$3.valid(...values$3);
|
|
3371
3371
|
};
|
|
3372
|
-
if (internals$
|
|
3372
|
+
if (internals$23.simple(config)) return valid$2(Joi$2, config);
|
|
3373
3373
|
if (typeof config === "function") return Joi$2.custom(config);
|
|
3374
|
-
assert$
|
|
3375
|
-
if (Common$
|
|
3376
|
-
if (Common$
|
|
3374
|
+
assert$50(typeof config === "object", "Invalid schema content:", typeof config);
|
|
3375
|
+
if (Common$22.isResolvable(config)) return valid$2(Joi$2, config);
|
|
3376
|
+
if (Common$22.isSchema(config)) return config;
|
|
3377
3377
|
if (Array.isArray(config)) {
|
|
3378
|
-
for (const item of config) if (!internals$
|
|
3378
|
+
for (const item of config) if (!internals$23.simple(item)) return Joi$2.alternatives().try(...config);
|
|
3379
3379
|
return valid$2(Joi$2, ...config);
|
|
3380
3380
|
}
|
|
3381
3381
|
if (config instanceof RegExp) return Joi$2.string().regex(config);
|
|
3382
3382
|
if (config instanceof Date) return valid$2(Joi$2.date(), config);
|
|
3383
|
-
assert$
|
|
3383
|
+
assert$50(Object.getPrototypeOf(config) === Object.getPrototypeOf({}), "Schema can only contain plain objects");
|
|
3384
3384
|
return Joi$2.object().keys(config);
|
|
3385
3385
|
};
|
|
3386
3386
|
exports.ref = function(id, options) {
|
|
3387
|
-
return Ref$
|
|
3387
|
+
return Ref$11.isRef(id) ? id : Ref$11.create(id, options);
|
|
3388
3388
|
};
|
|
3389
3389
|
exports.compile = function(root$11, schema$2, options = {}) {
|
|
3390
|
-
Common$
|
|
3391
|
-
const any = schema$2 && schema$2[Common$
|
|
3390
|
+
Common$22.assertOptions(options, ["legacy"]);
|
|
3391
|
+
const any = schema$2 && schema$2[Common$22.symbols.any];
|
|
3392
3392
|
if (any) {
|
|
3393
|
-
assert$
|
|
3393
|
+
assert$50(options.legacy || any.version === Common$22.version, "Cannot mix different versions of joi schemas:", any.version, Common$22.version);
|
|
3394
3394
|
return schema$2;
|
|
3395
3395
|
}
|
|
3396
3396
|
if (typeof schema$2 !== "object" || !options.legacy) return exports.schema(root$11, schema$2, { appendPath: true });
|
|
3397
|
-
const compiler = internals$
|
|
3397
|
+
const compiler = internals$23.walk(schema$2);
|
|
3398
3398
|
if (!compiler) return exports.schema(root$11, schema$2, { appendPath: true });
|
|
3399
3399
|
return compiler.compile(compiler.root, schema$2);
|
|
3400
3400
|
};
|
|
3401
|
-
internals$
|
|
3401
|
+
internals$23.walk = function(schema$2) {
|
|
3402
3402
|
if (typeof schema$2 !== "object") return null;
|
|
3403
3403
|
if (Array.isArray(schema$2)) {
|
|
3404
3404
|
for (const item of schema$2) {
|
|
3405
|
-
const compiler = internals$
|
|
3405
|
+
const compiler = internals$23.walk(item);
|
|
3406
3406
|
if (compiler) return compiler;
|
|
3407
3407
|
}
|
|
3408
3408
|
return null;
|
|
3409
3409
|
}
|
|
3410
|
-
const any = schema$2[Common$
|
|
3410
|
+
const any = schema$2[Common$22.symbols.any];
|
|
3411
3411
|
if (any) return {
|
|
3412
3412
|
root: schema$2[any.root],
|
|
3413
3413
|
compile: any.compile
|
|
3414
3414
|
};
|
|
3415
|
-
assert$
|
|
3415
|
+
assert$50(Object.getPrototypeOf(schema$2) === Object.getPrototypeOf({}), "Schema can only contain plain objects");
|
|
3416
3416
|
for (const key in schema$2) {
|
|
3417
|
-
const compiler = internals$
|
|
3417
|
+
const compiler = internals$23.walk(schema$2[key]);
|
|
3418
3418
|
if (compiler) return compiler;
|
|
3419
3419
|
}
|
|
3420
3420
|
return null;
|
|
3421
3421
|
};
|
|
3422
|
-
internals$
|
|
3422
|
+
internals$23.simple = function(value) {
|
|
3423
3423
|
return value === null || [
|
|
3424
3424
|
"boolean",
|
|
3425
3425
|
"string",
|
|
@@ -3428,12 +3428,12 @@ var require_compile = __commonJSMin((exports) => {
|
|
|
3428
3428
|
};
|
|
3429
3429
|
exports.when = function(schema$2, condition, options) {
|
|
3430
3430
|
if (options === void 0) {
|
|
3431
|
-
assert$
|
|
3431
|
+
assert$50(condition && typeof condition === "object", "Missing options");
|
|
3432
3432
|
options = condition;
|
|
3433
|
-
condition = Ref$
|
|
3433
|
+
condition = Ref$11.create(".");
|
|
3434
3434
|
}
|
|
3435
3435
|
if (Array.isArray(options)) options = { switch: options };
|
|
3436
|
-
Common$
|
|
3436
|
+
Common$22.assertOptions(options, [
|
|
3437
3437
|
"is",
|
|
3438
3438
|
"not",
|
|
3439
3439
|
"then",
|
|
@@ -3441,19 +3441,19 @@ var require_compile = __commonJSMin((exports) => {
|
|
|
3441
3441
|
"switch",
|
|
3442
3442
|
"break"
|
|
3443
3443
|
]);
|
|
3444
|
-
if (Common$
|
|
3445
|
-
assert$
|
|
3446
|
-
assert$
|
|
3447
|
-
assert$
|
|
3448
|
-
return internals$
|
|
3444
|
+
if (Common$22.isSchema(condition)) {
|
|
3445
|
+
assert$50(options.is === void 0, "\"is\" can not be used with a schema condition");
|
|
3446
|
+
assert$50(options.not === void 0, "\"not\" can not be used with a schema condition");
|
|
3447
|
+
assert$50(options.switch === void 0, "\"switch\" can not be used with a schema condition");
|
|
3448
|
+
return internals$23.condition(schema$2, {
|
|
3449
3449
|
is: condition,
|
|
3450
3450
|
then: options.then,
|
|
3451
3451
|
otherwise: options.otherwise,
|
|
3452
3452
|
break: options.break
|
|
3453
3453
|
});
|
|
3454
3454
|
}
|
|
3455
|
-
assert$
|
|
3456
|
-
assert$
|
|
3455
|
+
assert$50(Ref$11.isRef(condition) || typeof condition === "string", "Invalid condition:", condition);
|
|
3456
|
+
assert$50(options.not === void 0 || options.is === void 0, "Cannot combine \"is\" with \"not\"");
|
|
3457
3457
|
if (options.switch === void 0) {
|
|
3458
3458
|
let rule$1 = options;
|
|
3459
3459
|
if (options.not !== void 0) rule$1 = {
|
|
@@ -3463,10 +3463,10 @@ var require_compile = __commonJSMin((exports) => {
|
|
|
3463
3463
|
break: options.break
|
|
3464
3464
|
};
|
|
3465
3465
|
let is = rule$1.is !== void 0 ? schema$2.$_compile(rule$1.is) : schema$2.$_root.invalid(null, false, 0, "").required();
|
|
3466
|
-
assert$
|
|
3467
|
-
assert$
|
|
3468
|
-
if (options.is !== void 0 && !Ref$
|
|
3469
|
-
return internals$
|
|
3466
|
+
assert$50(rule$1.then !== void 0 || rule$1.otherwise !== void 0, "options must have at least one of \"then\", \"otherwise\", or \"switch\"");
|
|
3467
|
+
assert$50(rule$1.break === void 0 || rule$1.then === void 0 || rule$1.otherwise === void 0, "Cannot specify then, otherwise, and break all together");
|
|
3468
|
+
if (options.is !== void 0 && !Ref$11.isRef(options.is) && !Common$22.isSchema(options.is)) is = is.required();
|
|
3469
|
+
return internals$23.condition(schema$2, {
|
|
3470
3470
|
ref: exports.ref(condition),
|
|
3471
3471
|
is,
|
|
3472
3472
|
then: rule$1.then,
|
|
@@ -3474,10 +3474,10 @@ var require_compile = __commonJSMin((exports) => {
|
|
|
3474
3474
|
break: rule$1.break
|
|
3475
3475
|
});
|
|
3476
3476
|
}
|
|
3477
|
-
assert$
|
|
3478
|
-
assert$
|
|
3479
|
-
assert$
|
|
3480
|
-
assert$
|
|
3477
|
+
assert$50(Array.isArray(options.switch), "\"switch\" must be an array");
|
|
3478
|
+
assert$50(options.is === void 0, "Cannot combine \"switch\" with \"is\"");
|
|
3479
|
+
assert$50(options.not === void 0, "Cannot combine \"switch\" with \"not\"");
|
|
3480
|
+
assert$50(options.then === void 0, "Cannot combine \"switch\" with \"then\"");
|
|
3481
3481
|
const rule = {
|
|
3482
3482
|
ref: exports.ref(condition),
|
|
3483
3483
|
switch: [],
|
|
@@ -3486,23 +3486,23 @@ var require_compile = __commonJSMin((exports) => {
|
|
|
3486
3486
|
for (let i$4 = 0; i$4 < options.switch.length; ++i$4) {
|
|
3487
3487
|
const test = options.switch[i$4];
|
|
3488
3488
|
const last$2 = i$4 === options.switch.length - 1;
|
|
3489
|
-
Common$
|
|
3489
|
+
Common$22.assertOptions(test, last$2 ? [
|
|
3490
3490
|
"is",
|
|
3491
3491
|
"then",
|
|
3492
3492
|
"otherwise"
|
|
3493
3493
|
] : ["is", "then"]);
|
|
3494
|
-
assert$
|
|
3495
|
-
assert$
|
|
3494
|
+
assert$50(test.is !== void 0, "Switch statement missing \"is\"");
|
|
3495
|
+
assert$50(test.then !== void 0, "Switch statement missing \"then\"");
|
|
3496
3496
|
const item = {
|
|
3497
3497
|
is: schema$2.$_compile(test.is),
|
|
3498
3498
|
then: schema$2.$_compile(test.then)
|
|
3499
3499
|
};
|
|
3500
|
-
if (!Ref$
|
|
3500
|
+
if (!Ref$11.isRef(test.is) && !Common$22.isSchema(test.is)) item.is = item.is.required();
|
|
3501
3501
|
if (last$2) {
|
|
3502
|
-
assert$
|
|
3502
|
+
assert$50(options.otherwise === void 0 || test.otherwise === void 0, "Cannot specify \"otherwise\" inside and outside a \"switch\"");
|
|
3503
3503
|
const otherwise = options.otherwise !== void 0 ? options.otherwise : test.otherwise;
|
|
3504
3504
|
if (otherwise !== void 0) {
|
|
3505
|
-
assert$
|
|
3505
|
+
assert$50(rule.break === void 0, "Cannot specify both otherwise and break");
|
|
3506
3506
|
item.otherwise = schema$2.$_compile(otherwise);
|
|
3507
3507
|
}
|
|
3508
3508
|
}
|
|
@@ -3510,47 +3510,47 @@ var require_compile = __commonJSMin((exports) => {
|
|
|
3510
3510
|
}
|
|
3511
3511
|
return rule;
|
|
3512
3512
|
};
|
|
3513
|
-
internals$
|
|
3513
|
+
internals$23.condition = function(schema$2, condition) {
|
|
3514
3514
|
for (const key of ["then", "otherwise"]) if (condition[key] === void 0) delete condition[key];
|
|
3515
3515
|
else condition[key] = schema$2.$_compile(condition[key]);
|
|
3516
3516
|
return condition;
|
|
3517
3517
|
};
|
|
3518
3518
|
});
|
|
3519
3519
|
var require_messages = __commonJSMin((exports) => {
|
|
3520
|
-
const { assert: assert$
|
|
3521
|
-
const Template$
|
|
3520
|
+
const { assert: assert$49, clone: clone$17 } = require_lib$4();
|
|
3521
|
+
const Template$7 = require_template();
|
|
3522
3522
|
exports.compile = function(messages$3, target) {
|
|
3523
3523
|
if (typeof messages$3 === "string") {
|
|
3524
|
-
assert$
|
|
3525
|
-
return new Template$
|
|
3524
|
+
assert$49(!target, "Cannot set single message string");
|
|
3525
|
+
return new Template$7(messages$3);
|
|
3526
3526
|
}
|
|
3527
|
-
if (Template$
|
|
3528
|
-
assert$
|
|
3527
|
+
if (Template$7.isTemplate(messages$3)) {
|
|
3528
|
+
assert$49(!target, "Cannot set single message template");
|
|
3529
3529
|
return messages$3;
|
|
3530
3530
|
}
|
|
3531
|
-
assert$
|
|
3532
|
-
target = target ? clone$
|
|
3531
|
+
assert$49(typeof messages$3 === "object" && !Array.isArray(messages$3), "Invalid message options");
|
|
3532
|
+
target = target ? clone$17(target) : {};
|
|
3533
3533
|
for (let code$2 in messages$3) {
|
|
3534
3534
|
const message = messages$3[code$2];
|
|
3535
|
-
if (code$2 === "root" || Template$
|
|
3535
|
+
if (code$2 === "root" || Template$7.isTemplate(message)) {
|
|
3536
3536
|
target[code$2] = message;
|
|
3537
3537
|
continue;
|
|
3538
3538
|
}
|
|
3539
3539
|
if (typeof message === "string") {
|
|
3540
|
-
target[code$2] = new Template$
|
|
3540
|
+
target[code$2] = new Template$7(message);
|
|
3541
3541
|
continue;
|
|
3542
3542
|
}
|
|
3543
|
-
assert$
|
|
3543
|
+
assert$49(typeof message === "object" && !Array.isArray(message), "Invalid message for", code$2);
|
|
3544
3544
|
const language = code$2;
|
|
3545
3545
|
target[language] = target[language] || {};
|
|
3546
3546
|
for (code$2 in message) {
|
|
3547
3547
|
const localized = message[code$2];
|
|
3548
|
-
if (code$2 === "root" || Template$
|
|
3548
|
+
if (code$2 === "root" || Template$7.isTemplate(localized)) {
|
|
3549
3549
|
target[language][code$2] = localized;
|
|
3550
3550
|
continue;
|
|
3551
3551
|
}
|
|
3552
|
-
assert$
|
|
3553
|
-
target[language][code$2] = new Template$
|
|
3552
|
+
assert$49(typeof localized === "string", "Invalid message for", code$2, "in", language);
|
|
3553
|
+
target[language][code$2] = new Template$7(localized);
|
|
3554
3554
|
}
|
|
3555
3555
|
}
|
|
3556
3556
|
return target;
|
|
@@ -3563,7 +3563,7 @@ var require_messages = __commonJSMin((exports) => {
|
|
|
3563
3563
|
target.root = message;
|
|
3564
3564
|
continue;
|
|
3565
3565
|
}
|
|
3566
|
-
if (Template$
|
|
3566
|
+
if (Template$7.isTemplate(message)) {
|
|
3567
3567
|
target[code$2] = message.describe({ compact: true });
|
|
3568
3568
|
continue;
|
|
3569
3569
|
}
|
|
@@ -3583,62 +3583,62 @@ var require_messages = __commonJSMin((exports) => {
|
|
|
3583
3583
|
exports.merge = function(base$3, extended) {
|
|
3584
3584
|
if (!base$3) return exports.compile(extended);
|
|
3585
3585
|
if (!extended) return base$3;
|
|
3586
|
-
if (typeof extended === "string") return new Template$
|
|
3587
|
-
if (Template$
|
|
3588
|
-
const target = clone$
|
|
3586
|
+
if (typeof extended === "string") return new Template$7(extended);
|
|
3587
|
+
if (Template$7.isTemplate(extended)) return extended;
|
|
3588
|
+
const target = clone$17(base$3);
|
|
3589
3589
|
for (let code$2 in extended) {
|
|
3590
3590
|
const message = extended[code$2];
|
|
3591
|
-
if (code$2 === "root" || Template$
|
|
3591
|
+
if (code$2 === "root" || Template$7.isTemplate(message)) {
|
|
3592
3592
|
target[code$2] = message;
|
|
3593
3593
|
continue;
|
|
3594
3594
|
}
|
|
3595
3595
|
if (typeof message === "string") {
|
|
3596
|
-
target[code$2] = new Template$
|
|
3596
|
+
target[code$2] = new Template$7(message);
|
|
3597
3597
|
continue;
|
|
3598
3598
|
}
|
|
3599
|
-
assert$
|
|
3599
|
+
assert$49(typeof message === "object" && !Array.isArray(message), "Invalid message for", code$2);
|
|
3600
3600
|
const language = code$2;
|
|
3601
3601
|
target[language] = target[language] || {};
|
|
3602
3602
|
for (code$2 in message) {
|
|
3603
3603
|
const localized = message[code$2];
|
|
3604
|
-
if (code$2 === "root" || Template$
|
|
3604
|
+
if (code$2 === "root" || Template$7.isTemplate(localized)) {
|
|
3605
3605
|
target[language][code$2] = localized;
|
|
3606
3606
|
continue;
|
|
3607
3607
|
}
|
|
3608
|
-
assert$
|
|
3609
|
-
target[language][code$2] = new Template$
|
|
3608
|
+
assert$49(typeof localized === "string", "Invalid message for", code$2, "in", language);
|
|
3609
|
+
target[language][code$2] = new Template$7(localized);
|
|
3610
3610
|
}
|
|
3611
3611
|
}
|
|
3612
3612
|
return target;
|
|
3613
3613
|
};
|
|
3614
3614
|
});
|
|
3615
3615
|
var require_extend$1 = __commonJSMin((exports) => {
|
|
3616
|
-
const { assert: assert$
|
|
3617
|
-
const Common$
|
|
3618
|
-
const Messages$
|
|
3619
|
-
const internals$
|
|
3616
|
+
const { assert: assert$48, clone: clone$16 } = require_lib$4();
|
|
3617
|
+
const Common$21 = require_common$3();
|
|
3618
|
+
const Messages$7 = require_messages();
|
|
3619
|
+
const internals$22 = {};
|
|
3620
3620
|
exports.type = function(from$2, options) {
|
|
3621
3621
|
const base$3 = Object.getPrototypeOf(from$2);
|
|
3622
|
-
const prototype = clone$
|
|
3622
|
+
const prototype = clone$16(base$3);
|
|
3623
3623
|
const schema$2 = from$2._assign(Object.create(prototype));
|
|
3624
3624
|
const def = Object.assign({}, options);
|
|
3625
3625
|
delete def.base;
|
|
3626
3626
|
prototype._definition = def;
|
|
3627
3627
|
const parent = base$3._definition || {};
|
|
3628
|
-
def.messages = Messages$
|
|
3628
|
+
def.messages = Messages$7.merge(parent.messages, def.messages);
|
|
3629
3629
|
def.properties = Object.assign({}, parent.properties, def.properties);
|
|
3630
3630
|
schema$2.type = def.type;
|
|
3631
3631
|
def.flags = Object.assign({}, parent.flags, def.flags);
|
|
3632
3632
|
const terms = Object.assign({}, parent.terms);
|
|
3633
3633
|
if (def.terms) for (const name$2 in def.terms) {
|
|
3634
3634
|
const term = def.terms[name$2];
|
|
3635
|
-
assert$
|
|
3635
|
+
assert$48(schema$2.$_terms[name$2] === void 0, "Invalid term override for", def.type, name$2);
|
|
3636
3636
|
schema$2.$_terms[name$2] = term.init;
|
|
3637
3637
|
terms[name$2] = term;
|
|
3638
3638
|
}
|
|
3639
3639
|
def.terms = terms;
|
|
3640
3640
|
if (!def.args) def.args = parent.args;
|
|
3641
|
-
def.prepare = internals$
|
|
3641
|
+
def.prepare = internals$22.prepare(def.prepare, parent.prepare);
|
|
3642
3642
|
if (def.coerce) {
|
|
3643
3643
|
if (typeof def.coerce === "function") def.coerce = { method: def.coerce };
|
|
3644
3644
|
if (def.coerce.from && !Array.isArray(def.coerce.from)) def.coerce = {
|
|
@@ -3646,21 +3646,21 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3646
3646
|
from: [].concat(def.coerce.from)
|
|
3647
3647
|
};
|
|
3648
3648
|
}
|
|
3649
|
-
def.coerce = internals$
|
|
3650
|
-
def.validate = internals$
|
|
3649
|
+
def.coerce = internals$22.coerce(def.coerce, parent.coerce);
|
|
3650
|
+
def.validate = internals$22.validate(def.validate, parent.validate);
|
|
3651
3651
|
const rules = Object.assign({}, parent.rules);
|
|
3652
3652
|
if (def.rules) for (const name$2 in def.rules) {
|
|
3653
3653
|
const rule = def.rules[name$2];
|
|
3654
|
-
assert$
|
|
3654
|
+
assert$48(typeof rule === "object", "Invalid rule definition for", def.type, name$2);
|
|
3655
3655
|
let method$1 = rule.method;
|
|
3656
3656
|
if (method$1 === void 0) method$1 = function() {
|
|
3657
3657
|
return this.$_addRule(name$2);
|
|
3658
3658
|
};
|
|
3659
3659
|
if (method$1) {
|
|
3660
|
-
assert$
|
|
3660
|
+
assert$48(!prototype[name$2], "Rule conflict in", def.type, name$2);
|
|
3661
3661
|
prototype[name$2] = method$1;
|
|
3662
3662
|
}
|
|
3663
|
-
assert$
|
|
3663
|
+
assert$48(!rules[name$2], "Rule conflict in", def.type, name$2);
|
|
3664
3664
|
rules[name$2] = rule;
|
|
3665
3665
|
if (rule.alias) {
|
|
3666
3666
|
const aliases$1 = [].concat(rule.alias);
|
|
@@ -3670,8 +3670,8 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3670
3670
|
rule.argsByName = new Map();
|
|
3671
3671
|
rule.args = rule.args.map((arg) => {
|
|
3672
3672
|
if (typeof arg === "string") arg = { name: arg };
|
|
3673
|
-
assert$
|
|
3674
|
-
if (Common$
|
|
3673
|
+
assert$48(!rule.argsByName.has(arg.name), "Duplicated argument name", arg.name);
|
|
3674
|
+
if (Common$21.isSchema(arg.assert)) arg.assert = arg.assert.strict().label(arg.name);
|
|
3675
3675
|
rule.argsByName.set(arg.name, arg);
|
|
3676
3676
|
return arg;
|
|
3677
3677
|
});
|
|
@@ -3680,9 +3680,9 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3680
3680
|
def.rules = rules;
|
|
3681
3681
|
const modifiers$1 = Object.assign({}, parent.modifiers);
|
|
3682
3682
|
if (def.modifiers) for (const name$2 in def.modifiers) {
|
|
3683
|
-
assert$
|
|
3683
|
+
assert$48(!prototype[name$2], "Rule conflict in", def.type, name$2);
|
|
3684
3684
|
const modifier = def.modifiers[name$2];
|
|
3685
|
-
assert$
|
|
3685
|
+
assert$48(typeof modifier === "function", "Invalid modifier definition for", def.type, name$2);
|
|
3686
3686
|
const method$1 = function(arg) {
|
|
3687
3687
|
return this.rule({ [name$2]: arg });
|
|
3688
3688
|
};
|
|
@@ -3694,26 +3694,26 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3694
3694
|
prototype._super = base$3;
|
|
3695
3695
|
schema$2.$_super = {};
|
|
3696
3696
|
for (const override in def.overrides) {
|
|
3697
|
-
assert$
|
|
3698
|
-
def.overrides[override][Common$
|
|
3697
|
+
assert$48(base$3[override], "Cannot override missing", override);
|
|
3698
|
+
def.overrides[override][Common$21.symbols.parent] = base$3[override];
|
|
3699
3699
|
schema$2.$_super[override] = base$3[override].bind(schema$2);
|
|
3700
3700
|
}
|
|
3701
3701
|
Object.assign(prototype, def.overrides);
|
|
3702
3702
|
}
|
|
3703
3703
|
def.cast = Object.assign({}, parent.cast, def.cast);
|
|
3704
3704
|
const manifest = Object.assign({}, parent.manifest, def.manifest);
|
|
3705
|
-
manifest.build = internals$
|
|
3705
|
+
manifest.build = internals$22.build(def.manifest && def.manifest.build, parent.manifest && parent.manifest.build);
|
|
3706
3706
|
def.manifest = manifest;
|
|
3707
|
-
def.rebuild = internals$
|
|
3707
|
+
def.rebuild = internals$22.rebuild(def.rebuild, parent.rebuild);
|
|
3708
3708
|
return schema$2;
|
|
3709
3709
|
};
|
|
3710
|
-
internals$
|
|
3710
|
+
internals$22.build = function(child, parent) {
|
|
3711
3711
|
if (!child || !parent) return child || parent;
|
|
3712
3712
|
return function(obj, desc$1) {
|
|
3713
3713
|
return parent(child(obj, desc$1), desc$1);
|
|
3714
3714
|
};
|
|
3715
3715
|
};
|
|
3716
|
-
internals$
|
|
3716
|
+
internals$22.coerce = function(child, parent) {
|
|
3717
3717
|
if (!child || !parent) return child || parent;
|
|
3718
3718
|
return {
|
|
3719
3719
|
from: child.from && parent.from ? [...new Set([...child.from, ...parent.from])] : null,
|
|
@@ -3734,7 +3734,7 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
};
|
|
3736
3736
|
};
|
|
3737
|
-
internals$
|
|
3737
|
+
internals$22.prepare = function(child, parent) {
|
|
3738
3738
|
if (!child || !parent) return child || parent;
|
|
3739
3739
|
return function(value, helpers$8) {
|
|
3740
3740
|
const prepared = child(value, helpers$8);
|
|
@@ -3745,14 +3745,14 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3745
3745
|
return parent(value, helpers$8) || prepared;
|
|
3746
3746
|
};
|
|
3747
3747
|
};
|
|
3748
|
-
internals$
|
|
3748
|
+
internals$22.rebuild = function(child, parent) {
|
|
3749
3749
|
if (!child || !parent) return child || parent;
|
|
3750
3750
|
return function(schema$2) {
|
|
3751
3751
|
parent(schema$2);
|
|
3752
3752
|
child(schema$2);
|
|
3753
3753
|
};
|
|
3754
3754
|
};
|
|
3755
|
-
internals$
|
|
3755
|
+
internals$22.validate = function(child, parent) {
|
|
3756
3756
|
if (!child || !parent) return child || parent;
|
|
3757
3757
|
return function(value, helpers$8) {
|
|
3758
3758
|
const result = parent(value, helpers$8);
|
|
@@ -3764,13 +3764,268 @@ var require_extend$1 = __commonJSMin((exports) => {
|
|
|
3764
3764
|
};
|
|
3765
3765
|
};
|
|
3766
3766
|
});
|
|
3767
|
+
var require_manifest$1 = __commonJSMin((exports) => {
|
|
3768
|
+
var import_manifest$2 = __toESM(require_manifest$1());
|
|
3769
|
+
var import_manifest$3 = __toESM(require_manifest$1());
|
|
3770
|
+
var import_manifest$4 = __toESM(require_manifest$1());
|
|
3771
|
+
var import_manifest$5 = __toESM(require_manifest$1());
|
|
3772
|
+
var import_manifest$6 = __toESM(require_manifest$1());
|
|
3773
|
+
var import_manifest$7 = __toESM(require_manifest$1());
|
|
3774
|
+
var import_manifest$8 = __toESM(require_manifest$1());
|
|
3775
|
+
const { assert: assert$47, clone: clone$15 } = import_manifest$8.default;
|
|
3776
|
+
const Common$20 = import_manifest$7.default;
|
|
3777
|
+
const Messages$6 = import_manifest$6.default;
|
|
3778
|
+
const Ref$10 = import_manifest$5.default;
|
|
3779
|
+
const Template$6 = import_manifest$4.default;
|
|
3780
|
+
const ManifestDescriptionCache = new WeakMap();
|
|
3781
|
+
var ManifestItemCacheClass = class {
|
|
3782
|
+
#items = new WeakMap();
|
|
3783
|
+
get(item, options = {}) {
|
|
3784
|
+
const cached = this.#items.get(item);
|
|
3785
|
+
if (cached) return cached.get(options);
|
|
3786
|
+
}
|
|
3787
|
+
set(item, options = {}, value) {
|
|
3788
|
+
if (!this.#items.has(item)) this.#items.set(item, new WeakMap());
|
|
3789
|
+
this.#items.get(item).set(options, value);
|
|
3790
|
+
}
|
|
3791
|
+
setAndReturn(item, options = {}, value) {
|
|
3792
|
+
this.set(item, options, value);
|
|
3793
|
+
return value;
|
|
3794
|
+
}
|
|
3795
|
+
};
|
|
3796
|
+
const ManifestItemCache = new ManifestItemCacheClass();
|
|
3797
|
+
let Schemas$4;
|
|
3798
|
+
const internals$21 = {};
|
|
3799
|
+
exports.describe = function(schema$2) {
|
|
3800
|
+
const cached = ManifestDescriptionCache.get(schema$2);
|
|
3801
|
+
if (cached) return cached;
|
|
3802
|
+
const def = schema$2._definition;
|
|
3803
|
+
const desc$1 = {
|
|
3804
|
+
type: schema$2.type,
|
|
3805
|
+
flags: {},
|
|
3806
|
+
rules: []
|
|
3807
|
+
};
|
|
3808
|
+
for (const flag in schema$2._flags) if (flag[0] !== "_") desc$1.flags[flag] = internals$21.describe(schema$2._flags[flag]);
|
|
3809
|
+
if (!Object.keys(desc$1.flags).length) delete desc$1.flags;
|
|
3810
|
+
if (schema$2._preferences) {
|
|
3811
|
+
desc$1.preferences = clone$15(schema$2._preferences, { shallow: ["messages"] });
|
|
3812
|
+
delete desc$1.preferences[Common$20.symbols.prefs];
|
|
3813
|
+
if (desc$1.preferences.messages) desc$1.preferences.messages = Messages$6.decompile(desc$1.preferences.messages);
|
|
3814
|
+
}
|
|
3815
|
+
if (schema$2._valids) desc$1.allow = schema$2._valids.describe();
|
|
3816
|
+
if (schema$2._invalids) desc$1.invalid = schema$2._invalids.describe();
|
|
3817
|
+
for (const rule of schema$2._rules) {
|
|
3818
|
+
const ruleDef = def.rules[rule.name];
|
|
3819
|
+
if (ruleDef.manifest === false) continue;
|
|
3820
|
+
const item = { name: rule.name };
|
|
3821
|
+
for (const custom$1 in def.modifiers) if (rule[custom$1] !== void 0) item[custom$1] = internals$21.describe(rule[custom$1]);
|
|
3822
|
+
if (rule.args) {
|
|
3823
|
+
item.args = {};
|
|
3824
|
+
for (const key in rule.args) {
|
|
3825
|
+
const arg = rule.args[key];
|
|
3826
|
+
if (key === "options" && !Object.keys(arg).length) continue;
|
|
3827
|
+
item.args[key] = internals$21.describe(arg, { assign: key });
|
|
3828
|
+
}
|
|
3829
|
+
if (!Object.keys(item.args).length) delete item.args;
|
|
3830
|
+
}
|
|
3831
|
+
desc$1.rules.push(item);
|
|
3832
|
+
}
|
|
3833
|
+
if (!desc$1.rules.length) delete desc$1.rules;
|
|
3834
|
+
for (const term in schema$2.$_terms) {
|
|
3835
|
+
if (term[0] === "_") continue;
|
|
3836
|
+
assert$47(!desc$1[term], "Cannot describe schema due to internal name conflict with", term);
|
|
3837
|
+
const items = schema$2.$_terms[term];
|
|
3838
|
+
if (!items) continue;
|
|
3839
|
+
if (items instanceof Map) {
|
|
3840
|
+
if (items.size) desc$1[term] = [...items.entries()];
|
|
3841
|
+
continue;
|
|
3842
|
+
}
|
|
3843
|
+
if (Common$20.isValues(items)) {
|
|
3844
|
+
desc$1[term] = items.describe();
|
|
3845
|
+
continue;
|
|
3846
|
+
}
|
|
3847
|
+
assert$47(def.terms[term], "Term", term, "missing configuration");
|
|
3848
|
+
const manifest = def.terms[term].manifest;
|
|
3849
|
+
const mapped = typeof manifest === "object";
|
|
3850
|
+
if (!items.length && !mapped) continue;
|
|
3851
|
+
const normalized = [];
|
|
3852
|
+
for (const item of items) normalized.push(internals$21.describe(item));
|
|
3853
|
+
if (mapped) {
|
|
3854
|
+
const { from: from$2, to } = manifest.mapped;
|
|
3855
|
+
desc$1[term] = {};
|
|
3856
|
+
for (const item of normalized) desc$1[term][item[to]] = item[from$2];
|
|
3857
|
+
continue;
|
|
3858
|
+
}
|
|
3859
|
+
if (manifest === "single") {
|
|
3860
|
+
assert$47(normalized.length === 1, "Term", term, "contains more than one item");
|
|
3861
|
+
desc$1[term] = normalized[0];
|
|
3862
|
+
continue;
|
|
3863
|
+
}
|
|
3864
|
+
desc$1[term] = normalized;
|
|
3865
|
+
}
|
|
3866
|
+
internals$21.validate(schema$2.$_root, desc$1);
|
|
3867
|
+
ManifestDescriptionCache.set(schema$2, desc$1);
|
|
3868
|
+
return desc$1;
|
|
3869
|
+
};
|
|
3870
|
+
internals$21.describe = function(item, options = {}) {
|
|
3871
|
+
const cached = ManifestItemCache.get(item, options);
|
|
3872
|
+
if (cached) return cached;
|
|
3873
|
+
if (Array.isArray(item)) return ManifestItemCache.setAndReturn(item, options, item.map(internals$21.describe));
|
|
3874
|
+
if (item === Common$20.symbols.deepDefault) return ManifestItemCache.setAndReturn(item, options, { special: "deep" });
|
|
3875
|
+
if (typeof item !== "object" || item === null) return ManifestItemCache.setAndReturn(item, options, item);
|
|
3876
|
+
if (options.assign === "options") return ManifestItemCache.setAndReturn(item, options, clone$15(item));
|
|
3877
|
+
if (import_manifest$2.default && import_manifest$2.default.isBuffer(item)) return ManifestItemCache.setAndReturn(item, options, { buffer: item.toString("binary") });
|
|
3878
|
+
if (item instanceof Date) return ManifestItemCache.setAndReturn(item, options, item.toISOString());
|
|
3879
|
+
if (item instanceof Error) return ManifestItemCache.setAndReturn(item, options, item);
|
|
3880
|
+
if (item instanceof RegExp) {
|
|
3881
|
+
if (options.assign === "regex") return ManifestItemCache.setAndReturn(item, options, item.toString());
|
|
3882
|
+
return ManifestItemCache.setAndReturn(item, options, { regex: item.toString() });
|
|
3883
|
+
}
|
|
3884
|
+
if (item[Common$20.symbols.literal]) return ManifestItemCache.setAndReturn(item, options, { function: item.literal });
|
|
3885
|
+
if (typeof item.describe === "function") {
|
|
3886
|
+
if (options.assign === "ref") return ManifestItemCache.setAndReturn(item, options, item.describe().ref);
|
|
3887
|
+
return ManifestItemCache.setAndReturn(item, options, item.describe());
|
|
3888
|
+
}
|
|
3889
|
+
const normalized = {};
|
|
3890
|
+
for (const key in item) {
|
|
3891
|
+
const value = item[key];
|
|
3892
|
+
if (value === void 0) continue;
|
|
3893
|
+
normalized[key] = internals$21.describe(value, { assign: key });
|
|
3894
|
+
}
|
|
3895
|
+
return ManifestItemCache.setAndReturn(item, options, normalized);
|
|
3896
|
+
};
|
|
3897
|
+
exports.build = function(joi, desc$1) {
|
|
3898
|
+
const builder = new internals$21.Builder(joi);
|
|
3899
|
+
return builder.parse(desc$1);
|
|
3900
|
+
};
|
|
3901
|
+
internals$21.Builder = class {
|
|
3902
|
+
constructor(joi) {
|
|
3903
|
+
this.joi = joi;
|
|
3904
|
+
}
|
|
3905
|
+
parse(desc$1) {
|
|
3906
|
+
internals$21.validate(this.joi, desc$1);
|
|
3907
|
+
let schema$2 = this.joi[desc$1.type]()._bare();
|
|
3908
|
+
const def = schema$2._definition;
|
|
3909
|
+
if (desc$1.flags) for (const flag in desc$1.flags) {
|
|
3910
|
+
const setter = def.flags[flag] && def.flags[flag].setter || flag;
|
|
3911
|
+
assert$47(typeof schema$2[setter] === "function", "Invalid flag", flag, "for type", desc$1.type);
|
|
3912
|
+
schema$2 = schema$2[setter](this.build(desc$1.flags[flag]));
|
|
3913
|
+
}
|
|
3914
|
+
if (desc$1.preferences) schema$2 = schema$2.preferences(this.build(desc$1.preferences));
|
|
3915
|
+
if (desc$1.allow) schema$2 = schema$2.allow(...this.build(desc$1.allow));
|
|
3916
|
+
if (desc$1.invalid) schema$2 = schema$2.invalid(...this.build(desc$1.invalid));
|
|
3917
|
+
if (desc$1.rules) for (const rule of desc$1.rules) {
|
|
3918
|
+
assert$47(typeof schema$2[rule.name] === "function", "Invalid rule", rule.name, "for type", desc$1.type);
|
|
3919
|
+
const args$1 = [];
|
|
3920
|
+
if (rule.args) {
|
|
3921
|
+
const built = {};
|
|
3922
|
+
for (const key in rule.args) built[key] = this.build(rule.args[key], { assign: key });
|
|
3923
|
+
const keys$10 = Object.keys(built);
|
|
3924
|
+
const definition = def.rules[rule.name].args;
|
|
3925
|
+
if (definition) {
|
|
3926
|
+
assert$47(keys$10.length <= definition.length, "Invalid number of arguments for", desc$1.type, rule.name, "(expected up to", definition.length, ", found", keys$10.length, ")");
|
|
3927
|
+
for (const { name: name$2 } of definition) args$1.push(built[name$2]);
|
|
3928
|
+
} else {
|
|
3929
|
+
assert$47(keys$10.length === 1, "Invalid number of arguments for", desc$1.type, rule.name, "(expected up to 1, found", keys$10.length, ")");
|
|
3930
|
+
args$1.push(built[keys$10[0]]);
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
schema$2 = schema$2[rule.name](...args$1);
|
|
3934
|
+
const options = {};
|
|
3935
|
+
for (const custom$1 in def.modifiers) if (rule[custom$1] !== void 0) options[custom$1] = this.build(rule[custom$1]);
|
|
3936
|
+
if (Object.keys(options).length) schema$2 = schema$2.rule(options);
|
|
3937
|
+
}
|
|
3938
|
+
const terms = {};
|
|
3939
|
+
for (const key in desc$1) {
|
|
3940
|
+
if ([
|
|
3941
|
+
"allow",
|
|
3942
|
+
"flags",
|
|
3943
|
+
"invalid",
|
|
3944
|
+
"whens",
|
|
3945
|
+
"preferences",
|
|
3946
|
+
"rules",
|
|
3947
|
+
"type"
|
|
3948
|
+
].includes(key)) continue;
|
|
3949
|
+
assert$47(def.terms[key], "Term", key, "missing configuration");
|
|
3950
|
+
const manifest = def.terms[key].manifest;
|
|
3951
|
+
if (manifest === "schema") {
|
|
3952
|
+
terms[key] = desc$1[key].map((item) => this.parse(item));
|
|
3953
|
+
continue;
|
|
3954
|
+
}
|
|
3955
|
+
if (manifest === "values") {
|
|
3956
|
+
terms[key] = desc$1[key].map((item) => this.build(item));
|
|
3957
|
+
continue;
|
|
3958
|
+
}
|
|
3959
|
+
if (manifest === "single") {
|
|
3960
|
+
terms[key] = this.build(desc$1[key]);
|
|
3961
|
+
continue;
|
|
3962
|
+
}
|
|
3963
|
+
if (typeof manifest === "object") {
|
|
3964
|
+
terms[key] = {};
|
|
3965
|
+
for (const name$2 in desc$1[key]) {
|
|
3966
|
+
const value = desc$1[key][name$2];
|
|
3967
|
+
terms[key][name$2] = this.parse(value);
|
|
3968
|
+
}
|
|
3969
|
+
continue;
|
|
3970
|
+
}
|
|
3971
|
+
terms[key] = this.build(desc$1[key]);
|
|
3972
|
+
}
|
|
3973
|
+
if (desc$1.whens) terms.whens = desc$1.whens.map((when) => this.build(when));
|
|
3974
|
+
schema$2 = def.manifest.build(schema$2, terms);
|
|
3975
|
+
schema$2.$_temp.ruleset = false;
|
|
3976
|
+
return schema$2;
|
|
3977
|
+
}
|
|
3978
|
+
build(desc$1, options = {}) {
|
|
3979
|
+
if (desc$1 === null) return null;
|
|
3980
|
+
if (Array.isArray(desc$1)) return desc$1.map((item) => this.build(item));
|
|
3981
|
+
if (desc$1 instanceof Error) return desc$1;
|
|
3982
|
+
if (options.assign === "options") return clone$15(desc$1);
|
|
3983
|
+
if (options.assign === "regex") return internals$21.regex(desc$1);
|
|
3984
|
+
if (options.assign === "ref") return Ref$10.build(desc$1);
|
|
3985
|
+
if (typeof desc$1 !== "object") return desc$1;
|
|
3986
|
+
if (Object.keys(desc$1).length === 1) {
|
|
3987
|
+
if (desc$1.buffer) {
|
|
3988
|
+
assert$47(import_manifest$2.default, "Buffers are not supported");
|
|
3989
|
+
return import_manifest$2.default && import_manifest$2.default.from(desc$1.buffer, "binary");
|
|
3990
|
+
}
|
|
3991
|
+
if (desc$1.function) return {
|
|
3992
|
+
[Common$20.symbols.literal]: true,
|
|
3993
|
+
literal: desc$1.function
|
|
3994
|
+
};
|
|
3995
|
+
if (desc$1.override) return Common$20.symbols.override;
|
|
3996
|
+
if (desc$1.ref) return Ref$10.build(desc$1.ref);
|
|
3997
|
+
if (desc$1.regex) return internals$21.regex(desc$1.regex);
|
|
3998
|
+
if (desc$1.special) {
|
|
3999
|
+
assert$47(["deep"].includes(desc$1.special), "Unknown special value", desc$1.special);
|
|
4000
|
+
return Common$20.symbols.deepDefault;
|
|
4001
|
+
}
|
|
4002
|
+
if (desc$1.value) return clone$15(desc$1.value);
|
|
4003
|
+
}
|
|
4004
|
+
if (desc$1.type) return this.parse(desc$1);
|
|
4005
|
+
if (desc$1.template) return Template$6.build(desc$1);
|
|
4006
|
+
const normalized = {};
|
|
4007
|
+
for (const key in desc$1) normalized[key] = this.build(desc$1[key], { assign: key });
|
|
4008
|
+
return normalized;
|
|
4009
|
+
}
|
|
4010
|
+
};
|
|
4011
|
+
internals$21.regex = function(string) {
|
|
4012
|
+
const end = string.lastIndexOf("/");
|
|
4013
|
+
const exp = string.slice(1, end);
|
|
4014
|
+
const flags = string.slice(end + 1);
|
|
4015
|
+
return new RegExp(exp, flags);
|
|
4016
|
+
};
|
|
4017
|
+
internals$21.validate = function(joi, desc$1) {
|
|
4018
|
+
Schemas$4 = Schemas$4 || import_manifest$3.default;
|
|
4019
|
+
joi.assert(desc$1, Schemas$4.description);
|
|
4020
|
+
};
|
|
4021
|
+
});
|
|
3767
4022
|
var require_manifest = __commonJSMin((exports) => {
|
|
3768
|
-
|
|
3769
|
-
const { assert: assert$46, clone: clone$14 } =
|
|
3770
|
-
const Common$19 =
|
|
3771
|
-
const Messages$5 =
|
|
3772
|
-
const Ref$9 =
|
|
3773
|
-
const Template$5 =
|
|
4023
|
+
var import_manifest$1 = __toESM(require_manifest$1());
|
|
4024
|
+
const { assert: assert$46, clone: clone$14 } = require_manifest$1();
|
|
4025
|
+
const Common$19 = require_manifest$1();
|
|
4026
|
+
const Messages$5 = require_manifest$1();
|
|
4027
|
+
const Ref$9 = require_manifest$1();
|
|
4028
|
+
const Template$5 = require_manifest$1();
|
|
3774
4029
|
let Schemas$3;
|
|
3775
4030
|
const internals$20 = {};
|
|
3776
4031
|
exports.describe = function(schema$2) {
|
|
@@ -3846,7 +4101,7 @@ var require_manifest = __commonJSMin((exports) => {
|
|
|
3846
4101
|
if (item === Common$19.symbols.deepDefault) return { special: "deep" };
|
|
3847
4102
|
if (typeof item !== "object" || item === null) return item;
|
|
3848
4103
|
if (options.assign === "options") return clone$14(item);
|
|
3849
|
-
if (
|
|
4104
|
+
if (import_manifest$1.default && import_manifest$1.default.isBuffer(item)) return { buffer: item.toString("binary") };
|
|
3850
4105
|
if (item instanceof Date) return item.toISOString();
|
|
3851
4106
|
if (item instanceof Error) return item;
|
|
3852
4107
|
if (item instanceof RegExp) {
|
|
@@ -3957,8 +4212,8 @@ var require_manifest = __commonJSMin((exports) => {
|
|
|
3957
4212
|
if (typeof desc$1 !== "object") return desc$1;
|
|
3958
4213
|
if (Object.keys(desc$1).length === 1) {
|
|
3959
4214
|
if (desc$1.buffer) {
|
|
3960
|
-
assert$46(
|
|
3961
|
-
return
|
|
4215
|
+
assert$46(import_manifest$1.default, "Buffers are not supported");
|
|
4216
|
+
return import_manifest$1.default && import_manifest$1.default.from(desc$1.buffer, "binary");
|
|
3962
4217
|
}
|
|
3963
4218
|
if (desc$1.function) return {
|
|
3964
4219
|
[Common$19.symbols.literal]: true,
|
|
@@ -3987,7 +4242,7 @@ var require_manifest = __commonJSMin((exports) => {
|
|
|
3987
4242
|
return new RegExp(exp, flags);
|
|
3988
4243
|
};
|
|
3989
4244
|
internals$20.validate = function(joi, desc$1) {
|
|
3990
|
-
Schemas$3 = Schemas$3 ||
|
|
4245
|
+
Schemas$3 = Schemas$3 || require_manifest$1();
|
|
3991
4246
|
joi.assert(desc$1, Schemas$3.description);
|
|
3992
4247
|
};
|
|
3993
4248
|
});
|
|
@@ -4243,11 +4498,11 @@ var require_modify = __commonJSMin((exports) => {
|
|
|
4243
4498
|
this._schemaChain = false;
|
|
4244
4499
|
}
|
|
4245
4500
|
clone() {
|
|
4246
|
-
const clone$
|
|
4247
|
-
clone$
|
|
4248
|
-
clone$
|
|
4249
|
-
clone$
|
|
4250
|
-
return clone$
|
|
4501
|
+
const clone$21 = new internals$18.Ids();
|
|
4502
|
+
clone$21._byId = new Map(this._byId);
|
|
4503
|
+
clone$21._byKey = new Map(this._byKey);
|
|
4504
|
+
clone$21._schemaChain = this._schemaChain;
|
|
4505
|
+
return clone$21;
|
|
4251
4506
|
}
|
|
4252
4507
|
concat(source) {
|
|
4253
4508
|
if (source._schemaChain) this._schemaChain = true;
|
|
@@ -4363,11 +4618,11 @@ var require_modify = __commonJSMin((exports) => {
|
|
|
4363
4618
|
}, options);
|
|
4364
4619
|
if (result !== void 0) {
|
|
4365
4620
|
obj = obj || schema$2.clone();
|
|
4366
|
-
const clone$
|
|
4367
|
-
clone$
|
|
4368
|
-
obj._rules[i$4] = clone$
|
|
4621
|
+
const clone$21 = Object.assign({}, rule);
|
|
4622
|
+
clone$21.args = result;
|
|
4623
|
+
obj._rules[i$4] = clone$21;
|
|
4369
4624
|
const existingUnique = obj._singleRules.get(rule.name);
|
|
4370
|
-
if (existingUnique === rule) obj._singleRules.set(rule.name, clone$
|
|
4625
|
+
if (existingUnique === rule) obj._singleRules.set(rule.name, clone$21);
|
|
4371
4626
|
}
|
|
4372
4627
|
}
|
|
4373
4628
|
for (const name$2 in schema$2.$_terms) {
|
|
@@ -4386,17 +4641,17 @@ var require_modify = __commonJSMin((exports) => {
|
|
|
4386
4641
|
internals$18.scan = function(item, source, options, _path, _key) {
|
|
4387
4642
|
const path = _path || [];
|
|
4388
4643
|
if (item === null || typeof item !== "object") return;
|
|
4389
|
-
let clone$
|
|
4644
|
+
let clone$21;
|
|
4390
4645
|
if (Array.isArray(item)) {
|
|
4391
4646
|
for (let i$4 = 0; i$4 < item.length; ++i$4) {
|
|
4392
4647
|
const key = source.source === "terms" && source.name === "keys" && item[i$4].key;
|
|
4393
4648
|
const result = internals$18.scan(item[i$4], source, options, [i$4, ...path], key);
|
|
4394
4649
|
if (result !== void 0) {
|
|
4395
|
-
clone$
|
|
4396
|
-
clone$
|
|
4650
|
+
clone$21 = clone$21 || item.slice();
|
|
4651
|
+
clone$21[i$4] = result;
|
|
4397
4652
|
}
|
|
4398
4653
|
}
|
|
4399
|
-
return clone$
|
|
4654
|
+
return clone$21;
|
|
4400
4655
|
}
|
|
4401
4656
|
if (options.schema !== false && Common$18.isSchema(item) || options.ref !== false && Ref$8.isRef(item)) {
|
|
4402
4657
|
const result = options.each(item, {
|
|
@@ -4411,11 +4666,11 @@ var require_modify = __commonJSMin((exports) => {
|
|
|
4411
4666
|
if (key[0] === "_") continue;
|
|
4412
4667
|
const result = internals$18.scan(item[key], source, options, [key, ...path], _key);
|
|
4413
4668
|
if (result !== void 0) {
|
|
4414
|
-
clone$
|
|
4415
|
-
clone$
|
|
4669
|
+
clone$21 = clone$21 || Object.assign({}, item);
|
|
4670
|
+
clone$21[key] = result;
|
|
4416
4671
|
}
|
|
4417
4672
|
}
|
|
4418
|
-
return clone$
|
|
4673
|
+
return clone$21;
|
|
4419
4674
|
};
|
|
4420
4675
|
});
|
|
4421
4676
|
var require_state$1 = __commonJSMin((exports, module) => {
|
|
@@ -7336,24 +7591,24 @@ var require_keys$1 = __commonJSMin((exports, module) => {
|
|
|
7336
7591
|
internals$8.clone = function(value, prefs) {
|
|
7337
7592
|
if (typeof value === "object") {
|
|
7338
7593
|
if (prefs.nonEnumerables) return Clone(value, { shallow: true });
|
|
7339
|
-
const clone$
|
|
7340
|
-
Object.assign(clone$
|
|
7341
|
-
return clone$
|
|
7594
|
+
const clone$22 = Object.create(Object.getPrototypeOf(value));
|
|
7595
|
+
Object.assign(clone$22, value);
|
|
7596
|
+
return clone$22;
|
|
7342
7597
|
}
|
|
7343
|
-
const clone$
|
|
7598
|
+
const clone$21 = function(...args$1) {
|
|
7344
7599
|
return value.apply(this, args$1);
|
|
7345
7600
|
};
|
|
7346
|
-
clone$
|
|
7347
|
-
Object.defineProperty(clone$
|
|
7601
|
+
clone$21.prototype = Clone(value.prototype);
|
|
7602
|
+
Object.defineProperty(clone$21, "name", {
|
|
7348
7603
|
value: value.name,
|
|
7349
7604
|
writable: false
|
|
7350
7605
|
});
|
|
7351
|
-
Object.defineProperty(clone$
|
|
7606
|
+
Object.defineProperty(clone$21, "length", {
|
|
7352
7607
|
value: value.length,
|
|
7353
7608
|
writable: false
|
|
7354
7609
|
});
|
|
7355
|
-
Object.assign(clone$
|
|
7356
|
-
return clone$
|
|
7610
|
+
Object.assign(clone$21, value);
|
|
7611
|
+
return clone$21;
|
|
7357
7612
|
};
|
|
7358
7613
|
internals$8.dependency = function(schema$2, rel, key, peers, options) {
|
|
7359
7614
|
assert$35(key === null || typeof key === "string", rel, "key must be a strings");
|
|
@@ -13444,12 +13699,12 @@ var require_common$3 = __commonJSMin((exports) => {
|
|
|
13444
13699
|
throw err$1;
|
|
13445
13700
|
}
|
|
13446
13701
|
};
|
|
13447
|
-
exports.validateArg = function(value, label, { assert: assert$
|
|
13448
|
-
if (exports.isSchema(assert$
|
|
13449
|
-
const result = assert$
|
|
13702
|
+
exports.validateArg = function(value, label, { assert: assert$55, message }) {
|
|
13703
|
+
if (exports.isSchema(assert$55)) {
|
|
13704
|
+
const result = assert$55.validate(value);
|
|
13450
13705
|
if (!result.error) return;
|
|
13451
13706
|
return result.error.message;
|
|
13452
|
-
} else if (!assert$
|
|
13707
|
+
} else if (!assert$55(value)) return label ? `${label} ${message}` : message;
|
|
13453
13708
|
};
|
|
13454
13709
|
exports.verifyFlat = function(args$1, method$1) {
|
|
13455
13710
|
for (const arg of args$1) Assert(!Array.isArray(arg), "Method no longer accepts array arguments:", method$1);
|
|
@@ -13703,20 +13958,6 @@ Object.defineProperty(import_errors$1.default, "template", { value: function(val
|
|
|
13703
13958
|
if (!messages$3[code$2]) return messages$3["*"];
|
|
13704
13959
|
return messages$3[code$2];
|
|
13705
13960
|
} });
|
|
13706
|
-
var import_manifest$1 = __toESM(require_manifest());
|
|
13707
|
-
const ManifestDescriptionCache = new WeakMap();
|
|
13708
|
-
const originalDescribe = import_manifest$1.default.describe;
|
|
13709
|
-
Object.defineProperty(import_manifest$1.default, "describe", {
|
|
13710
|
-
value: function(schema$2) {
|
|
13711
|
-
const cached = ManifestDescriptionCache.get(schema$2);
|
|
13712
|
-
if (cached) return cached;
|
|
13713
|
-
const result = originalDescribe.call(this, schema$2);
|
|
13714
|
-
ManifestDescriptionCache.set(schema$2, result);
|
|
13715
|
-
return result;
|
|
13716
|
-
},
|
|
13717
|
-
writable: true,
|
|
13718
|
-
configurable: true
|
|
13719
|
-
});
|
|
13720
13961
|
const json = (root$11) => {
|
|
13721
13962
|
return root$11;
|
|
13722
13963
|
};
|
|
@@ -32766,7 +33007,7 @@ var init_package = __esmMin(() => {
|
|
|
32766
33007
|
var require_bn$1 = __commonJSMin((exports, module) => {
|
|
32767
33008
|
(function(module$1, exports$1) {
|
|
32768
33009
|
"use strict";
|
|
32769
|
-
function assert$
|
|
33010
|
+
function assert$55(val, msg) {
|
|
32770
33011
|
if (!val) throw new Error(msg || "Assertion failed");
|
|
32771
33012
|
}
|
|
32772
33013
|
function inherits$14(ctor, superCtor) {
|
|
@@ -32794,10 +33035,10 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
32794
33035
|
else exports$1.BN = BN$14;
|
|
32795
33036
|
BN$14.BN = BN$14;
|
|
32796
33037
|
BN$14.wordSize = 26;
|
|
32797
|
-
var Buffer$
|
|
33038
|
+
var Buffer$29;
|
|
32798
33039
|
try {
|
|
32799
|
-
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$
|
|
32800
|
-
else Buffer$
|
|
33040
|
+
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$29 = window.Buffer;
|
|
33041
|
+
else Buffer$29 = (init_dist$1(), __toCommonJS(dist_exports)).Buffer;
|
|
32801
33042
|
} catch (e$2) {}
|
|
32802
33043
|
BN$14.isBN = function isBN(num) {
|
|
32803
33044
|
if (num instanceof BN$14) return true;
|
|
@@ -32815,7 +33056,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
32815
33056
|
if (typeof number === "number") return this._initNumber(number, base$3, endian);
|
|
32816
33057
|
if (typeof number === "object") return this._initArray(number, base$3, endian);
|
|
32817
33058
|
if (base$3 === "hex") base$3 = 16;
|
|
32818
|
-
assert$
|
|
33059
|
+
assert$55(base$3 === (base$3 | 0) && base$3 >= 2 && base$3 <= 36);
|
|
32819
33060
|
number = number.toString().replace(/\s+/g, "");
|
|
32820
33061
|
var start = 0;
|
|
32821
33062
|
if (number[0] === "-") {
|
|
@@ -32840,7 +33081,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
32840
33081
|
this.words = [number & 67108863, number / 67108864 & 67108863];
|
|
32841
33082
|
this.length = 2;
|
|
32842
33083
|
} else {
|
|
32843
|
-
assert$
|
|
33084
|
+
assert$55(number < 9007199254740992);
|
|
32844
33085
|
this.words = [
|
|
32845
33086
|
number & 67108863,
|
|
32846
33087
|
number / 67108864 & 67108863,
|
|
@@ -32852,7 +33093,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
32852
33093
|
this._initArray(this.toArray(), base$3, endian);
|
|
32853
33094
|
};
|
|
32854
33095
|
BN$14.prototype._initArray = function _initArray(number, base$3, endian) {
|
|
32855
|
-
assert$
|
|
33096
|
+
assert$55(typeof number.length === "number");
|
|
32856
33097
|
if (number.length <= 0) {
|
|
32857
33098
|
this.words = [0];
|
|
32858
33099
|
this.length = 1;
|
|
@@ -32971,7 +33212,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
32971
33212
|
dest.negative = this.negative;
|
|
32972
33213
|
dest.red = this.red;
|
|
32973
33214
|
};
|
|
32974
|
-
BN$14.prototype.clone = function clone$
|
|
33215
|
+
BN$14.prototype.clone = function clone$21() {
|
|
32975
33216
|
var r$2 = new BN$14(null);
|
|
32976
33217
|
this.copy(r$2);
|
|
32977
33218
|
return r$2;
|
|
@@ -33139,21 +33380,21 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33139
33380
|
if (this.negative !== 0) out = "-" + out;
|
|
33140
33381
|
return out;
|
|
33141
33382
|
}
|
|
33142
|
-
assert$
|
|
33383
|
+
assert$55(false, "Base should be between 2 and 36");
|
|
33143
33384
|
};
|
|
33144
33385
|
BN$14.prototype.toNumber = function toNumber$8() {
|
|
33145
33386
|
var ret = this.words[0];
|
|
33146
33387
|
if (this.length === 2) ret += this.words[1] * 67108864;
|
|
33147
33388
|
else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864;
|
|
33148
|
-
else if (this.length > 2) assert$
|
|
33389
|
+
else if (this.length > 2) assert$55(false, "Number can only safely store up to 53 bits");
|
|
33149
33390
|
return this.negative !== 0 ? -ret : ret;
|
|
33150
33391
|
};
|
|
33151
33392
|
BN$14.prototype.toJSON = function toJSON() {
|
|
33152
33393
|
return this.toString(16);
|
|
33153
33394
|
};
|
|
33154
33395
|
BN$14.prototype.toBuffer = function toBuffer$5(endian, length) {
|
|
33155
|
-
assert$
|
|
33156
|
-
return this.toArrayLike(Buffer$
|
|
33396
|
+
assert$55(typeof Buffer$29 !== "undefined");
|
|
33397
|
+
return this.toArrayLike(Buffer$29, endian, length);
|
|
33157
33398
|
};
|
|
33158
33399
|
BN$14.prototype.toArray = function toArray$8(endian, length) {
|
|
33159
33400
|
return this.toArrayLike(Array, endian, length);
|
|
@@ -33161,8 +33402,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33161
33402
|
BN$14.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
|
|
33162
33403
|
var byteLength$2 = this.byteLength();
|
|
33163
33404
|
var reqLength = length || Math.max(1, byteLength$2);
|
|
33164
|
-
assert$
|
|
33165
|
-
assert$
|
|
33405
|
+
assert$55(byteLength$2 <= reqLength, "byte array longer than desired length");
|
|
33406
|
+
assert$55(reqLength > 0, "Requested array length <= 0");
|
|
33166
33407
|
this.strip();
|
|
33167
33408
|
var littleEndian = endian === "le";
|
|
33168
33409
|
var res = new ArrayType(reqLength);
|
|
@@ -33283,7 +33524,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33283
33524
|
return this.strip();
|
|
33284
33525
|
};
|
|
33285
33526
|
BN$14.prototype.ior = function ior(num) {
|
|
33286
|
-
assert$
|
|
33527
|
+
assert$55((this.negative | num.negative) === 0);
|
|
33287
33528
|
return this.iuor(num);
|
|
33288
33529
|
};
|
|
33289
33530
|
BN$14.prototype.or = function or(num) {
|
|
@@ -33303,7 +33544,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33303
33544
|
return this.strip();
|
|
33304
33545
|
};
|
|
33305
33546
|
BN$14.prototype.iand = function iand(num) {
|
|
33306
|
-
assert$
|
|
33547
|
+
assert$55((this.negative | num.negative) === 0);
|
|
33307
33548
|
return this.iuand(num);
|
|
33308
33549
|
};
|
|
33309
33550
|
BN$14.prototype.and = function and(num) {
|
|
@@ -33330,7 +33571,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33330
33571
|
return this.strip();
|
|
33331
33572
|
};
|
|
33332
33573
|
BN$14.prototype.ixor = function ixor(num) {
|
|
33333
|
-
assert$
|
|
33574
|
+
assert$55((this.negative | num.negative) === 0);
|
|
33334
33575
|
return this.iuxor(num);
|
|
33335
33576
|
};
|
|
33336
33577
|
BN$14.prototype.xor = function xor$2(num) {
|
|
@@ -33342,7 +33583,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33342
33583
|
return num.clone().iuxor(this);
|
|
33343
33584
|
};
|
|
33344
33585
|
BN$14.prototype.inotn = function inotn(width) {
|
|
33345
|
-
assert$
|
|
33586
|
+
assert$55(typeof width === "number" && width >= 0);
|
|
33346
33587
|
var bytesNeeded = Math.ceil(width / 26) | 0;
|
|
33347
33588
|
var bitsLeft = width % 26;
|
|
33348
33589
|
this._expand(bytesNeeded);
|
|
@@ -33355,7 +33596,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
33355
33596
|
return this.clone().inotn(width);
|
|
33356
33597
|
};
|
|
33357
33598
|
BN$14.prototype.setn = function setn(bit, val) {
|
|
33358
|
-
assert$
|
|
33599
|
+
assert$55(typeof bit === "number" && bit >= 0);
|
|
33359
33600
|
var off = bit / 26 | 0;
|
|
33360
33601
|
var wbit = bit % 26;
|
|
33361
33602
|
this._expand(off + 1);
|
|
@@ -34184,8 +34425,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34184
34425
|
carry = carry >>> 13;
|
|
34185
34426
|
}
|
|
34186
34427
|
for (i$4 = 2 * len$2; i$4 < N; ++i$4) rws[i$4] = 0;
|
|
34187
|
-
assert$
|
|
34188
|
-
assert$
|
|
34428
|
+
assert$55(carry === 0);
|
|
34429
|
+
assert$55((carry & -8192) === 0);
|
|
34189
34430
|
};
|
|
34190
34431
|
FFTM.prototype.stub = function stub(N) {
|
|
34191
34432
|
var ph = new Array(N);
|
|
@@ -34235,8 +34476,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34235
34476
|
return this.clone().mulTo(num, this);
|
|
34236
34477
|
};
|
|
34237
34478
|
BN$14.prototype.imuln = function imuln(num) {
|
|
34238
|
-
assert$
|
|
34239
|
-
assert$
|
|
34479
|
+
assert$55(typeof num === "number");
|
|
34480
|
+
assert$55(num < 67108864);
|
|
34240
34481
|
var carry = 0;
|
|
34241
34482
|
for (var i$4 = 0; i$4 < this.length; i$4++) {
|
|
34242
34483
|
var w$1 = (this.words[i$4] | 0) * num;
|
|
@@ -34274,7 +34515,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34274
34515
|
return res;
|
|
34275
34516
|
};
|
|
34276
34517
|
BN$14.prototype.iushln = function iushln(bits$1) {
|
|
34277
|
-
assert$
|
|
34518
|
+
assert$55(typeof bits$1 === "number" && bits$1 >= 0);
|
|
34278
34519
|
var r$2 = bits$1 % 26;
|
|
34279
34520
|
var s$6 = (bits$1 - r$2) / 26;
|
|
34280
34521
|
var carryMask = 67108863 >>> 26 - r$2 << 26 - r$2;
|
|
@@ -34300,11 +34541,11 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34300
34541
|
return this.strip();
|
|
34301
34542
|
};
|
|
34302
34543
|
BN$14.prototype.ishln = function ishln(bits$1) {
|
|
34303
|
-
assert$
|
|
34544
|
+
assert$55(this.negative === 0);
|
|
34304
34545
|
return this.iushln(bits$1);
|
|
34305
34546
|
};
|
|
34306
34547
|
BN$14.prototype.iushrn = function iushrn(bits$1, hint, extended) {
|
|
34307
|
-
assert$
|
|
34548
|
+
assert$55(typeof bits$1 === "number" && bits$1 >= 0);
|
|
34308
34549
|
var h$1;
|
|
34309
34550
|
if (hint) h$1 = (hint - hint % 26) / 26;
|
|
34310
34551
|
else h$1 = 0;
|
|
@@ -34339,7 +34580,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34339
34580
|
return this.strip();
|
|
34340
34581
|
};
|
|
34341
34582
|
BN$14.prototype.ishrn = function ishrn(bits$1, hint, extended) {
|
|
34342
|
-
assert$
|
|
34583
|
+
assert$55(this.negative === 0);
|
|
34343
34584
|
return this.iushrn(bits$1, hint, extended);
|
|
34344
34585
|
};
|
|
34345
34586
|
BN$14.prototype.shln = function shln(bits$1) {
|
|
@@ -34355,7 +34596,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34355
34596
|
return this.clone().iushrn(bits$1);
|
|
34356
34597
|
};
|
|
34357
34598
|
BN$14.prototype.testn = function testn(bit) {
|
|
34358
|
-
assert$
|
|
34599
|
+
assert$55(typeof bit === "number" && bit >= 0);
|
|
34359
34600
|
var r$2 = bit % 26;
|
|
34360
34601
|
var s$6 = (bit - r$2) / 26;
|
|
34361
34602
|
var q = 1 << r$2;
|
|
@@ -34364,10 +34605,10 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34364
34605
|
return !!(w$1 & q);
|
|
34365
34606
|
};
|
|
34366
34607
|
BN$14.prototype.imaskn = function imaskn(bits$1) {
|
|
34367
|
-
assert$
|
|
34608
|
+
assert$55(typeof bits$1 === "number" && bits$1 >= 0);
|
|
34368
34609
|
var r$2 = bits$1 % 26;
|
|
34369
34610
|
var s$6 = (bits$1 - r$2) / 26;
|
|
34370
|
-
assert$
|
|
34611
|
+
assert$55(this.negative === 0, "imaskn works only with positive numbers");
|
|
34371
34612
|
if (this.length <= s$6) return this;
|
|
34372
34613
|
if (r$2 !== 0) s$6++;
|
|
34373
34614
|
this.length = Math.min(s$6, this.length);
|
|
@@ -34381,8 +34622,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34381
34622
|
return this.clone().imaskn(bits$1);
|
|
34382
34623
|
};
|
|
34383
34624
|
BN$14.prototype.iaddn = function iaddn(num) {
|
|
34384
|
-
assert$
|
|
34385
|
-
assert$
|
|
34625
|
+
assert$55(typeof num === "number");
|
|
34626
|
+
assert$55(num < 67108864);
|
|
34386
34627
|
if (num < 0) return this.isubn(-num);
|
|
34387
34628
|
if (this.negative !== 0) {
|
|
34388
34629
|
if (this.length === 1 && (this.words[0] | 0) < num) {
|
|
@@ -34408,8 +34649,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34408
34649
|
return this;
|
|
34409
34650
|
};
|
|
34410
34651
|
BN$14.prototype.isubn = function isubn(num) {
|
|
34411
|
-
assert$
|
|
34412
|
-
assert$
|
|
34652
|
+
assert$55(typeof num === "number");
|
|
34653
|
+
assert$55(num < 67108864);
|
|
34413
34654
|
if (num < 0) return this.iaddn(-num);
|
|
34414
34655
|
if (this.negative !== 0) {
|
|
34415
34656
|
this.negative = 0;
|
|
@@ -34459,7 +34700,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34459
34700
|
this.words[i$4 + shift] = w$1 & 67108863;
|
|
34460
34701
|
}
|
|
34461
34702
|
if (carry === 0) return this.strip();
|
|
34462
|
-
assert$
|
|
34703
|
+
assert$55(carry === -1);
|
|
34463
34704
|
carry = 0;
|
|
34464
34705
|
for (i$4 = 0; i$4 < this.length; i$4++) {
|
|
34465
34706
|
w$1 = -(this.words[i$4] | 0) + carry;
|
|
@@ -34515,7 +34756,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34515
34756
|
};
|
|
34516
34757
|
};
|
|
34517
34758
|
BN$14.prototype.divmod = function divmod(num, mode, positive) {
|
|
34518
|
-
assert$
|
|
34759
|
+
assert$55(!num.isZero());
|
|
34519
34760
|
if (this.isZero()) return {
|
|
34520
34761
|
div: new BN$14(0),
|
|
34521
34762
|
mod: new BN$14(0)
|
|
@@ -34592,14 +34833,14 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34592
34833
|
return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
|
|
34593
34834
|
};
|
|
34594
34835
|
BN$14.prototype.modn = function modn(num) {
|
|
34595
|
-
assert$
|
|
34836
|
+
assert$55(num <= 67108863);
|
|
34596
34837
|
var p$1 = (1 << 26) % num;
|
|
34597
34838
|
var acc = 0;
|
|
34598
34839
|
for (var i$4 = this.length - 1; i$4 >= 0; i$4--) acc = (p$1 * acc + (this.words[i$4] | 0)) % num;
|
|
34599
34840
|
return acc;
|
|
34600
34841
|
};
|
|
34601
34842
|
BN$14.prototype.idivn = function idivn(num) {
|
|
34602
|
-
assert$
|
|
34843
|
+
assert$55(num <= 67108863);
|
|
34603
34844
|
var carry = 0;
|
|
34604
34845
|
for (var i$4 = this.length - 1; i$4 >= 0; i$4--) {
|
|
34605
34846
|
var w$1 = (this.words[i$4] | 0) + carry * 67108864;
|
|
@@ -34612,8 +34853,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34612
34853
|
return this.clone().idivn(num);
|
|
34613
34854
|
};
|
|
34614
34855
|
BN$14.prototype.egcd = function egcd(p$1) {
|
|
34615
|
-
assert$
|
|
34616
|
-
assert$
|
|
34856
|
+
assert$55(p$1.negative === 0);
|
|
34857
|
+
assert$55(!p$1.isZero());
|
|
34617
34858
|
var x$1 = this;
|
|
34618
34859
|
var y$1 = p$1.clone();
|
|
34619
34860
|
if (x$1.negative !== 0) x$1 = x$1.umod(p$1);
|
|
@@ -34672,8 +34913,8 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34672
34913
|
};
|
|
34673
34914
|
};
|
|
34674
34915
|
BN$14.prototype._invmp = function _invmp(p$1) {
|
|
34675
|
-
assert$
|
|
34676
|
-
assert$
|
|
34916
|
+
assert$55(p$1.negative === 0);
|
|
34917
|
+
assert$55(!p$1.isZero());
|
|
34677
34918
|
var a$2 = this;
|
|
34678
34919
|
var b = p$1.clone();
|
|
34679
34920
|
if (a$2.negative !== 0) a$2 = a$2.umod(p$1);
|
|
@@ -34749,7 +34990,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34749
34990
|
return this.words[0] & num;
|
|
34750
34991
|
};
|
|
34751
34992
|
BN$14.prototype.bincn = function bincn(bit) {
|
|
34752
|
-
assert$
|
|
34993
|
+
assert$55(typeof bit === "number");
|
|
34753
34994
|
var r$2 = bit % 26;
|
|
34754
34995
|
var s$6 = (bit - r$2) / 26;
|
|
34755
34996
|
var q = 1 << r$2;
|
|
@@ -34784,7 +35025,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34784
35025
|
if (this.length > 1) res = 1;
|
|
34785
35026
|
else {
|
|
34786
35027
|
if (negative) num = -num;
|
|
34787
|
-
assert$
|
|
35028
|
+
assert$55(num <= 67108863, "Number is too big");
|
|
34788
35029
|
var w$1 = this.words[0] | 0;
|
|
34789
35030
|
res = w$1 === num ? 0 : w$1 < num ? -1 : 1;
|
|
34790
35031
|
}
|
|
@@ -34846,12 +35087,12 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34846
35087
|
return new Red(num);
|
|
34847
35088
|
};
|
|
34848
35089
|
BN$14.prototype.toRed = function toRed(ctx) {
|
|
34849
|
-
assert$
|
|
34850
|
-
assert$
|
|
35090
|
+
assert$55(!this.red, "Already a number in reduction context");
|
|
35091
|
+
assert$55(this.negative === 0, "red works only with positives");
|
|
34851
35092
|
return ctx.convertTo(this)._forceRed(ctx);
|
|
34852
35093
|
};
|
|
34853
35094
|
BN$14.prototype.fromRed = function fromRed() {
|
|
34854
|
-
assert$
|
|
35095
|
+
assert$55(this.red, "fromRed works only with numbers in reduction context");
|
|
34855
35096
|
return this.red.convertFrom(this);
|
|
34856
35097
|
};
|
|
34857
35098
|
BN$14.prototype._forceRed = function _forceRed(ctx) {
|
|
@@ -34859,66 +35100,66 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
34859
35100
|
return this;
|
|
34860
35101
|
};
|
|
34861
35102
|
BN$14.prototype.forceRed = function forceRed(ctx) {
|
|
34862
|
-
assert$
|
|
35103
|
+
assert$55(!this.red, "Already a number in reduction context");
|
|
34863
35104
|
return this._forceRed(ctx);
|
|
34864
35105
|
};
|
|
34865
35106
|
BN$14.prototype.redAdd = function redAdd(num) {
|
|
34866
|
-
assert$
|
|
35107
|
+
assert$55(this.red, "redAdd works only with red numbers");
|
|
34867
35108
|
return this.red.add(this, num);
|
|
34868
35109
|
};
|
|
34869
35110
|
BN$14.prototype.redIAdd = function redIAdd(num) {
|
|
34870
|
-
assert$
|
|
35111
|
+
assert$55(this.red, "redIAdd works only with red numbers");
|
|
34871
35112
|
return this.red.iadd(this, num);
|
|
34872
35113
|
};
|
|
34873
35114
|
BN$14.prototype.redSub = function redSub(num) {
|
|
34874
|
-
assert$
|
|
35115
|
+
assert$55(this.red, "redSub works only with red numbers");
|
|
34875
35116
|
return this.red.sub(this, num);
|
|
34876
35117
|
};
|
|
34877
35118
|
BN$14.prototype.redISub = function redISub(num) {
|
|
34878
|
-
assert$
|
|
35119
|
+
assert$55(this.red, "redISub works only with red numbers");
|
|
34879
35120
|
return this.red.isub(this, num);
|
|
34880
35121
|
};
|
|
34881
35122
|
BN$14.prototype.redShl = function redShl(num) {
|
|
34882
|
-
assert$
|
|
35123
|
+
assert$55(this.red, "redShl works only with red numbers");
|
|
34883
35124
|
return this.red.shl(this, num);
|
|
34884
35125
|
};
|
|
34885
35126
|
BN$14.prototype.redMul = function redMul(num) {
|
|
34886
|
-
assert$
|
|
35127
|
+
assert$55(this.red, "redMul works only with red numbers");
|
|
34887
35128
|
this.red._verify2(this, num);
|
|
34888
35129
|
return this.red.mul(this, num);
|
|
34889
35130
|
};
|
|
34890
35131
|
BN$14.prototype.redIMul = function redIMul(num) {
|
|
34891
|
-
assert$
|
|
35132
|
+
assert$55(this.red, "redMul works only with red numbers");
|
|
34892
35133
|
this.red._verify2(this, num);
|
|
34893
35134
|
return this.red.imul(this, num);
|
|
34894
35135
|
};
|
|
34895
35136
|
BN$14.prototype.redSqr = function redSqr() {
|
|
34896
|
-
assert$
|
|
35137
|
+
assert$55(this.red, "redSqr works only with red numbers");
|
|
34897
35138
|
this.red._verify1(this);
|
|
34898
35139
|
return this.red.sqr(this);
|
|
34899
35140
|
};
|
|
34900
35141
|
BN$14.prototype.redISqr = function redISqr() {
|
|
34901
|
-
assert$
|
|
35142
|
+
assert$55(this.red, "redISqr works only with red numbers");
|
|
34902
35143
|
this.red._verify1(this);
|
|
34903
35144
|
return this.red.isqr(this);
|
|
34904
35145
|
};
|
|
34905
35146
|
BN$14.prototype.redSqrt = function redSqrt() {
|
|
34906
|
-
assert$
|
|
35147
|
+
assert$55(this.red, "redSqrt works only with red numbers");
|
|
34907
35148
|
this.red._verify1(this);
|
|
34908
35149
|
return this.red.sqrt(this);
|
|
34909
35150
|
};
|
|
34910
35151
|
BN$14.prototype.redInvm = function redInvm() {
|
|
34911
|
-
assert$
|
|
35152
|
+
assert$55(this.red, "redInvm works only with red numbers");
|
|
34912
35153
|
this.red._verify1(this);
|
|
34913
35154
|
return this.red.invm(this);
|
|
34914
35155
|
};
|
|
34915
35156
|
BN$14.prototype.redNeg = function redNeg() {
|
|
34916
|
-
assert$
|
|
35157
|
+
assert$55(this.red, "redNeg works only with red numbers");
|
|
34917
35158
|
this.red._verify1(this);
|
|
34918
35159
|
return this.red.neg(this);
|
|
34919
35160
|
};
|
|
34920
35161
|
BN$14.prototype.redPow = function redPow(num) {
|
|
34921
|
-
assert$
|
|
35162
|
+
assert$55(this.red && !num.red, "redPow(normalNum)");
|
|
34922
35163
|
this.red._verify1(this);
|
|
34923
35164
|
return this.red.pow(this, num);
|
|
34924
35165
|
};
|
|
@@ -35048,18 +35289,18 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
35048
35289
|
this.m = prime.p;
|
|
35049
35290
|
this.prime = prime;
|
|
35050
35291
|
} else {
|
|
35051
|
-
assert$
|
|
35292
|
+
assert$55(m$3.gtn(1), "modulus must be greater than 1");
|
|
35052
35293
|
this.m = m$3;
|
|
35053
35294
|
this.prime = null;
|
|
35054
35295
|
}
|
|
35055
35296
|
}
|
|
35056
35297
|
Red.prototype._verify1 = function _verify1(a$2) {
|
|
35057
|
-
assert$
|
|
35058
|
-
assert$
|
|
35298
|
+
assert$55(a$2.negative === 0, "red works only with positives");
|
|
35299
|
+
assert$55(a$2.red, "red works only with red numbers");
|
|
35059
35300
|
};
|
|
35060
35301
|
Red.prototype._verify2 = function _verify2(a$2, b) {
|
|
35061
|
-
assert$
|
|
35062
|
-
assert$
|
|
35302
|
+
assert$55((a$2.negative | b.negative) === 0, "red works only with positives");
|
|
35303
|
+
assert$55(a$2.red && a$2.red === b.red, "red works only with red numbers");
|
|
35063
35304
|
};
|
|
35064
35305
|
Red.prototype.imod = function imod(a$2) {
|
|
35065
35306
|
if (this.prime) return this.prime.ireduce(a$2)._forceRed(this);
|
|
@@ -35114,7 +35355,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
35114
35355
|
Red.prototype.sqrt = function sqrt(a$2) {
|
|
35115
35356
|
if (a$2.isZero()) return a$2.clone();
|
|
35116
35357
|
var mod3 = this.m.andln(3);
|
|
35117
|
-
assert$
|
|
35358
|
+
assert$55(mod3 % 2 === 1);
|
|
35118
35359
|
if (mod3 === 3) {
|
|
35119
35360
|
var pow$1 = this.m.add(new BN$14(1)).iushrn(2);
|
|
35120
35361
|
return this.pow(a$2, pow$1);
|
|
@@ -35125,7 +35366,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
35125
35366
|
s$6++;
|
|
35126
35367
|
q.iushrn(1);
|
|
35127
35368
|
}
|
|
35128
|
-
assert$
|
|
35369
|
+
assert$55(!q.isZero());
|
|
35129
35370
|
var one = new BN$14(1).toRed(this);
|
|
35130
35371
|
var nOne = one.redNeg();
|
|
35131
35372
|
var lpow = this.m.subn(1).iushrn(1);
|
|
@@ -35139,7 +35380,7 @@ var require_bn$1 = __commonJSMin((exports, module) => {
|
|
|
35139
35380
|
while (t$7.cmp(one) !== 0) {
|
|
35140
35381
|
var tmp = t$7;
|
|
35141
35382
|
for (var i$4 = 0; tmp.cmp(one) !== 0; i$4++) tmp = tmp.redSqr();
|
|
35142
|
-
assert$
|
|
35383
|
+
assert$55(i$4 < m$3);
|
|
35143
35384
|
var b = this.pow(c$1, new BN$14(1).iushln(m$3 - i$4 - 1));
|
|
35144
35385
|
r$2 = r$2.redMul(b);
|
|
35145
35386
|
c$1 = b.redSqr();
|
|
@@ -39536,7 +39777,7 @@ var require_node = __commonJSMin((exports, module) => {
|
|
|
39536
39777
|
"implicit",
|
|
39537
39778
|
"contains"
|
|
39538
39779
|
];
|
|
39539
|
-
Node.prototype.clone = function clone$
|
|
39780
|
+
Node.prototype.clone = function clone$21() {
|
|
39540
39781
|
var state = this._baseState;
|
|
39541
39782
|
var cstate = {};
|
|
39542
39783
|
stateProps.forEach(function(prop) {
|
|
@@ -39550,9 +39791,9 @@ var require_node = __commonJSMin((exports, module) => {
|
|
|
39550
39791
|
var state = this._baseState;
|
|
39551
39792
|
methods.forEach(function(method$1) {
|
|
39552
39793
|
this[method$1] = function _wrappedMethod() {
|
|
39553
|
-
var clone$
|
|
39554
|
-
state.children.push(clone$
|
|
39555
|
-
return clone$
|
|
39794
|
+
var clone$21 = new this.constructor(this);
|
|
39795
|
+
state.children.push(clone$21);
|
|
39796
|
+
return clone$21[method$1].apply(clone$21, arguments);
|
|
39556
39797
|
};
|
|
39557
39798
|
}, this);
|
|
39558
39799
|
};
|
|
@@ -40906,7 +41147,7 @@ var require_withPublic = __commonJSMin((exports, module) => {
|
|
|
40906
41147
|
var require_bn = __commonJSMin((exports, module) => {
|
|
40907
41148
|
(function(module$1, exports$1) {
|
|
40908
41149
|
"use strict";
|
|
40909
|
-
function assert$
|
|
41150
|
+
function assert$55(val, msg) {
|
|
40910
41151
|
if (!val) throw new Error(msg || "Assertion failed");
|
|
40911
41152
|
}
|
|
40912
41153
|
function inherits$14(ctor, superCtor) {
|
|
@@ -40934,10 +41175,10 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
40934
41175
|
else exports$1.BN = BN$14;
|
|
40935
41176
|
BN$14.BN = BN$14;
|
|
40936
41177
|
BN$14.wordSize = 26;
|
|
40937
|
-
var Buffer$
|
|
41178
|
+
var Buffer$29;
|
|
40938
41179
|
try {
|
|
40939
|
-
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$
|
|
40940
|
-
else Buffer$
|
|
41180
|
+
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$29 = window.Buffer;
|
|
41181
|
+
else Buffer$29 = (init_dist$1(), __toCommonJS(dist_exports)).Buffer;
|
|
40941
41182
|
} catch (e$2) {}
|
|
40942
41183
|
BN$14.isBN = function isBN(num) {
|
|
40943
41184
|
if (num instanceof BN$14) return true;
|
|
@@ -40955,7 +41196,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
40955
41196
|
if (typeof number === "number") return this._initNumber(number, base$3, endian);
|
|
40956
41197
|
if (typeof number === "object") return this._initArray(number, base$3, endian);
|
|
40957
41198
|
if (base$3 === "hex") base$3 = 16;
|
|
40958
|
-
assert$
|
|
41199
|
+
assert$55(base$3 === (base$3 | 0) && base$3 >= 2 && base$3 <= 36);
|
|
40959
41200
|
number = number.toString().replace(/\s+/g, "");
|
|
40960
41201
|
var start = 0;
|
|
40961
41202
|
if (number[0] === "-") {
|
|
@@ -40980,7 +41221,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
40980
41221
|
this.words = [number & 67108863, number / 67108864 & 67108863];
|
|
40981
41222
|
this.length = 2;
|
|
40982
41223
|
} else {
|
|
40983
|
-
assert$
|
|
41224
|
+
assert$55(number < 9007199254740992);
|
|
40984
41225
|
this.words = [
|
|
40985
41226
|
number & 67108863,
|
|
40986
41227
|
number / 67108864 & 67108863,
|
|
@@ -40992,7 +41233,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
40992
41233
|
this._initArray(this.toArray(), base$3, endian);
|
|
40993
41234
|
};
|
|
40994
41235
|
BN$14.prototype._initArray = function _initArray(number, base$3, endian) {
|
|
40995
|
-
assert$
|
|
41236
|
+
assert$55(typeof number.length === "number");
|
|
40996
41237
|
if (number.length <= 0) {
|
|
40997
41238
|
this.words = [0];
|
|
40998
41239
|
this.length = 1;
|
|
@@ -41030,7 +41271,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41030
41271
|
if (c$1 >= 48 && c$1 <= 57) return c$1 - 48;
|
|
41031
41272
|
else if (c$1 >= 65 && c$1 <= 70) return c$1 - 55;
|
|
41032
41273
|
else if (c$1 >= 97 && c$1 <= 102) return c$1 - 87;
|
|
41033
|
-
else assert$
|
|
41274
|
+
else assert$55(false, "Invalid character in " + string);
|
|
41034
41275
|
}
|
|
41035
41276
|
function parseHexByte(string, lowerBound, index$2) {
|
|
41036
41277
|
var r$2 = parseHex4Bits(string, index$2);
|
|
@@ -41077,7 +41318,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41077
41318
|
if (c$1 >= 49) b = c$1 - 49 + 10;
|
|
41078
41319
|
else if (c$1 >= 17) b = c$1 - 17 + 10;
|
|
41079
41320
|
else b = c$1;
|
|
41080
|
-
assert$
|
|
41321
|
+
assert$55(c$1 >= 0 && b < mul, "Invalid character");
|
|
41081
41322
|
r$2 += b;
|
|
41082
41323
|
}
|
|
41083
41324
|
return r$2;
|
|
@@ -41124,7 +41365,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41124
41365
|
BN$14.prototype._move = function _move(dest) {
|
|
41125
41366
|
move(dest, this);
|
|
41126
41367
|
};
|
|
41127
|
-
BN$14.prototype.clone = function clone$
|
|
41368
|
+
BN$14.prototype.clone = function clone$21() {
|
|
41128
41369
|
var r$2 = new BN$14(null);
|
|
41129
41370
|
this.copy(r$2);
|
|
41130
41371
|
return r$2;
|
|
@@ -41298,20 +41539,20 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41298
41539
|
if (this.negative !== 0) out = "-" + out;
|
|
41299
41540
|
return out;
|
|
41300
41541
|
}
|
|
41301
|
-
assert$
|
|
41542
|
+
assert$55(false, "Base should be between 2 and 36");
|
|
41302
41543
|
};
|
|
41303
41544
|
BN$14.prototype.toNumber = function toNumber$8() {
|
|
41304
41545
|
var ret = this.words[0];
|
|
41305
41546
|
if (this.length === 2) ret += this.words[1] * 67108864;
|
|
41306
41547
|
else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864;
|
|
41307
|
-
else if (this.length > 2) assert$
|
|
41548
|
+
else if (this.length > 2) assert$55(false, "Number can only safely store up to 53 bits");
|
|
41308
41549
|
return this.negative !== 0 ? -ret : ret;
|
|
41309
41550
|
};
|
|
41310
41551
|
BN$14.prototype.toJSON = function toJSON() {
|
|
41311
41552
|
return this.toString(16, 2);
|
|
41312
41553
|
};
|
|
41313
|
-
if (Buffer$
|
|
41314
|
-
return this.toArrayLike(Buffer$
|
|
41554
|
+
if (Buffer$29) BN$14.prototype.toBuffer = function toBuffer$5(endian, length) {
|
|
41555
|
+
return this.toArrayLike(Buffer$29, endian, length);
|
|
41315
41556
|
};
|
|
41316
41557
|
BN$14.prototype.toArray = function toArray$8(endian, length) {
|
|
41317
41558
|
return this.toArrayLike(Array, endian, length);
|
|
@@ -41324,8 +41565,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41324
41565
|
this._strip();
|
|
41325
41566
|
var byteLength$2 = this.byteLength();
|
|
41326
41567
|
var reqLength = length || Math.max(1, byteLength$2);
|
|
41327
|
-
assert$
|
|
41328
|
-
assert$
|
|
41568
|
+
assert$55(byteLength$2 <= reqLength, "byte array longer than desired length");
|
|
41569
|
+
assert$55(reqLength > 0, "Requested array length <= 0");
|
|
41329
41570
|
var res = allocate(ArrayType, reqLength);
|
|
41330
41571
|
var postfix = endian === "le" ? "LE" : "BE";
|
|
41331
41572
|
this["_toArrayLike" + postfix](res, byteLength$2);
|
|
@@ -41473,7 +41714,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41473
41714
|
return this._strip();
|
|
41474
41715
|
};
|
|
41475
41716
|
BN$14.prototype.ior = function ior(num) {
|
|
41476
|
-
assert$
|
|
41717
|
+
assert$55((this.negative | num.negative) === 0);
|
|
41477
41718
|
return this.iuor(num);
|
|
41478
41719
|
};
|
|
41479
41720
|
BN$14.prototype.or = function or(num) {
|
|
@@ -41493,7 +41734,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41493
41734
|
return this._strip();
|
|
41494
41735
|
};
|
|
41495
41736
|
BN$14.prototype.iand = function iand(num) {
|
|
41496
|
-
assert$
|
|
41737
|
+
assert$55((this.negative | num.negative) === 0);
|
|
41497
41738
|
return this.iuand(num);
|
|
41498
41739
|
};
|
|
41499
41740
|
BN$14.prototype.and = function and(num) {
|
|
@@ -41520,7 +41761,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41520
41761
|
return this._strip();
|
|
41521
41762
|
};
|
|
41522
41763
|
BN$14.prototype.ixor = function ixor(num) {
|
|
41523
|
-
assert$
|
|
41764
|
+
assert$55((this.negative | num.negative) === 0);
|
|
41524
41765
|
return this.iuxor(num);
|
|
41525
41766
|
};
|
|
41526
41767
|
BN$14.prototype.xor = function xor$2(num) {
|
|
@@ -41532,7 +41773,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41532
41773
|
return num.clone().iuxor(this);
|
|
41533
41774
|
};
|
|
41534
41775
|
BN$14.prototype.inotn = function inotn(width) {
|
|
41535
|
-
assert$
|
|
41776
|
+
assert$55(typeof width === "number" && width >= 0);
|
|
41536
41777
|
var bytesNeeded = Math.ceil(width / 26) | 0;
|
|
41537
41778
|
var bitsLeft = width % 26;
|
|
41538
41779
|
this._expand(bytesNeeded);
|
|
@@ -41545,7 +41786,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
41545
41786
|
return this.clone().inotn(width);
|
|
41546
41787
|
};
|
|
41547
41788
|
BN$14.prototype.setn = function setn(bit, val) {
|
|
41548
|
-
assert$
|
|
41789
|
+
assert$55(typeof bit === "number" && bit >= 0);
|
|
41549
41790
|
var off = bit / 26 | 0;
|
|
41550
41791
|
var wbit = bit % 26;
|
|
41551
41792
|
this._expand(off + 1);
|
|
@@ -42373,8 +42614,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42373
42614
|
carry = carry >>> 13;
|
|
42374
42615
|
}
|
|
42375
42616
|
for (i$4 = 2 * len$2; i$4 < N; ++i$4) rws[i$4] = 0;
|
|
42376
|
-
assert$
|
|
42377
|
-
assert$
|
|
42617
|
+
assert$55(carry === 0);
|
|
42618
|
+
assert$55((carry & -8192) === 0);
|
|
42378
42619
|
};
|
|
42379
42620
|
FFTM.prototype.stub = function stub(N) {
|
|
42380
42621
|
var ph = new Array(N);
|
|
@@ -42426,8 +42667,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42426
42667
|
BN$14.prototype.imuln = function imuln(num) {
|
|
42427
42668
|
var isNegNum = num < 0;
|
|
42428
42669
|
if (isNegNum) num = -num;
|
|
42429
|
-
assert$
|
|
42430
|
-
assert$
|
|
42670
|
+
assert$55(typeof num === "number");
|
|
42671
|
+
assert$55(num < 67108864);
|
|
42431
42672
|
var carry = 0;
|
|
42432
42673
|
for (var i$4 = 0; i$4 < this.length; i$4++) {
|
|
42433
42674
|
var w$1 = (this.words[i$4] | 0) * num;
|
|
@@ -42465,7 +42706,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42465
42706
|
return res;
|
|
42466
42707
|
};
|
|
42467
42708
|
BN$14.prototype.iushln = function iushln(bits$1) {
|
|
42468
|
-
assert$
|
|
42709
|
+
assert$55(typeof bits$1 === "number" && bits$1 >= 0);
|
|
42469
42710
|
var r$2 = bits$1 % 26;
|
|
42470
42711
|
var s$6 = (bits$1 - r$2) / 26;
|
|
42471
42712
|
var carryMask = 67108863 >>> 26 - r$2 << 26 - r$2;
|
|
@@ -42491,11 +42732,11 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42491
42732
|
return this._strip();
|
|
42492
42733
|
};
|
|
42493
42734
|
BN$14.prototype.ishln = function ishln(bits$1) {
|
|
42494
|
-
assert$
|
|
42735
|
+
assert$55(this.negative === 0);
|
|
42495
42736
|
return this.iushln(bits$1);
|
|
42496
42737
|
};
|
|
42497
42738
|
BN$14.prototype.iushrn = function iushrn(bits$1, hint, extended) {
|
|
42498
|
-
assert$
|
|
42739
|
+
assert$55(typeof bits$1 === "number" && bits$1 >= 0);
|
|
42499
42740
|
var h$1;
|
|
42500
42741
|
if (hint) h$1 = (hint - hint % 26) / 26;
|
|
42501
42742
|
else h$1 = 0;
|
|
@@ -42530,7 +42771,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42530
42771
|
return this._strip();
|
|
42531
42772
|
};
|
|
42532
42773
|
BN$14.prototype.ishrn = function ishrn(bits$1, hint, extended) {
|
|
42533
|
-
assert$
|
|
42774
|
+
assert$55(this.negative === 0);
|
|
42534
42775
|
return this.iushrn(bits$1, hint, extended);
|
|
42535
42776
|
};
|
|
42536
42777
|
BN$14.prototype.shln = function shln(bits$1) {
|
|
@@ -42546,7 +42787,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42546
42787
|
return this.clone().iushrn(bits$1);
|
|
42547
42788
|
};
|
|
42548
42789
|
BN$14.prototype.testn = function testn(bit) {
|
|
42549
|
-
assert$
|
|
42790
|
+
assert$55(typeof bit === "number" && bit >= 0);
|
|
42550
42791
|
var r$2 = bit % 26;
|
|
42551
42792
|
var s$6 = (bit - r$2) / 26;
|
|
42552
42793
|
var q = 1 << r$2;
|
|
@@ -42555,10 +42796,10 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42555
42796
|
return !!(w$1 & q);
|
|
42556
42797
|
};
|
|
42557
42798
|
BN$14.prototype.imaskn = function imaskn(bits$1) {
|
|
42558
|
-
assert$
|
|
42799
|
+
assert$55(typeof bits$1 === "number" && bits$1 >= 0);
|
|
42559
42800
|
var r$2 = bits$1 % 26;
|
|
42560
42801
|
var s$6 = (bits$1 - r$2) / 26;
|
|
42561
|
-
assert$
|
|
42802
|
+
assert$55(this.negative === 0, "imaskn works only with positive numbers");
|
|
42562
42803
|
if (this.length <= s$6) return this;
|
|
42563
42804
|
if (r$2 !== 0) s$6++;
|
|
42564
42805
|
this.length = Math.min(s$6, this.length);
|
|
@@ -42572,8 +42813,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42572
42813
|
return this.clone().imaskn(bits$1);
|
|
42573
42814
|
};
|
|
42574
42815
|
BN$14.prototype.iaddn = function iaddn(num) {
|
|
42575
|
-
assert$
|
|
42576
|
-
assert$
|
|
42816
|
+
assert$55(typeof num === "number");
|
|
42817
|
+
assert$55(num < 67108864);
|
|
42577
42818
|
if (num < 0) return this.isubn(-num);
|
|
42578
42819
|
if (this.negative !== 0) {
|
|
42579
42820
|
if (this.length === 1 && (this.words[0] | 0) <= num) {
|
|
@@ -42599,8 +42840,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42599
42840
|
return this;
|
|
42600
42841
|
};
|
|
42601
42842
|
BN$14.prototype.isubn = function isubn(num) {
|
|
42602
|
-
assert$
|
|
42603
|
-
assert$
|
|
42843
|
+
assert$55(typeof num === "number");
|
|
42844
|
+
assert$55(num < 67108864);
|
|
42604
42845
|
if (num < 0) return this.iaddn(-num);
|
|
42605
42846
|
if (this.negative !== 0) {
|
|
42606
42847
|
this.negative = 0;
|
|
@@ -42650,7 +42891,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42650
42891
|
this.words[i$4 + shift] = w$1 & 67108863;
|
|
42651
42892
|
}
|
|
42652
42893
|
if (carry === 0) return this._strip();
|
|
42653
|
-
assert$
|
|
42894
|
+
assert$55(carry === -1);
|
|
42654
42895
|
carry = 0;
|
|
42655
42896
|
for (i$4 = 0; i$4 < this.length; i$4++) {
|
|
42656
42897
|
w$1 = -(this.words[i$4] | 0) + carry;
|
|
@@ -42706,7 +42947,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42706
42947
|
};
|
|
42707
42948
|
};
|
|
42708
42949
|
BN$14.prototype.divmod = function divmod(num, mode, positive) {
|
|
42709
|
-
assert$
|
|
42950
|
+
assert$55(!num.isZero());
|
|
42710
42951
|
if (this.isZero()) return {
|
|
42711
42952
|
div: new BN$14(0),
|
|
42712
42953
|
mod: new BN$14(0)
|
|
@@ -42785,7 +43026,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42785
43026
|
BN$14.prototype.modrn = function modrn(num) {
|
|
42786
43027
|
var isNegNum = num < 0;
|
|
42787
43028
|
if (isNegNum) num = -num;
|
|
42788
|
-
assert$
|
|
43029
|
+
assert$55(num <= 67108863);
|
|
42789
43030
|
var p$1 = (1 << 26) % num;
|
|
42790
43031
|
var acc = 0;
|
|
42791
43032
|
for (var i$4 = this.length - 1; i$4 >= 0; i$4--) acc = (p$1 * acc + (this.words[i$4] | 0)) % num;
|
|
@@ -42797,7 +43038,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42797
43038
|
BN$14.prototype.idivn = function idivn(num) {
|
|
42798
43039
|
var isNegNum = num < 0;
|
|
42799
43040
|
if (isNegNum) num = -num;
|
|
42800
|
-
assert$
|
|
43041
|
+
assert$55(num <= 67108863);
|
|
42801
43042
|
var carry = 0;
|
|
42802
43043
|
for (var i$4 = this.length - 1; i$4 >= 0; i$4--) {
|
|
42803
43044
|
var w$1 = (this.words[i$4] | 0) + carry * 67108864;
|
|
@@ -42811,8 +43052,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42811
43052
|
return this.clone().idivn(num);
|
|
42812
43053
|
};
|
|
42813
43054
|
BN$14.prototype.egcd = function egcd(p$1) {
|
|
42814
|
-
assert$
|
|
42815
|
-
assert$
|
|
43055
|
+
assert$55(p$1.negative === 0);
|
|
43056
|
+
assert$55(!p$1.isZero());
|
|
42816
43057
|
var x$1 = this;
|
|
42817
43058
|
var y$1 = p$1.clone();
|
|
42818
43059
|
if (x$1.negative !== 0) x$1 = x$1.umod(p$1);
|
|
@@ -42871,8 +43112,8 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42871
43112
|
};
|
|
42872
43113
|
};
|
|
42873
43114
|
BN$14.prototype._invmp = function _invmp(p$1) {
|
|
42874
|
-
assert$
|
|
42875
|
-
assert$
|
|
43115
|
+
assert$55(p$1.negative === 0);
|
|
43116
|
+
assert$55(!p$1.isZero());
|
|
42876
43117
|
var a$2 = this;
|
|
42877
43118
|
var b = p$1.clone();
|
|
42878
43119
|
if (a$2.negative !== 0) a$2 = a$2.umod(p$1);
|
|
@@ -42948,7 +43189,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42948
43189
|
return this.words[0] & num;
|
|
42949
43190
|
};
|
|
42950
43191
|
BN$14.prototype.bincn = function bincn(bit) {
|
|
42951
|
-
assert$
|
|
43192
|
+
assert$55(typeof bit === "number");
|
|
42952
43193
|
var r$2 = bit % 26;
|
|
42953
43194
|
var s$6 = (bit - r$2) / 26;
|
|
42954
43195
|
var q = 1 << r$2;
|
|
@@ -42983,7 +43224,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
42983
43224
|
if (this.length > 1) res = 1;
|
|
42984
43225
|
else {
|
|
42985
43226
|
if (negative) num = -num;
|
|
42986
|
-
assert$
|
|
43227
|
+
assert$55(num <= 67108863, "Number is too big");
|
|
42987
43228
|
var w$1 = this.words[0] | 0;
|
|
42988
43229
|
res = w$1 === num ? 0 : w$1 < num ? -1 : 1;
|
|
42989
43230
|
}
|
|
@@ -43045,12 +43286,12 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
43045
43286
|
return new Red(num);
|
|
43046
43287
|
};
|
|
43047
43288
|
BN$14.prototype.toRed = function toRed(ctx) {
|
|
43048
|
-
assert$
|
|
43049
|
-
assert$
|
|
43289
|
+
assert$55(!this.red, "Already a number in reduction context");
|
|
43290
|
+
assert$55(this.negative === 0, "red works only with positives");
|
|
43050
43291
|
return ctx.convertTo(this)._forceRed(ctx);
|
|
43051
43292
|
};
|
|
43052
43293
|
BN$14.prototype.fromRed = function fromRed() {
|
|
43053
|
-
assert$
|
|
43294
|
+
assert$55(this.red, "fromRed works only with numbers in reduction context");
|
|
43054
43295
|
return this.red.convertFrom(this);
|
|
43055
43296
|
};
|
|
43056
43297
|
BN$14.prototype._forceRed = function _forceRed(ctx) {
|
|
@@ -43058,66 +43299,66 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
43058
43299
|
return this;
|
|
43059
43300
|
};
|
|
43060
43301
|
BN$14.prototype.forceRed = function forceRed(ctx) {
|
|
43061
|
-
assert$
|
|
43302
|
+
assert$55(!this.red, "Already a number in reduction context");
|
|
43062
43303
|
return this._forceRed(ctx);
|
|
43063
43304
|
};
|
|
43064
43305
|
BN$14.prototype.redAdd = function redAdd(num) {
|
|
43065
|
-
assert$
|
|
43306
|
+
assert$55(this.red, "redAdd works only with red numbers");
|
|
43066
43307
|
return this.red.add(this, num);
|
|
43067
43308
|
};
|
|
43068
43309
|
BN$14.prototype.redIAdd = function redIAdd(num) {
|
|
43069
|
-
assert$
|
|
43310
|
+
assert$55(this.red, "redIAdd works only with red numbers");
|
|
43070
43311
|
return this.red.iadd(this, num);
|
|
43071
43312
|
};
|
|
43072
43313
|
BN$14.prototype.redSub = function redSub(num) {
|
|
43073
|
-
assert$
|
|
43314
|
+
assert$55(this.red, "redSub works only with red numbers");
|
|
43074
43315
|
return this.red.sub(this, num);
|
|
43075
43316
|
};
|
|
43076
43317
|
BN$14.prototype.redISub = function redISub(num) {
|
|
43077
|
-
assert$
|
|
43318
|
+
assert$55(this.red, "redISub works only with red numbers");
|
|
43078
43319
|
return this.red.isub(this, num);
|
|
43079
43320
|
};
|
|
43080
43321
|
BN$14.prototype.redShl = function redShl(num) {
|
|
43081
|
-
assert$
|
|
43322
|
+
assert$55(this.red, "redShl works only with red numbers");
|
|
43082
43323
|
return this.red.shl(this, num);
|
|
43083
43324
|
};
|
|
43084
43325
|
BN$14.prototype.redMul = function redMul(num) {
|
|
43085
|
-
assert$
|
|
43326
|
+
assert$55(this.red, "redMul works only with red numbers");
|
|
43086
43327
|
this.red._verify2(this, num);
|
|
43087
43328
|
return this.red.mul(this, num);
|
|
43088
43329
|
};
|
|
43089
43330
|
BN$14.prototype.redIMul = function redIMul(num) {
|
|
43090
|
-
assert$
|
|
43331
|
+
assert$55(this.red, "redMul works only with red numbers");
|
|
43091
43332
|
this.red._verify2(this, num);
|
|
43092
43333
|
return this.red.imul(this, num);
|
|
43093
43334
|
};
|
|
43094
43335
|
BN$14.prototype.redSqr = function redSqr() {
|
|
43095
|
-
assert$
|
|
43336
|
+
assert$55(this.red, "redSqr works only with red numbers");
|
|
43096
43337
|
this.red._verify1(this);
|
|
43097
43338
|
return this.red.sqr(this);
|
|
43098
43339
|
};
|
|
43099
43340
|
BN$14.prototype.redISqr = function redISqr() {
|
|
43100
|
-
assert$
|
|
43341
|
+
assert$55(this.red, "redISqr works only with red numbers");
|
|
43101
43342
|
this.red._verify1(this);
|
|
43102
43343
|
return this.red.isqr(this);
|
|
43103
43344
|
};
|
|
43104
43345
|
BN$14.prototype.redSqrt = function redSqrt() {
|
|
43105
|
-
assert$
|
|
43346
|
+
assert$55(this.red, "redSqrt works only with red numbers");
|
|
43106
43347
|
this.red._verify1(this);
|
|
43107
43348
|
return this.red.sqrt(this);
|
|
43108
43349
|
};
|
|
43109
43350
|
BN$14.prototype.redInvm = function redInvm() {
|
|
43110
|
-
assert$
|
|
43351
|
+
assert$55(this.red, "redInvm works only with red numbers");
|
|
43111
43352
|
this.red._verify1(this);
|
|
43112
43353
|
return this.red.invm(this);
|
|
43113
43354
|
};
|
|
43114
43355
|
BN$14.prototype.redNeg = function redNeg() {
|
|
43115
|
-
assert$
|
|
43356
|
+
assert$55(this.red, "redNeg works only with red numbers");
|
|
43116
43357
|
this.red._verify1(this);
|
|
43117
43358
|
return this.red.neg(this);
|
|
43118
43359
|
};
|
|
43119
43360
|
BN$14.prototype.redPow = function redPow(num) {
|
|
43120
|
-
assert$
|
|
43361
|
+
assert$55(this.red && !num.red, "redPow(normalNum)");
|
|
43121
43362
|
this.red._verify1(this);
|
|
43122
43363
|
return this.red.pow(this, num);
|
|
43123
43364
|
};
|
|
@@ -43247,18 +43488,18 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
43247
43488
|
this.m = prime.p;
|
|
43248
43489
|
this.prime = prime;
|
|
43249
43490
|
} else {
|
|
43250
|
-
assert$
|
|
43491
|
+
assert$55(m$3.gtn(1), "modulus must be greater than 1");
|
|
43251
43492
|
this.m = m$3;
|
|
43252
43493
|
this.prime = null;
|
|
43253
43494
|
}
|
|
43254
43495
|
}
|
|
43255
43496
|
Red.prototype._verify1 = function _verify1(a$2) {
|
|
43256
|
-
assert$
|
|
43257
|
-
assert$
|
|
43497
|
+
assert$55(a$2.negative === 0, "red works only with positives");
|
|
43498
|
+
assert$55(a$2.red, "red works only with red numbers");
|
|
43258
43499
|
};
|
|
43259
43500
|
Red.prototype._verify2 = function _verify2(a$2, b) {
|
|
43260
|
-
assert$
|
|
43261
|
-
assert$
|
|
43501
|
+
assert$55((a$2.negative | b.negative) === 0, "red works only with positives");
|
|
43502
|
+
assert$55(a$2.red && a$2.red === b.red, "red works only with red numbers");
|
|
43262
43503
|
};
|
|
43263
43504
|
Red.prototype.imod = function imod(a$2) {
|
|
43264
43505
|
if (this.prime) return this.prime.ireduce(a$2)._forceRed(this);
|
|
@@ -43314,7 +43555,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
43314
43555
|
Red.prototype.sqrt = function sqrt(a$2) {
|
|
43315
43556
|
if (a$2.isZero()) return a$2.clone();
|
|
43316
43557
|
var mod3 = this.m.andln(3);
|
|
43317
|
-
assert$
|
|
43558
|
+
assert$55(mod3 % 2 === 1);
|
|
43318
43559
|
if (mod3 === 3) {
|
|
43319
43560
|
var pow$1 = this.m.add(new BN$14(1)).iushrn(2);
|
|
43320
43561
|
return this.pow(a$2, pow$1);
|
|
@@ -43325,7 +43566,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
43325
43566
|
s$6++;
|
|
43326
43567
|
q.iushrn(1);
|
|
43327
43568
|
}
|
|
43328
|
-
assert$
|
|
43569
|
+
assert$55(!q.isZero());
|
|
43329
43570
|
var one = new BN$14(1).toRed(this);
|
|
43330
43571
|
var nOne = one.redNeg();
|
|
43331
43572
|
var lpow = this.m.subn(1).iushrn(1);
|
|
@@ -43339,7 +43580,7 @@ var require_bn = __commonJSMin((exports, module) => {
|
|
|
43339
43580
|
while (t$7.cmp(one) !== 0) {
|
|
43340
43581
|
var tmp = t$7;
|
|
43341
43582
|
for (var i$4 = 0; tmp.cmp(one) !== 0; i$4++) tmp = tmp.redSqr();
|
|
43342
|
-
assert$
|
|
43583
|
+
assert$55(i$4 < m$3);
|
|
43343
43584
|
var b = this.pow(c$1, new BN$14(1).iushln(m$3 - i$4 - 1));
|
|
43344
43585
|
r$2 = r$2.redMul(b);
|
|
43345
43586
|
c$1 = b.redSqr();
|
|
@@ -45702,11 +45943,11 @@ var RootFactory = class RootFactory {
|
|
|
45702
45943
|
static generate(root$11, schema$2, args$1) {
|
|
45703
45944
|
(0, import_assert.default)(root$11, "Must be invoked on a Joi instance.");
|
|
45704
45945
|
const cloned = schema$2.clone();
|
|
45705
|
-
const originalDescribe
|
|
45946
|
+
const originalDescribe = cloned.describe.bind(cloned);
|
|
45706
45947
|
cloned.describe = function() {
|
|
45707
45948
|
const cached = RootFactory.$_cachedDescriptions.get(this);
|
|
45708
45949
|
if (cached) return cached;
|
|
45709
|
-
const result = originalDescribe
|
|
45950
|
+
const result = originalDescribe();
|
|
45710
45951
|
RootFactory.$_cachedDescriptions.set(this, result);
|
|
45711
45952
|
return result;
|
|
45712
45953
|
};
|
|
@@ -143176,7 +143417,7 @@ const encode = (schema$2, options = {}) => {
|
|
|
143176
143417
|
});
|
|
143177
143418
|
}
|
|
143178
143419
|
const json$1 = JSON.stringify({
|
|
143179
|
-
version: "0.1.0-master-
|
|
143420
|
+
version: "0.1.0-master-952eca46",
|
|
143180
143421
|
schema: description$2
|
|
143181
143422
|
}, (key, value) => {
|
|
143182
143423
|
if (typeof value === "bigint") return value.toString();
|
|
@@ -143224,9 +143465,9 @@ const decode = (base64, options = {}) => {
|
|
|
143224
143465
|
});
|
|
143225
143466
|
if (!isPlainObject(description$2) || !("version" in description$2) || !("schema" in description$2) || typeof description$2.version !== "string" || !isPlainObject(description$2.schema)) throw new TypeError("Not a valid encoded schema");
|
|
143226
143467
|
const { version: schemaVersion, schema: schema$2 } = description$2;
|
|
143227
|
-
if (import_semver.valid("0.1.0-master-
|
|
143468
|
+
if (import_semver.valid("0.1.0-master-952eca46")) {
|
|
143228
143469
|
if (!import_semver.valid(import_semver.coerce(schemaVersion))) throw new TypeError(`Invalid schema version: ${schemaVersion}`);
|
|
143229
|
-
if (import_semver.gt(import_semver.coerce(schemaVersion), "0.1.0-master-
|
|
143470
|
+
if (import_semver.gt(import_semver.coerce(schemaVersion), "0.1.0-master-952eca46")) throw new TypeError(`Schema version ${schemaVersion} is not compatible with current version 0.1.0-master-952eca46`);
|
|
143230
143471
|
}
|
|
143231
143472
|
return validator.build(schema$2);
|
|
143232
143473
|
};
|
|
@@ -144680,7 +144921,7 @@ init_esm();
|
|
|
144680
144921
|
var import_lib = __toESM(require_lib$3());
|
|
144681
144922
|
var import_lib$1 = __toESM(require_lib$2());
|
|
144682
144923
|
var import_lib$2 = __toESM(require_lib());
|
|
144683
|
-
const version = "0.1.0-master-
|
|
144924
|
+
const version = "0.1.0-master-952eca46";
|
|
144684
144925
|
Object.defineProperty(exports, "ValidationError", {
|
|
144685
144926
|
enumerable: true,
|
|
144686
144927
|
get: function() {
|