@pdg/crypto 1.0.4 → 1.0.6

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/dist/index.js CHANGED
@@ -1,13 +1,3258 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _md5=require('md5'),_base64=require('base-64'),utf8=require('utf8'),sha=require('sha.js');function md5(text) {
2
- return _md5(text);
3
- }const base64 = {
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var require$$0=require('buffer');require('crypto');function md5(text) {
2
+ return md5();
3
+ }var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }var base64$2 = {exports: {}};/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
8
+ var base64$1 = base64$2.exports;
9
+
10
+ var hasRequiredBase64;
11
+
12
+ function requireBase64 () {
13
+ if (hasRequiredBase64) return base64$2.exports;
14
+ hasRequiredBase64 = 1;
15
+ (function (module, exports$1) {
16
+ (function(root) {
17
+
18
+ // Detect free variables `exports`.
19
+ var freeExports = exports$1;
20
+
21
+ // Detect free variable `module`.
22
+ var freeModule = module &&
23
+ module.exports == freeExports && module;
24
+
25
+ // Detect free variable `global`, from Node.js or Browserified code, and use
26
+ // it as `root`.
27
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
28
+ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
29
+ root = freeGlobal;
30
+ }
31
+
32
+ /*--------------------------------------------------------------------------*/
33
+
34
+ var InvalidCharacterError = function(message) {
35
+ this.message = message;
36
+ };
37
+ InvalidCharacterError.prototype = new Error;
38
+ InvalidCharacterError.prototype.name = 'InvalidCharacterError';
39
+
40
+ var error = function(message) {
41
+ // Note: the error messages used throughout this file match those used by
42
+ // the native `atob`/`btoa` implementation in Chromium.
43
+ throw new InvalidCharacterError(message);
44
+ };
45
+
46
+ var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
47
+ // http://whatwg.org/html/common-microsyntaxes.html#space-character
48
+ var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;
49
+
50
+ // `decode` is designed to be fully compatible with `atob` as described in the
51
+ // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob
52
+ // The optimized base64-decoding algorithm used is based on @atk’s excellent
53
+ // implementation. https://gist.github.com/atk/1020396
54
+ var decode = function(input) {
55
+ input = String(input)
56
+ .replace(REGEX_SPACE_CHARACTERS, '');
57
+ var length = input.length;
58
+ if (length % 4 == 0) {
59
+ input = input.replace(/==?$/, '');
60
+ length = input.length;
61
+ }
62
+ if (
63
+ length % 4 == 1 ||
64
+ // http://whatwg.org/C#alphanumeric-ascii-characters
65
+ /[^+a-zA-Z0-9/]/.test(input)
66
+ ) {
67
+ error(
68
+ 'Invalid character: the string to be decoded is not correctly encoded.'
69
+ );
70
+ }
71
+ var bitCounter = 0;
72
+ var bitStorage;
73
+ var buffer;
74
+ var output = '';
75
+ var position = -1;
76
+ while (++position < length) {
77
+ buffer = TABLE.indexOf(input.charAt(position));
78
+ bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
79
+ // Unless this is the first of a group of 4 characters…
80
+ if (bitCounter++ % 4) {
81
+ // …convert the first 8 bits to a single ASCII character.
82
+ output += String.fromCharCode(
83
+ 0xFF & bitStorage >> (-2 * bitCounter & 6)
84
+ );
85
+ }
86
+ }
87
+ return output;
88
+ };
89
+
90
+ // `encode` is designed to be fully compatible with `btoa` as described in the
91
+ // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa
92
+ var encode = function(input) {
93
+ input = String(input);
94
+ if (/[^\0-\xFF]/.test(input)) {
95
+ // Note: no need to special-case astral symbols here, as surrogates are
96
+ // matched, and the input is supposed to only contain ASCII anyway.
97
+ error(
98
+ 'The string to be encoded contains characters outside of the ' +
99
+ 'Latin1 range.'
100
+ );
101
+ }
102
+ var padding = input.length % 3;
103
+ var output = '';
104
+ var position = -1;
105
+ var a;
106
+ var b;
107
+ var c;
108
+ var buffer;
109
+ // Make sure any padding is handled outside of the loop.
110
+ var length = input.length - padding;
111
+
112
+ while (++position < length) {
113
+ // Read three bytes, i.e. 24 bits.
114
+ a = input.charCodeAt(position) << 16;
115
+ b = input.charCodeAt(++position) << 8;
116
+ c = input.charCodeAt(++position);
117
+ buffer = a + b + c;
118
+ // Turn the 24 bits into four chunks of 6 bits each, and append the
119
+ // matching character for each of them to the output.
120
+ output += (
121
+ TABLE.charAt(buffer >> 18 & 0x3F) +
122
+ TABLE.charAt(buffer >> 12 & 0x3F) +
123
+ TABLE.charAt(buffer >> 6 & 0x3F) +
124
+ TABLE.charAt(buffer & 0x3F)
125
+ );
126
+ }
127
+
128
+ if (padding == 2) {
129
+ a = input.charCodeAt(position) << 8;
130
+ b = input.charCodeAt(++position);
131
+ buffer = a + b;
132
+ output += (
133
+ TABLE.charAt(buffer >> 10) +
134
+ TABLE.charAt((buffer >> 4) & 0x3F) +
135
+ TABLE.charAt((buffer << 2) & 0x3F) +
136
+ '='
137
+ );
138
+ } else if (padding == 1) {
139
+ buffer = input.charCodeAt(position);
140
+ output += (
141
+ TABLE.charAt(buffer >> 2) +
142
+ TABLE.charAt((buffer << 4) & 0x3F) +
143
+ '=='
144
+ );
145
+ }
146
+
147
+ return output;
148
+ };
149
+
150
+ var base64 = {
151
+ 'encode': encode,
152
+ 'decode': decode,
153
+ 'version': '1.0.0'
154
+ };
155
+
156
+ // Some AMD build optimizers, like r.js, check for specific condition patterns
157
+ // like the following:
158
+ if (freeExports && !freeExports.nodeType) {
159
+ if (freeModule) { // in Node.js or RingoJS v0.8.0+
160
+ freeModule.exports = base64;
161
+ } else { // in Narwhal or RingoJS v0.7.0-
162
+ for (var key in base64) {
163
+ base64.hasOwnProperty(key) && (freeExports[key] = base64[key]);
164
+ }
165
+ }
166
+ } else { // in Rhino or a web browser
167
+ root.base64 = base64;
168
+ }
169
+
170
+ }(base64$1));
171
+ } (base64$2, base64$2.exports));
172
+ return base64$2.exports;
173
+ }var base64Exports = requireBase64();
174
+ var _base64 = /*@__PURE__*/getDefaultExportFromCjs(base64Exports);var utf8$1 = {};/*! https://mths.be/utf8js v3.0.0 by @mathias */
175
+
176
+ var hasRequiredUtf8;
177
+
178
+ function requireUtf8 () {
179
+ if (hasRequiredUtf8) return utf8$1;
180
+ hasRequiredUtf8 = 1;
181
+ (function (exports$1) {
182
+ (function(root) {
183
+
184
+ var stringFromCharCode = String.fromCharCode;
185
+
186
+ // Taken from https://mths.be/punycode
187
+ function ucs2decode(string) {
188
+ var output = [];
189
+ var counter = 0;
190
+ var length = string.length;
191
+ var value;
192
+ var extra;
193
+ while (counter < length) {
194
+ value = string.charCodeAt(counter++);
195
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
196
+ // high surrogate, and there is a next character
197
+ extra = string.charCodeAt(counter++);
198
+ if ((extra & 0xFC00) == 0xDC00) { // low surrogate
199
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
200
+ } else {
201
+ // unmatched surrogate; only append this code unit, in case the next
202
+ // code unit is the high surrogate of a surrogate pair
203
+ output.push(value);
204
+ counter--;
205
+ }
206
+ } else {
207
+ output.push(value);
208
+ }
209
+ }
210
+ return output;
211
+ }
212
+
213
+ // Taken from https://mths.be/punycode
214
+ function ucs2encode(array) {
215
+ var length = array.length;
216
+ var index = -1;
217
+ var value;
218
+ var output = '';
219
+ while (++index < length) {
220
+ value = array[index];
221
+ if (value > 0xFFFF) {
222
+ value -= 0x10000;
223
+ output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
224
+ value = 0xDC00 | value & 0x3FF;
225
+ }
226
+ output += stringFromCharCode(value);
227
+ }
228
+ return output;
229
+ }
230
+
231
+ function checkScalarValue(codePoint) {
232
+ if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
233
+ throw Error(
234
+ 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
235
+ ' is not a scalar value'
236
+ );
237
+ }
238
+ }
239
+ /*--------------------------------------------------------------------------*/
240
+
241
+ function createByte(codePoint, shift) {
242
+ return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
243
+ }
244
+
245
+ function encodeCodePoint(codePoint) {
246
+ if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
247
+ return stringFromCharCode(codePoint);
248
+ }
249
+ var symbol = '';
250
+ if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
251
+ symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
252
+ }
253
+ else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
254
+ checkScalarValue(codePoint);
255
+ symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
256
+ symbol += createByte(codePoint, 6);
257
+ }
258
+ else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
259
+ symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
260
+ symbol += createByte(codePoint, 12);
261
+ symbol += createByte(codePoint, 6);
262
+ }
263
+ symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
264
+ return symbol;
265
+ }
266
+
267
+ function utf8encode(string) {
268
+ var codePoints = ucs2decode(string);
269
+ var length = codePoints.length;
270
+ var index = -1;
271
+ var codePoint;
272
+ var byteString = '';
273
+ while (++index < length) {
274
+ codePoint = codePoints[index];
275
+ byteString += encodeCodePoint(codePoint);
276
+ }
277
+ return byteString;
278
+ }
279
+
280
+ /*--------------------------------------------------------------------------*/
281
+
282
+ function readContinuationByte() {
283
+ if (byteIndex >= byteCount) {
284
+ throw Error('Invalid byte index');
285
+ }
286
+
287
+ var continuationByte = byteArray[byteIndex] & 0xFF;
288
+ byteIndex++;
289
+
290
+ if ((continuationByte & 0xC0) == 0x80) {
291
+ return continuationByte & 0x3F;
292
+ }
293
+
294
+ // If we end up here, it’s not a continuation byte
295
+ throw Error('Invalid continuation byte');
296
+ }
297
+
298
+ function decodeSymbol() {
299
+ var byte1;
300
+ var byte2;
301
+ var byte3;
302
+ var byte4;
303
+ var codePoint;
304
+
305
+ if (byteIndex > byteCount) {
306
+ throw Error('Invalid byte index');
307
+ }
308
+
309
+ if (byteIndex == byteCount) {
310
+ return false;
311
+ }
312
+
313
+ // Read first byte
314
+ byte1 = byteArray[byteIndex] & 0xFF;
315
+ byteIndex++;
316
+
317
+ // 1-byte sequence (no continuation bytes)
318
+ if ((byte1 & 0x80) == 0) {
319
+ return byte1;
320
+ }
321
+
322
+ // 2-byte sequence
323
+ if ((byte1 & 0xE0) == 0xC0) {
324
+ byte2 = readContinuationByte();
325
+ codePoint = ((byte1 & 0x1F) << 6) | byte2;
326
+ if (codePoint >= 0x80) {
327
+ return codePoint;
328
+ } else {
329
+ throw Error('Invalid continuation byte');
330
+ }
331
+ }
332
+
333
+ // 3-byte sequence (may include unpaired surrogates)
334
+ if ((byte1 & 0xF0) == 0xE0) {
335
+ byte2 = readContinuationByte();
336
+ byte3 = readContinuationByte();
337
+ codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
338
+ if (codePoint >= 0x0800) {
339
+ checkScalarValue(codePoint);
340
+ return codePoint;
341
+ } else {
342
+ throw Error('Invalid continuation byte');
343
+ }
344
+ }
345
+
346
+ // 4-byte sequence
347
+ if ((byte1 & 0xF8) == 0xF0) {
348
+ byte2 = readContinuationByte();
349
+ byte3 = readContinuationByte();
350
+ byte4 = readContinuationByte();
351
+ codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
352
+ (byte3 << 0x06) | byte4;
353
+ if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
354
+ return codePoint;
355
+ }
356
+ }
357
+
358
+ throw Error('Invalid UTF-8 detected');
359
+ }
360
+
361
+ var byteArray;
362
+ var byteCount;
363
+ var byteIndex;
364
+ function utf8decode(byteString) {
365
+ byteArray = ucs2decode(byteString);
366
+ byteCount = byteArray.length;
367
+ byteIndex = 0;
368
+ var codePoints = [];
369
+ var tmp;
370
+ while ((tmp = decodeSymbol()) !== false) {
371
+ codePoints.push(tmp);
372
+ }
373
+ return ucs2encode(codePoints);
374
+ }
375
+
376
+ /*--------------------------------------------------------------------------*/
377
+
378
+ root.version = '3.0.0';
379
+ root.encode = utf8encode;
380
+ root.decode = utf8decode;
381
+
382
+ }(exports$1));
383
+ } (utf8$1));
384
+ return utf8$1;
385
+ }var utf8Exports = requireUtf8();
386
+ var utf8 = /*@__PURE__*/getDefaultExportFromCjs(utf8Exports);const base64 = {
4
387
  encode(text) {
5
388
  return _base64.encode(utf8.encode(text));
6
389
  },
7
390
  decode(encodedText) {
8
391
  return utf8.decode(_base64.decode(encodedText));
9
392
  },
10
- };function sha1(text, encoding = 'hex') {
393
+ };var sha_js = {exports: {}};var inherits = {exports: {}};var inherits_browser = {exports: {}};var hasRequiredInherits_browser;
394
+
395
+ function requireInherits_browser () {
396
+ if (hasRequiredInherits_browser) return inherits_browser.exports;
397
+ hasRequiredInherits_browser = 1;
398
+ if (typeof Object.create === 'function') {
399
+ // implementation from standard node.js 'util' module
400
+ inherits_browser.exports = function inherits(ctor, superCtor) {
401
+ if (superCtor) {
402
+ ctor.super_ = superCtor;
403
+ ctor.prototype = Object.create(superCtor.prototype, {
404
+ constructor: {
405
+ value: ctor,
406
+ enumerable: false,
407
+ writable: true,
408
+ configurable: true
409
+ }
410
+ });
411
+ }
412
+ };
413
+ } else {
414
+ // old school shim for old browsers
415
+ inherits_browser.exports = function inherits(ctor, superCtor) {
416
+ if (superCtor) {
417
+ ctor.super_ = superCtor;
418
+ var TempCtor = function () {};
419
+ TempCtor.prototype = superCtor.prototype;
420
+ ctor.prototype = new TempCtor();
421
+ ctor.prototype.constructor = ctor;
422
+ }
423
+ };
424
+ }
425
+ return inherits_browser.exports;
426
+ }var hasRequiredInherits;
427
+
428
+ function requireInherits () {
429
+ if (hasRequiredInherits) return inherits.exports;
430
+ hasRequiredInherits = 1;
431
+ try {
432
+ var util = require('util');
433
+ /* istanbul ignore next */
434
+ if (typeof util.inherits !== 'function') throw '';
435
+ inherits.exports = util.inherits;
436
+ } catch (e) {
437
+ /* istanbul ignore next */
438
+ inherits.exports = requireInherits_browser();
439
+ }
440
+ return inherits.exports;
441
+ }var safeBuffer = {exports: {}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
442
+
443
+ var hasRequiredSafeBuffer;
444
+
445
+ function requireSafeBuffer () {
446
+ if (hasRequiredSafeBuffer) return safeBuffer.exports;
447
+ hasRequiredSafeBuffer = 1;
448
+ (function (module, exports$1) {
449
+ /* eslint-disable node/no-deprecated-api */
450
+ var buffer = require$$0;
451
+ var Buffer = buffer.Buffer;
452
+
453
+ // alternative to using Object.keys for old browsers
454
+ function copyProps (src, dst) {
455
+ for (var key in src) {
456
+ dst[key] = src[key];
457
+ }
458
+ }
459
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
460
+ module.exports = buffer;
461
+ } else {
462
+ // Copy properties from require('buffer')
463
+ copyProps(buffer, exports$1);
464
+ exports$1.Buffer = SafeBuffer;
465
+ }
466
+
467
+ function SafeBuffer (arg, encodingOrOffset, length) {
468
+ return Buffer(arg, encodingOrOffset, length)
469
+ }
470
+
471
+ SafeBuffer.prototype = Object.create(Buffer.prototype);
472
+
473
+ // Copy static methods from Buffer
474
+ copyProps(Buffer, SafeBuffer);
475
+
476
+ SafeBuffer.from = function (arg, encodingOrOffset, length) {
477
+ if (typeof arg === 'number') {
478
+ throw new TypeError('Argument must not be a number')
479
+ }
480
+ return Buffer(arg, encodingOrOffset, length)
481
+ };
482
+
483
+ SafeBuffer.alloc = function (size, fill, encoding) {
484
+ if (typeof size !== 'number') {
485
+ throw new TypeError('Argument must be a number')
486
+ }
487
+ var buf = Buffer(size);
488
+ if (fill !== undefined) {
489
+ if (typeof encoding === 'string') {
490
+ buf.fill(fill, encoding);
491
+ } else {
492
+ buf.fill(fill);
493
+ }
494
+ } else {
495
+ buf.fill(0);
496
+ }
497
+ return buf
498
+ };
499
+
500
+ SafeBuffer.allocUnsafe = function (size) {
501
+ if (typeof size !== 'number') {
502
+ throw new TypeError('Argument must be a number')
503
+ }
504
+ return Buffer(size)
505
+ };
506
+
507
+ SafeBuffer.allocUnsafeSlow = function (size) {
508
+ if (typeof size !== 'number') {
509
+ throw new TypeError('Argument must be a number')
510
+ }
511
+ return buffer.SlowBuffer(size)
512
+ };
513
+ } (safeBuffer, safeBuffer.exports));
514
+ return safeBuffer.exports;
515
+ }var isarray;
516
+ var hasRequiredIsarray;
517
+
518
+ function requireIsarray () {
519
+ if (hasRequiredIsarray) return isarray;
520
+ hasRequiredIsarray = 1;
521
+ var toString = {}.toString;
522
+
523
+ isarray = Array.isArray || function (arr) {
524
+ return toString.call(arr) == '[object Array]';
525
+ };
526
+ return isarray;
527
+ }var type;
528
+ var hasRequiredType;
529
+
530
+ function requireType () {
531
+ if (hasRequiredType) return type;
532
+ hasRequiredType = 1;
533
+
534
+ /** @type {import('./type')} */
535
+ type = TypeError;
536
+ return type;
537
+ }var esObjectAtoms;
538
+ var hasRequiredEsObjectAtoms;
539
+
540
+ function requireEsObjectAtoms () {
541
+ if (hasRequiredEsObjectAtoms) return esObjectAtoms;
542
+ hasRequiredEsObjectAtoms = 1;
543
+
544
+ /** @type {import('.')} */
545
+ esObjectAtoms = Object;
546
+ return esObjectAtoms;
547
+ }var esErrors;
548
+ var hasRequiredEsErrors;
549
+
550
+ function requireEsErrors () {
551
+ if (hasRequiredEsErrors) return esErrors;
552
+ hasRequiredEsErrors = 1;
553
+
554
+ /** @type {import('.')} */
555
+ esErrors = Error;
556
+ return esErrors;
557
+ }var _eval;
558
+ var hasRequired_eval;
559
+
560
+ function require_eval () {
561
+ if (hasRequired_eval) return _eval;
562
+ hasRequired_eval = 1;
563
+
564
+ /** @type {import('./eval')} */
565
+ _eval = EvalError;
566
+ return _eval;
567
+ }var range;
568
+ var hasRequiredRange;
569
+
570
+ function requireRange () {
571
+ if (hasRequiredRange) return range;
572
+ hasRequiredRange = 1;
573
+
574
+ /** @type {import('./range')} */
575
+ range = RangeError;
576
+ return range;
577
+ }var ref;
578
+ var hasRequiredRef;
579
+
580
+ function requireRef () {
581
+ if (hasRequiredRef) return ref;
582
+ hasRequiredRef = 1;
583
+
584
+ /** @type {import('./ref')} */
585
+ ref = ReferenceError;
586
+ return ref;
587
+ }var syntax;
588
+ var hasRequiredSyntax;
589
+
590
+ function requireSyntax () {
591
+ if (hasRequiredSyntax) return syntax;
592
+ hasRequiredSyntax = 1;
593
+
594
+ /** @type {import('./syntax')} */
595
+ syntax = SyntaxError;
596
+ return syntax;
597
+ }var uri;
598
+ var hasRequiredUri;
599
+
600
+ function requireUri () {
601
+ if (hasRequiredUri) return uri;
602
+ hasRequiredUri = 1;
603
+
604
+ /** @type {import('./uri')} */
605
+ uri = URIError;
606
+ return uri;
607
+ }var abs;
608
+ var hasRequiredAbs;
609
+
610
+ function requireAbs () {
611
+ if (hasRequiredAbs) return abs;
612
+ hasRequiredAbs = 1;
613
+
614
+ /** @type {import('./abs')} */
615
+ abs = Math.abs;
616
+ return abs;
617
+ }var floor;
618
+ var hasRequiredFloor;
619
+
620
+ function requireFloor () {
621
+ if (hasRequiredFloor) return floor;
622
+ hasRequiredFloor = 1;
623
+
624
+ /** @type {import('./floor')} */
625
+ floor = Math.floor;
626
+ return floor;
627
+ }var max;
628
+ var hasRequiredMax;
629
+
630
+ function requireMax () {
631
+ if (hasRequiredMax) return max;
632
+ hasRequiredMax = 1;
633
+
634
+ /** @type {import('./max')} */
635
+ max = Math.max;
636
+ return max;
637
+ }var min;
638
+ var hasRequiredMin;
639
+
640
+ function requireMin () {
641
+ if (hasRequiredMin) return min;
642
+ hasRequiredMin = 1;
643
+
644
+ /** @type {import('./min')} */
645
+ min = Math.min;
646
+ return min;
647
+ }var pow;
648
+ var hasRequiredPow;
649
+
650
+ function requirePow () {
651
+ if (hasRequiredPow) return pow;
652
+ hasRequiredPow = 1;
653
+
654
+ /** @type {import('./pow')} */
655
+ pow = Math.pow;
656
+ return pow;
657
+ }var round;
658
+ var hasRequiredRound;
659
+
660
+ function requireRound () {
661
+ if (hasRequiredRound) return round;
662
+ hasRequiredRound = 1;
663
+
664
+ /** @type {import('./round')} */
665
+ round = Math.round;
666
+ return round;
667
+ }var _isNaN;
668
+ var hasRequired_isNaN;
669
+
670
+ function require_isNaN () {
671
+ if (hasRequired_isNaN) return _isNaN;
672
+ hasRequired_isNaN = 1;
673
+
674
+ /** @type {import('./isNaN')} */
675
+ _isNaN = Number.isNaN || function isNaN(a) {
676
+ return a !== a;
677
+ };
678
+ return _isNaN;
679
+ }var sign;
680
+ var hasRequiredSign;
681
+
682
+ function requireSign () {
683
+ if (hasRequiredSign) return sign;
684
+ hasRequiredSign = 1;
685
+
686
+ var $isNaN = /*@__PURE__*/ require_isNaN();
687
+
688
+ /** @type {import('./sign')} */
689
+ sign = function sign(number) {
690
+ if ($isNaN(number) || number === 0) {
691
+ return number;
692
+ }
693
+ return number < 0 ? -1 : 1;
694
+ };
695
+ return sign;
696
+ }var gOPD;
697
+ var hasRequiredGOPD;
698
+
699
+ function requireGOPD () {
700
+ if (hasRequiredGOPD) return gOPD;
701
+ hasRequiredGOPD = 1;
702
+
703
+ /** @type {import('./gOPD')} */
704
+ gOPD = Object.getOwnPropertyDescriptor;
705
+ return gOPD;
706
+ }var gopd;
707
+ var hasRequiredGopd;
708
+
709
+ function requireGopd () {
710
+ if (hasRequiredGopd) return gopd;
711
+ hasRequiredGopd = 1;
712
+
713
+ /** @type {import('.')} */
714
+ var $gOPD = /*@__PURE__*/ requireGOPD();
715
+
716
+ if ($gOPD) {
717
+ try {
718
+ $gOPD([], 'length');
719
+ } catch (e) {
720
+ // IE 8 has a broken gOPD
721
+ $gOPD = null;
722
+ }
723
+ }
724
+
725
+ gopd = $gOPD;
726
+ return gopd;
727
+ }var esDefineProperty;
728
+ var hasRequiredEsDefineProperty;
729
+
730
+ function requireEsDefineProperty () {
731
+ if (hasRequiredEsDefineProperty) return esDefineProperty;
732
+ hasRequiredEsDefineProperty = 1;
733
+
734
+ /** @type {import('.')} */
735
+ var $defineProperty = Object.defineProperty || false;
736
+ if ($defineProperty) {
737
+ try {
738
+ $defineProperty({}, 'a', { value: 1 });
739
+ } catch (e) {
740
+ // IE 8 has a broken defineProperty
741
+ $defineProperty = false;
742
+ }
743
+ }
744
+
745
+ esDefineProperty = $defineProperty;
746
+ return esDefineProperty;
747
+ }var shams$1;
748
+ var hasRequiredShams$1;
749
+
750
+ function requireShams$1 () {
751
+ if (hasRequiredShams$1) return shams$1;
752
+ hasRequiredShams$1 = 1;
753
+
754
+ /** @type {import('./shams')} */
755
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
756
+ shams$1 = function hasSymbols() {
757
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
758
+ if (typeof Symbol.iterator === 'symbol') { return true; }
759
+
760
+ /** @type {{ [k in symbol]?: unknown }} */
761
+ var obj = {};
762
+ var sym = Symbol('test');
763
+ var symObj = Object(sym);
764
+ if (typeof sym === 'string') { return false; }
765
+
766
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
767
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
768
+
769
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
770
+ // if (sym instanceof Symbol) { return false; }
771
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
772
+ // if (!(symObj instanceof Symbol)) { return false; }
773
+
774
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
775
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
776
+
777
+ var symVal = 42;
778
+ obj[sym] = symVal;
779
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
780
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
781
+
782
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
783
+
784
+ var syms = Object.getOwnPropertySymbols(obj);
785
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
786
+
787
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
788
+
789
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
790
+ // eslint-disable-next-line no-extra-parens
791
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
792
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
793
+ }
794
+
795
+ return true;
796
+ };
797
+ return shams$1;
798
+ }var hasSymbols;
799
+ var hasRequiredHasSymbols;
800
+
801
+ function requireHasSymbols () {
802
+ if (hasRequiredHasSymbols) return hasSymbols;
803
+ hasRequiredHasSymbols = 1;
804
+
805
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
806
+ var hasSymbolSham = requireShams$1();
807
+
808
+ /** @type {import('.')} */
809
+ hasSymbols = function hasNativeSymbols() {
810
+ if (typeof origSymbol !== 'function') { return false; }
811
+ if (typeof Symbol !== 'function') { return false; }
812
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
813
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
814
+
815
+ return hasSymbolSham();
816
+ };
817
+ return hasSymbols;
818
+ }var Reflect_getPrototypeOf;
819
+ var hasRequiredReflect_getPrototypeOf;
820
+
821
+ function requireReflect_getPrototypeOf () {
822
+ if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
823
+ hasRequiredReflect_getPrototypeOf = 1;
824
+
825
+ /** @type {import('./Reflect.getPrototypeOf')} */
826
+ Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
827
+ return Reflect_getPrototypeOf;
828
+ }var Object_getPrototypeOf;
829
+ var hasRequiredObject_getPrototypeOf;
830
+
831
+ function requireObject_getPrototypeOf () {
832
+ if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
833
+ hasRequiredObject_getPrototypeOf = 1;
834
+
835
+ var $Object = /*@__PURE__*/ requireEsObjectAtoms();
836
+
837
+ /** @type {import('./Object.getPrototypeOf')} */
838
+ Object_getPrototypeOf = $Object.getPrototypeOf || null;
839
+ return Object_getPrototypeOf;
840
+ }var implementation;
841
+ var hasRequiredImplementation;
842
+
843
+ function requireImplementation () {
844
+ if (hasRequiredImplementation) return implementation;
845
+ hasRequiredImplementation = 1;
846
+
847
+ /* eslint no-invalid-this: 1 */
848
+
849
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
850
+ var toStr = Object.prototype.toString;
851
+ var max = Math.max;
852
+ var funcType = '[object Function]';
853
+
854
+ var concatty = function concatty(a, b) {
855
+ var arr = [];
856
+
857
+ for (var i = 0; i < a.length; i += 1) {
858
+ arr[i] = a[i];
859
+ }
860
+ for (var j = 0; j < b.length; j += 1) {
861
+ arr[j + a.length] = b[j];
862
+ }
863
+
864
+ return arr;
865
+ };
866
+
867
+ var slicy = function slicy(arrLike, offset) {
868
+ var arr = [];
869
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
870
+ arr[j] = arrLike[i];
871
+ }
872
+ return arr;
873
+ };
874
+
875
+ var joiny = function (arr, joiner) {
876
+ var str = '';
877
+ for (var i = 0; i < arr.length; i += 1) {
878
+ str += arr[i];
879
+ if (i + 1 < arr.length) {
880
+ str += joiner;
881
+ }
882
+ }
883
+ return str;
884
+ };
885
+
886
+ implementation = function bind(that) {
887
+ var target = this;
888
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
889
+ throw new TypeError(ERROR_MESSAGE + target);
890
+ }
891
+ var args = slicy(arguments, 1);
892
+
893
+ var bound;
894
+ var binder = function () {
895
+ if (this instanceof bound) {
896
+ var result = target.apply(
897
+ this,
898
+ concatty(args, arguments)
899
+ );
900
+ if (Object(result) === result) {
901
+ return result;
902
+ }
903
+ return this;
904
+ }
905
+ return target.apply(
906
+ that,
907
+ concatty(args, arguments)
908
+ );
909
+
910
+ };
911
+
912
+ var boundLength = max(0, target.length - args.length);
913
+ var boundArgs = [];
914
+ for (var i = 0; i < boundLength; i++) {
915
+ boundArgs[i] = '$' + i;
916
+ }
917
+
918
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
919
+
920
+ if (target.prototype) {
921
+ var Empty = function Empty() {};
922
+ Empty.prototype = target.prototype;
923
+ bound.prototype = new Empty();
924
+ Empty.prototype = null;
925
+ }
926
+
927
+ return bound;
928
+ };
929
+ return implementation;
930
+ }var functionBind;
931
+ var hasRequiredFunctionBind;
932
+
933
+ function requireFunctionBind () {
934
+ if (hasRequiredFunctionBind) return functionBind;
935
+ hasRequiredFunctionBind = 1;
936
+
937
+ var implementation = requireImplementation();
938
+
939
+ functionBind = Function.prototype.bind || implementation;
940
+ return functionBind;
941
+ }var functionCall;
942
+ var hasRequiredFunctionCall;
943
+
944
+ function requireFunctionCall () {
945
+ if (hasRequiredFunctionCall) return functionCall;
946
+ hasRequiredFunctionCall = 1;
947
+
948
+ /** @type {import('./functionCall')} */
949
+ functionCall = Function.prototype.call;
950
+ return functionCall;
951
+ }var functionApply;
952
+ var hasRequiredFunctionApply;
953
+
954
+ function requireFunctionApply () {
955
+ if (hasRequiredFunctionApply) return functionApply;
956
+ hasRequiredFunctionApply = 1;
957
+
958
+ /** @type {import('./functionApply')} */
959
+ functionApply = Function.prototype.apply;
960
+ return functionApply;
961
+ }var reflectApply;
962
+ var hasRequiredReflectApply;
963
+
964
+ function requireReflectApply () {
965
+ if (hasRequiredReflectApply) return reflectApply;
966
+ hasRequiredReflectApply = 1;
967
+
968
+ /** @type {import('./reflectApply')} */
969
+ reflectApply = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
970
+ return reflectApply;
971
+ }var actualApply;
972
+ var hasRequiredActualApply;
973
+
974
+ function requireActualApply () {
975
+ if (hasRequiredActualApply) return actualApply;
976
+ hasRequiredActualApply = 1;
977
+
978
+ var bind = requireFunctionBind();
979
+
980
+ var $apply = requireFunctionApply();
981
+ var $call = requireFunctionCall();
982
+ var $reflectApply = requireReflectApply();
983
+
984
+ /** @type {import('./actualApply')} */
985
+ actualApply = $reflectApply || bind.call($call, $apply);
986
+ return actualApply;
987
+ }var callBindApplyHelpers;
988
+ var hasRequiredCallBindApplyHelpers;
989
+
990
+ function requireCallBindApplyHelpers () {
991
+ if (hasRequiredCallBindApplyHelpers) return callBindApplyHelpers;
992
+ hasRequiredCallBindApplyHelpers = 1;
993
+
994
+ var bind = requireFunctionBind();
995
+ var $TypeError = /*@__PURE__*/ requireType();
996
+
997
+ var $call = requireFunctionCall();
998
+ var $actualApply = requireActualApply();
999
+
1000
+ /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
1001
+ callBindApplyHelpers = function callBindBasic(args) {
1002
+ if (args.length < 1 || typeof args[0] !== 'function') {
1003
+ throw new $TypeError('a function is required');
1004
+ }
1005
+ return $actualApply(bind, $call, args);
1006
+ };
1007
+ return callBindApplyHelpers;
1008
+ }var get;
1009
+ var hasRequiredGet;
1010
+
1011
+ function requireGet () {
1012
+ if (hasRequiredGet) return get;
1013
+ hasRequiredGet = 1;
1014
+
1015
+ var callBind = requireCallBindApplyHelpers();
1016
+ var gOPD = /*@__PURE__*/ requireGopd();
1017
+
1018
+ var hasProtoAccessor;
1019
+ try {
1020
+ // eslint-disable-next-line no-extra-parens, no-proto
1021
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
1022
+ } catch (e) {
1023
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
1024
+ throw e;
1025
+ }
1026
+ }
1027
+
1028
+ // eslint-disable-next-line no-extra-parens
1029
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
1030
+
1031
+ var $Object = Object;
1032
+ var $getPrototypeOf = $Object.getPrototypeOf;
1033
+
1034
+ /** @type {import('./get')} */
1035
+ get = desc && typeof desc.get === 'function'
1036
+ ? callBind([desc.get])
1037
+ : typeof $getPrototypeOf === 'function'
1038
+ ? /** @type {import('./get')} */ function getDunder(value) {
1039
+ // eslint-disable-next-line eqeqeq
1040
+ return $getPrototypeOf(value == null ? value : $Object(value));
1041
+ }
1042
+ : false;
1043
+ return get;
1044
+ }var getProto;
1045
+ var hasRequiredGetProto;
1046
+
1047
+ function requireGetProto () {
1048
+ if (hasRequiredGetProto) return getProto;
1049
+ hasRequiredGetProto = 1;
1050
+
1051
+ var reflectGetProto = requireReflect_getPrototypeOf();
1052
+ var originalGetProto = requireObject_getPrototypeOf();
1053
+
1054
+ var getDunderProto = /*@__PURE__*/ requireGet();
1055
+
1056
+ /** @type {import('.')} */
1057
+ getProto = reflectGetProto
1058
+ ? function getProto(O) {
1059
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
1060
+ return reflectGetProto(O);
1061
+ }
1062
+ : originalGetProto
1063
+ ? function getProto(O) {
1064
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
1065
+ throw new TypeError('getProto: not an object');
1066
+ }
1067
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
1068
+ return originalGetProto(O);
1069
+ }
1070
+ : getDunderProto
1071
+ ? function getProto(O) {
1072
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
1073
+ return getDunderProto(O);
1074
+ }
1075
+ : null;
1076
+ return getProto;
1077
+ }var hasown;
1078
+ var hasRequiredHasown;
1079
+
1080
+ function requireHasown () {
1081
+ if (hasRequiredHasown) return hasown;
1082
+ hasRequiredHasown = 1;
1083
+
1084
+ var call = Function.prototype.call;
1085
+ var $hasOwn = Object.prototype.hasOwnProperty;
1086
+ var bind = requireFunctionBind();
1087
+
1088
+ /** @type {import('.')} */
1089
+ hasown = bind.call(call, $hasOwn);
1090
+ return hasown;
1091
+ }var getIntrinsic;
1092
+ var hasRequiredGetIntrinsic;
1093
+
1094
+ function requireGetIntrinsic () {
1095
+ if (hasRequiredGetIntrinsic) return getIntrinsic;
1096
+ hasRequiredGetIntrinsic = 1;
1097
+
1098
+ var undefined$1;
1099
+
1100
+ var $Object = /*@__PURE__*/ requireEsObjectAtoms();
1101
+
1102
+ var $Error = /*@__PURE__*/ requireEsErrors();
1103
+ var $EvalError = /*@__PURE__*/ require_eval();
1104
+ var $RangeError = /*@__PURE__*/ requireRange();
1105
+ var $ReferenceError = /*@__PURE__*/ requireRef();
1106
+ var $SyntaxError = /*@__PURE__*/ requireSyntax();
1107
+ var $TypeError = /*@__PURE__*/ requireType();
1108
+ var $URIError = /*@__PURE__*/ requireUri();
1109
+
1110
+ var abs = /*@__PURE__*/ requireAbs();
1111
+ var floor = /*@__PURE__*/ requireFloor();
1112
+ var max = /*@__PURE__*/ requireMax();
1113
+ var min = /*@__PURE__*/ requireMin();
1114
+ var pow = /*@__PURE__*/ requirePow();
1115
+ var round = /*@__PURE__*/ requireRound();
1116
+ var sign = /*@__PURE__*/ requireSign();
1117
+
1118
+ var $Function = Function;
1119
+
1120
+ // eslint-disable-next-line consistent-return
1121
+ var getEvalledConstructor = function (expressionSyntax) {
1122
+ try {
1123
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1124
+ } catch (e) {}
1125
+ };
1126
+
1127
+ var $gOPD = /*@__PURE__*/ requireGopd();
1128
+ var $defineProperty = /*@__PURE__*/ requireEsDefineProperty();
1129
+
1130
+ var throwTypeError = function () {
1131
+ throw new $TypeError();
1132
+ };
1133
+ var ThrowTypeError = $gOPD
1134
+ ? (function () {
1135
+ try {
1136
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
1137
+ arguments.callee; // IE 8 does not throw here
1138
+ return throwTypeError;
1139
+ } catch (calleeThrows) {
1140
+ try {
1141
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1142
+ return $gOPD(arguments, 'callee').get;
1143
+ } catch (gOPDthrows) {
1144
+ return throwTypeError;
1145
+ }
1146
+ }
1147
+ }())
1148
+ : throwTypeError;
1149
+
1150
+ var hasSymbols = requireHasSymbols()();
1151
+
1152
+ var getProto = requireGetProto();
1153
+ var $ObjectGPO = requireObject_getPrototypeOf();
1154
+ var $ReflectGPO = requireReflect_getPrototypeOf();
1155
+
1156
+ var $apply = requireFunctionApply();
1157
+ var $call = requireFunctionCall();
1158
+
1159
+ var needsEval = {};
1160
+
1161
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
1162
+
1163
+ var INTRINSICS = {
1164
+ __proto__: null,
1165
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
1166
+ '%Array%': Array,
1167
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
1168
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
1169
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
1170
+ '%AsyncFunction%': needsEval,
1171
+ '%AsyncGenerator%': needsEval,
1172
+ '%AsyncGeneratorFunction%': needsEval,
1173
+ '%AsyncIteratorPrototype%': needsEval,
1174
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
1175
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
1176
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
1177
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
1178
+ '%Boolean%': Boolean,
1179
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
1180
+ '%Date%': Date,
1181
+ '%decodeURI%': decodeURI,
1182
+ '%decodeURIComponent%': decodeURIComponent,
1183
+ '%encodeURI%': encodeURI,
1184
+ '%encodeURIComponent%': encodeURIComponent,
1185
+ '%Error%': $Error,
1186
+ '%eval%': eval, // eslint-disable-line no-eval
1187
+ '%EvalError%': $EvalError,
1188
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
1189
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
1190
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
1191
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
1192
+ '%Function%': $Function,
1193
+ '%GeneratorFunction%': needsEval,
1194
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
1195
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
1196
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
1197
+ '%isFinite%': isFinite,
1198
+ '%isNaN%': isNaN,
1199
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
1200
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
1201
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
1202
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
1203
+ '%Math%': Math,
1204
+ '%Number%': Number,
1205
+ '%Object%': $Object,
1206
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
1207
+ '%parseFloat%': parseFloat,
1208
+ '%parseInt%': parseInt,
1209
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
1210
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
1211
+ '%RangeError%': $RangeError,
1212
+ '%ReferenceError%': $ReferenceError,
1213
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
1214
+ '%RegExp%': RegExp,
1215
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
1216
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
1217
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
1218
+ '%String%': String,
1219
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
1220
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
1221
+ '%SyntaxError%': $SyntaxError,
1222
+ '%ThrowTypeError%': ThrowTypeError,
1223
+ '%TypedArray%': TypedArray,
1224
+ '%TypeError%': $TypeError,
1225
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
1226
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
1227
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
1228
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
1229
+ '%URIError%': $URIError,
1230
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
1231
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
1232
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
1233
+
1234
+ '%Function.prototype.call%': $call,
1235
+ '%Function.prototype.apply%': $apply,
1236
+ '%Object.defineProperty%': $defineProperty,
1237
+ '%Object.getPrototypeOf%': $ObjectGPO,
1238
+ '%Math.abs%': abs,
1239
+ '%Math.floor%': floor,
1240
+ '%Math.max%': max,
1241
+ '%Math.min%': min,
1242
+ '%Math.pow%': pow,
1243
+ '%Math.round%': round,
1244
+ '%Math.sign%': sign,
1245
+ '%Reflect.getPrototypeOf%': $ReflectGPO
1246
+ };
1247
+
1248
+ if (getProto) {
1249
+ try {
1250
+ null.error; // eslint-disable-line no-unused-expressions
1251
+ } catch (e) {
1252
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
1253
+ var errorProto = getProto(getProto(e));
1254
+ INTRINSICS['%Error.prototype%'] = errorProto;
1255
+ }
1256
+ }
1257
+
1258
+ var doEval = function doEval(name) {
1259
+ var value;
1260
+ if (name === '%AsyncFunction%') {
1261
+ value = getEvalledConstructor('async function () {}');
1262
+ } else if (name === '%GeneratorFunction%') {
1263
+ value = getEvalledConstructor('function* () {}');
1264
+ } else if (name === '%AsyncGeneratorFunction%') {
1265
+ value = getEvalledConstructor('async function* () {}');
1266
+ } else if (name === '%AsyncGenerator%') {
1267
+ var fn = doEval('%AsyncGeneratorFunction%');
1268
+ if (fn) {
1269
+ value = fn.prototype;
1270
+ }
1271
+ } else if (name === '%AsyncIteratorPrototype%') {
1272
+ var gen = doEval('%AsyncGenerator%');
1273
+ if (gen && getProto) {
1274
+ value = getProto(gen.prototype);
1275
+ }
1276
+ }
1277
+
1278
+ INTRINSICS[name] = value;
1279
+
1280
+ return value;
1281
+ };
1282
+
1283
+ var LEGACY_ALIASES = {
1284
+ __proto__: null,
1285
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1286
+ '%ArrayPrototype%': ['Array', 'prototype'],
1287
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1288
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1289
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1290
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1291
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1292
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1293
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1294
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
1295
+ '%DataViewPrototype%': ['DataView', 'prototype'],
1296
+ '%DatePrototype%': ['Date', 'prototype'],
1297
+ '%ErrorPrototype%': ['Error', 'prototype'],
1298
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1299
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1300
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1301
+ '%FunctionPrototype%': ['Function', 'prototype'],
1302
+ '%Generator%': ['GeneratorFunction', 'prototype'],
1303
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1304
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1305
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1306
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1307
+ '%JSONParse%': ['JSON', 'parse'],
1308
+ '%JSONStringify%': ['JSON', 'stringify'],
1309
+ '%MapPrototype%': ['Map', 'prototype'],
1310
+ '%NumberPrototype%': ['Number', 'prototype'],
1311
+ '%ObjectPrototype%': ['Object', 'prototype'],
1312
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1313
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1314
+ '%PromisePrototype%': ['Promise', 'prototype'],
1315
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1316
+ '%Promise_all%': ['Promise', 'all'],
1317
+ '%Promise_reject%': ['Promise', 'reject'],
1318
+ '%Promise_resolve%': ['Promise', 'resolve'],
1319
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1320
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1321
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
1322
+ '%SetPrototype%': ['Set', 'prototype'],
1323
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1324
+ '%StringPrototype%': ['String', 'prototype'],
1325
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
1326
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1327
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1328
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1329
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1330
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1331
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1332
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1333
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
1334
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1335
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
1336
+ };
1337
+
1338
+ var bind = requireFunctionBind();
1339
+ var hasOwn = /*@__PURE__*/ requireHasown();
1340
+ var $concat = bind.call($call, Array.prototype.concat);
1341
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
1342
+ var $replace = bind.call($call, String.prototype.replace);
1343
+ var $strSlice = bind.call($call, String.prototype.slice);
1344
+ var $exec = bind.call($call, RegExp.prototype.exec);
1345
+
1346
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1347
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1348
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1349
+ var stringToPath = function stringToPath(string) {
1350
+ var first = $strSlice(string, 0, 1);
1351
+ var last = $strSlice(string, -1);
1352
+ if (first === '%' && last !== '%') {
1353
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
1354
+ } else if (last === '%' && first !== '%') {
1355
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
1356
+ }
1357
+ var result = [];
1358
+ $replace(string, rePropName, function (match, number, quote, subString) {
1359
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
1360
+ });
1361
+ return result;
1362
+ };
1363
+ /* end adaptation */
1364
+
1365
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1366
+ var intrinsicName = name;
1367
+ var alias;
1368
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
1369
+ alias = LEGACY_ALIASES[intrinsicName];
1370
+ intrinsicName = '%' + alias[0] + '%';
1371
+ }
1372
+
1373
+ if (hasOwn(INTRINSICS, intrinsicName)) {
1374
+ var value = INTRINSICS[intrinsicName];
1375
+ if (value === needsEval) {
1376
+ value = doEval(intrinsicName);
1377
+ }
1378
+ if (typeof value === 'undefined' && !allowMissing) {
1379
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1380
+ }
1381
+
1382
+ return {
1383
+ alias: alias,
1384
+ name: intrinsicName,
1385
+ value: value
1386
+ };
1387
+ }
1388
+
1389
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
1390
+ };
1391
+
1392
+ getIntrinsic = function GetIntrinsic(name, allowMissing) {
1393
+ if (typeof name !== 'string' || name.length === 0) {
1394
+ throw new $TypeError('intrinsic name must be a non-empty string');
1395
+ }
1396
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1397
+ throw new $TypeError('"allowMissing" argument must be a boolean');
1398
+ }
1399
+
1400
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
1401
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
1402
+ }
1403
+ var parts = stringToPath(name);
1404
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1405
+
1406
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1407
+ var intrinsicRealName = intrinsic.name;
1408
+ var value = intrinsic.value;
1409
+ var skipFurtherCaching = false;
1410
+
1411
+ var alias = intrinsic.alias;
1412
+ if (alias) {
1413
+ intrinsicBaseName = alias[0];
1414
+ $spliceApply(parts, $concat([0, 1], alias));
1415
+ }
1416
+
1417
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1418
+ var part = parts[i];
1419
+ var first = $strSlice(part, 0, 1);
1420
+ var last = $strSlice(part, -1);
1421
+ if (
1422
+ (
1423
+ (first === '"' || first === "'" || first === '`')
1424
+ || (last === '"' || last === "'" || last === '`')
1425
+ )
1426
+ && first !== last
1427
+ ) {
1428
+ throw new $SyntaxError('property names with quotes must have matching quotes');
1429
+ }
1430
+ if (part === 'constructor' || !isOwn) {
1431
+ skipFurtherCaching = true;
1432
+ }
1433
+
1434
+ intrinsicBaseName += '.' + part;
1435
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
1436
+
1437
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
1438
+ value = INTRINSICS[intrinsicRealName];
1439
+ } else if (value != null) {
1440
+ if (!(part in value)) {
1441
+ if (!allowMissing) {
1442
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1443
+ }
1444
+ return void undefined$1;
1445
+ }
1446
+ if ($gOPD && (i + 1) >= parts.length) {
1447
+ var desc = $gOPD(value, part);
1448
+ isOwn = !!desc;
1449
+
1450
+ // By convention, when a data property is converted to an accessor
1451
+ // property to emulate a data property that does not suffer from
1452
+ // the override mistake, that accessor's getter is marked with
1453
+ // an `originalValue` property. Here, when we detect this, we
1454
+ // uphold the illusion by pretending to see that original data
1455
+ // property, i.e., returning the value rather than the getter
1456
+ // itself.
1457
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1458
+ value = desc.get;
1459
+ } else {
1460
+ value = value[part];
1461
+ }
1462
+ } else {
1463
+ isOwn = hasOwn(value, part);
1464
+ value = value[part];
1465
+ }
1466
+
1467
+ if (isOwn && !skipFurtherCaching) {
1468
+ INTRINSICS[intrinsicRealName] = value;
1469
+ }
1470
+ }
1471
+ }
1472
+ return value;
1473
+ };
1474
+ return getIntrinsic;
1475
+ }var callBound;
1476
+ var hasRequiredCallBound;
1477
+
1478
+ function requireCallBound () {
1479
+ if (hasRequiredCallBound) return callBound;
1480
+ hasRequiredCallBound = 1;
1481
+
1482
+ var GetIntrinsic = /*@__PURE__*/ requireGetIntrinsic();
1483
+
1484
+ var callBindBasic = requireCallBindApplyHelpers();
1485
+
1486
+ /** @type {(thisArg: string, searchString: string, position?: number) => number} */
1487
+ var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
1488
+
1489
+ /** @type {import('.')} */
1490
+ callBound = function callBoundIntrinsic(name, allowMissing) {
1491
+ /* eslint no-extra-parens: 0 */
1492
+
1493
+ var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
1494
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1495
+ return callBindBasic(/** @type {const} */ ([intrinsic]));
1496
+ }
1497
+ return intrinsic;
1498
+ };
1499
+ return callBound;
1500
+ }var isCallable;
1501
+ var hasRequiredIsCallable;
1502
+
1503
+ function requireIsCallable () {
1504
+ if (hasRequiredIsCallable) return isCallable;
1505
+ hasRequiredIsCallable = 1;
1506
+
1507
+ var fnToStr = Function.prototype.toString;
1508
+ var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
1509
+ var badArrayLike;
1510
+ var isCallableMarker;
1511
+ if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
1512
+ try {
1513
+ badArrayLike = Object.defineProperty({}, 'length', {
1514
+ get: function () {
1515
+ throw isCallableMarker;
1516
+ }
1517
+ });
1518
+ isCallableMarker = {};
1519
+ // eslint-disable-next-line no-throw-literal
1520
+ reflectApply(function () { throw 42; }, null, badArrayLike);
1521
+ } catch (_) {
1522
+ if (_ !== isCallableMarker) {
1523
+ reflectApply = null;
1524
+ }
1525
+ }
1526
+ } else {
1527
+ reflectApply = null;
1528
+ }
1529
+
1530
+ var constructorRegex = /^\s*class\b/;
1531
+ var isES6ClassFn = function isES6ClassFunction(value) {
1532
+ try {
1533
+ var fnStr = fnToStr.call(value);
1534
+ return constructorRegex.test(fnStr);
1535
+ } catch (e) {
1536
+ return false; // not a function
1537
+ }
1538
+ };
1539
+
1540
+ var tryFunctionObject = function tryFunctionToStr(value) {
1541
+ try {
1542
+ if (isES6ClassFn(value)) { return false; }
1543
+ fnToStr.call(value);
1544
+ return true;
1545
+ } catch (e) {
1546
+ return false;
1547
+ }
1548
+ };
1549
+ var toStr = Object.prototype.toString;
1550
+ var objectClass = '[object Object]';
1551
+ var fnClass = '[object Function]';
1552
+ var genClass = '[object GeneratorFunction]';
1553
+ var ddaClass = '[object HTMLAllCollection]'; // IE 11
1554
+ var ddaClass2 = '[object HTML document.all class]';
1555
+ var ddaClass3 = '[object HTMLCollection]'; // IE 9-10
1556
+ var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
1557
+
1558
+ var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing
1559
+
1560
+ var isDDA = function isDocumentDotAll() { return false; };
1561
+ if (typeof document === 'object') {
1562
+ // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
1563
+ var all = document.all;
1564
+ if (toStr.call(all) === toStr.call(document.all)) {
1565
+ isDDA = function isDocumentDotAll(value) {
1566
+ /* globals document: false */
1567
+ // in IE 6-8, typeof document.all is "object" and it's truthy
1568
+ if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
1569
+ try {
1570
+ var str = toStr.call(value);
1571
+ return (
1572
+ str === ddaClass
1573
+ || str === ddaClass2
1574
+ || str === ddaClass3 // opera 12.16
1575
+ || str === objectClass // IE 6-8
1576
+ ) && value('') == null; // eslint-disable-line eqeqeq
1577
+ } catch (e) { /**/ }
1578
+ }
1579
+ return false;
1580
+ };
1581
+ }
1582
+ }
1583
+
1584
+ isCallable = reflectApply
1585
+ ? function isCallable(value) {
1586
+ if (isDDA(value)) { return true; }
1587
+ if (!value) { return false; }
1588
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
1589
+ try {
1590
+ reflectApply(value, null, badArrayLike);
1591
+ } catch (e) {
1592
+ if (e !== isCallableMarker) { return false; }
1593
+ }
1594
+ return !isES6ClassFn(value) && tryFunctionObject(value);
1595
+ }
1596
+ : function isCallable(value) {
1597
+ if (isDDA(value)) { return true; }
1598
+ if (!value) { return false; }
1599
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
1600
+ if (hasToStringTag) { return tryFunctionObject(value); }
1601
+ if (isES6ClassFn(value)) { return false; }
1602
+ var strClass = toStr.call(value);
1603
+ if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; }
1604
+ return tryFunctionObject(value);
1605
+ };
1606
+ return isCallable;
1607
+ }var forEach;
1608
+ var hasRequiredForEach;
1609
+
1610
+ function requireForEach () {
1611
+ if (hasRequiredForEach) return forEach;
1612
+ hasRequiredForEach = 1;
1613
+
1614
+ var isCallable = requireIsCallable();
1615
+
1616
+ var toStr = Object.prototype.toString;
1617
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1618
+
1619
+ /** @type {<This, A extends readonly unknown[]>(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */
1620
+ var forEachArray = function forEachArray(array, iterator, receiver) {
1621
+ for (var i = 0, len = array.length; i < len; i++) {
1622
+ if (hasOwnProperty.call(array, i)) {
1623
+ if (receiver == null) {
1624
+ iterator(array[i], i, array);
1625
+ } else {
1626
+ iterator.call(receiver, array[i], i, array);
1627
+ }
1628
+ }
1629
+ }
1630
+ };
1631
+
1632
+ /** @type {<This, S extends string>(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */
1633
+ var forEachString = function forEachString(string, iterator, receiver) {
1634
+ for (var i = 0, len = string.length; i < len; i++) {
1635
+ // no such thing as a sparse string.
1636
+ if (receiver == null) {
1637
+ iterator(string.charAt(i), i, string);
1638
+ } else {
1639
+ iterator.call(receiver, string.charAt(i), i, string);
1640
+ }
1641
+ }
1642
+ };
1643
+
1644
+ /** @type {<This, O>(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */
1645
+ var forEachObject = function forEachObject(object, iterator, receiver) {
1646
+ for (var k in object) {
1647
+ if (hasOwnProperty.call(object, k)) {
1648
+ if (receiver == null) {
1649
+ iterator(object[k], k, object);
1650
+ } else {
1651
+ iterator.call(receiver, object[k], k, object);
1652
+ }
1653
+ }
1654
+ }
1655
+ };
1656
+
1657
+ /** @type {(x: unknown) => x is readonly unknown[]} */
1658
+ function isArray(x) {
1659
+ return toStr.call(x) === '[object Array]';
1660
+ }
1661
+
1662
+ /** @type {import('.')._internal} */
1663
+ forEach = function forEach(list, iterator, thisArg) {
1664
+ if (!isCallable(iterator)) {
1665
+ throw new TypeError('iterator must be a function');
1666
+ }
1667
+
1668
+ var receiver;
1669
+ if (arguments.length >= 3) {
1670
+ receiver = thisArg;
1671
+ }
1672
+
1673
+ if (isArray(list)) {
1674
+ forEachArray(list, iterator, receiver);
1675
+ } else if (typeof list === 'string') {
1676
+ forEachString(list, iterator, receiver);
1677
+ } else {
1678
+ forEachObject(list, iterator, receiver);
1679
+ }
1680
+ };
1681
+ return forEach;
1682
+ }var possibleTypedArrayNames;
1683
+ var hasRequiredPossibleTypedArrayNames;
1684
+
1685
+ function requirePossibleTypedArrayNames () {
1686
+ if (hasRequiredPossibleTypedArrayNames) return possibleTypedArrayNames;
1687
+ hasRequiredPossibleTypedArrayNames = 1;
1688
+
1689
+ /** @type {import('.')} */
1690
+ possibleTypedArrayNames = [
1691
+ 'Float16Array',
1692
+ 'Float32Array',
1693
+ 'Float64Array',
1694
+ 'Int8Array',
1695
+ 'Int16Array',
1696
+ 'Int32Array',
1697
+ 'Uint8Array',
1698
+ 'Uint8ClampedArray',
1699
+ 'Uint16Array',
1700
+ 'Uint32Array',
1701
+ 'BigInt64Array',
1702
+ 'BigUint64Array'
1703
+ ];
1704
+ return possibleTypedArrayNames;
1705
+ }var availableTypedArrays;
1706
+ var hasRequiredAvailableTypedArrays;
1707
+
1708
+ function requireAvailableTypedArrays () {
1709
+ if (hasRequiredAvailableTypedArrays) return availableTypedArrays;
1710
+ hasRequiredAvailableTypedArrays = 1;
1711
+
1712
+ var possibleNames = /*@__PURE__*/ requirePossibleTypedArrayNames();
1713
+
1714
+ var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
1715
+
1716
+ /** @type {import('.')} */
1717
+ availableTypedArrays = function availableTypedArrays() {
1718
+ var /** @type {ReturnType<typeof availableTypedArrays>} */ out = [];
1719
+ for (var i = 0; i < possibleNames.length; i++) {
1720
+ if (typeof g[possibleNames[i]] === 'function') {
1721
+ // @ts-expect-error
1722
+ out[out.length] = possibleNames[i];
1723
+ }
1724
+ }
1725
+ return out;
1726
+ };
1727
+ return availableTypedArrays;
1728
+ }var callBind = {exports: {}};var defineDataProperty;
1729
+ var hasRequiredDefineDataProperty;
1730
+
1731
+ function requireDefineDataProperty () {
1732
+ if (hasRequiredDefineDataProperty) return defineDataProperty;
1733
+ hasRequiredDefineDataProperty = 1;
1734
+
1735
+ var $defineProperty = /*@__PURE__*/ requireEsDefineProperty();
1736
+
1737
+ var $SyntaxError = /*@__PURE__*/ requireSyntax();
1738
+ var $TypeError = /*@__PURE__*/ requireType();
1739
+
1740
+ var gopd = /*@__PURE__*/ requireGopd();
1741
+
1742
+ /** @type {import('.')} */
1743
+ defineDataProperty = function defineDataProperty(
1744
+ obj,
1745
+ property,
1746
+ value
1747
+ ) {
1748
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
1749
+ throw new $TypeError('`obj` must be an object or a function`');
1750
+ }
1751
+ if (typeof property !== 'string' && typeof property !== 'symbol') {
1752
+ throw new $TypeError('`property` must be a string or a symbol`');
1753
+ }
1754
+ if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
1755
+ throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
1756
+ }
1757
+ if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
1758
+ throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
1759
+ }
1760
+ if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
1761
+ throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
1762
+ }
1763
+ if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
1764
+ throw new $TypeError('`loose`, if provided, must be a boolean');
1765
+ }
1766
+
1767
+ var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
1768
+ var nonWritable = arguments.length > 4 ? arguments[4] : null;
1769
+ var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
1770
+ var loose = arguments.length > 6 ? arguments[6] : false;
1771
+
1772
+ /* @type {false | TypedPropertyDescriptor<unknown>} */
1773
+ var desc = !!gopd && gopd(obj, property);
1774
+
1775
+ if ($defineProperty) {
1776
+ $defineProperty(obj, property, {
1777
+ configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
1778
+ enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
1779
+ value: value,
1780
+ writable: nonWritable === null && desc ? desc.writable : !nonWritable
1781
+ });
1782
+ } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
1783
+ // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
1784
+ obj[property] = value; // eslint-disable-line no-param-reassign
1785
+ } else {
1786
+ throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
1787
+ }
1788
+ };
1789
+ return defineDataProperty;
1790
+ }var hasPropertyDescriptors_1;
1791
+ var hasRequiredHasPropertyDescriptors;
1792
+
1793
+ function requireHasPropertyDescriptors () {
1794
+ if (hasRequiredHasPropertyDescriptors) return hasPropertyDescriptors_1;
1795
+ hasRequiredHasPropertyDescriptors = 1;
1796
+
1797
+ var $defineProperty = /*@__PURE__*/ requireEsDefineProperty();
1798
+
1799
+ var hasPropertyDescriptors = function hasPropertyDescriptors() {
1800
+ return !!$defineProperty;
1801
+ };
1802
+
1803
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
1804
+ // node v0.6 has a bug where array lengths can be Set but not Defined
1805
+ if (!$defineProperty) {
1806
+ return null;
1807
+ }
1808
+ try {
1809
+ return $defineProperty([], 'length', { value: 1 }).length !== 1;
1810
+ } catch (e) {
1811
+ // In Firefox 4-22, defining length on an array throws an exception.
1812
+ return true;
1813
+ }
1814
+ };
1815
+
1816
+ hasPropertyDescriptors_1 = hasPropertyDescriptors;
1817
+ return hasPropertyDescriptors_1;
1818
+ }var setFunctionLength;
1819
+ var hasRequiredSetFunctionLength;
1820
+
1821
+ function requireSetFunctionLength () {
1822
+ if (hasRequiredSetFunctionLength) return setFunctionLength;
1823
+ hasRequiredSetFunctionLength = 1;
1824
+
1825
+ var GetIntrinsic = /*@__PURE__*/ requireGetIntrinsic();
1826
+ var define = /*@__PURE__*/ requireDefineDataProperty();
1827
+ var hasDescriptors = /*@__PURE__*/ requireHasPropertyDescriptors()();
1828
+ var gOPD = /*@__PURE__*/ requireGopd();
1829
+
1830
+ var $TypeError = /*@__PURE__*/ requireType();
1831
+ var $floor = GetIntrinsic('%Math.floor%');
1832
+
1833
+ /** @type {import('.')} */
1834
+ setFunctionLength = function setFunctionLength(fn, length) {
1835
+ if (typeof fn !== 'function') {
1836
+ throw new $TypeError('`fn` is not a function');
1837
+ }
1838
+ if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
1839
+ throw new $TypeError('`length` must be a positive 32-bit integer');
1840
+ }
1841
+
1842
+ var loose = arguments.length > 2 && !!arguments[2];
1843
+
1844
+ var functionLengthIsConfigurable = true;
1845
+ var functionLengthIsWritable = true;
1846
+ if ('length' in fn && gOPD) {
1847
+ var desc = gOPD(fn, 'length');
1848
+ if (desc && !desc.configurable) {
1849
+ functionLengthIsConfigurable = false;
1850
+ }
1851
+ if (desc && !desc.writable) {
1852
+ functionLengthIsWritable = false;
1853
+ }
1854
+ }
1855
+
1856
+ if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
1857
+ if (hasDescriptors) {
1858
+ define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
1859
+ } else {
1860
+ define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
1861
+ }
1862
+ }
1863
+ return fn;
1864
+ };
1865
+ return setFunctionLength;
1866
+ }var applyBind;
1867
+ var hasRequiredApplyBind;
1868
+
1869
+ function requireApplyBind () {
1870
+ if (hasRequiredApplyBind) return applyBind;
1871
+ hasRequiredApplyBind = 1;
1872
+
1873
+ var bind = requireFunctionBind();
1874
+ var $apply = requireFunctionApply();
1875
+ var actualApply = requireActualApply();
1876
+
1877
+ /** @type {import('./applyBind')} */
1878
+ applyBind = function applyBind() {
1879
+ return actualApply(bind, $apply, arguments);
1880
+ };
1881
+ return applyBind;
1882
+ }var hasRequiredCallBind;
1883
+
1884
+ function requireCallBind () {
1885
+ if (hasRequiredCallBind) return callBind.exports;
1886
+ hasRequiredCallBind = 1;
1887
+ (function (module) {
1888
+
1889
+ var setFunctionLength = /*@__PURE__*/ requireSetFunctionLength();
1890
+
1891
+ var $defineProperty = /*@__PURE__*/ requireEsDefineProperty();
1892
+
1893
+ var callBindBasic = requireCallBindApplyHelpers();
1894
+ var applyBind = requireApplyBind();
1895
+
1896
+ module.exports = function callBind(originalFunction) {
1897
+ var func = callBindBasic(arguments);
1898
+ var adjustedLength = originalFunction.length - (arguments.length - 1);
1899
+ return setFunctionLength(
1900
+ func,
1901
+ 1 + (adjustedLength > 0 ? adjustedLength : 0),
1902
+ true
1903
+ );
1904
+ };
1905
+
1906
+ if ($defineProperty) {
1907
+ $defineProperty(module.exports, 'apply', { value: applyBind });
1908
+ } else {
1909
+ module.exports.apply = applyBind;
1910
+ }
1911
+ } (callBind));
1912
+ return callBind.exports;
1913
+ }var shams;
1914
+ var hasRequiredShams;
1915
+
1916
+ function requireShams () {
1917
+ if (hasRequiredShams) return shams;
1918
+ hasRequiredShams = 1;
1919
+
1920
+ var hasSymbols = requireShams$1();
1921
+
1922
+ /** @type {import('.')} */
1923
+ shams = function hasToStringTagShams() {
1924
+ return hasSymbols() && !!Symbol.toStringTag;
1925
+ };
1926
+ return shams;
1927
+ }var whichTypedArray;
1928
+ var hasRequiredWhichTypedArray;
1929
+
1930
+ function requireWhichTypedArray () {
1931
+ if (hasRequiredWhichTypedArray) return whichTypedArray;
1932
+ hasRequiredWhichTypedArray = 1;
1933
+
1934
+ var forEach = requireForEach();
1935
+ var availableTypedArrays = /*@__PURE__*/ requireAvailableTypedArrays();
1936
+ var callBind = requireCallBind();
1937
+ var callBound = /*@__PURE__*/ requireCallBound();
1938
+ var gOPD = /*@__PURE__*/ requireGopd();
1939
+ var getProto = requireGetProto();
1940
+
1941
+ var $toString = callBound('Object.prototype.toString');
1942
+ var hasToStringTag = requireShams()();
1943
+
1944
+ var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
1945
+ var typedArrays = availableTypedArrays();
1946
+
1947
+ var $slice = callBound('String.prototype.slice');
1948
+
1949
+ /** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
1950
+ var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
1951
+ for (var i = 0; i < array.length; i += 1) {
1952
+ if (array[i] === value) {
1953
+ return i;
1954
+ }
1955
+ }
1956
+ return -1;
1957
+ };
1958
+
1959
+ /** @typedef {import('./types').Getter} Getter */
1960
+ /** @type {import('./types').Cache} */
1961
+ var cache = { __proto__: null };
1962
+ if (hasToStringTag && gOPD && getProto) {
1963
+ forEach(typedArrays, function (typedArray) {
1964
+ var arr = new g[typedArray]();
1965
+ if (Symbol.toStringTag in arr && getProto) {
1966
+ var proto = getProto(arr);
1967
+ // @ts-expect-error TS won't narrow inside a closure
1968
+ var descriptor = gOPD(proto, Symbol.toStringTag);
1969
+ if (!descriptor && proto) {
1970
+ var superProto = getProto(proto);
1971
+ // @ts-expect-error TS won't narrow inside a closure
1972
+ descriptor = gOPD(superProto, Symbol.toStringTag);
1973
+ }
1974
+ // @ts-expect-error TODO: fix
1975
+ cache['$' + typedArray] = callBind(descriptor.get);
1976
+ }
1977
+ });
1978
+ } else {
1979
+ forEach(typedArrays, function (typedArray) {
1980
+ var arr = new g[typedArray]();
1981
+ var fn = arr.slice || arr.set;
1982
+ if (fn) {
1983
+ cache[
1984
+ /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)
1985
+ ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ (
1986
+ // @ts-expect-error TODO FIXME
1987
+ callBind(fn)
1988
+ );
1989
+ }
1990
+ });
1991
+ }
1992
+
1993
+ /** @type {(value: object) => false | import('.').TypedArrayName} */
1994
+ var tryTypedArrays = function tryAllTypedArrays(value) {
1995
+ /** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;
1996
+ forEach(
1997
+ /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache),
1998
+ /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
1999
+ function (getter, typedArray) {
2000
+ if (!found) {
2001
+ try {
2002
+ // @ts-expect-error a throw is fine here
2003
+ if ('$' + getter(value) === typedArray) {
2004
+ found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1));
2005
+ }
2006
+ } catch (e) { /**/ }
2007
+ }
2008
+ }
2009
+ );
2010
+ return found;
2011
+ };
2012
+
2013
+ /** @type {(value: object) => false | import('.').TypedArrayName} */
2014
+ var trySlices = function tryAllSlices(value) {
2015
+ /** @type {ReturnType<typeof tryAllSlices>} */ var found = false;
2016
+ forEach(
2017
+ /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache),
2018
+ /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) {
2019
+ if (!found) {
2020
+ try {
2021
+ // @ts-expect-error a throw is fine here
2022
+ getter(value);
2023
+ found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1));
2024
+ } catch (e) { /**/ }
2025
+ }
2026
+ }
2027
+ );
2028
+ return found;
2029
+ };
2030
+
2031
+ /** @type {import('.')} */
2032
+ whichTypedArray = function whichTypedArray(value) {
2033
+ if (!value || typeof value !== 'object') { return false; }
2034
+ if (!hasToStringTag) {
2035
+ /** @type {string} */
2036
+ var tag = $slice($toString(value), 8, -1);
2037
+ if ($indexOf(typedArrays, tag) > -1) {
2038
+ return tag;
2039
+ }
2040
+ if (tag !== 'Object') {
2041
+ return false;
2042
+ }
2043
+ // node < 0.6 hits here on real Typed Arrays
2044
+ return trySlices(value);
2045
+ }
2046
+ if (!gOPD) { return null; } // unknown engine
2047
+ return tryTypedArrays(value);
2048
+ };
2049
+ return whichTypedArray;
2050
+ }var isTypedArray;
2051
+ var hasRequiredIsTypedArray;
2052
+
2053
+ function requireIsTypedArray () {
2054
+ if (hasRequiredIsTypedArray) return isTypedArray;
2055
+ hasRequiredIsTypedArray = 1;
2056
+
2057
+ var whichTypedArray = /*@__PURE__*/ requireWhichTypedArray();
2058
+
2059
+ /** @type {import('.')} */
2060
+ isTypedArray = function isTypedArray(value) {
2061
+ return !!whichTypedArray(value);
2062
+ };
2063
+ return isTypedArray;
2064
+ }var typedArrayBuffer;
2065
+ var hasRequiredTypedArrayBuffer;
2066
+
2067
+ function requireTypedArrayBuffer () {
2068
+ if (hasRequiredTypedArrayBuffer) return typedArrayBuffer;
2069
+ hasRequiredTypedArrayBuffer = 1;
2070
+
2071
+ var $TypeError = /*@__PURE__*/ requireType();
2072
+
2073
+ var callBound = /*@__PURE__*/ requireCallBound();
2074
+
2075
+ /** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */
2076
+ var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);
2077
+
2078
+ var isTypedArray = /*@__PURE__*/ requireIsTypedArray();
2079
+
2080
+ /** @type {import('.')} */
2081
+ // node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
2082
+ typedArrayBuffer = $typedArrayBuffer || function typedArrayBuffer(x) {
2083
+ if (!isTypedArray(x)) {
2084
+ throw new $TypeError('Not a Typed Array');
2085
+ }
2086
+ return x.buffer;
2087
+ };
2088
+ return typedArrayBuffer;
2089
+ }var toBuffer;
2090
+ var hasRequiredToBuffer;
2091
+
2092
+ function requireToBuffer () {
2093
+ if (hasRequiredToBuffer) return toBuffer;
2094
+ hasRequiredToBuffer = 1;
2095
+
2096
+ var Buffer = requireSafeBuffer().Buffer;
2097
+ var isArray = requireIsarray();
2098
+ var typedArrayBuffer = /*@__PURE__*/ requireTypedArrayBuffer();
2099
+
2100
+ var isView = ArrayBuffer.isView || function isView(obj) {
2101
+ try {
2102
+ typedArrayBuffer(obj);
2103
+ return true;
2104
+ } catch (e) {
2105
+ return false;
2106
+ }
2107
+ };
2108
+
2109
+ var useUint8Array = typeof Uint8Array !== 'undefined';
2110
+ var useArrayBuffer = typeof ArrayBuffer !== 'undefined'
2111
+ && typeof Uint8Array !== 'undefined';
2112
+ var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
2113
+
2114
+ toBuffer = function toBuffer(data, encoding) {
2115
+ if (Buffer.isBuffer(data)) {
2116
+ if (data.constructor && !('isBuffer' in data)) {
2117
+ // probably a SlowBuffer
2118
+ return Buffer.from(data);
2119
+ }
2120
+ return data;
2121
+ }
2122
+
2123
+ if (typeof data === 'string') {
2124
+ return Buffer.from(data, encoding);
2125
+ }
2126
+
2127
+ /*
2128
+ * Wrap any TypedArray instances and DataViews
2129
+ * Makes sense only on engines with full TypedArray support -- let Buffer detect that
2130
+ */
2131
+ if (useArrayBuffer && isView(data)) {
2132
+ // Bug in Node.js <6.3.1, which treats this as out-of-bounds
2133
+ if (data.byteLength === 0) {
2134
+ return Buffer.alloc(0);
2135
+ }
2136
+
2137
+ // When Buffer is based on Uint8Array, we can just construct it from ArrayBuffer
2138
+ if (useFromArrayBuffer) {
2139
+ var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
2140
+ /*
2141
+ * Recheck result size, as offset/length doesn't work on Node.js <5.10
2142
+ * We just go to Uint8Array case if this fails
2143
+ */
2144
+ if (res.byteLength === data.byteLength) {
2145
+ return res;
2146
+ }
2147
+ }
2148
+
2149
+ // Convert to Uint8Array bytes and then to Buffer
2150
+ var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
2151
+ var result = Buffer.from(uint8);
2152
+
2153
+ /*
2154
+ * Let's recheck that conversion succeeded
2155
+ * We have .length but not .byteLength when useFromArrayBuffer is false
2156
+ */
2157
+ if (result.length === data.byteLength) {
2158
+ return result;
2159
+ }
2160
+ }
2161
+
2162
+ /*
2163
+ * Uint8Array in engines where Buffer.from might not work with ArrayBuffer, just copy over
2164
+ * Doesn't make sense with other TypedArray instances
2165
+ */
2166
+ if (useUint8Array && data instanceof Uint8Array) {
2167
+ return Buffer.from(data);
2168
+ }
2169
+
2170
+ var isArr = isArray(data);
2171
+ if (isArr) {
2172
+ for (var i = 0; i < data.length; i += 1) {
2173
+ var x = data[i];
2174
+ if (
2175
+ typeof x !== 'number'
2176
+ || x < 0
2177
+ || x > 255
2178
+ || ~~x !== x // NaN and integer check
2179
+ ) {
2180
+ throw new RangeError('Array items must be numbers in the range 0-255.');
2181
+ }
2182
+ }
2183
+ }
2184
+
2185
+ /*
2186
+ * Old Buffer polyfill on an engine that doesn't have TypedArray support
2187
+ * Also, this is from a different Buffer polyfill implementation then we have, as instanceof check failed
2188
+ * Convert to our current Buffer implementation
2189
+ */
2190
+ if (
2191
+ isArr || (
2192
+ Buffer.isBuffer(data)
2193
+ && data.constructor
2194
+ && typeof data.constructor.isBuffer === 'function'
2195
+ && data.constructor.isBuffer(data)
2196
+ )
2197
+ ) {
2198
+ return Buffer.from(data);
2199
+ }
2200
+
2201
+ throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.');
2202
+ };
2203
+ return toBuffer;
2204
+ }var hash;
2205
+ var hasRequiredHash;
2206
+
2207
+ function requireHash () {
2208
+ if (hasRequiredHash) return hash;
2209
+ hasRequiredHash = 1;
2210
+
2211
+ var Buffer = requireSafeBuffer().Buffer;
2212
+ var toBuffer = /*@__PURE__*/ requireToBuffer();
2213
+
2214
+ // prototype class for hash functions
2215
+ function Hash(blockSize, finalSize) {
2216
+ this._block = Buffer.alloc(blockSize);
2217
+ this._finalSize = finalSize;
2218
+ this._blockSize = blockSize;
2219
+ this._len = 0;
2220
+ }
2221
+
2222
+ Hash.prototype.update = function (data, enc) {
2223
+ /* eslint no-param-reassign: 0 */
2224
+ data = toBuffer(data, enc || 'utf8');
2225
+
2226
+ var block = this._block;
2227
+ var blockSize = this._blockSize;
2228
+ var length = data.length;
2229
+ var accum = this._len;
2230
+
2231
+ for (var offset = 0; offset < length;) {
2232
+ var assigned = accum % blockSize;
2233
+ var remainder = Math.min(length - offset, blockSize - assigned);
2234
+
2235
+ for (var i = 0; i < remainder; i++) {
2236
+ block[assigned + i] = data[offset + i];
2237
+ }
2238
+
2239
+ accum += remainder;
2240
+ offset += remainder;
2241
+
2242
+ if ((accum % blockSize) === 0) {
2243
+ this._update(block);
2244
+ }
2245
+ }
2246
+
2247
+ this._len += length;
2248
+ return this;
2249
+ };
2250
+
2251
+ Hash.prototype.digest = function (enc) {
2252
+ var rem = this._len % this._blockSize;
2253
+
2254
+ this._block[rem] = 0x80;
2255
+
2256
+ /*
2257
+ * zero (rem + 1) trailing bits, where (rem + 1) is the smallest
2258
+ * non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
2259
+ */
2260
+ this._block.fill(0, rem + 1);
2261
+
2262
+ if (rem >= this._finalSize) {
2263
+ this._update(this._block);
2264
+ this._block.fill(0);
2265
+ }
2266
+
2267
+ var bits = this._len * 8;
2268
+
2269
+ // uint32
2270
+ if (bits <= 0xffffffff) {
2271
+ this._block.writeUInt32BE(bits, this._blockSize - 4);
2272
+
2273
+ // uint64
2274
+ } else {
2275
+ var lowBits = (bits & 0xffffffff) >>> 0;
2276
+ var highBits = (bits - lowBits) / 0x100000000;
2277
+
2278
+ this._block.writeUInt32BE(highBits, this._blockSize - 8);
2279
+ this._block.writeUInt32BE(lowBits, this._blockSize - 4);
2280
+ }
2281
+
2282
+ this._update(this._block);
2283
+ var hash = this._hash();
2284
+
2285
+ return enc ? hash.toString(enc) : hash;
2286
+ };
2287
+
2288
+ Hash.prototype._update = function () {
2289
+ throw new Error('_update must be implemented by subclass');
2290
+ };
2291
+
2292
+ hash = Hash;
2293
+ return hash;
2294
+ }var sha$1;
2295
+ var hasRequiredSha;
2296
+
2297
+ function requireSha () {
2298
+ if (hasRequiredSha) return sha$1;
2299
+ hasRequiredSha = 1;
2300
+
2301
+ /*
2302
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
2303
+ * in FIPS PUB 180-1
2304
+ * This source code is derived from sha1.js of the same repository.
2305
+ * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
2306
+ * operation was added.
2307
+ */
2308
+
2309
+ var inherits = requireInherits();
2310
+ var Hash = requireHash();
2311
+ var Buffer = requireSafeBuffer().Buffer;
2312
+
2313
+ var K = [
2314
+ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
2315
+ ];
2316
+
2317
+ var W = new Array(80);
2318
+
2319
+ function Sha() {
2320
+ this.init();
2321
+ this._w = W;
2322
+
2323
+ Hash.call(this, 64, 56);
2324
+ }
2325
+
2326
+ inherits(Sha, Hash);
2327
+
2328
+ Sha.prototype.init = function () {
2329
+ this._a = 0x67452301;
2330
+ this._b = 0xefcdab89;
2331
+ this._c = 0x98badcfe;
2332
+ this._d = 0x10325476;
2333
+ this._e = 0xc3d2e1f0;
2334
+
2335
+ return this;
2336
+ };
2337
+
2338
+ function rotl5(num) {
2339
+ return (num << 5) | (num >>> 27);
2340
+ }
2341
+
2342
+ function rotl30(num) {
2343
+ return (num << 30) | (num >>> 2);
2344
+ }
2345
+
2346
+ function ft(s, b, c, d) {
2347
+ if (s === 0) {
2348
+ return (b & c) | (~b & d);
2349
+ }
2350
+ if (s === 2) {
2351
+ return (b & c) | (b & d) | (c & d);
2352
+ }
2353
+ return b ^ c ^ d;
2354
+ }
2355
+
2356
+ Sha.prototype._update = function (M) {
2357
+ var w = this._w;
2358
+
2359
+ var a = this._a | 0;
2360
+ var b = this._b | 0;
2361
+ var c = this._c | 0;
2362
+ var d = this._d | 0;
2363
+ var e = this._e | 0;
2364
+
2365
+ for (var i = 0; i < 16; ++i) {
2366
+ w[i] = M.readInt32BE(i * 4);
2367
+ }
2368
+ for (; i < 80; ++i) {
2369
+ w[i] = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
2370
+ }
2371
+
2372
+ for (var j = 0; j < 80; ++j) {
2373
+ var s = ~~(j / 20);
2374
+ var t = (rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s]) | 0;
2375
+
2376
+ e = d;
2377
+ d = c;
2378
+ c = rotl30(b);
2379
+ b = a;
2380
+ a = t;
2381
+ }
2382
+
2383
+ this._a = (a + this._a) | 0;
2384
+ this._b = (b + this._b) | 0;
2385
+ this._c = (c + this._c) | 0;
2386
+ this._d = (d + this._d) | 0;
2387
+ this._e = (e + this._e) | 0;
2388
+ };
2389
+
2390
+ Sha.prototype._hash = function () {
2391
+ var H = Buffer.allocUnsafe(20);
2392
+
2393
+ H.writeInt32BE(this._a | 0, 0);
2394
+ H.writeInt32BE(this._b | 0, 4);
2395
+ H.writeInt32BE(this._c | 0, 8);
2396
+ H.writeInt32BE(this._d | 0, 12);
2397
+ H.writeInt32BE(this._e | 0, 16);
2398
+
2399
+ return H;
2400
+ };
2401
+
2402
+ sha$1 = Sha;
2403
+ return sha$1;
2404
+ }var sha1$1;
2405
+ var hasRequiredSha1;
2406
+
2407
+ function requireSha1 () {
2408
+ if (hasRequiredSha1) return sha1$1;
2409
+ hasRequiredSha1 = 1;
2410
+
2411
+ /*
2412
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
2413
+ * in FIPS PUB 180-1
2414
+ * Version 2.1a Copyright Paul Johnston 2000 - 2002.
2415
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
2416
+ * Distributed under the BSD License
2417
+ * See http://pajhome.org.uk/crypt/md5 for details.
2418
+ */
2419
+
2420
+ var inherits = requireInherits();
2421
+ var Hash = requireHash();
2422
+ var Buffer = requireSafeBuffer().Buffer;
2423
+
2424
+ var K = [
2425
+ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
2426
+ ];
2427
+
2428
+ var W = new Array(80);
2429
+
2430
+ function Sha1() {
2431
+ this.init();
2432
+ this._w = W;
2433
+
2434
+ Hash.call(this, 64, 56);
2435
+ }
2436
+
2437
+ inherits(Sha1, Hash);
2438
+
2439
+ Sha1.prototype.init = function () {
2440
+ this._a = 0x67452301;
2441
+ this._b = 0xefcdab89;
2442
+ this._c = 0x98badcfe;
2443
+ this._d = 0x10325476;
2444
+ this._e = 0xc3d2e1f0;
2445
+
2446
+ return this;
2447
+ };
2448
+
2449
+ function rotl1(num) {
2450
+ return (num << 1) | (num >>> 31);
2451
+ }
2452
+
2453
+ function rotl5(num) {
2454
+ return (num << 5) | (num >>> 27);
2455
+ }
2456
+
2457
+ function rotl30(num) {
2458
+ return (num << 30) | (num >>> 2);
2459
+ }
2460
+
2461
+ function ft(s, b, c, d) {
2462
+ if (s === 0) {
2463
+ return (b & c) | (~b & d);
2464
+ }
2465
+ if (s === 2) {
2466
+ return (b & c) | (b & d) | (c & d);
2467
+ }
2468
+ return b ^ c ^ d;
2469
+ }
2470
+
2471
+ Sha1.prototype._update = function (M) {
2472
+ var w = this._w;
2473
+
2474
+ var a = this._a | 0;
2475
+ var b = this._b | 0;
2476
+ var c = this._c | 0;
2477
+ var d = this._d | 0;
2478
+ var e = this._e | 0;
2479
+
2480
+ for (var i = 0; i < 16; ++i) {
2481
+ w[i] = M.readInt32BE(i * 4);
2482
+ }
2483
+ for (; i < 80; ++i) {
2484
+ w[i] = rotl1(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);
2485
+ }
2486
+
2487
+ for (var j = 0; j < 80; ++j) {
2488
+ var s = ~~(j / 20);
2489
+ var t = (rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s]) | 0;
2490
+
2491
+ e = d;
2492
+ d = c;
2493
+ c = rotl30(b);
2494
+ b = a;
2495
+ a = t;
2496
+ }
2497
+
2498
+ this._a = (a + this._a) | 0;
2499
+ this._b = (b + this._b) | 0;
2500
+ this._c = (c + this._c) | 0;
2501
+ this._d = (d + this._d) | 0;
2502
+ this._e = (e + this._e) | 0;
2503
+ };
2504
+
2505
+ Sha1.prototype._hash = function () {
2506
+ var H = Buffer.allocUnsafe(20);
2507
+
2508
+ H.writeInt32BE(this._a | 0, 0);
2509
+ H.writeInt32BE(this._b | 0, 4);
2510
+ H.writeInt32BE(this._c | 0, 8);
2511
+ H.writeInt32BE(this._d | 0, 12);
2512
+ H.writeInt32BE(this._e | 0, 16);
2513
+
2514
+ return H;
2515
+ };
2516
+
2517
+ sha1$1 = Sha1;
2518
+ return sha1$1;
2519
+ }var sha256$1;
2520
+ var hasRequiredSha256;
2521
+
2522
+ function requireSha256 () {
2523
+ if (hasRequiredSha256) return sha256$1;
2524
+ hasRequiredSha256 = 1;
2525
+
2526
+ /**
2527
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
2528
+ * in FIPS 180-2
2529
+ * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
2530
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
2531
+ *
2532
+ */
2533
+
2534
+ var inherits = requireInherits();
2535
+ var Hash = requireHash();
2536
+ var Buffer = requireSafeBuffer().Buffer;
2537
+
2538
+ var K = [
2539
+ 0x428A2F98,
2540
+ 0x71374491,
2541
+ 0xB5C0FBCF,
2542
+ 0xE9B5DBA5,
2543
+ 0x3956C25B,
2544
+ 0x59F111F1,
2545
+ 0x923F82A4,
2546
+ 0xAB1C5ED5,
2547
+ 0xD807AA98,
2548
+ 0x12835B01,
2549
+ 0x243185BE,
2550
+ 0x550C7DC3,
2551
+ 0x72BE5D74,
2552
+ 0x80DEB1FE,
2553
+ 0x9BDC06A7,
2554
+ 0xC19BF174,
2555
+ 0xE49B69C1,
2556
+ 0xEFBE4786,
2557
+ 0x0FC19DC6,
2558
+ 0x240CA1CC,
2559
+ 0x2DE92C6F,
2560
+ 0x4A7484AA,
2561
+ 0x5CB0A9DC,
2562
+ 0x76F988DA,
2563
+ 0x983E5152,
2564
+ 0xA831C66D,
2565
+ 0xB00327C8,
2566
+ 0xBF597FC7,
2567
+ 0xC6E00BF3,
2568
+ 0xD5A79147,
2569
+ 0x06CA6351,
2570
+ 0x14292967,
2571
+ 0x27B70A85,
2572
+ 0x2E1B2138,
2573
+ 0x4D2C6DFC,
2574
+ 0x53380D13,
2575
+ 0x650A7354,
2576
+ 0x766A0ABB,
2577
+ 0x81C2C92E,
2578
+ 0x92722C85,
2579
+ 0xA2BFE8A1,
2580
+ 0xA81A664B,
2581
+ 0xC24B8B70,
2582
+ 0xC76C51A3,
2583
+ 0xD192E819,
2584
+ 0xD6990624,
2585
+ 0xF40E3585,
2586
+ 0x106AA070,
2587
+ 0x19A4C116,
2588
+ 0x1E376C08,
2589
+ 0x2748774C,
2590
+ 0x34B0BCB5,
2591
+ 0x391C0CB3,
2592
+ 0x4ED8AA4A,
2593
+ 0x5B9CCA4F,
2594
+ 0x682E6FF3,
2595
+ 0x748F82EE,
2596
+ 0x78A5636F,
2597
+ 0x84C87814,
2598
+ 0x8CC70208,
2599
+ 0x90BEFFFA,
2600
+ 0xA4506CEB,
2601
+ 0xBEF9A3F7,
2602
+ 0xC67178F2
2603
+ ];
2604
+
2605
+ var W = new Array(64);
2606
+
2607
+ function Sha256() {
2608
+ this.init();
2609
+
2610
+ this._w = W; // new Array(64)
2611
+
2612
+ Hash.call(this, 64, 56);
2613
+ }
2614
+
2615
+ inherits(Sha256, Hash);
2616
+
2617
+ Sha256.prototype.init = function () {
2618
+ this._a = 0x6a09e667;
2619
+ this._b = 0xbb67ae85;
2620
+ this._c = 0x3c6ef372;
2621
+ this._d = 0xa54ff53a;
2622
+ this._e = 0x510e527f;
2623
+ this._f = 0x9b05688c;
2624
+ this._g = 0x1f83d9ab;
2625
+ this._h = 0x5be0cd19;
2626
+
2627
+ return this;
2628
+ };
2629
+
2630
+ function ch(x, y, z) {
2631
+ return z ^ (x & (y ^ z));
2632
+ }
2633
+
2634
+ function maj(x, y, z) {
2635
+ return (x & y) | (z & (x | y));
2636
+ }
2637
+
2638
+ function sigma0(x) {
2639
+ return ((x >>> 2) | (x << 30)) ^ ((x >>> 13) | (x << 19)) ^ ((x >>> 22) | (x << 10));
2640
+ }
2641
+
2642
+ function sigma1(x) {
2643
+ return ((x >>> 6) | (x << 26)) ^ ((x >>> 11) | (x << 21)) ^ ((x >>> 25) | (x << 7));
2644
+ }
2645
+
2646
+ function gamma0(x) {
2647
+ return ((x >>> 7) | (x << 25)) ^ ((x >>> 18) | (x << 14)) ^ (x >>> 3);
2648
+ }
2649
+
2650
+ function gamma1(x) {
2651
+ return ((x >>> 17) | (x << 15)) ^ ((x >>> 19) | (x << 13)) ^ (x >>> 10);
2652
+ }
2653
+
2654
+ Sha256.prototype._update = function (M) {
2655
+ var w = this._w;
2656
+
2657
+ var a = this._a | 0;
2658
+ var b = this._b | 0;
2659
+ var c = this._c | 0;
2660
+ var d = this._d | 0;
2661
+ var e = this._e | 0;
2662
+ var f = this._f | 0;
2663
+ var g = this._g | 0;
2664
+ var h = this._h | 0;
2665
+
2666
+ for (var i = 0; i < 16; ++i) {
2667
+ w[i] = M.readInt32BE(i * 4);
2668
+ }
2669
+ for (; i < 64; ++i) {
2670
+ w[i] = (gamma1(w[i - 2]) + w[i - 7] + gamma0(w[i - 15]) + w[i - 16]) | 0;
2671
+ }
2672
+
2673
+ for (var j = 0; j < 64; ++j) {
2674
+ var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + w[j]) | 0;
2675
+ var T2 = (sigma0(a) + maj(a, b, c)) | 0;
2676
+
2677
+ h = g;
2678
+ g = f;
2679
+ f = e;
2680
+ e = (d + T1) | 0;
2681
+ d = c;
2682
+ c = b;
2683
+ b = a;
2684
+ a = (T1 + T2) | 0;
2685
+ }
2686
+
2687
+ this._a = (a + this._a) | 0;
2688
+ this._b = (b + this._b) | 0;
2689
+ this._c = (c + this._c) | 0;
2690
+ this._d = (d + this._d) | 0;
2691
+ this._e = (e + this._e) | 0;
2692
+ this._f = (f + this._f) | 0;
2693
+ this._g = (g + this._g) | 0;
2694
+ this._h = (h + this._h) | 0;
2695
+ };
2696
+
2697
+ Sha256.prototype._hash = function () {
2698
+ var H = Buffer.allocUnsafe(32);
2699
+
2700
+ H.writeInt32BE(this._a, 0);
2701
+ H.writeInt32BE(this._b, 4);
2702
+ H.writeInt32BE(this._c, 8);
2703
+ H.writeInt32BE(this._d, 12);
2704
+ H.writeInt32BE(this._e, 16);
2705
+ H.writeInt32BE(this._f, 20);
2706
+ H.writeInt32BE(this._g, 24);
2707
+ H.writeInt32BE(this._h, 28);
2708
+
2709
+ return H;
2710
+ };
2711
+
2712
+ sha256$1 = Sha256;
2713
+ return sha256$1;
2714
+ }var sha224;
2715
+ var hasRequiredSha224;
2716
+
2717
+ function requireSha224 () {
2718
+ if (hasRequiredSha224) return sha224;
2719
+ hasRequiredSha224 = 1;
2720
+
2721
+ /**
2722
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
2723
+ * in FIPS 180-2
2724
+ * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
2725
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
2726
+ *
2727
+ */
2728
+
2729
+ var inherits = requireInherits();
2730
+ var Sha256 = requireSha256();
2731
+ var Hash = requireHash();
2732
+ var Buffer = requireSafeBuffer().Buffer;
2733
+
2734
+ var W = new Array(64);
2735
+
2736
+ function Sha224() {
2737
+ this.init();
2738
+
2739
+ this._w = W; // new Array(64)
2740
+
2741
+ Hash.call(this, 64, 56);
2742
+ }
2743
+
2744
+ inherits(Sha224, Sha256);
2745
+
2746
+ Sha224.prototype.init = function () {
2747
+ this._a = 0xc1059ed8;
2748
+ this._b = 0x367cd507;
2749
+ this._c = 0x3070dd17;
2750
+ this._d = 0xf70e5939;
2751
+ this._e = 0xffc00b31;
2752
+ this._f = 0x68581511;
2753
+ this._g = 0x64f98fa7;
2754
+ this._h = 0xbefa4fa4;
2755
+
2756
+ return this;
2757
+ };
2758
+
2759
+ Sha224.prototype._hash = function () {
2760
+ var H = Buffer.allocUnsafe(28);
2761
+
2762
+ H.writeInt32BE(this._a, 0);
2763
+ H.writeInt32BE(this._b, 4);
2764
+ H.writeInt32BE(this._c, 8);
2765
+ H.writeInt32BE(this._d, 12);
2766
+ H.writeInt32BE(this._e, 16);
2767
+ H.writeInt32BE(this._f, 20);
2768
+ H.writeInt32BE(this._g, 24);
2769
+
2770
+ return H;
2771
+ };
2772
+
2773
+ sha224 = Sha224;
2774
+ return sha224;
2775
+ }var sha512;
2776
+ var hasRequiredSha512;
2777
+
2778
+ function requireSha512 () {
2779
+ if (hasRequiredSha512) return sha512;
2780
+ hasRequiredSha512 = 1;
2781
+
2782
+ var inherits = requireInherits();
2783
+ var Hash = requireHash();
2784
+ var Buffer = requireSafeBuffer().Buffer;
2785
+
2786
+ var K = [
2787
+ 0x428a2f98,
2788
+ 0xd728ae22,
2789
+ 0x71374491,
2790
+ 0x23ef65cd,
2791
+ 0xb5c0fbcf,
2792
+ 0xec4d3b2f,
2793
+ 0xe9b5dba5,
2794
+ 0x8189dbbc,
2795
+ 0x3956c25b,
2796
+ 0xf348b538,
2797
+ 0x59f111f1,
2798
+ 0xb605d019,
2799
+ 0x923f82a4,
2800
+ 0xaf194f9b,
2801
+ 0xab1c5ed5,
2802
+ 0xda6d8118,
2803
+ 0xd807aa98,
2804
+ 0xa3030242,
2805
+ 0x12835b01,
2806
+ 0x45706fbe,
2807
+ 0x243185be,
2808
+ 0x4ee4b28c,
2809
+ 0x550c7dc3,
2810
+ 0xd5ffb4e2,
2811
+ 0x72be5d74,
2812
+ 0xf27b896f,
2813
+ 0x80deb1fe,
2814
+ 0x3b1696b1,
2815
+ 0x9bdc06a7,
2816
+ 0x25c71235,
2817
+ 0xc19bf174,
2818
+ 0xcf692694,
2819
+ 0xe49b69c1,
2820
+ 0x9ef14ad2,
2821
+ 0xefbe4786,
2822
+ 0x384f25e3,
2823
+ 0x0fc19dc6,
2824
+ 0x8b8cd5b5,
2825
+ 0x240ca1cc,
2826
+ 0x77ac9c65,
2827
+ 0x2de92c6f,
2828
+ 0x592b0275,
2829
+ 0x4a7484aa,
2830
+ 0x6ea6e483,
2831
+ 0x5cb0a9dc,
2832
+ 0xbd41fbd4,
2833
+ 0x76f988da,
2834
+ 0x831153b5,
2835
+ 0x983e5152,
2836
+ 0xee66dfab,
2837
+ 0xa831c66d,
2838
+ 0x2db43210,
2839
+ 0xb00327c8,
2840
+ 0x98fb213f,
2841
+ 0xbf597fc7,
2842
+ 0xbeef0ee4,
2843
+ 0xc6e00bf3,
2844
+ 0x3da88fc2,
2845
+ 0xd5a79147,
2846
+ 0x930aa725,
2847
+ 0x06ca6351,
2848
+ 0xe003826f,
2849
+ 0x14292967,
2850
+ 0x0a0e6e70,
2851
+ 0x27b70a85,
2852
+ 0x46d22ffc,
2853
+ 0x2e1b2138,
2854
+ 0x5c26c926,
2855
+ 0x4d2c6dfc,
2856
+ 0x5ac42aed,
2857
+ 0x53380d13,
2858
+ 0x9d95b3df,
2859
+ 0x650a7354,
2860
+ 0x8baf63de,
2861
+ 0x766a0abb,
2862
+ 0x3c77b2a8,
2863
+ 0x81c2c92e,
2864
+ 0x47edaee6,
2865
+ 0x92722c85,
2866
+ 0x1482353b,
2867
+ 0xa2bfe8a1,
2868
+ 0x4cf10364,
2869
+ 0xa81a664b,
2870
+ 0xbc423001,
2871
+ 0xc24b8b70,
2872
+ 0xd0f89791,
2873
+ 0xc76c51a3,
2874
+ 0x0654be30,
2875
+ 0xd192e819,
2876
+ 0xd6ef5218,
2877
+ 0xd6990624,
2878
+ 0x5565a910,
2879
+ 0xf40e3585,
2880
+ 0x5771202a,
2881
+ 0x106aa070,
2882
+ 0x32bbd1b8,
2883
+ 0x19a4c116,
2884
+ 0xb8d2d0c8,
2885
+ 0x1e376c08,
2886
+ 0x5141ab53,
2887
+ 0x2748774c,
2888
+ 0xdf8eeb99,
2889
+ 0x34b0bcb5,
2890
+ 0xe19b48a8,
2891
+ 0x391c0cb3,
2892
+ 0xc5c95a63,
2893
+ 0x4ed8aa4a,
2894
+ 0xe3418acb,
2895
+ 0x5b9cca4f,
2896
+ 0x7763e373,
2897
+ 0x682e6ff3,
2898
+ 0xd6b2b8a3,
2899
+ 0x748f82ee,
2900
+ 0x5defb2fc,
2901
+ 0x78a5636f,
2902
+ 0x43172f60,
2903
+ 0x84c87814,
2904
+ 0xa1f0ab72,
2905
+ 0x8cc70208,
2906
+ 0x1a6439ec,
2907
+ 0x90befffa,
2908
+ 0x23631e28,
2909
+ 0xa4506ceb,
2910
+ 0xde82bde9,
2911
+ 0xbef9a3f7,
2912
+ 0xb2c67915,
2913
+ 0xc67178f2,
2914
+ 0xe372532b,
2915
+ 0xca273ece,
2916
+ 0xea26619c,
2917
+ 0xd186b8c7,
2918
+ 0x21c0c207,
2919
+ 0xeada7dd6,
2920
+ 0xcde0eb1e,
2921
+ 0xf57d4f7f,
2922
+ 0xee6ed178,
2923
+ 0x06f067aa,
2924
+ 0x72176fba,
2925
+ 0x0a637dc5,
2926
+ 0xa2c898a6,
2927
+ 0x113f9804,
2928
+ 0xbef90dae,
2929
+ 0x1b710b35,
2930
+ 0x131c471b,
2931
+ 0x28db77f5,
2932
+ 0x23047d84,
2933
+ 0x32caab7b,
2934
+ 0x40c72493,
2935
+ 0x3c9ebe0a,
2936
+ 0x15c9bebc,
2937
+ 0x431d67c4,
2938
+ 0x9c100d4c,
2939
+ 0x4cc5d4be,
2940
+ 0xcb3e42b6,
2941
+ 0x597f299c,
2942
+ 0xfc657e2a,
2943
+ 0x5fcb6fab,
2944
+ 0x3ad6faec,
2945
+ 0x6c44198c,
2946
+ 0x4a475817
2947
+ ];
2948
+
2949
+ var W = new Array(160);
2950
+
2951
+ function Sha512() {
2952
+ this.init();
2953
+ this._w = W;
2954
+
2955
+ Hash.call(this, 128, 112);
2956
+ }
2957
+
2958
+ inherits(Sha512, Hash);
2959
+
2960
+ Sha512.prototype.init = function () {
2961
+ this._ah = 0x6a09e667;
2962
+ this._bh = 0xbb67ae85;
2963
+ this._ch = 0x3c6ef372;
2964
+ this._dh = 0xa54ff53a;
2965
+ this._eh = 0x510e527f;
2966
+ this._fh = 0x9b05688c;
2967
+ this._gh = 0x1f83d9ab;
2968
+ this._hh = 0x5be0cd19;
2969
+
2970
+ this._al = 0xf3bcc908;
2971
+ this._bl = 0x84caa73b;
2972
+ this._cl = 0xfe94f82b;
2973
+ this._dl = 0x5f1d36f1;
2974
+ this._el = 0xade682d1;
2975
+ this._fl = 0x2b3e6c1f;
2976
+ this._gl = 0xfb41bd6b;
2977
+ this._hl = 0x137e2179;
2978
+
2979
+ return this;
2980
+ };
2981
+
2982
+ function Ch(x, y, z) {
2983
+ return z ^ (x & (y ^ z));
2984
+ }
2985
+
2986
+ function maj(x, y, z) {
2987
+ return (x & y) | (z & (x | y));
2988
+ }
2989
+
2990
+ function sigma0(x, xl) {
2991
+ return ((x >>> 28) | (xl << 4)) ^ ((xl >>> 2) | (x << 30)) ^ ((xl >>> 7) | (x << 25));
2992
+ }
2993
+
2994
+ function sigma1(x, xl) {
2995
+ return ((x >>> 14) | (xl << 18)) ^ ((x >>> 18) | (xl << 14)) ^ ((xl >>> 9) | (x << 23));
2996
+ }
2997
+
2998
+ function Gamma0(x, xl) {
2999
+ return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ (x >>> 7);
3000
+ }
3001
+
3002
+ function Gamma0l(x, xl) {
3003
+ return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ ((x >>> 7) | (xl << 25));
3004
+ }
3005
+
3006
+ function Gamma1(x, xl) {
3007
+ return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ (x >>> 6);
3008
+ }
3009
+
3010
+ function Gamma1l(x, xl) {
3011
+ return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ ((x >>> 6) | (xl << 26));
3012
+ }
3013
+
3014
+ function getCarry(a, b) {
3015
+ return (a >>> 0) < (b >>> 0) ? 1 : 0;
3016
+ }
3017
+
3018
+ Sha512.prototype._update = function (M) {
3019
+ var w = this._w;
3020
+
3021
+ var ah = this._ah | 0;
3022
+ var bh = this._bh | 0;
3023
+ var ch = this._ch | 0;
3024
+ var dh = this._dh | 0;
3025
+ var eh = this._eh | 0;
3026
+ var fh = this._fh | 0;
3027
+ var gh = this._gh | 0;
3028
+ var hh = this._hh | 0;
3029
+
3030
+ var al = this._al | 0;
3031
+ var bl = this._bl | 0;
3032
+ var cl = this._cl | 0;
3033
+ var dl = this._dl | 0;
3034
+ var el = this._el | 0;
3035
+ var fl = this._fl | 0;
3036
+ var gl = this._gl | 0;
3037
+ var hl = this._hl | 0;
3038
+
3039
+ for (var i = 0; i < 32; i += 2) {
3040
+ w[i] = M.readInt32BE(i * 4);
3041
+ w[i + 1] = M.readInt32BE((i * 4) + 4);
3042
+ }
3043
+ for (; i < 160; i += 2) {
3044
+ var xh = w[i - (15 * 2)];
3045
+ var xl = w[i - (15 * 2) + 1];
3046
+ var gamma0 = Gamma0(xh, xl);
3047
+ var gamma0l = Gamma0l(xl, xh);
3048
+
3049
+ xh = w[i - (2 * 2)];
3050
+ xl = w[i - (2 * 2) + 1];
3051
+ var gamma1 = Gamma1(xh, xl);
3052
+ var gamma1l = Gamma1l(xl, xh);
3053
+
3054
+ // w[i] = gamma0 + w[i - 7] + gamma1 + w[i - 16]
3055
+ var Wi7h = w[i - (7 * 2)];
3056
+ var Wi7l = w[i - (7 * 2) + 1];
3057
+
3058
+ var Wi16h = w[i - (16 * 2)];
3059
+ var Wi16l = w[i - (16 * 2) + 1];
3060
+
3061
+ var Wil = (gamma0l + Wi7l) | 0;
3062
+ var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0;
3063
+ Wil = (Wil + gamma1l) | 0;
3064
+ Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0;
3065
+ Wil = (Wil + Wi16l) | 0;
3066
+ Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0;
3067
+
3068
+ w[i] = Wih;
3069
+ w[i + 1] = Wil;
3070
+ }
3071
+
3072
+ for (var j = 0; j < 160; j += 2) {
3073
+ Wih = w[j];
3074
+ Wil = w[j + 1];
3075
+
3076
+ var majh = maj(ah, bh, ch);
3077
+ var majl = maj(al, bl, cl);
3078
+
3079
+ var sigma0h = sigma0(ah, al);
3080
+ var sigma0l = sigma0(al, ah);
3081
+ var sigma1h = sigma1(eh, el);
3082
+ var sigma1l = sigma1(el, eh);
3083
+
3084
+ // t1 = h + sigma1 + ch + K[j] + w[j]
3085
+ var Kih = K[j];
3086
+ var Kil = K[j + 1];
3087
+
3088
+ var chh = Ch(eh, fh, gh);
3089
+ var chl = Ch(el, fl, gl);
3090
+
3091
+ var t1l = (hl + sigma1l) | 0;
3092
+ var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0;
3093
+ t1l = (t1l + chl) | 0;
3094
+ t1h = (t1h + chh + getCarry(t1l, chl)) | 0;
3095
+ t1l = (t1l + Kil) | 0;
3096
+ t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0;
3097
+ t1l = (t1l + Wil) | 0;
3098
+ t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0;
3099
+
3100
+ // t2 = sigma0 + maj
3101
+ var t2l = (sigma0l + majl) | 0;
3102
+ var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0;
3103
+
3104
+ hh = gh;
3105
+ hl = gl;
3106
+ gh = fh;
3107
+ gl = fl;
3108
+ fh = eh;
3109
+ fl = el;
3110
+ el = (dl + t1l) | 0;
3111
+ eh = (dh + t1h + getCarry(el, dl)) | 0;
3112
+ dh = ch;
3113
+ dl = cl;
3114
+ ch = bh;
3115
+ cl = bl;
3116
+ bh = ah;
3117
+ bl = al;
3118
+ al = (t1l + t2l) | 0;
3119
+ ah = (t1h + t2h + getCarry(al, t1l)) | 0;
3120
+ }
3121
+
3122
+ this._al = (this._al + al) | 0;
3123
+ this._bl = (this._bl + bl) | 0;
3124
+ this._cl = (this._cl + cl) | 0;
3125
+ this._dl = (this._dl + dl) | 0;
3126
+ this._el = (this._el + el) | 0;
3127
+ this._fl = (this._fl + fl) | 0;
3128
+ this._gl = (this._gl + gl) | 0;
3129
+ this._hl = (this._hl + hl) | 0;
3130
+
3131
+ this._ah = (this._ah + ah + getCarry(this._al, al)) | 0;
3132
+ this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0;
3133
+ this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0;
3134
+ this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0;
3135
+ this._eh = (this._eh + eh + getCarry(this._el, el)) | 0;
3136
+ this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0;
3137
+ this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0;
3138
+ this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0;
3139
+ };
3140
+
3141
+ Sha512.prototype._hash = function () {
3142
+ var H = Buffer.allocUnsafe(64);
3143
+
3144
+ function writeInt64BE(h, l, offset) {
3145
+ H.writeInt32BE(h, offset);
3146
+ H.writeInt32BE(l, offset + 4);
3147
+ }
3148
+
3149
+ writeInt64BE(this._ah, this._al, 0);
3150
+ writeInt64BE(this._bh, this._bl, 8);
3151
+ writeInt64BE(this._ch, this._cl, 16);
3152
+ writeInt64BE(this._dh, this._dl, 24);
3153
+ writeInt64BE(this._eh, this._el, 32);
3154
+ writeInt64BE(this._fh, this._fl, 40);
3155
+ writeInt64BE(this._gh, this._gl, 48);
3156
+ writeInt64BE(this._hh, this._hl, 56);
3157
+
3158
+ return H;
3159
+ };
3160
+
3161
+ sha512 = Sha512;
3162
+ return sha512;
3163
+ }var sha384;
3164
+ var hasRequiredSha384;
3165
+
3166
+ function requireSha384 () {
3167
+ if (hasRequiredSha384) return sha384;
3168
+ hasRequiredSha384 = 1;
3169
+
3170
+ var inherits = requireInherits();
3171
+ var SHA512 = requireSha512();
3172
+ var Hash = requireHash();
3173
+ var Buffer = requireSafeBuffer().Buffer;
3174
+
3175
+ var W = new Array(160);
3176
+
3177
+ function Sha384() {
3178
+ this.init();
3179
+ this._w = W;
3180
+
3181
+ Hash.call(this, 128, 112);
3182
+ }
3183
+
3184
+ inherits(Sha384, SHA512);
3185
+
3186
+ Sha384.prototype.init = function () {
3187
+ this._ah = 0xcbbb9d5d;
3188
+ this._bh = 0x629a292a;
3189
+ this._ch = 0x9159015a;
3190
+ this._dh = 0x152fecd8;
3191
+ this._eh = 0x67332667;
3192
+ this._fh = 0x8eb44a87;
3193
+ this._gh = 0xdb0c2e0d;
3194
+ this._hh = 0x47b5481d;
3195
+
3196
+ this._al = 0xc1059ed8;
3197
+ this._bl = 0x367cd507;
3198
+ this._cl = 0x3070dd17;
3199
+ this._dl = 0xf70e5939;
3200
+ this._el = 0xffc00b31;
3201
+ this._fl = 0x68581511;
3202
+ this._gl = 0x64f98fa7;
3203
+ this._hl = 0xbefa4fa4;
3204
+
3205
+ return this;
3206
+ };
3207
+
3208
+ Sha384.prototype._hash = function () {
3209
+ var H = Buffer.allocUnsafe(48);
3210
+
3211
+ function writeInt64BE(h, l, offset) {
3212
+ H.writeInt32BE(h, offset);
3213
+ H.writeInt32BE(l, offset + 4);
3214
+ }
3215
+
3216
+ writeInt64BE(this._ah, this._al, 0);
3217
+ writeInt64BE(this._bh, this._bl, 8);
3218
+ writeInt64BE(this._ch, this._cl, 16);
3219
+ writeInt64BE(this._dh, this._dl, 24);
3220
+ writeInt64BE(this._eh, this._el, 32);
3221
+ writeInt64BE(this._fh, this._fl, 40);
3222
+
3223
+ return H;
3224
+ };
3225
+
3226
+ sha384 = Sha384;
3227
+ return sha384;
3228
+ }var hasRequiredSha_js;
3229
+
3230
+ function requireSha_js () {
3231
+ if (hasRequiredSha_js) return sha_js.exports;
3232
+ hasRequiredSha_js = 1;
3233
+ (function (module) {
3234
+
3235
+ module.exports = function SHA(algorithm) {
3236
+ var alg = algorithm.toLowerCase();
3237
+
3238
+ var Algorithm = module.exports[alg];
3239
+ if (!Algorithm) {
3240
+ throw new Error(alg + ' is not supported (we accept pull requests)');
3241
+ }
3242
+
3243
+ return new Algorithm();
3244
+ };
3245
+
3246
+ module.exports.sha = requireSha();
3247
+ module.exports.sha1 = requireSha1();
3248
+ module.exports.sha224 = requireSha224();
3249
+ module.exports.sha256 = requireSha256();
3250
+ module.exports.sha384 = requireSha384();
3251
+ module.exports.sha512 = requireSha512();
3252
+ } (sha_js));
3253
+ return sha_js.exports;
3254
+ }var sha_jsExports = requireSha_js();
3255
+ var sha = /*@__PURE__*/getDefaultExportFromCjs(sha_jsExports);function sha1(text, encoding = 'hex') {
11
3256
  return sha('sha1').update(utf8.encode(text)).digest(encoding);
12
3257
  }function sha256(text, encoding = 'hex') {
13
3258
  return sha('sha256').update(utf8.encode(text)).digest(encoding);